From 029bf038708559c0393d7ad3f7307fe2902cbef3 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Tue, 2 Nov 2021 13:41:55 -0700 Subject: [PATCH 001/399] Changed PassBuilder's job dependencies to be OrderOnce. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using a normal job dependency was overkill. As a result, modifying a shader would trigger a pass to rebuild, and that would cause the entire render pipeline to reinitialize. This causes a lot of unnecessary churn that made debugging shader hot reloads difficult. When a builder depends on knowing the UUID of another asset, it does need to have a job dependency on that asset. But when the builder doesn’t actually consume any data from inside the asset, and it just needs the ID, it is best to use JobDependencyType::OrderOnce to simply make sure the AP knows about the asset. Also, the call to GetSourceInfoBySourcePath was an unnecessary check because the AP does not require the file to exist at the time a dependency is reported. GetSourceInfoBySourcePath will only succeed after the AP has scanned the requested source file. We can’t just assume that a false result indicates the file does not exist, it just isn’t known yet. There are a couple additional use cases to be aware of (from @antonmic)... 1. Passes are critical assets, and some passes depend on shaders, so those shaders need to be processed, that's one reason for the dependency (otherwise you can start the engine, load all critical passes, try to load the shader, shader isn't ready, and bad things happen) 2. If a shader is deleted/removed, the pass should try to rebuild and fail. This was a recent issue that I fixed, you could have some odd condition where you delete a shader, but the pass that references that shader doesn't update or throw any errors because it doesn't rebuild, so the user is unaware that they need to change the .pass file and bad things happen OrderOnce is sufficient for both these cases. #1 is related to first time processing which exactly the time when OrderOnce would be applied. I tested #2 as well; deleting a .shader file with OrderOnce dependency did trigger the .pass file to rebuild and fail. Testing: Ran an ASV pass test with both an exiting cache and after deleting the local cache. Started the Editor with a clean cache and didn't encounter any startup issues. Was able to successfully load a level the first time. Deleted SkyBox.shader and saw SkyBox.pass fail in the AP. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Source/RPI.Builders/Pass/PassBuilder.cpp | 33 +++++++------------ 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Pass/PassBuilder.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Pass/PassBuilder.cpp index 6a0b10633e..e2d4bd629a 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Pass/PassBuilder.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Pass/PassBuilder.cpp @@ -53,7 +53,7 @@ namespace AZ { AssetBuilderSDK::AssetBuilderDesc builder; builder.m_name = PassBuilderJobKey; - builder.m_version = 14; // making .pass files emit product dependencies for the shaders they reference so they are picked up by the asset bundler + builder.m_version = 15; // Changed dependency type to OrderOnce builder.m_busId = azrtti_typeid(); builder.m_createJobFunction = AZStd::bind(&PassBuilder::CreateJobs, this, AZStd::placeholders::_1, AZStd::placeholders::_2); builder.m_processJobFunction = AZStd::bind(&PassBuilder::ProcessJob, this, AZStd::placeholders::_1, AZStd::placeholders::_2); @@ -97,27 +97,16 @@ namespace AZ // Helper function to get a file reference and create a corresponding job dependency bool AddDependency(FindPassReferenceAssetParams& params, AssetBuilderSDK::JobDescriptor* job) { - AZStd::string_view& file = params.dependencySourceFile; - AZ::Data::AssetInfo sourceInfo; - AZStd::string watchFolder; - bool fileFound = false; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult(fileFound, &AzToolsFramework::AssetSystem::AssetSystemRequest::GetSourceInfoBySourcePath, file.data(), sourceInfo, watchFolder); - - if (fileFound) - { - AssetBuilderSDK::JobDependency jobDependency; - jobDependency.m_jobKey = params.jobKey; - jobDependency.m_type = AssetBuilderSDK::JobDependencyType::Order; - jobDependency.m_sourceFile.m_sourceFileDependencyPath = file; - job->m_jobDependencyList.push_back(jobDependency); - AZ_TracePrintf(PassBuilderName, "Creating job dependency on file [%s] \n", file.data()); - return true; - } - else - { - AZ_Error(PassBuilderName, false, "Could not find referenced file [%s]", file.data()); - return false; - } + // We use an OrderOnce job dependency to ensure that the Asset Processor knows about the + // referenced asset, so we can make an AssetId for it later in ProcessJob. OrderOnce is + // enough because we don't need to read any data from the asset, we just needs its ID. + AssetBuilderSDK::JobDependency jobDependency; + jobDependency.m_jobKey = params.jobKey; + jobDependency.m_type = AssetBuilderSDK::JobDependencyType::OrderOnce; + jobDependency.m_sourceFile.m_sourceFileDependencyPath = params.dependencySourceFile; + job->m_jobDependencyList.push_back(jobDependency); + AZ_TracePrintf(PassBuilderName, "Creating job dependency on file [%.*s] \n", AZ_STRING_ARG(params.dependencySourceFile)); + return true; } bool SetJobKeyForExtension(const AZStd::string& filePath, FindPassReferenceAssetParams& params) From c00d7ff6585c3e1240241c8d7af9dbc556f16a06 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Fri, 3 Dec 2021 00:56:40 -0800 Subject: [PATCH 002/399] Small formatting fix to jinja for autocomponent's behavior context Signed-off-by: Gene Walters --- .../AutoGen/AutoComponent_Source.jinja | 86 +++++++++---------- 1 file changed, 42 insertions(+), 44 deletions(-) diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/AutoGen/AutoComponent_Source.jinja b/Gems/Multiplayer/Code/Include/Multiplayer/AutoGen/AutoComponent_Source.jinja index d0b77159f8..01bed7d52d 100644 --- a/Gems/Multiplayer/Code/Include/Multiplayer/AutoGen/AutoComponent_Source.jinja +++ b/Gems/Multiplayer/Code/Include/Multiplayer/AutoGen/AutoComponent_Source.jinja @@ -309,11 +309,11 @@ void {{ ClassName }}::Set{{ UpperFirst(Property.attrib['Name']) }}(const {{ Prop {# #} -{% macro PrintRpcParameters(printPrefix, paramDefines) %} -{% if paramDefines|count > 0 %} +{% macro PrintRpcParameters(printPrefix, paramDefines) -%} +{% if paramDefines|count > 0 -%} {{ printPrefix }}{{ ', '.join(paramDefines) }} -{% endif %} -{% endmacro %} +{%- endif %} +{%- endmacro -%} {# #} @@ -366,47 +366,45 @@ void {{ ClassName }}::{{ UpperFirst(Property.attrib['Name']) }}({{ PrintRpcParam {% set paramTypes = [] %} {% set paramDefines = [] %} {{ AutoComponentMacros.ParseRpcParams(Property, paramNames, paramTypes, paramDefines) }} - ->Method("{{ UpperFirst(Property.attrib['Name']) }}", []({{ ClassName }}* self{{ PrintRpcParameters(', ', paramDefines) }}) { -{% if (InvokeFrom == 'Server') %} - self->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }}); -{% elif (InvokeFrom == 'Authority') or (InvokeFrom == 'Autonomous') %} - if (self->m_controller) - { - self->m_controller->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }}); - } - else - { - AZ_Warning("Network RPC", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }} method failed. Entity '%s' (id: %s) {{ ClassName }} is missing the network controller. This remote-procedure can only be invoked from {{InvokeFrom}} network entities, because this entity doesn't have a controller, it must not be a {{InvokeFrom}} entity. Please check your network context before attempting to call {{ UpperFirst(Property.attrib['Name']) }}.", self->GetEntity()->GetName().c_str(), self->GetEntityId().ToString().c_str()) - } -{% endif %} - }) + ->Method("{{ UpperFirst(Property.attrib['Name']) }}", []({{ ClassName }}* self{{ PrintRpcParameters(', ', paramDefines) }}){ +{% if (InvokeFrom == 'Server') %} + self->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }}); +{% elif (InvokeFrom == 'Authority') or (InvokeFrom == 'Autonomous') %} + if (self->m_controller) + { + self->m_controller->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }}); + } + else + { + AZ_Warning("Network RPC", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }} method failed. Entity '%s' (id: %s) {{ ClassName }} is missing the network controller. This remote-procedure can only be invoked from {{InvokeFrom}} network entities, because this entity doesn't have a controller, it must not be a {{InvokeFrom}} entity. Please check your network context before attempting to call {{ UpperFirst(Property.attrib['Name']) }}.", self->GetEntity()->GetName().c_str(), self->GetEntityId().ToString().c_str()) + } +{% endif %} + }) ->Method("{{ UpperFirst(Property.attrib['Name']) }}ByEntityId", [](AZ::EntityId id{{ PrintRpcParameters(', ', paramDefines) }}) { - - AZ::Entity* entity = AZ::Interface::Get()->FindEntity(id); - if (!entity) - { - AZ_Warning("Network RPC", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }}ByEntityId failed. The entity with id %s doesn't exist, please provide a valid entity id.", id.ToString().c_str()) - return; - } - - {{ ClassName }}* networkComponent = entity->FindComponent<{{ ClassName }}>(); - if (!networkComponent) - { - AZ_Warning("Network RPC", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }}ByEntityId failed. Entity '%s' (id: %s) is missing {{ ClassName }}, be sure to add {{ ClassName }} to this entity.", entity->GetName().c_str(), id.ToString().c_str()) - return; - } -{% if (InvokeFrom == 'Server') %} - networkComponent->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }}); -{% elif (InvokeFrom == 'Authority') or (InvokeFrom == 'Autonomous') %} - {{ ClassName }}Controller* controller = static_cast<{{ ClassName }}Controller*>(networkComponent->GetController()); - if (!controller) - { - AZ_Warning("Network RPC", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }}ByEntityId method failed. Entity '%s' (id: %s) {{ ClassName }} is missing the network controller. This RemoteProcedure can only be invoked from {{InvokeFrom}} network entities, because this entity doesn't have a controller, it must not be a {{InvokeFrom}} entity. Please check your network context before attempting to call {{ UpperFirst(Property.attrib['Name']) }}.", entity->GetName().c_str(), id.ToString().c_str()) - return; - } - controller->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }}); -{% endif %} - }, { { { "Source", "The Source containing the {{ ClassName }}Controller" }{% for paramName in paramNames %}, {"{{ paramName }}"}{% endfor %}}}) + AZ::Entity* entity = AZ::Interface::Get()->FindEntity(id); + if (!entity) + { + AZ_Warning("Network RPC", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }}ByEntityId failed. The entity with id %s doesn't exist, please provide a valid entity id.", id.ToString().c_str()) + return; + } + {{ ClassName }}* networkComponent = entity->FindComponent<{{ ClassName }}>(); + if (!networkComponent) + { + AZ_Warning("Network RPC", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }}ByEntityId failed. Entity '%s' (id: %s) is missing {{ ClassName }}, be sure to add {{ ClassName }} to this entity.", entity->GetName().c_str(), id.ToString().c_str()) + return; + } +{% if (InvokeFrom == 'Server') %} + networkComponent->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }}); +{% elif (InvokeFrom == 'Authority') or (InvokeFrom == 'Autonomous') %} + {{ ClassName }}Controller* controller = static_cast<{{ ClassName }}Controller*>(networkComponent->GetController()); + if (!controller) + { + AZ_Warning("Network RPC", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }}ByEntityId method failed. Entity '%s' (id: %s) {{ ClassName }} is missing the network controller. This RemoteProcedure can only be invoked from {{InvokeFrom}} network entities, because this entity doesn't have a controller, it must not be a {{InvokeFrom}} entity. Please check your network context before attempting to call {{ UpperFirst(Property.attrib['Name']) }}.", entity->GetName().c_str(), id.ToString().c_str()) + return; + } + controller->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }}); +{% endif %} + }, { { { "Source", "The Source containing the {{ ClassName }}Controller" }{% for paramName in paramNames %}, {"{{ paramName }}"}{% endfor %}}}) ->Attribute(AZ::Script::Attributes::ToolTip, "{{Property.attrib['Description']}}") {% endif %} {% endcall %} From 308a2e4ce3771326832828c7379d3d0c6922552a Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Fri, 3 Dec 2021 15:29:55 -0800 Subject: [PATCH 003/399] Add RPC script for Authority->Autonomous message; the authority is telling each player their player id (in the order than they joined) Signed-off-by: Gene Walters --- ...tworkTestPlayerComponent.AutoComponent.xml | 4 +- .../AutoComponent_RPC.prefab | 627 ++++++ .../AutoComponent_RPC.scriptcanvas | 1958 +++++++++++++++++ .../GlobalGameData.scriptcanvas | 662 ++++++ .../GlobalGameData.scriptevents | 106 + .../AutoComponent_RPC/Player.prefab | 195 ++ .../Multiplayer/AutoComponent_RPC/tags.txt | 12 + 7 files changed, 3562 insertions(+), 2 deletions(-) create mode 100644 AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab create mode 100644 AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas create mode 100644 AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/GlobalGameData.scriptcanvas create mode 100644 AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/GlobalGameData.scriptevents create mode 100644 AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/Player.prefab create mode 100644 AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/tags.txt diff --git a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml index 46d6191835..07004c4f1e 100644 --- a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml +++ b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml @@ -19,8 +19,8 @@ - - + + diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab new file mode 100644 index 0000000000..a9bec3251a --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab @@ -0,0 +1,627 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Entity_[12685882829720]" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 15661114386016447348 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1172344194419]": { + "Id": "Entity_[1172344194419]", + "Name": "Shader Ball", + "Components": { + "Component_[10789351944715265527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10789351944715265527 + }, + "Component_[12037033284781049225]": { + "$type": "EditorEntitySortComponent", + "Id": 12037033284781049225 + }, + "Component_[13759153306105970079]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13759153306105970079 + }, + "Component_[14135560884830586279]": { + "$type": "EditorInspectorComponent", + "Id": 14135560884830586279 + }, + "Component_[16247165675903986673]": { + "$type": "EditorVisibilityComponent", + "Id": 16247165675903986673 + }, + "Component_[18082433625958885247]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18082433625958885247 + }, + "Component_[6472623349872972660]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6472623349872972660, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Rotate": [ + 0.0, + 0.10000000149011612, + 180.0 + ] + } + }, + "Component_[6495255223970673916]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 6495255223970673916, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}", + "subId": 281415304 + }, + "assetHint": "objects/shaderball/shaderball_default_1m.azmodel" + } + } + } + }, + "Component_[8056625192494070973]": { + "$type": "SelectionComponent", + "Id": 8056625192494070973 + }, + "Component_[8550141614185782969]": { + "$type": "EditorEntityIconComponent", + "Id": 8550141614185782969 + }, + "Component_[9439770997198325425]": { + "$type": "EditorLockComponent", + "Id": 9439770997198325425 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1172344194419]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + }, + "Entity_[12685882829720]": { + "Id": "Entity_[12685882829720]", + "Name": "GlobalGameData", + "Components": { + "Component_[11240656689650225106]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 11240656689650225106 + }, + "Component_[13863201640354873385]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13863201640354873385 + }, + "Component_[14671754037021562789]": { + "$type": "EditorInspectorComponent", + "Id": 14671754037021562789 + }, + "Component_[14750978061505735417]": { + "$type": "EditorScriptCanvasComponent", + "Id": 14750978061505735417, + "m_name": "GlobalGameData", + "m_assetHolder": { + "m_asset": { + "assetId": { + "guid": "{B16589A0-EA01-56BC-8141-91A3967FB95F}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/globalgamedata.scriptcanvas" + } + }, + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "assetId": { + "guid": "{B16589A0-EA01-56BC-8141-91A3967FB95F}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/globalgamedata.scriptcanvas" + } + } + }, + "Component_[16436925042043744033]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16436925042043744033, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 0.0, + 0.10000038146972656, + 4.005393981933594 + ] + } + }, + "Component_[16974524495698916088]": { + "$type": "EditorOnlyEntityComponent", + "Id": 16974524495698916088 + }, + "Component_[2753700837834389204]": { + "$type": "EditorLockComponent", + "Id": 2753700837834389204 + }, + "Component_[3766473509503096065]": { + "$type": "SelectionComponent", + "Id": 3766473509503096065 + }, + "Component_[4025955184206569130]": { + "$type": "EditorEntitySortComponent", + "Id": 4025955184206569130 + }, + "Component_[7909743395732791573]": { + "$type": "EditorVisibilityComponent", + "Id": 7909743395732791573 + }, + "Component_[9550161640684119498]": { + "$type": "EditorEntityIconComponent", + "Id": 9550161640684119498 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas new file mode 100644 index 0000000000..474266e7a0 --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas @@ -0,0 +1,1958 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 45584036346395 + }, + "Name": "AutoComponent_RPC", + "Components": { + "Component_[6790521910463264404]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 6790521910463264404, + "m_variableData": { + "m_nameVariableMap": [ + { + "Key": { + "m_id": "{71675BCB-6546-4B79-9D5E-912982945852}" + }, + "Value": { + "Datum": { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0 + }, + "VariableId": { + "m_id": "{71675BCB-6546-4B79-9D5E-912982945852}" + }, + "VariableName": "PlayerNumber" + } + } + ] + } + }, + "Component_[9755768666831861951]": { + "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "Id": 9755768666831861951, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 45592626280987 + }, + "Name": "SC-EventNode(AuthorityToAutonomous_PlayerNumber Notify Event)", + "Components": { + "Component_[10688723972761024546]": { + "$type": "AzEventHandler", + "Id": 10688723972761024546, + "Slots": [ + { + "id": { + "m_id": "{46E6B649-CAA4-4318-960D-5E4854E21BB2}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 45605511182875 + } + } + ], + "slotName": "Connect", + "toolTip": "Connect the AZ Event to this AZ Event Handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{221AFED2-BD9E-4CFF-8EC7-75ABA019134D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect current AZ Event from this AZ Event Handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{D139A8D2-F57B-4EBF-B7F8-1D65C2D97C25}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Connected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{3F47A140-182E-4B32-AE14-467555A6640A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Disconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{586BE222-2DEA-4E08-968F-07CA4EB96C54}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnEvent", + "toolTip": "Triggered when the AZ Event invokes Signal() function.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "player_number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{8C7E88EA-8FEE-45D0-9A2E-78BC4A18F508}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 45605511182875 + } + } + ], + "slotName": "AuthorityToAutonomous_PlayerNumber Notify Event", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{DB613438-34F0-5B2E-A413-77424F4254CD}" + }, + "isNullPointer": true, + "label": "AuthorityToAutonomous_PlayerNumber Notify Event" + } + ], + "m_azEventEntry": { + "m_eventName": "AuthorityToAutonomous_PlayerNumber Notify Event", + "m_parameterSlotIds": [ + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + } + ], + "m_parameterNames": [ + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + } + ], + "m_eventSlotId": { + "m_id": "{8C7E88EA-8FEE-45D0-9A2E-78BC4A18F508}" + } + } + } + } + }, + { + "Id": { + "id": 45609806150171 + }, + "Name": "SC-Node(IsNetEntityRoleAuthority)", + "Components": { + "Component_[11076422520044215441]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 11076422520044215441, + "Slots": [ + { + "id": { + "m_id": "{4EAB8D16-C0B4-44E1-885D-8E6754CD1A55}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityId: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{B6C4BE5E-CDE4-4EC7-98D0-A019CD80041C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1071F455-D5A0-4C7A-AF91-648A0F197885}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{BA87B4ED-9A52-4A0D-8920-CD0ED4E839EA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Is Role Authority", + "DisplayDataType": { + "m_type": 0 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "EntityId: 0" + } + ], + "methodType": 2, + "methodName": "IsNetEntityRoleAuthority", + "className": "NetBindComponent", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{4EAB8D16-C0B4-44E1-885D-8E6754CD1A55}" + } + ], + "prettyClassName": "NetBindComponent" + } + } + }, + { + "Id": { + "id": 45588331313691 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[15185116749844245504]": { + "$type": "Print", + "Id": 15185116749844245504, + "Slots": [ + { + "id": { + "m_id": "{F3ED8C08-D751-492A-A39A-7B7734727A5A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{D4FA5CCA-34FB-412B-826E-BC7050E684A6}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Value", + "toolTip": "Value which replaces instances of {Value} in the resulting string.", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1015031923 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{71675BCB-6546-4B79-9D5E-912982945852}" + } + }, + { + "id": { + "m_id": "{5A4FB037-120E-4BF8-A170-D827E5DC161B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Value" + } + ], + "m_format": "AutoComponent_RPC: Sending client PlayerNumber {Value}\n", + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{D4FA5CCA-34FB-412B-826E-BC7050E684A6}" + } + } + ], + "m_unresolvedString": [ + "AutoComponent_RPC: Sending client PlayerNumber ", + {}, + "\n" + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{D4FA5CCA-34FB-412B-826E-BC7050E684A6}" + } + } + } + } + }, + { + "Id": { + "id": 45605511182875 + }, + "Name": "SC-Node(GetAuthorityToAutonomous_PlayerNumberEventByEntityId)", + "Components": { + "Component_[1841271567102345236]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 1841271567102345236, + "Slots": [ + { + "id": { + "m_id": "{B556F66D-84DB-4118-8AFE-B3D88D6D75CA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityId: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{211BD78B-E01E-44F8-B44E-2FD988047BE9}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1A6BCB27-F99F-4B6B-89CC-F2BE2A698331}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{7262E6CD-BADF-4DD0-8FCE-3A02C3F31CC8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Event", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{DB613438-34F0-5B2E-A413-77424F4254CD}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "EntityId: 0" + } + ], + "methodType": 2, + "methodName": "GetAuthorityToAutonomous_PlayerNumberEventByEntityId", + "className": "NetworkTestPlayerComponent", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{B556F66D-84DB-4118-8AFE-B3D88D6D75CA}" + } + ], + "prettyClassName": "NetworkTestPlayerComponent" + } + } + }, + { + "Id": { + "id": 45618396084763 + }, + "Name": "SendScriptEvent", + "Components": { + "Component_[5751772243856660980]": { + "$type": "SendScriptEvent", + "Id": 5751772243856660980, + "Slots": [ + { + "id": { + "m_id": "{2FF1A0A1-59C6-4DCF-AE1D-296BD5964D4E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Fires the specified ScriptEvent when signaled", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{F2955681-A901-432D-99A3-53818F46CDE7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Trigged after the ScriptEvent has been signaled and returns", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_version": 1, + "m_scriptEventAssetId": { + "guid": "{FE1B1992-8220-5DD3-A60A-AEC85EB91C54}" + }, + "m_asset": { + "assetId": { + "guid": "{FE1B1992-8220-5DD3-A60A-AEC85EB91C54}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/globalgamedata.scriptevents" + }, + "m_busId": { + "Value": 1375178404 + }, + "m_eventId": { + "Value": 2930121176 + } + } + } + }, + { + "Id": { + "id": 45631280986651 + }, + "Name": "SendScriptEvent", + "Components": { + "Component_[6456267108920901297]": { + "$type": "SendScriptEvent", + "Id": 6456267108920901297, + "Slots": [ + { + "id": { + "m_id": "{23DBACD8-7784-4E18-A51C-258B25DF4C19}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Fires the specified ScriptEvent when signaled", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{19C850D7-7F1E-4D41-AFD9-5A4FA03D54F0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Trigged after the ScriptEvent has been signaled and returns", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{B6CA4982-245A-45F1-8AA6-3295F49DC071}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{71675BCB-6546-4B79-9D5E-912982945852}" + } + } + ], + "m_version": 1, + "m_eventSlotMapping": { + "{C7E99974-D1C0-4108-B731-120AF000060C}": { + "m_id": "{B6CA4982-245A-45F1-8AA6-3295F49DC071}" + } + }, + "m_scriptEventAssetId": { + "guid": "{FE1B1992-8220-5DD3-A60A-AEC85EB91C54}" + }, + "m_asset": { + "assetId": { + "guid": "{FE1B1992-8220-5DD3-A60A-AEC85EB91C54}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/globalgamedata.scriptevents" + }, + "m_busId": { + "Value": 1375178404 + }, + "m_eventId": { + "Value": 242067946 + } + } + } + }, + { + "Id": { + "id": 45601216215579 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[6838720237293185886]": { + "$type": "Print", + "Id": 6838720237293185886, + "Slots": [ + { + "id": { + "m_id": "{D206E5BC-3746-4A18-80C7-DBD335FD05FE}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{BA146872-FBFF-4662-A569-8F1B4C8774AC}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Value", + "toolTip": "Value which replaces instances of {Value} in the resulting string.", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1015031923 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{A4555039-973F-43F6-BC9D-CCC0C9B34252}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Value" + } + ], + "m_format": "AutoComponent_RPC: I'm Player #{Value}\n", + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{BA146872-FBFF-4662-A569-8F1B4C8774AC}" + } + } + ], + "m_unresolvedString": [ + "AutoComponent_RPC: I'm Player #", + {}, + "\n" + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{BA146872-FBFF-4662-A569-8F1B4C8774AC}" + } + } + } + } + }, + { + "Id": { + "id": 45626986019355 + }, + "Name": "SC-Node(TimeDelayNodeableNode)", + "Components": { + "Component_[8216689437045635826]": { + "$type": "TimeDelayNodeableNode", + "Id": 8216689437045635826, + "Slots": [ + { + "id": { + "m_id": "{D2337DC6-F126-4254-B296-2DE6BA03993F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{5809EA65-214B-43A9-8674-B89E9ADF1AE6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Delay", + "toolTip": "The amount of time to delay before the Done is signalled.", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{AC3B9B74-5A7A-4AC9-89AA-B255879D6F63}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{25568B15-5372-4C2D-8280-2B433251EACA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Done", + "toolTip": "Signaled after waiting for the specified amount of times.", + "DisplayGroup": { + "Value": 271442091 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 1.0, + "label": "Delay" + } + ], + "nodeable": { + "m_timeUnits": 2 + }, + "slotExecutionMap": { + "ins": [ + { + "_slotId": { + "m_id": "{D2337DC6-F126-4254-B296-2DE6BA03993F}" + }, + "_inputs": [ + { + "_slotId": { + "m_id": "{5809EA65-214B-43A9-8674-B89E9ADF1AE6}" + } + } + ], + "_outs": [ + { + "_slotId": { + "m_id": "{AC3B9B74-5A7A-4AC9-89AA-B255879D6F63}" + }, + "_name": "On Start", + "_interfaceSourceId": "{C071AF8D-5D00-0000-E074-ECBC15020000}" + } + ], + "_interfaceSourceId": "{C3B60A69-2ADF-0000-4062-ABA615020000}" + } + ], + "latents": [ + { + "_slotId": { + "m_id": "{25568B15-5372-4C2D-8280-2B433251EACA}" + }, + "_name": "Done", + "_interfaceSourceId": "{C3B60A69-2ADF-0000-4062-ABA615020000}" + } + ] + } + } + } + }, + { + "Id": { + "id": 45596921248283 + }, + "Name": "SC-Node(AuthorityToAutonomous_PlayerNumberByEntityId)", + "Components": { + "Component_[8243210565080727934]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 8243210565080727934, + "Slots": [ + { + "id": { + "m_id": "{D8767DB8-4BD8-4907-A3A4-BE0AE4F1A774}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Source", + "toolTip": "The Source containing the NetworkTestPlayerComponentController", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{2B948544-DD45-4DE1-A9FC-7AFBE1CAB202}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "player_number", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{71675BCB-6546-4B79-9D5E-912982945852}" + } + }, + { + "id": { + "m_id": "{1FDB4A9A-D46A-49E8-B734-475230EB7C06}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{964EAD23-8DF5-47A9-BF07-1E5C7CD0CC6C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Source" + }, + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "player_number" + } + ], + "methodType": 2, + "methodName": "AuthorityToAutonomous_PlayerNumberByEntityId", + "className": "NetworkTestPlayerComponent", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{D8767DB8-4BD8-4907-A3A4-BE0AE4F1A774}" + }, + { + "m_id": "{2B948544-DD45-4DE1-A9FC-7AFBE1CAB202}" + } + ], + "prettyClassName": "NetworkTestPlayerComponent" + } + } + }, + { + "Id": { + "id": 45622691052059 + }, + "Name": "SC-Node(Start)", + "Components": { + "Component_[8447409406288787781]": { + "$type": "Start", + "Id": 8447409406288787781, + "Slots": [ + { + "id": { + "m_id": "{A8EA9EF2-A3A6-46B5-8D43-08EF6B6B5B32}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled when the entity that owns this graph is fully activated.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ] + } + } + }, + { + "Id": { + "id": 45614101117467 + }, + "Name": "SC-Node(Gate)", + "Components": { + "Component_[8679383768392231909]": { + "$type": "Gate", + "Id": 8679383768392231909, + "Slots": [ + { + "id": { + "m_id": "{3E89B67B-1EF2-4DAB-8028-59A97527F3DF}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Condition", + "toolTip": "If true the node will signal the Output and proceed execution", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{8AE7F430-C4A9-444E-B42A-BDDFE96C387A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{78C92586-C0E1-449F-8EB2-B1CE3BFC8AE7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "True", + "toolTip": "Signaled if the condition provided evaluates to true.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{47D87C86-2D61-46D3-A0FC-138F84FD352B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "False", + "toolTip": "Signaled if the condition provided evaluates to false.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 0 + }, + "isNullPointer": false, + "$type": "bool", + "value": false, + "label": "Condition" + } + ] + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 45635575953947 + }, + "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Out), destEndpoint=(If: In)", + "Components": { + "Component_[3645153988172561571]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 3645153988172561571, + "sourceEndpoint": { + "nodeId": { + "id": 45609806150171 + }, + "slotId": { + "m_id": "{1071F455-D5A0-4C7A-AF91-648A0F197885}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45614101117467 + }, + "slotId": { + "m_id": "{8AE7F430-C4A9-444E-B42A-BDDFE96C387A}" + } + } + } + } + }, + { + "Id": { + "id": 45639870921243 + }, + "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Is Role Authority), destEndpoint=(If: Condition)", + "Components": { + "Component_[17942926291787646743]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 17942926291787646743, + "sourceEndpoint": { + "nodeId": { + "id": 45609806150171 + }, + "slotId": { + "m_id": "{BA87B4ED-9A52-4A0D-8920-CD0ED4E839EA}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45614101117467 + }, + "slotId": { + "m_id": "{3E89B67B-1EF2-4DAB-8028-59A97527F3DF}" + } + } + } + } + }, + { + "Id": { + "id": 45644165888539 + }, + "Name": "srcEndpoint=(If: True), destEndpoint=(Send Script Event: In)", + "Components": { + "Component_[3298020356088639785]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 3298020356088639785, + "sourceEndpoint": { + "nodeId": { + "id": 45614101117467 + }, + "slotId": { + "m_id": "{78C92586-C0E1-449F-8EB2-B1CE3BFC8AE7}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45618396084763 + }, + "slotId": { + "m_id": "{2FF1A0A1-59C6-4DCF-AE1D-296BD5964D4E}" + } + } + } + } + }, + { + "Id": { + "id": 45648460855835 + }, + "Name": "srcEndpoint=(Send Script Event: Out), destEndpoint=(Send Script Event: In)", + "Components": { + "Component_[5482500452520221078]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 5482500452520221078, + "sourceEndpoint": { + "nodeId": { + "id": 45618396084763 + }, + "slotId": { + "m_id": "{F2955681-A901-432D-99A3-53818F46CDE7}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45631280986651 + }, + "slotId": { + "m_id": "{23DBACD8-7784-4E18-A51C-258B25DF4C19}" + } + } + } + } + }, + { + "Id": { + "id": 45652755823131 + }, + "Name": "srcEndpoint=(Send Script Event: Out), destEndpoint=(AuthorityToAutonomous_PlayerNumberByEntityId: In)", + "Components": { + "Component_[16156808606878296902]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16156808606878296902, + "sourceEndpoint": { + "nodeId": { + "id": 45631280986651 + }, + "slotId": { + "m_id": "{19C850D7-7F1E-4D41-AFD9-5A4FA03D54F0}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45596921248283 + }, + "slotId": { + "m_id": "{1FDB4A9A-D46A-49E8-B734-475230EB7C06}" + } + } + } + } + }, + { + "Id": { + "id": 45657050790427 + }, + "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumberByEntityId: Out), destEndpoint=(Print: In)", + "Components": { + "Component_[17367899649716276273]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 17367899649716276273, + "sourceEndpoint": { + "nodeId": { + "id": 45596921248283 + }, + "slotId": { + "m_id": "{964EAD23-8DF5-47A9-BF07-1E5C7CD0CC6C}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45588331313691 + }, + "slotId": { + "m_id": "{F3ED8C08-D751-492A-A39A-7B7734727A5A}" + } + } + } + } + }, + { + "Id": { + "id": 45661345757723 + }, + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(TimeDelay: Start)", + "Components": { + "Component_[13463448697016307967]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 13463448697016307967, + "sourceEndpoint": { + "nodeId": { + "id": 45622691052059 + }, + "slotId": { + "m_id": "{A8EA9EF2-A3A6-46B5-8D43-08EF6B6B5B32}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45626986019355 + }, + "slotId": { + "m_id": "{D2337DC6-F126-4254-B296-2DE6BA03993F}" + } + } + } + } + }, + { + "Id": { + "id": 45665640725019 + }, + "Name": "srcEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: Event), destEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: AuthorityToAutonomous_PlayerNumber Notify Event)", + "Components": { + "Component_[9477060643694737434]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 9477060643694737434, + "sourceEndpoint": { + "nodeId": { + "id": 45605511182875 + }, + "slotId": { + "m_id": "{7262E6CD-BADF-4DD0-8FCE-3A02C3F31CC8}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45592626280987 + }, + "slotId": { + "m_id": "{8C7E88EA-8FEE-45D0-9A2E-78BC4A18F508}" + } + } + } + } + }, + { + "Id": { + "id": 45669935692315 + }, + "Name": "srcEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: Out), destEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: Connect)", + "Components": { + "Component_[16543380658701699472]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16543380658701699472, + "sourceEndpoint": { + "nodeId": { + "id": 45605511182875 + }, + "slotId": { + "m_id": "{1A6BCB27-F99F-4B6B-89CC-F2BE2A698331}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45592626280987 + }, + "slotId": { + "m_id": "{46E6B649-CAA4-4318-960D-5E4854E21BB2}" + } + } + } + } + }, + { + "Id": { + "id": 45674230659611 + }, + "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: player_number), destEndpoint=(Print: Value)", + "Components": { + "Component_[864863482692400383]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 864863482692400383, + "sourceEndpoint": { + "nodeId": { + "id": 45592626280987 + }, + "slotId": { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45601216215579 + }, + "slotId": { + "m_id": "{BA146872-FBFF-4662-A569-8F1B4C8774AC}" + } + } + } + } + }, + { + "Id": { + "id": 45678525626907 + }, + "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: OnEvent), destEndpoint=(Print: In)", + "Components": { + "Component_[2451057837093425972]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 2451057837093425972, + "sourceEndpoint": { + "nodeId": { + "id": 45592626280987 + }, + "slotId": { + "m_id": "{586BE222-2DEA-4E08-968F-07CA4EB96C54}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45601216215579 + }, + "slotId": { + "m_id": "{D206E5BC-3746-4A18-80C7-DBD335FD05FE}" + } + } + } + } + }, + { + "Id": { + "id": 45682820594203 + }, + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: In)", + "Components": { + "Component_[12180981889720748145]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 12180981889720748145, + "sourceEndpoint": { + "nodeId": { + "id": 45622691052059 + }, + "slotId": { + "m_id": "{A8EA9EF2-A3A6-46B5-8D43-08EF6B6B5B32}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45605511182875 + }, + "slotId": { + "m_id": "{211BD78B-E01E-44F8-B44E-2FD988047BE9}" + } + } + } + } + }, + { + "Id": { + "id": 45687115561499 + }, + "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(IsNetEntityRoleAuthority: In)", + "Components": { + "Component_[5772191552099194657]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 5772191552099194657, + "sourceEndpoint": { + "nodeId": { + "id": 45626986019355 + }, + "slotId": { + "m_id": "{25568B15-5372-4C2D-8280-2B433251EACA}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45609806150171 + }, + "slotId": { + "m_id": "{B6C4BE5E-CDE4-4EC7-98D0-A019CD80041C}" + } + } + } + } + } + ], + "m_scriptEventAssets": [ + [ + { + "id": 45631280986651 + }, + {} + ], + [ + { + "id": 45618396084763 + }, + {} + ] + ] + }, + "m_assetType": "{3E2AC8CD-713F-453E-967F-29517F331784}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1, + "_fileVersion": 1 + }, + "m_variableCounter": 1, + "GraphCanvasData": [ + { + "Key": { + "id": 45584036346395 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "Scale": 0.9670775714052148, + "AnchorX": 180.9575653076172, + "AnchorY": 127.18731689453125 + } + } + } + } + }, + { + "Key": { + "id": 45588331313691 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 2280.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{B91C0E41-E6B5-46DE-885F-6BC6CFB2E813}" + } + } + } + }, + { + "Key": { + "id": 45592626280987 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "HandlerNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 980.0, + 620.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".azeventhandler" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{F112D217-FAC8-4577-B67A-DFDF47842F7D}" + } + } + } + }, + { + "Key": { + "id": 45596921248283 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1840.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{59FFF3C1-2D7B-47EA-AE35-ED15DCB95CC8}" + } + } + } + }, + { + "Key": { + "id": 45601216215579 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1160.0, + 620.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{74ED5AE1-A269-46D4-B968-FEDF513C9CF1}" + } + } + } + }, + { + "Key": { + "id": 45605511182875 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 380.0, + 620.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{BBBE60FC-0215-4A5A-BEBE-4FC869E5EECE}" + } + } + } + }, + { + "Key": { + "id": 45609806150171 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 500.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{348E780E-3A4E-47C7-ACF5-C7B2CB387517}" + } + } + } + }, + { + "Key": { + "id": 45614101117467 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "LogicNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 940.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{53C8DAF1-FFF3-4AF8-A7FB-BC0B4E492B37}" + } + } + } + }, + { + "Key": { + "id": 45618396084763 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1240.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{13BD3C1C-EDBB-419E-8465-495935414A1A}" + } + } + } + }, + { + "Key": { + "id": 45622691052059 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TimeNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 40.0, + 280.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{B4CB62D9-9965-42E2-81FF-BDADDBD14CBE}" + } + } + } + }, + { + "Key": { + "id": 45626986019355 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TimeNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 200.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{5DF902FE-B0C4-4563-B2BA-17996B24E211}" + } + } + } + }, + { + "Key": { + "id": 45631280986651 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1540.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{FD844BFD-72DA-44BA-B92A-AFDB58263B91}" + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 4199610336680704683, + "Value": 1 + }, + { + "Key": 4847610523576971761, + "Value": 1 + }, + { + "Key": 6462358712820489356, + "Value": 1 + }, + { + "Key": 7760188923571293852, + "Value": 1 + }, + { + "Key": 8065262779685207188, + "Value": 1 + }, + { + "Key": 8452971738487658154, + "Value": 1 + }, + { + "Key": 10684225535275896474, + "Value": 2 + }, + { + "Key": 12248403816200817622, + "Value": 1 + }, + { + "Key": 12248403882232298424, + "Value": 1 + }, + { + "Key": 16232169425081397848, + "Value": 1 + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/GlobalGameData.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/GlobalGameData.scriptcanvas new file mode 100644 index 0000000000..3ba5cc6b7d --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/GlobalGameData.scriptcanvas @@ -0,0 +1,662 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 17732469402520 + }, + "Name": "Untitled-1", + "Components": { + "Component_[16492301523567686923]": { + "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "Id": 16492301523567686923, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 17741059337112 + }, + "Name": "SC-Node(OperatorAdd)", + "Components": { + "Component_[11612963594766700030]": { + "$type": "OperatorAdd", + "Id": 11612963594766700030, + "Slots": [ + { + "id": { + "m_id": "{B7529112-C29F-45F0-811C-DB8EE18EB8B8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{49618851-F6B2-4B90-BFDF-ADBAAA84BBA4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{4612C904-82DF-4B48-8485-4C878AF9A4D1}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 8 + }, + { + "m_type": 9 + }, + { + "m_type": 10 + }, + { + "m_type": 11 + }, + { + "m_type": 12 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Number", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{8451E795-6A0E-44CE-81FD-AEF0EE5B0400}" + } + }, + { + "id": { + "m_id": "{610B3BFB-9043-47A0-9694-5F14A1947E36}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 8 + }, + { + "m_type": 9 + }, + { + "m_type": 10 + }, + { + "m_type": 11 + }, + { + "m_type": 12 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Number", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{36FFF1AB-C208-47CB-8271-436C85E0AE42}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 8 + }, + { + "m_type": 9 + }, + { + "m_type": 10 + }, + { + "m_type": 11 + }, + { + "m_type": 12 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Result", + "toolTip": "The result of the specified operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{8451E795-6A0E-44CE-81FD-AEF0EE5B0400}" + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Number" + }, + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 1.0, + "label": "Number" + } + ] + } + } + }, + { + "Id": { + "id": 17736764369816 + }, + "Name": "ReceiveScriptEvent", + "Components": { + "Component_[16408183651077237195]": { + "$type": "ReceiveScriptEvent", + "Id": 16408183651077237195, + "Slots": [ + { + "id": { + "m_id": "{8DC10581-B8DF-473C-9C75-996111DBF560}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E60D1951-E56D-41F8-84C5-AD0BA803DD51}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1BCE6CAC-B1C0-43FA-B4F5-E9A34D5064E5}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{FEB42E9A-D562-4BBD-90AB-32255124BFE8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{C9EF936B-8C74-42B4-8793-67FC7FD3BCBC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{76985C7A-761A-4CEF-9F55-6DD2B136317A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:NewPlayerScriptActive", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{5CD8E1E9-6192-4B7D-9C2C-6C18BE99CF44}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{8451E795-6A0E-44CE-81FD-AEF0EE5B0400}" + } + }, + { + "id": { + "m_id": "{9FDB71AA-0F19-406D-82CA-508A2CA10F95}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:GetNumberOfActivePlayers", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Number" + } + ], + "m_version": 1, + "m_eventMap": [ + { + "Key": { + "Value": 242067946 + }, + "Value": { + "m_scriptEventAssetId": { + "guid": "{FE1B1992-8220-5DD3-A60A-AEC85EB91C54}" + }, + "m_eventName": "GetNumberOfActivePlayers", + "m_eventSlotId": { + "m_id": "{9FDB71AA-0F19-406D-82CA-508A2CA10F95}" + }, + "m_resultSlotId": { + "m_id": "{5CD8E1E9-6192-4B7D-9C2C-6C18BE99CF44}" + } + } + }, + { + "Key": { + "Value": 2930121176 + }, + "Value": { + "m_scriptEventAssetId": { + "guid": "{FE1B1992-8220-5DD3-A60A-AEC85EB91C54}" + }, + "m_eventName": "NewPlayerScriptActive", + "m_eventSlotId": { + "m_id": "{76985C7A-761A-4CEF-9F55-6DD2B136317A}" + } + } + } + ], + "m_eventSlotMapping": { + "{155BF981-AD70-4D29-81A6-1517FAE59FB1}": { + "m_id": "{5CD8E1E9-6192-4B7D-9C2C-6C18BE99CF44}" + }, + "{65D394D3-F90D-4F10-94BF-F5E1581CF2CF}": { + "m_id": "{76985C7A-761A-4CEF-9F55-6DD2B136317A}" + }, + "{67784749-9B41-429C-9C97-3D296182EB67}": { + "m_id": "{9FDB71AA-0F19-406D-82CA-508A2CA10F95}" + } + }, + "m_scriptEventAssetId": { + "guid": "{FE1B1992-8220-5DD3-A60A-AEC85EB91C54}" + }, + "m_asset": { + "assetId": { + "guid": "{FE1B1992-8220-5DD3-A60A-AEC85EB91C54}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/globalgamedata.scriptevents" + } + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 17745354304408 + }, + "Name": "srcEndpoint=(Receive Script Event: ExecutionSlot:NewPlayerScriptActive), destEndpoint=(Add (+): In)", + "Components": { + "Component_[8782209668839578826]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 8782209668839578826, + "sourceEndpoint": { + "nodeId": { + "id": 17736764369816 + }, + "slotId": { + "m_id": "{76985C7A-761A-4CEF-9F55-6DD2B136317A}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 17741059337112 + }, + "slotId": { + "m_id": "{B7529112-C29F-45F0-811C-DB8EE18EB8B8}" + } + } + } + } + } + ], + "m_scriptEventAssets": [ + [ + { + "id": 17736764369816 + }, + {} + ] + ] + }, + "m_assetType": "{3E2AC8CD-713F-453E-967F-29517F331784}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1, + "_fileVersion": 1 + }, + "m_variableCounter": 1, + "GraphCanvasData": [ + { + "Key": { + "id": 17732469402520 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData" + } + } + } + }, + { + "Key": { + "id": 17736764369816 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -360.0, + -60.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{C419A1CF-CBA8-416B-BF6C-4B574C3E59E3}" + }, + "{D8BBE799-7E4D-495A-B69A-1E3940670891}": { + "$type": "ScriptEventReceiverHandlerNodeDescriptorSaveData", + "EventNames": [ + [ + { + "Value": 242067946 + }, + "GetNumberOfActivePlayers" + ], + [ + { + "Value": 2930121176 + }, + "NewPlayerScriptActive" + ] + ] + } + } + } + }, + { + "Key": { + "id": 17741059337112 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 120.0, + 100.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{0D0751AD-8164-4196-9C09-8CDB9AAA296F}" + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 1244476766431948410, + "Value": 1 + }, + { + "Key": 1678857390775488101, + "Value": 1 + }, + { + "Key": 1678857392390856307, + "Value": 1 + } + ] + } + }, + "Component_[16498171485036643402]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 16498171485036643402, + "m_variableData": { + "m_nameVariableMap": [ + { + "Key": { + "m_id": "{8451E795-6A0E-44CE-81FD-AEF0EE5B0400}" + }, + "Value": { + "Datum": { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0 + }, + "VariableId": { + "m_id": "{8451E795-6A0E-44CE-81FD-AEF0EE5B0400}" + }, + "VariableName": "ActivePlayerCount" + } + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/GlobalGameData.scriptevents b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/GlobalGameData.scriptevents new file mode 100644 index 0000000000..059713e14b --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/GlobalGameData.scriptevents @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/Player.prefab b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/Player.prefab new file mode 100644 index 0000000000..2653809dda --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/Player.prefab @@ -0,0 +1,195 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "Player", + "Components": { + "Component_[10603663676997462041]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10603663676997462041 + }, + "Component_[11066377844757909329]": { + "$type": "EditorPrefabComponent", + "Id": 11066377844757909329 + }, + "Component_[11664640320098005944]": { + "$type": "EditorEntityIconComponent", + "Id": 11664640320098005944 + }, + "Component_[12551690377468870725]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12551690377468870725, + "Parent Entity": "" + }, + "Component_[16402163080075698011]": { + "$type": "EditorOnlyEntityComponent", + "Id": 16402163080075698011 + }, + "Component_[3491366785918494447]": { + "$type": "EditorLockComponent", + "Id": 3491366785918494447 + }, + "Component_[4830373679514129871]": { + "$type": "EditorVisibilityComponent", + "Id": 4830373679514129871 + }, + "Component_[5144323498211834874]": { + "$type": "SelectionComponent", + "Id": 5144323498211834874 + }, + "Component_[5267607163086533733]": { + "$type": "EditorInspectorComponent", + "Id": 5267607163086533733 + }, + "Component_[6678300504118618849]": { + "$type": "EditorPendingCompositionComponent", + "Id": 6678300504118618849 + }, + "Component_[8384628950786300469]": { + "$type": "EditorEntitySortComponent", + "Id": 8384628950786300469, + "Child Entity Order": [ + "Entity_[10070247746456]" + ] + } + } + }, + "Entities": { + "Entity_[10070247746456]": { + "Id": "Entity_[10070247746456]", + "Name": "Player", + "Components": { + "Component_[1059478843478789313]": { + "$type": "EditorInspectorComponent", + "Id": 1059478843478789313, + "ComponentOrderEntryArray": [ + { + "ComponentId": 9878555871810913249 + }, + { + "ComponentId": 11481641385923146202, + "SortIndex": 1 + }, + { + "ComponentId": 11440172471478606933, + "SortIndex": 2 + }, + { + "ComponentId": 17461691807054668218, + "SortIndex": 3 + }, + { + "ComponentId": 15530420875454157766, + "SortIndex": 4 + }, + { + "ComponentId": 10596595655489113153, + "SortIndex": 5 + } + ] + }, + "Component_[10596595655489113153]": { + "$type": "EditorScriptCanvasComponent", + "Id": 10596595655489113153, + "m_name": "AutoComponent_RPC", + "m_assetHolder": { + "m_asset": { + "assetId": { + "guid": "{5ED120C4-07DC-56F1-80A7-37BFC98FD74E}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/autocomponent_rpc.scriptcanvas" + } + }, + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "assetId": { + "guid": "{5ED120C4-07DC-56F1-80A7-37BFC98FD74E}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/autocomponent_rpc.scriptcanvas" + } + } + }, + "Component_[11440172471478606933]": { + "$type": "GenericComponentWrapper", + "Id": 11440172471478606933, + "m_template": { + "$type": "Multiplayer::NetworkTransformComponent" + } + }, + "Component_[11481641385923146202]": { + "$type": "GenericComponentWrapper", + "Id": 11481641385923146202, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[13110996849704981748]": { + "$type": "EditorVisibilityComponent", + "Id": 13110996849704981748 + }, + "Component_[1472895075383059499]": { + "$type": "EditorLockComponent", + "Id": 1472895075383059499 + }, + "Component_[1526920553231193509]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1526920553231193509 + }, + "Component_[15530420875454157766]": { + "$type": "GenericComponentWrapper", + "Id": 15530420875454157766, + "m_template": { + "$type": "Multiplayer::LocalPredictionPlayerInputComponent" + } + }, + "Component_[1699895912837266792]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1699895912837266792 + }, + "Component_[17461691807054668218]": { + "$type": "GenericComponentWrapper", + "Id": 17461691807054668218, + "m_template": { + "$type": "AutomatedTesting::NetworkTestPlayerComponent" + } + }, + "Component_[3622545398462507871]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3622545398462507871 + }, + "Component_[5778259918231688598]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5778259918231688598, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{F322592F-43BC-50E7-903C-CC231846093F}", + "subId": 276443623 + }, + "assetHint": "objects/_primitives/_cylinder_1x1.azmodel" + } + } + } + }, + "Component_[7004633483882343256]": { + "$type": "SelectionComponent", + "Id": 7004633483882343256 + }, + "Component_[8469628382507693850]": { + "$type": "EditorEntitySortComponent", + "Id": 8469628382507693850 + }, + "Component_[9407892837096707905]": { + "$type": "EditorEntityIconComponent", + "Id": 9407892837096707905 + }, + "Component_[9878555871810913249]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 9878555871810913249, + "Parent Entity": "ContainerEntity" + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/tags.txt b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/tags.txt new file mode 100644 index 0000000000..0d6c1880e7 --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 From f6c318715198b77ae7ee5f198a53a087b968c8b1 Mon Sep 17 00:00:00 2001 From: sphrose <82213493+sphrose@users.noreply.github.com> Date: Mon, 6 Dec 2021 09:54:00 +0000 Subject: [PATCH 004/399] LYN-7056 SurfaceDataConstants should be revised to have no terrain references Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com> --- Gems/SurfaceData/Code/CMakeLists.txt | 3 +++ .../SurfaceData/SurfaceDataConstants.h | 13 +--------- .../EditorSurfaceDataSystemComponent.cpp | 1 - .../Editor/EditorSurfaceDataSystemComponent.h | 11 ++++++++- .../Code/Tests/SurfaceDataTest.cpp | 2 +- .../Include/Terrain/TerrainDataConstants.h | 24 +++++++++++++++++++ .../TerrainSurfaceDataSystemComponent.cpp | 8 +++---- Gems/Terrain/Code/terrain_files.cmake | 1 + 8 files changed, 44 insertions(+), 19 deletions(-) create mode 100644 Gems/Terrain/Code/Include/Terrain/TerrainDataConstants.h diff --git a/Gems/SurfaceData/Code/CMakeLists.txt b/Gems/SurfaceData/Code/CMakeLists.txt index 54363d265e..c35da595d6 100644 --- a/Gems/SurfaceData/Code/CMakeLists.txt +++ b/Gems/SurfaceData/Code/CMakeLists.txt @@ -70,6 +70,7 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) AZ::AzToolsFramework Gem::SurfaceData.Static Gem::LmbrCentral.Editor + Gem::Terrain RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor ) @@ -97,9 +98,11 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzTest + AZ::AzToolsFramework Legacy::CryCommon Gem::SurfaceData.Static Gem::LmbrCentral + Gem::Terrain ) ly_add_googletest( NAME Gem::SurfaceData.Tests diff --git a/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataConstants.h b/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataConstants.h index 3f4a1bb605..2a8f618ac8 100644 --- a/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataConstants.h +++ b/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataConstants.h @@ -9,25 +9,14 @@ #pragma once #include -#include +#include namespace SurfaceData { namespace Constants { static const char* s_unassignedTagName = AzFramework::SurfaceData::Constants::s_unassignedTagName; - static const char* s_terrainHoleTagName = "terrainHole"; - static const char* s_terrainTagName = "terrain"; static const AZ::Crc32 s_unassignedTagCrc = AZ::Crc32(s_unassignedTagName); - static const AZ::Crc32 s_terrainHoleTagCrc = AZ::Crc32(s_terrainHoleTagName); - static const AZ::Crc32 s_terrainTagCrc = AZ::Crc32(s_terrainTagName); - - static const char* s_allTagNames[] = - { - s_unassignedTagName, - s_terrainHoleTagName, - s_terrainTagName, - }; } } diff --git a/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp b/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp index a5bf51d0fe..0285ab5ca4 100644 --- a/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp +++ b/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp @@ -12,7 +12,6 @@ #include #include - namespace SurfaceData { namespace Details diff --git a/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.h b/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.h index 603cffc56d..68f7ea7291 100644 --- a/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.h +++ b/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.h @@ -14,6 +14,7 @@ #include #include #include +#include namespace AZ::Data { @@ -22,6 +23,15 @@ namespace AZ::Data namespace SurfaceData { + namespace Constants + { + static const char* s_allTagNames[] = { + Constants::s_unassignedTagName, + Terrain::Constants::s_terrainHoleTagName, + Terrain::Constants::s_terrainTagName, + }; + } //namespace Constants + class EditorSurfaceDataSystemConfig : public AZ::ComponentConfig { @@ -47,7 +57,6 @@ namespace SurfaceData static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required); private: - void LoadAsset(const AZ::Data::AssetId& assetId); void AddAsset(AZ::Data::Asset& asset); diff --git a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp index d5384161ad..23c0a1d4c6 100644 --- a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp +++ b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp @@ -23,8 +23,8 @@ #include #include #include -#include #include +#include struct MockGlobalEnvironment { diff --git a/Gems/Terrain/Code/Include/Terrain/TerrainDataConstants.h b/Gems/Terrain/Code/Include/Terrain/TerrainDataConstants.h new file mode 100644 index 0000000000..e125e41ccf --- /dev/null +++ b/Gems/Terrain/Code/Include/Terrain/TerrainDataConstants.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include + +namespace Terrain +{ + namespace Constants + { + static const char* s_terrainHoleTagName = "terrainHole"; + static const char* s_terrainTagName = "terrain"; + + static const AZ::Crc32 s_terrainHoleTagCrc = AZ::Crc32(s_terrainHoleTagName); + static const AZ::Crc32 s_terrainTagCrc = AZ::Crc32(s_terrainTagName); + } +} diff --git a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp index 65e8600d62..8c75aafa65 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -162,8 +163,7 @@ namespace Terrain point.m_normal = terrainSurfacePoint.m_normal; // Always add a "terrain" or "terrainHole" tag. - const AZ::Crc32 terrainTag = - isHole ? SurfaceData::Constants::s_terrainHoleTagCrc : SurfaceData::Constants::s_terrainTagCrc; + const AZ::Crc32 terrainTag = isHole ? Constants::s_terrainHoleTagCrc : Constants::s_terrainTagCrc; SurfaceData::AddMaxValueForMasks(point.m_masks, terrainTag, 1.0f); // Add all of the surface tags that the terrain has at this point. @@ -189,8 +189,8 @@ namespace Terrain SurfaceData::SurfaceTagVector TerrainSurfaceDataSystemComponent::GetSurfaceTags() const { SurfaceData::SurfaceTagVector tags; - tags.push_back(SurfaceData::Constants::s_terrainHoleTagCrc); - tags.push_back(SurfaceData::Constants::s_terrainTagCrc); + tags.push_back(Constants::s_terrainHoleTagCrc); + tags.push_back(Constants::s_terrainTagCrc); return tags; } diff --git a/Gems/Terrain/Code/terrain_files.cmake b/Gems/Terrain/Code/terrain_files.cmake index 893477e10d..9e6e68d140 100644 --- a/Gems/Terrain/Code/terrain_files.cmake +++ b/Gems/Terrain/Code/terrain_files.cmake @@ -8,6 +8,7 @@ set(FILES Include/Terrain/Ebuses/TerrainAreaSurfaceRequestBus.h + Include/Terrain/TerrainDataConstants.h Source/Components/TerrainHeightGradientListComponent.cpp Source/Components/TerrainHeightGradientListComponent.h Source/Components/TerrainLayerSpawnerComponent.cpp From 58872581c5fe794c81db20711eb1b9ce30fd544a Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 6 Dec 2021 08:52:54 -0800 Subject: [PATCH 005/399] Wip.RPC testing Authority->Client and Server->Authory. Ran into a blocker so checking in now to save work Signed-off-by: Gene Walters --- ...tworkTestPlayerComponent.AutoComponent.xml | 6 +- .../AutoComponent_RPC.prefab | 125 ++++++++- .../AutoComponent_RPC.scriptcanvas | 252 ++++++++++-------- 3 files changed, 270 insertions(+), 113 deletions(-) diff --git a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml index 07004c4f1e..9037db43ee 100644 --- a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml +++ b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml @@ -29,10 +29,10 @@ - + - - + + diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab index a9bec3251a..74dbcd993f 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab @@ -20,7 +20,9 @@ "Id": 14126657869720434043, "Child Entity Order": [ "Entity_[1176639161715]", - "Entity_[12685882829720]" + "Entity_[12685882829720]", + "Entity_[31145534614197]", + "Entity_[31145534614197]" ] }, "Component_[15230859088967841193]": { @@ -205,7 +207,7 @@ "Controller": { "Configuration": { "Field of View": 55.0, - "EditorEntityId": 15661114386016447348 + "EditorEntityId": 11050384689878106598 } } }, @@ -622,6 +624,125 @@ "Id": 9550161640684119498 } } + }, + "Entity_[31145534614197]": { + "Id": "Entity_[31145534614197]", + "Name": "NetLevelEntity", + "Components": { + "Component_[12132849363414901338]": { + "$type": "EditorEntityIconComponent", + "Id": 12132849363414901338 + }, + "Component_[12302672911455629152]": { + "$type": "SelectionComponent", + "Id": 12302672911455629152 + }, + "Component_[14169903623243423134]": { + "$type": "EditorVisibilityComponent", + "Id": 14169903623243423134 + }, + "Component_[14300469789192169678]": { + "$type": "GenericComponentWrapper", + "Id": 14300469789192169678, + "m_template": { + "$type": "AutomatedTesting::NetworkTestPlayerComponent" + } + }, + "Component_[14607413934411389854]": { + "$type": "EditorInspectorComponent", + "Id": 14607413934411389854 + }, + "Component_[15494977028055234270]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15494977028055234270 + }, + "Component_[16325088972532345964]": { + "$type": "EditorLockComponent", + "Id": 16325088972532345964 + }, + "Component_[1639017114849961416]": { + "$type": "GenericComponentWrapper", + "Id": 1639017114849961416, + "m_template": { + "$type": "Multiplayer::LocalPredictionPlayerInputComponent" + } + }, + "Component_[1986030426392465743]": { + "$type": "EditorEntitySortComponent", + "Id": 1986030426392465743 + }, + "Component_[4591476848838823508]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 4591476848838823508, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{80FA8BAF-4A5B-5937-9679-2E592E841A3A}", + "subId": 275306041 + }, + "assetHint": "assets/physics/collider_pxmeshautoassigned/spherebot/r0-b_body.azmodel" + } + } + } + }, + "Component_[7256163899440301540]": { + "$type": "EditorScriptCanvasComponent", + "Id": 7256163899440301540, + "m_name": "AutoComponent_RPC_NetLevelEntity", + "m_assetHolder": { + "m_asset": { + "assetId": { + "guid": "{1D517006-AC01-5ECA-AE66-0E007871F0CD}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/autocomponent_rpc_netlevelentity.scriptcanvas" + } + }, + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "assetId": { + "guid": "{1D517006-AC01-5ECA-AE66-0E007871F0CD}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/autocomponent_rpc_netlevelentity.scriptcanvas" + } + } + }, + "Component_[731336627222243355]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 731336627222243355, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 2.561863899230957, + -1.038161277770996, + 0.1487259864807129 + ] + } + }, + "Component_[8012379125499217348]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8012379125499217348 + }, + "Component_[8122568562140740597]": { + "$type": "GenericComponentWrapper", + "Id": 8122568562140740597, + "m_template": { + "$type": "Multiplayer::NetworkTransformComponent" + } + }, + "Component_[8805228647591404845]": { + "$type": "GenericComponentWrapper", + "Id": 8805228647591404845, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[9880860858035405475]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9880860858035405475 + } + } } } } \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas index 474266e7a0..54bb46e379 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas @@ -5,7 +5,7 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 45584036346395 + "id": 49433505360565 }, "Name": "AutoComponent_RPC", "Components": { @@ -43,7 +43,7 @@ "m_nodes": [ { "Id": { - "id": 45592626280987 + "id": 49442095295157 }, "Name": "SC-EventNode(AuthorityToAutonomous_PlayerNumber Notify Event)", "Components": { @@ -66,7 +66,7 @@ { "$type": "RestrictedNodeContract", "m_nodeId": { - "id": 45605511182875 + "id": 49472160066229 } } ], @@ -176,7 +176,7 @@ { "$type": "RestrictedNodeContract", "m_nodeId": { - "id": 45605511182875 + "id": 49472160066229 } } ], @@ -201,6 +201,24 @@ "m_azEventEntry": { "m_eventName": "AuthorityToAutonomous_PlayerNumber Notify Event", "m_parameterSlotIds": [ + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" }, @@ -209,6 +227,24 @@ } ], "m_parameterNames": [ + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" }, @@ -225,7 +261,7 @@ }, { "Id": { - "id": 45609806150171 + "id": 49467865098933 }, "Name": "SC-Node(IsNetEntityRoleAuthority)", "Components": { @@ -309,7 +345,7 @@ "value": { "id": 2901262558 }, - "label": "EntityId: 0" + "label": "Entity Id" } ], "methodType": 2, @@ -329,7 +365,7 @@ }, { "Id": { - "id": 45588331313691 + "id": 49446390262453 }, "Name": "SC-Node(Print)", "Components": { @@ -432,7 +468,7 @@ }, { "Id": { - "id": 45605511182875 + "id": 49472160066229 }, "Name": "SC-Node(GetAuthorityToAutonomous_PlayerNumberEventByEntityId)", "Components": { @@ -537,7 +573,7 @@ }, { "Id": { - "id": 45618396084763 + "id": 49476455033525 }, "Name": "SendScriptEvent", "Components": { @@ -599,7 +635,7 @@ }, { "Id": { - "id": 45631280986651 + "id": 49437800327861 }, "Name": "SendScriptEvent", "Components": { @@ -689,7 +725,7 @@ }, { "Id": { - "id": 45601216215579 + "id": 49454980197045 }, "Name": "SC-Node(Print)", "Components": { @@ -788,7 +824,7 @@ }, { "Id": { - "id": 45626986019355 + "id": 49459275164341 }, "Name": "SC-Node(TimeDelayNodeableNode)", "Components": { @@ -927,7 +963,7 @@ }, { "Id": { - "id": 45596921248283 + "id": 49480750000821 }, "Name": "SC-Node(AuthorityToAutonomous_PlayerNumberByEntityId)", "Components": { @@ -1045,7 +1081,7 @@ }, { "Id": { - "id": 45622691052059 + "id": 49450685229749 }, "Name": "SC-Node(Start)", "Components": { @@ -1075,7 +1111,7 @@ }, { "Id": { - "id": 45614101117467 + "id": 49463570131637 }, "Name": "SC-Node(Gate)", "Components": { @@ -1167,7 +1203,7 @@ "m_connections": [ { "Id": { - "id": 45635575953947 + "id": 49485044968117 }, "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Out), destEndpoint=(If: In)", "Components": { @@ -1176,7 +1212,7 @@ "Id": 3645153988172561571, "sourceEndpoint": { "nodeId": { - "id": 45609806150171 + "id": 49467865098933 }, "slotId": { "m_id": "{1071F455-D5A0-4C7A-AF91-648A0F197885}" @@ -1184,7 +1220,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45614101117467 + "id": 49463570131637 }, "slotId": { "m_id": "{8AE7F430-C4A9-444E-B42A-BDDFE96C387A}" @@ -1195,7 +1231,7 @@ }, { "Id": { - "id": 45639870921243 + "id": 49489339935413 }, "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Is Role Authority), destEndpoint=(If: Condition)", "Components": { @@ -1204,7 +1240,7 @@ "Id": 17942926291787646743, "sourceEndpoint": { "nodeId": { - "id": 45609806150171 + "id": 49467865098933 }, "slotId": { "m_id": "{BA87B4ED-9A52-4A0D-8920-CD0ED4E839EA}" @@ -1212,7 +1248,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45614101117467 + "id": 49463570131637 }, "slotId": { "m_id": "{3E89B67B-1EF2-4DAB-8028-59A97527F3DF}" @@ -1223,7 +1259,7 @@ }, { "Id": { - "id": 45644165888539 + "id": 49493634902709 }, "Name": "srcEndpoint=(If: True), destEndpoint=(Send Script Event: In)", "Components": { @@ -1232,7 +1268,7 @@ "Id": 3298020356088639785, "sourceEndpoint": { "nodeId": { - "id": 45614101117467 + "id": 49463570131637 }, "slotId": { "m_id": "{78C92586-C0E1-449F-8EB2-B1CE3BFC8AE7}" @@ -1240,7 +1276,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45618396084763 + "id": 49476455033525 }, "slotId": { "m_id": "{2FF1A0A1-59C6-4DCF-AE1D-296BD5964D4E}" @@ -1251,7 +1287,7 @@ }, { "Id": { - "id": 45648460855835 + "id": 49497929870005 }, "Name": "srcEndpoint=(Send Script Event: Out), destEndpoint=(Send Script Event: In)", "Components": { @@ -1260,7 +1296,7 @@ "Id": 5482500452520221078, "sourceEndpoint": { "nodeId": { - "id": 45618396084763 + "id": 49476455033525 }, "slotId": { "m_id": "{F2955681-A901-432D-99A3-53818F46CDE7}" @@ -1268,7 +1304,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45631280986651 + "id": 49437800327861 }, "slotId": { "m_id": "{23DBACD8-7784-4E18-A51C-258B25DF4C19}" @@ -1279,7 +1315,7 @@ }, { "Id": { - "id": 45652755823131 + "id": 49502224837301 }, "Name": "srcEndpoint=(Send Script Event: Out), destEndpoint=(AuthorityToAutonomous_PlayerNumberByEntityId: In)", "Components": { @@ -1288,7 +1324,7 @@ "Id": 16156808606878296902, "sourceEndpoint": { "nodeId": { - "id": 45631280986651 + "id": 49437800327861 }, "slotId": { "m_id": "{19C850D7-7F1E-4D41-AFD9-5A4FA03D54F0}" @@ -1296,7 +1332,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45596921248283 + "id": 49480750000821 }, "slotId": { "m_id": "{1FDB4A9A-D46A-49E8-B734-475230EB7C06}" @@ -1307,7 +1343,7 @@ }, { "Id": { - "id": 45657050790427 + "id": 49506519804597 }, "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumberByEntityId: Out), destEndpoint=(Print: In)", "Components": { @@ -1316,7 +1352,7 @@ "Id": 17367899649716276273, "sourceEndpoint": { "nodeId": { - "id": 45596921248283 + "id": 49480750000821 }, "slotId": { "m_id": "{964EAD23-8DF5-47A9-BF07-1E5C7CD0CC6C}" @@ -1324,7 +1360,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45588331313691 + "id": 49446390262453 }, "slotId": { "m_id": "{F3ED8C08-D751-492A-A39A-7B7734727A5A}" @@ -1335,7 +1371,7 @@ }, { "Id": { - "id": 45661345757723 + "id": 49510814771893 }, "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(TimeDelay: Start)", "Components": { @@ -1344,7 +1380,7 @@ "Id": 13463448697016307967, "sourceEndpoint": { "nodeId": { - "id": 45622691052059 + "id": 49450685229749 }, "slotId": { "m_id": "{A8EA9EF2-A3A6-46B5-8D43-08EF6B6B5B32}" @@ -1352,7 +1388,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45626986019355 + "id": 49459275164341 }, "slotId": { "m_id": "{D2337DC6-F126-4254-B296-2DE6BA03993F}" @@ -1363,7 +1399,7 @@ }, { "Id": { - "id": 45665640725019 + "id": 49515109739189 }, "Name": "srcEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: Event), destEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: AuthorityToAutonomous_PlayerNumber Notify Event)", "Components": { @@ -1372,7 +1408,7 @@ "Id": 9477060643694737434, "sourceEndpoint": { "nodeId": { - "id": 45605511182875 + "id": 49472160066229 }, "slotId": { "m_id": "{7262E6CD-BADF-4DD0-8FCE-3A02C3F31CC8}" @@ -1380,7 +1416,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45592626280987 + "id": 49442095295157 }, "slotId": { "m_id": "{8C7E88EA-8FEE-45D0-9A2E-78BC4A18F508}" @@ -1391,7 +1427,7 @@ }, { "Id": { - "id": 45669935692315 + "id": 49519404706485 }, "Name": "srcEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: Out), destEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: Connect)", "Components": { @@ -1400,7 +1436,7 @@ "Id": 16543380658701699472, "sourceEndpoint": { "nodeId": { - "id": 45605511182875 + "id": 49472160066229 }, "slotId": { "m_id": "{1A6BCB27-F99F-4B6B-89CC-F2BE2A698331}" @@ -1408,7 +1444,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45592626280987 + "id": 49442095295157 }, "slotId": { "m_id": "{46E6B649-CAA4-4318-960D-5E4854E21BB2}" @@ -1419,7 +1455,7 @@ }, { "Id": { - "id": 45674230659611 + "id": 49523699673781 }, "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: player_number), destEndpoint=(Print: Value)", "Components": { @@ -1428,7 +1464,7 @@ "Id": 864863482692400383, "sourceEndpoint": { "nodeId": { - "id": 45592626280987 + "id": 49442095295157 }, "slotId": { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" @@ -1436,7 +1472,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45601216215579 + "id": 49454980197045 }, "slotId": { "m_id": "{BA146872-FBFF-4662-A569-8F1B4C8774AC}" @@ -1447,7 +1483,7 @@ }, { "Id": { - "id": 45678525626907 + "id": 49527994641077 }, "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: OnEvent), destEndpoint=(Print: In)", "Components": { @@ -1456,7 +1492,7 @@ "Id": 2451057837093425972, "sourceEndpoint": { "nodeId": { - "id": 45592626280987 + "id": 49442095295157 }, "slotId": { "m_id": "{586BE222-2DEA-4E08-968F-07CA4EB96C54}" @@ -1464,7 +1500,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45601216215579 + "id": 49454980197045 }, "slotId": { "m_id": "{D206E5BC-3746-4A18-80C7-DBD335FD05FE}" @@ -1475,7 +1511,7 @@ }, { "Id": { - "id": 45682820594203 + "id": 49532289608373 }, "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: In)", "Components": { @@ -1484,7 +1520,7 @@ "Id": 12180981889720748145, "sourceEndpoint": { "nodeId": { - "id": 45622691052059 + "id": 49450685229749 }, "slotId": { "m_id": "{A8EA9EF2-A3A6-46B5-8D43-08EF6B6B5B32}" @@ -1492,7 +1528,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45605511182875 + "id": 49472160066229 }, "slotId": { "m_id": "{211BD78B-E01E-44F8-B44E-2FD988047BE9}" @@ -1503,7 +1539,7 @@ }, { "Id": { - "id": 45687115561499 + "id": 49536584575669 }, "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(IsNetEntityRoleAuthority: In)", "Components": { @@ -1512,7 +1548,7 @@ "Id": 5772191552099194657, "sourceEndpoint": { "nodeId": { - "id": 45626986019355 + "id": 49459275164341 }, "slotId": { "m_id": "{25568B15-5372-4C2D-8280-2B433251EACA}" @@ -1520,7 +1556,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45609806150171 + "id": 49467865098933 }, "slotId": { "m_id": "{B6C4BE5E-CDE4-4EC7-98D0-A019CD80041C}" @@ -1533,13 +1569,13 @@ "m_scriptEventAssets": [ [ { - "id": 45631280986651 + "id": 49437800327861 }, {} ], [ { - "id": 45618396084763 + "id": 49476455033525 }, {} ] @@ -1555,16 +1591,16 @@ "GraphCanvasData": [ { "Key": { - "id": 45584036346395 + "id": 49433505360565 }, "Value": { "ComponentData": { "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { "$type": "SceneComponentSaveData", "ViewParams": { - "Scale": 0.9670775714052148, - "AnchorX": 180.9575653076172, - "AnchorY": 127.18731689453125 + "Scale": 0.8220159356944325, + "AnchorX": 72.99128723144531, + "AnchorY": 74.20780944824219 } } } @@ -1572,7 +1608,7 @@ }, { "Key": { - "id": 45588331313691 + "id": 49437800327861 }, "Value": { "ComponentData": { @@ -1581,28 +1617,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "StringNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 2280.0, + 1540.0, 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{B91C0E41-E6B5-46DE-885F-6BC6CFB2E813}" + "PersistentId": "{FD844BFD-72DA-44BA-B92A-AFDB58263B91}" } } } }, { "Key": { - "id": 45592626280987 + "id": 49442095295157 }, "Value": { "ComponentData": { @@ -1616,7 +1653,7 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 980.0, + 820.0, 620.0 ] }, @@ -1633,7 +1670,7 @@ }, { "Key": { - "id": 45596921248283 + "id": 49446390262453 }, "Value": { "ComponentData": { @@ -1642,29 +1679,28 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "StringNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1840.0, + 2280.0, 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{59FFF3C1-2D7B-47EA-AE35-ED15DCB95CC8}" + "PersistentId": "{B91C0E41-E6B5-46DE-885F-6BC6CFB2E813}" } } } }, { "Key": { - "id": 45601216215579 + "id": 49450685229749 }, "Value": { "ComponentData": { @@ -1673,13 +1709,13 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "StringNodeTitlePalette" + "PaletteOverride": "TimeNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1160.0, - 620.0 + 40.0, + 280.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1687,14 +1723,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{74ED5AE1-A269-46D4-B968-FEDF513C9CF1}" + "PersistentId": "{B4CB62D9-9965-42E2-81FF-BDADDBD14CBE}" } } } }, { "Key": { - "id": 45605511182875 + "id": 49454980197045 }, "Value": { "ComponentData": { @@ -1703,29 +1739,28 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "StringNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 380.0, + 1400.0, 620.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{BBBE60FC-0215-4A5A-BEBE-4FC869E5EECE}" + "PersistentId": "{74ED5AE1-A269-46D4-B968-FEDF513C9CF1}" } } } }, { "Key": { - "id": 45609806150171 + "id": 49459275164341 }, "Value": { "ComponentData": { @@ -1734,29 +1769,28 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "TimeNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 500.0, + 200.0, 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{348E780E-3A4E-47C7-ACF5-C7B2CB387517}" + "PersistentId": "{5DF902FE-B0C4-4563-B2BA-17996B24E211}" } } } }, { "Key": { - "id": 45614101117467 + "id": 49463570131637 }, "Value": { "ComponentData": { @@ -1786,7 +1820,7 @@ }, { "Key": { - "id": 45618396084763 + "id": 49467865098933 }, "Value": { "ComponentData": { @@ -1800,7 +1834,7 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1240.0, + 500.0, 260.0 ] }, @@ -1810,14 +1844,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{13BD3C1C-EDBB-419E-8465-495935414A1A}" + "PersistentId": "{348E780E-3A4E-47C7-ACF5-C7B2CB387517}" } } } }, { "Key": { - "id": 45622691052059 + "id": 49472160066229 }, "Value": { "ComponentData": { @@ -1826,28 +1860,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "TimeNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 40.0, - 280.0 + 380.0, + 620.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{B4CB62D9-9965-42E2-81FF-BDADDBD14CBE}" + "PersistentId": "{BBBE60FC-0215-4A5A-BEBE-4FC869E5EECE}" } } } }, { "Key": { - "id": 45626986019355 + "id": 49476455033525 }, "Value": { "ComponentData": { @@ -1856,28 +1891,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "TimeNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 200.0, + 1240.0, 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{5DF902FE-B0C4-4563-B2BA-17996B24E211}" + "PersistentId": "{13BD3C1C-EDBB-419E-8465-495935414A1A}" } } } }, { "Key": { - "id": 45631280986651 + "id": 49480750000821 }, "Value": { "ComponentData": { @@ -1891,7 +1927,7 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1540.0, + 1840.0, 260.0 ] }, @@ -1901,7 +1937,7 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{FD844BFD-72DA-44BA-B92A-AFDB58263B91}" + "PersistentId": "{59FFF3C1-2D7B-47EA-AE35-ED15DCB95CC8}" } } } From b0be54fa16a6257dd0b14f3e5df5fc9dc7b5e675 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 7 Dec 2021 14:46:58 -0800 Subject: [PATCH 006/399] Small script changes. WiP Signed-off-by: Gene Walters --- .../AutoComponent_RPC.prefab | 29 +- .../AutoComponent_RPC.scriptcanvas | 954 +++++++++++++++--- 2 files changed, 852 insertions(+), 131 deletions(-) diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab index 74dbcd993f..758cb4fca8 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab @@ -21,7 +21,6 @@ "Child Entity Order": [ "Entity_[1176639161715]", "Entity_[12685882829720]", - "Entity_[31145534614197]", "Entity_[31145534614197]" ] }, @@ -641,17 +640,17 @@ "$type": "EditorVisibilityComponent", "Id": 14169903623243423134 }, - "Component_[14300469789192169678]": { - "$type": "GenericComponentWrapper", - "Id": 14300469789192169678, - "m_template": { - "$type": "AutomatedTesting::NetworkTestPlayerComponent" - } - }, "Component_[14607413934411389854]": { "$type": "EditorInspectorComponent", "Id": 14607413934411389854 }, + "Component_[15396284312416541768]": { + "$type": "GenericComponentWrapper", + "Id": 15396284312416541768, + "m_template": { + "$type": "Multiplayer::LocalPredictionPlayerInputComponent" + } + }, "Component_[15494977028055234270]": { "$type": "EditorDisabledCompositionComponent", "Id": 15494977028055234270 @@ -660,13 +659,6 @@ "$type": "EditorLockComponent", "Id": 16325088972532345964 }, - "Component_[1639017114849961416]": { - "$type": "GenericComponentWrapper", - "Id": 1639017114849961416, - "m_template": { - "$type": "Multiplayer::LocalPredictionPlayerInputComponent" - } - }, "Component_[1986030426392465743]": { "$type": "EditorEntitySortComponent", "Id": 1986030426392465743 @@ -738,6 +730,13 @@ "$type": "NetBindComponent" } }, + "Component_[9816897251206708579]": { + "$type": "GenericComponentWrapper", + "Id": 9816897251206708579, + "m_template": { + "$type": "AutomatedTesting::NetworkTestPlayerComponent" + } + }, "Component_[9880860858035405475]": { "$type": "EditorOnlyEntityComponent", "Id": 9880860858035405475 diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas index 54bb46e379..72cc980550 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas @@ -5,7 +5,7 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 49433505360565 + "id": 8702689999760 }, "Name": "AutoComponent_RPC", "Components": { @@ -43,7 +43,7 @@ "m_nodes": [ { "Id": { - "id": 49442095295157 + "id": 8706984967056 }, "Name": "SC-EventNode(AuthorityToAutonomous_PlayerNumber Notify Event)", "Components": { @@ -66,7 +66,7 @@ { "$type": "RestrictedNodeContract", "m_nodeId": { - "id": 49472160066229 + "id": 8719869868944 } } ], @@ -176,7 +176,7 @@ { "$type": "RestrictedNodeContract", "m_nodeId": { - "id": 49472160066229 + "id": 8719869868944 } } ], @@ -201,6 +201,366 @@ "m_azEventEntry": { "m_eventName": "AuthorityToAutonomous_PlayerNumber Notify Event", "m_parameterSlotIds": [ + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" }, @@ -227,6 +587,366 @@ } ], "m_parameterNames": [ + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" }, @@ -261,7 +981,7 @@ }, { "Id": { - "id": 49467865098933 + "id": 8724164836240 }, "Name": "SC-Node(IsNetEntityRoleAuthority)", "Components": { @@ -365,7 +1085,7 @@ }, { "Id": { - "id": 49446390262453 + "id": 8737049738128 }, "Name": "SC-Node(Print)", "Components": { @@ -445,6 +1165,7 @@ } ], "m_format": "AutoComponent_RPC: Sending client PlayerNumber {Value}\n", + "m_numericPrecision": 0, "m_arrayBindingMap": [ { "Key": 1, @@ -468,7 +1189,7 @@ }, { "Id": { - "id": 49472160066229 + "id": 8719869868944 }, "Name": "SC-Node(GetAuthorityToAutonomous_PlayerNumberEventByEntityId)", "Components": { @@ -573,7 +1294,7 @@ }, { "Id": { - "id": 49476455033525 + "id": 8711279934352 }, "Name": "SendScriptEvent", "Components": { @@ -635,7 +1356,7 @@ }, { "Id": { - "id": 49437800327861 + "id": 8749934640016 }, "Name": "SendScriptEvent", "Components": { @@ -725,7 +1446,7 @@ }, { "Id": { - "id": 49454980197045 + "id": 8732754770832 }, "Name": "SC-Node(Print)", "Components": { @@ -801,6 +1522,7 @@ } ], "m_format": "AutoComponent_RPC: I'm Player #{Value}\n", + "m_numericPrecision": 0, "m_arrayBindingMap": [ { "Key": 1, @@ -824,7 +1546,7 @@ }, { "Id": { - "id": 49459275164341 + "id": 8715574901648 }, "Name": "SC-Node(TimeDelayNodeableNode)", "Components": { @@ -963,7 +1685,7 @@ }, { "Id": { - "id": 49480750000821 + "id": 8741344705424 }, "Name": "SC-Node(AuthorityToAutonomous_PlayerNumberByEntityId)", "Components": { @@ -1081,7 +1803,7 @@ }, { "Id": { - "id": 49450685229749 + "id": 8745639672720 }, "Name": "SC-Node(Start)", "Components": { @@ -1111,7 +1833,7 @@ }, { "Id": { - "id": 49463570131637 + "id": 8728459803536 }, "Name": "SC-Node(Gate)", "Components": { @@ -1203,7 +1925,7 @@ "m_connections": [ { "Id": { - "id": 49485044968117 + "id": 8754229607312 }, "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Out), destEndpoint=(If: In)", "Components": { @@ -1212,7 +1934,7 @@ "Id": 3645153988172561571, "sourceEndpoint": { "nodeId": { - "id": 49467865098933 + "id": 8724164836240 }, "slotId": { "m_id": "{1071F455-D5A0-4C7A-AF91-648A0F197885}" @@ -1220,7 +1942,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49463570131637 + "id": 8728459803536 }, "slotId": { "m_id": "{8AE7F430-C4A9-444E-B42A-BDDFE96C387A}" @@ -1231,7 +1953,7 @@ }, { "Id": { - "id": 49489339935413 + "id": 8758524574608 }, "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Is Role Authority), destEndpoint=(If: Condition)", "Components": { @@ -1240,7 +1962,7 @@ "Id": 17942926291787646743, "sourceEndpoint": { "nodeId": { - "id": 49467865098933 + "id": 8724164836240 }, "slotId": { "m_id": "{BA87B4ED-9A52-4A0D-8920-CD0ED4E839EA}" @@ -1248,7 +1970,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49463570131637 + "id": 8728459803536 }, "slotId": { "m_id": "{3E89B67B-1EF2-4DAB-8028-59A97527F3DF}" @@ -1259,7 +1981,7 @@ }, { "Id": { - "id": 49493634902709 + "id": 8762819541904 }, "Name": "srcEndpoint=(If: True), destEndpoint=(Send Script Event: In)", "Components": { @@ -1268,7 +1990,7 @@ "Id": 3298020356088639785, "sourceEndpoint": { "nodeId": { - "id": 49463570131637 + "id": 8728459803536 }, "slotId": { "m_id": "{78C92586-C0E1-449F-8EB2-B1CE3BFC8AE7}" @@ -1276,7 +1998,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49476455033525 + "id": 8711279934352 }, "slotId": { "m_id": "{2FF1A0A1-59C6-4DCF-AE1D-296BD5964D4E}" @@ -1287,7 +2009,7 @@ }, { "Id": { - "id": 49497929870005 + "id": 8767114509200 }, "Name": "srcEndpoint=(Send Script Event: Out), destEndpoint=(Send Script Event: In)", "Components": { @@ -1296,7 +2018,7 @@ "Id": 5482500452520221078, "sourceEndpoint": { "nodeId": { - "id": 49476455033525 + "id": 8711279934352 }, "slotId": { "m_id": "{F2955681-A901-432D-99A3-53818F46CDE7}" @@ -1304,7 +2026,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49437800327861 + "id": 8749934640016 }, "slotId": { "m_id": "{23DBACD8-7784-4E18-A51C-258B25DF4C19}" @@ -1315,7 +2037,7 @@ }, { "Id": { - "id": 49502224837301 + "id": 8771409476496 }, "Name": "srcEndpoint=(Send Script Event: Out), destEndpoint=(AuthorityToAutonomous_PlayerNumberByEntityId: In)", "Components": { @@ -1324,7 +2046,7 @@ "Id": 16156808606878296902, "sourceEndpoint": { "nodeId": { - "id": 49437800327861 + "id": 8749934640016 }, "slotId": { "m_id": "{19C850D7-7F1E-4D41-AFD9-5A4FA03D54F0}" @@ -1332,7 +2054,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49480750000821 + "id": 8741344705424 }, "slotId": { "m_id": "{1FDB4A9A-D46A-49E8-B734-475230EB7C06}" @@ -1343,7 +2065,7 @@ }, { "Id": { - "id": 49506519804597 + "id": 8775704443792 }, "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumberByEntityId: Out), destEndpoint=(Print: In)", "Components": { @@ -1352,7 +2074,7 @@ "Id": 17367899649716276273, "sourceEndpoint": { "nodeId": { - "id": 49480750000821 + "id": 8741344705424 }, "slotId": { "m_id": "{964EAD23-8DF5-47A9-BF07-1E5C7CD0CC6C}" @@ -1360,7 +2082,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49446390262453 + "id": 8737049738128 }, "slotId": { "m_id": "{F3ED8C08-D751-492A-A39A-7B7734727A5A}" @@ -1371,7 +2093,7 @@ }, { "Id": { - "id": 49510814771893 + "id": 8779999411088 }, "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(TimeDelay: Start)", "Components": { @@ -1380,7 +2102,7 @@ "Id": 13463448697016307967, "sourceEndpoint": { "nodeId": { - "id": 49450685229749 + "id": 8745639672720 }, "slotId": { "m_id": "{A8EA9EF2-A3A6-46B5-8D43-08EF6B6B5B32}" @@ -1388,7 +2110,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49459275164341 + "id": 8715574901648 }, "slotId": { "m_id": "{D2337DC6-F126-4254-B296-2DE6BA03993F}" @@ -1399,7 +2121,7 @@ }, { "Id": { - "id": 49515109739189 + "id": 8784294378384 }, "Name": "srcEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: Event), destEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: AuthorityToAutonomous_PlayerNumber Notify Event)", "Components": { @@ -1408,7 +2130,7 @@ "Id": 9477060643694737434, "sourceEndpoint": { "nodeId": { - "id": 49472160066229 + "id": 8719869868944 }, "slotId": { "m_id": "{7262E6CD-BADF-4DD0-8FCE-3A02C3F31CC8}" @@ -1416,7 +2138,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49442095295157 + "id": 8706984967056 }, "slotId": { "m_id": "{8C7E88EA-8FEE-45D0-9A2E-78BC4A18F508}" @@ -1427,7 +2149,7 @@ }, { "Id": { - "id": 49519404706485 + "id": 8788589345680 }, "Name": "srcEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: Out), destEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: Connect)", "Components": { @@ -1436,7 +2158,7 @@ "Id": 16543380658701699472, "sourceEndpoint": { "nodeId": { - "id": 49472160066229 + "id": 8719869868944 }, "slotId": { "m_id": "{1A6BCB27-F99F-4B6B-89CC-F2BE2A698331}" @@ -1444,7 +2166,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49442095295157 + "id": 8706984967056 }, "slotId": { "m_id": "{46E6B649-CAA4-4318-960D-5E4854E21BB2}" @@ -1455,7 +2177,7 @@ }, { "Id": { - "id": 49523699673781 + "id": 8792884312976 }, "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: player_number), destEndpoint=(Print: Value)", "Components": { @@ -1464,7 +2186,7 @@ "Id": 864863482692400383, "sourceEndpoint": { "nodeId": { - "id": 49442095295157 + "id": 8706984967056 }, "slotId": { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" @@ -1472,7 +2194,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49454980197045 + "id": 8732754770832 }, "slotId": { "m_id": "{BA146872-FBFF-4662-A569-8F1B4C8774AC}" @@ -1483,7 +2205,7 @@ }, { "Id": { - "id": 49527994641077 + "id": 8797179280272 }, "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: OnEvent), destEndpoint=(Print: In)", "Components": { @@ -1492,7 +2214,7 @@ "Id": 2451057837093425972, "sourceEndpoint": { "nodeId": { - "id": 49442095295157 + "id": 8706984967056 }, "slotId": { "m_id": "{586BE222-2DEA-4E08-968F-07CA4EB96C54}" @@ -1500,7 +2222,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49454980197045 + "id": 8732754770832 }, "slotId": { "m_id": "{D206E5BC-3746-4A18-80C7-DBD335FD05FE}" @@ -1511,7 +2233,7 @@ }, { "Id": { - "id": 49532289608373 + "id": 8801474247568 }, "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: In)", "Components": { @@ -1520,7 +2242,7 @@ "Id": 12180981889720748145, "sourceEndpoint": { "nodeId": { - "id": 49450685229749 + "id": 8745639672720 }, "slotId": { "m_id": "{A8EA9EF2-A3A6-46B5-8D43-08EF6B6B5B32}" @@ -1528,7 +2250,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49472160066229 + "id": 8719869868944 }, "slotId": { "m_id": "{211BD78B-E01E-44F8-B44E-2FD988047BE9}" @@ -1539,7 +2261,7 @@ }, { "Id": { - "id": 49536584575669 + "id": 8805769214864 }, "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(IsNetEntityRoleAuthority: In)", "Components": { @@ -1548,7 +2270,7 @@ "Id": 5772191552099194657, "sourceEndpoint": { "nodeId": { - "id": 49459275164341 + "id": 8715574901648 }, "slotId": { "m_id": "{25568B15-5372-4C2D-8280-2B433251EACA}" @@ -1556,7 +2278,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49467865098933 + "id": 8724164836240 }, "slotId": { "m_id": "{B6C4BE5E-CDE4-4EC7-98D0-A019CD80041C}" @@ -1569,13 +2291,13 @@ "m_scriptEventAssets": [ [ { - "id": 49437800327861 + "id": 8749934640016 }, {} ], [ { - "id": 49476455033525 + "id": 8711279934352 }, {} ] @@ -1591,16 +2313,16 @@ "GraphCanvasData": [ { "Key": { - "id": 49433505360565 + "id": 8702689999760 }, "Value": { "ComponentData": { "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { "$type": "SceneComponentSaveData", "ViewParams": { - "Scale": 0.8220159356944325, - "AnchorX": 72.99128723144531, - "AnchorY": 74.20780944824219 + "Scale": 0.9240486637125038, + "AnchorX": 1429.578369140625, + "AnchorY": -71.42481231689453 } } } @@ -1608,7 +2330,7 @@ }, { "Key": { - "id": 49437800327861 + "id": 8706984967056 }, "Value": { "ComponentData": { @@ -1617,29 +2339,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "HandlerNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1540.0, - 260.0 + 820.0, + 620.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "SubStyle": ".azeventhandler" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{FD844BFD-72DA-44BA-B92A-AFDB58263B91}" + "PersistentId": "{F112D217-FAC8-4577-B67A-DFDF47842F7D}" } } } }, { "Key": { - "id": 49442095295157 + "id": 8711279934352 }, "Value": { "ComponentData": { @@ -1648,29 +2370,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "HandlerNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 820.0, - 620.0 + 1240.0, + 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { "$type": "StylingComponentSaveData", - "SubStyle": ".azeventhandler" + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{F112D217-FAC8-4577-B67A-DFDF47842F7D}" + "PersistentId": "{13BD3C1C-EDBB-419E-8465-495935414A1A}" } } } }, { "Key": { - "id": 49446390262453 + "id": 8715574901648 }, "Value": { "ComponentData": { @@ -1679,12 +2401,12 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "StringNodeTitlePalette" + "PaletteOverride": "TimeNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 2280.0, + 200.0, 260.0 ] }, @@ -1693,14 +2415,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{B91C0E41-E6B5-46DE-885F-6BC6CFB2E813}" + "PersistentId": "{5DF902FE-B0C4-4563-B2BA-17996B24E211}" } } } }, { "Key": { - "id": 49450685229749 + "id": 8719869868944 }, "Value": { "ComponentData": { @@ -1709,28 +2431,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "TimeNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 40.0, - 280.0 + 380.0, + 620.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{B4CB62D9-9965-42E2-81FF-BDADDBD14CBE}" + "PersistentId": "{BBBE60FC-0215-4A5A-BEBE-4FC869E5EECE}" } } } }, { "Key": { - "id": 49454980197045 + "id": 8724164836240 }, "Value": { "ComponentData": { @@ -1739,28 +2462,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "StringNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1400.0, - 620.0 + 500.0, + 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{74ED5AE1-A269-46D4-B968-FEDF513C9CF1}" + "PersistentId": "{348E780E-3A4E-47C7-ACF5-C7B2CB387517}" } } } }, { "Key": { - "id": 49459275164341 + "id": 8728459803536 }, "Value": { "ComponentData": { @@ -1769,12 +2493,12 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "TimeNodeTitlePalette" + "PaletteOverride": "LogicNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 200.0, + 940.0, 260.0 ] }, @@ -1783,14 +2507,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{5DF902FE-B0C4-4563-B2BA-17996B24E211}" + "PersistentId": "{53C8DAF1-FFF3-4AF8-A7FB-BC0B4E492B37}" } } } }, { "Key": { - "id": 49463570131637 + "id": 8732754770832 }, "Value": { "ComponentData": { @@ -1799,13 +2523,13 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "LogicNodeTitlePalette" + "PaletteOverride": "StringNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 940.0, - 260.0 + 1440.0, + 620.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1813,14 +2537,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{53C8DAF1-FFF3-4AF8-A7FB-BC0B4E492B37}" + "PersistentId": "{74ED5AE1-A269-46D4-B968-FEDF513C9CF1}" } } } }, { "Key": { - "id": 49467865098933 + "id": 8737049738128 }, "Value": { "ComponentData": { @@ -1829,29 +2553,28 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "StringNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 500.0, + 2280.0, 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{348E780E-3A4E-47C7-ACF5-C7B2CB387517}" + "PersistentId": "{B91C0E41-E6B5-46DE-885F-6BC6CFB2E813}" } } } }, { "Key": { - "id": 49472160066229 + "id": 8741344705424 }, "Value": { "ComponentData": { @@ -1865,8 +2588,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 380.0, - 620.0 + 1840.0, + 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1875,14 +2598,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{BBBE60FC-0215-4A5A-BEBE-4FC869E5EECE}" + "PersistentId": "{59FFF3C1-2D7B-47EA-AE35-ED15DCB95CC8}" } } } }, { "Key": { - "id": 49476455033525 + "id": 8745639672720 }, "Value": { "ComponentData": { @@ -1891,29 +2614,28 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "TimeNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1240.0, - 260.0 + 40.0, + 280.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{13BD3C1C-EDBB-419E-8465-495935414A1A}" + "PersistentId": "{B4CB62D9-9965-42E2-81FF-BDADDBD14CBE}" } } } }, { "Key": { - "id": 49480750000821 + "id": 8749934640016 }, "Value": { "ComponentData": { @@ -1927,7 +2649,7 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1840.0, + 1540.0, 260.0 ] }, @@ -1937,7 +2659,7 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{59FFF3C1-2D7B-47EA-AE35-ED15DCB95CC8}" + "PersistentId": "{FD844BFD-72DA-44BA-B92A-AFDB58263B91}" } } } From 80a216e079dac034d958d32f0e221858947f9f87 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 8 Dec 2021 00:21:02 -0800 Subject: [PATCH 007/399] Adding RPC test. Update editor-servers to flush stdout Signed-off-by: Gene Walters --- .../Multiplayer/TestSuite_Sandbox.py | 3 + .../tests/Multiplayer_AutoComponent_RPC.py | 91 + ...oComponent_RPC_NetLevelEntity.scriptcanvas | 1702 +++++++++++++++++ .../Editor/MultiplayerEditorConnection.cpp | 4 +- .../Editor/MultiplayerEditorConnection.h | 1 + 5 files changed, 1800 insertions(+), 1 deletion(-) create mode 100644 AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py create mode 100644 AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py index 8f50d4d36d..8c5f33993d 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py @@ -32,3 +32,6 @@ class TestAutomation(TestAutomationBase): from .tests import Multiplayer_AutoComponent_NetworkInput as test_module self._run_prefab_test(request, workspace, editor, test_module) + def test_Multiplayer_AutoComponent_RPC(self, request, workspace, editor, launcher_platform): + from .tests import Multiplayer_AutoComponent_RPC as test_module + self._run_prefab_test(request, workspace, editor, test_module) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py new file mode 100644 index 0000000000..3f971e4abf --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py @@ -0,0 +1,91 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + + +# Test Case Title : Check that the four network RPCs can be sent and received + + +# fmt: off +class Tests(): + enter_game_mode = ("Entered game mode", "Failed to enter game mode") + exit_game_mode = ("Exited game mode", "Couldn't exit game mode") + find_network_player = ("Found network player", "Couldn't find network player") + found_lines = ("Expected log lines were found", "Expected log lines were not found") + found_unexpected_lines = ("Unexpected log lines were not found", "Unexpected log lines were found") +# fmt: on + + +def Multiplayer_AutoComponent_RPC(): + r""" + Summary: + Runs a test to make sure that network input can be sent from the autonomous player, received by the authority, and processed + + Level Description: + - Dynamic + 1. Although the level is empty, when the server and editor connect the server will spawn and replicate the player network prefab. + a. The player network prefab has a NetworkTestPlayerComponent.AutoComponent and a script canvas attached which will listen for the CreateInput and ProcessInput events. + Print logs occur upon triggering the CreateInput and ProcessInput events along with their values; we are testing to make sure the expected events are values are recieved. + - Static + 1. This is an empty level. All the logic occurs on the Player.network.spawnable (see the above Dynamic description) + + + Expected Outcome: + We should see editor logs stating that network input has been created and processed. + However, if the script receives unexpected values for the Process event we will see print logs for bad data as well. + + :return: + """ + import azlmbr.legacy.general as general + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import Tracer + + from editor_python_test_tools.utils import TestHelper as helper + from ly_remote_console.remote_console_commands import RemoteConsole as RemoteConsole + + + # looks for an expected line in a list of tracers lines + # lines: the tracer list of lines to search. options are section_tracer.warnings, section_tracer.errors, section_tracer.asserts, section_tracer.prints + # return: true if the line is found, otherwise false + def find_expected_line(expected_line, lines): + found_lines = [printInfo.message.strip() for printInfo in lines] + return expected_line in found_lines + + def wait_for_critical_expected_line(expected_line, lines, time_out): + helper.wait_for_condition(lambda : find_expected_line(expected_line, lines), time_out) + Report.critical_result(("Found expected line: " + expected_line, "Failed to find expected line: " + expected_line), find_expected_line(expected_line, lines)) + + level_name = "AutoComponent_RPC" + player_prefab_name = "Player" + player_prefab_path = f"levels/multiplayer/{level_name}/{player_prefab_name}.network.spawnable" + + helper.init_idle() + + # 1) Open Level + helper.open_level("Multiplayer", level_name) + + with Tracer() as section_tracer: + # 2) Enter game mode + helper.multiplayer_enter_game_mode(Tests.enter_game_mode, player_prefab_path.lower()) + + # 3) Make sure the network player was spawned + player_id = general.find_game_entity(player_prefab_name) + Report.critical_result(Tests.find_network_player, player_id.IsValid()) + + # 4) Check the editor logs for expected and unexpected log output + EXPECTEDLINE_WAIT_TIME_SECONDS = 1.0 + wait_for_critical_expected_line('Script: AutoComponent_RPC: Sending client PlayerNumber 1', section_tracer.prints, EXPECTEDLINE_WAIT_TIME_SECONDS) + wait_for_critical_expected_line("AutoComponent_RPC: I'm Player #1", section_tracer.prints, EXPECTEDLINE_WAIT_TIME_SECONDS) + + + # Exit game mode + helper.exit_game_mode(Tests.exit_game_mode) + + + +if __name__ == "__main__": + from editor_python_test_tools.utils import Report + Report.start_test(Multiplayer_AutoComponent_RPC) diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas new file mode 100644 index 0000000000..aa5244a7cd --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas @@ -0,0 +1,1702 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 56982432064952 + }, + "Name": "AutoComponent_RPC_NetLevelEntity", + "Components": { + "Component_[2936040539888065977]": { + "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "Id": 2936040539888065977, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 56986727032248 + }, + "Name": "SC-Node(RepeaterNodeableNode)", + "Components": { + "Component_[11069913642528675281]": { + "$type": "RepeaterNodeableNode", + "Id": 11069913642528675281, + "Slots": [ + { + "id": { + "m_id": "{07267CBA-B377-4B57-8A04-E322F8BFC07F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{A9CCCCF4-BC3E-44B8-B2BB-2EEFBF475F82}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Repetitions", + "toolTip": "How many times to repeat.", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{E490B225-8A15-4CA1-9F25-6D8F9F8E398F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Interval", + "toolTip": "The Interval between repetitions. If zero, all repititions execute immediately, before On Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{92077333-D7F5-4E54-80FD-0363876B5510}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{91CF89F3-906C-4860-B84E-9BD7D6842CA8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Complete", + "toolTip": "Signaled upon node exit", + "DisplayGroup": { + "Value": 1114099747 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Action", + "toolTip": "Signaled every repetition", + "DisplayGroup": { + "Value": 1204587666 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 10.0, + "label": "Repetitions" + }, + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 1.0, + "label": "Interval" + } + ], + "nodeable": { + "m_timeUnits": 2 + }, + "slotExecutionMap": { + "ins": [ + { + "_slotId": { + "m_id": "{07267CBA-B377-4B57-8A04-E322F8BFC07F}" + }, + "_inputs": [ + { + "_slotId": { + "m_id": "{A9CCCCF4-BC3E-44B8-B2BB-2EEFBF475F82}" + } + }, + { + "_slotId": { + "m_id": "{E490B225-8A15-4CA1-9F25-6D8F9F8E398F}" + } + } + ], + "_outs": [ + { + "_slotId": { + "m_id": "{92077333-D7F5-4E54-80FD-0363876B5510}" + }, + "_name": "On Start", + "_interfaceSourceId": "{60330D5B-FB7F-0000-8039-14DD7C020000}" + } + ], + "_interfaceSourceId": "{E1D0AF7E-837B-0000-0033-BA267C020000}" + } + ], + "latents": [ + { + "_slotId": { + "m_id": "{91CF89F3-906C-4860-B84E-9BD7D6842CA8}" + }, + "_name": "Complete", + "_interfaceSourceId": "{E1D0AF7E-837B-0000-0033-BA267C020000}" + }, + { + "_slotId": { + "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" + }, + "_name": "Action", + "_interfaceSourceId": "{E1D0AF7E-837B-0000-0033-BA267C020000}" + } + ] + } + } + } + }, + { + "Id": { + "id": 57021086770616 + }, + "Name": "SC-Node(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId)", + "Components": { + "Component_[1410603071340071190]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 1410603071340071190, + "Slots": [ + { + "id": { + "m_id": "{406DA66F-95FA-406B-8A5B-F2C5E292EC21}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityId: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{5CDED810-9455-424A-9A1D-40B9366D1F94}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{2FC162C0-D717-4053-9842-39DAD3E8EA86}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{C18E637D-BFD1-42C8-A30D-C2B52D157142}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Event<>", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "EntityId: 0" + } + ], + "methodType": 2, + "methodName": "GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId", + "className": "NetworkTestPlayerComponent", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{406DA66F-95FA-406B-8A5B-F2C5E292EC21}" + } + ], + "prettyClassName": "NetworkTestPlayerComponent" + } + } + }, + { + "Id": { + "id": 57003906901432 + }, + "Name": "SC-Node(DrawTextOnEntity)", + "Components": { + "Component_[14125366736968050670]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 14125366736968050670, + "Slots": [ + { + "id": { + "m_id": "{6BD7BF07-D1B6-4CC2-A861-C4334AA3A025}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityId: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{AB0304C4-CD52-4351-A009-CD959CDA6E2B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String: 1", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{EB877F87-C03A-4692-ABBB-2317E98E8C6F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Color: 2", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{E2D11762-F47C-4341-806A-DBB4FBAEC235}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number: 3", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{1673B8A0-D4EC-4CC7-8F80-0419BB5560EB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{5F720C70-EA4F-4883-B5BE-4278E75370E8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Entity Id" + }, + { + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "AutoComponent_RPC_NetLevelEntity: I'm a client playing some superficial fx", + "label": "Color" + }, + { + "scriptCanvasType": { + "m_type": 12 + }, + "isNullPointer": false, + "$type": "Color", + "value": [ + 1.0, + 0.0, + 0.0, + 1.0 + ], + "label": "Color: 2" + }, + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 2.0, + "label": "Number: 3" + } + ], + "methodType": 0, + "methodName": "DrawTextOnEntity", + "className": "DebugDrawRequestBus", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{6BD7BF07-D1B6-4CC2-A861-C4334AA3A025}" + }, + { + "m_id": "{AB0304C4-CD52-4351-A009-CD959CDA6E2B}" + }, + { + "m_id": "{EB877F87-C03A-4692-ABBB-2317E98E8C6F}" + }, + { + "m_id": "{E2D11762-F47C-4341-806A-DBB4FBAEC235}" + } + ], + "prettyClassName": "DebugDrawRequestBus" + } + } + }, + { + "Id": { + "id": 56999611934136 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[15472692142045278273]": { + "$type": "Print", + "Id": 15472692142045278273, + "Slots": [ + { + "id": { + "m_id": "{2F11CF04-DC4B-4881-8D74-AB0E51B4A278}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{6CE4DAB2-4D8E-461E-B9B2-34338EBBAD97}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some superficial fx.\n", + "m_unresolvedString": [ + "AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some superficial fx.\n" + ] + } + } + }, + { + "Id": { + "id": 56995316966840 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[15717135232290736332]": { + "$type": "Print", + "Id": 15717135232290736332, + "Slots": [ + { + "id": { + "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{C38BB068-BF1B-4734-BFFA-10B258870349}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "AutoComponent_RPC_NetLevelEntity: I'm a client playing some superficial fx.\n", + "m_unresolvedString": [ + "AutoComponent_RPC_NetLevelEntity: I'm a client playing some superficial fx.\n" + ] + } + } + }, + { + "Id": { + "id": 56991021999544 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[15785913678997669879]": { + "$type": "Print", + "Id": 15785913678997669879, + "Slots": [ + { + "id": { + "m_id": "{8E1B9705-148A-42E4-831E-D7B2877358E3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E9B979F9-D682-4B58-8E88-6102387FE70B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "AutoComponent_RPC_NetLevelEntity Activated!\n", + "m_unresolvedString": [ + "AutoComponent_RPC_NetLevelEntity Activated!\n" + ] + } + } + }, + { + "Id": { + "id": 57016791803320 + }, + "Name": "SC-EventNode(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event)", + "Components": { + "Component_[17598011665473695286]": { + "$type": "AzEventHandler", + "Id": 17598011665473695286, + "Slots": [ + { + "id": { + "m_id": "{6F8A1DAB-76A6-445F-B532-6B71CD5DB48F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 57021086770616 + } + } + ], + "slotName": "Connect", + "toolTip": "Connect the AZ Event to this AZ Event Handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{D986DF89-49E8-4CFF-907E-7A46BC118208}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect current AZ Event from this AZ Event Handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{277D7B39-E1B0-4700-946B-FFA024EEDF89}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Connected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{7673B52D-3BEC-4BFF-B29A-D027400B16B1}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Disconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnEvent", + "toolTip": "Triggered when the AZ Event invokes Signal() function.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{F5D0C2B0-F557-4D94-B747-6F3EF01AF54B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 57021086770616 + } + } + ], + "slotName": "AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" + }, + "isNullPointer": true, + "label": "AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event" + } + ], + "m_azEventEntry": { + "m_eventName": "AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event", + "m_eventSlotId": { + "m_id": "{F5D0C2B0-F557-4D94-B747-6F3EF01AF54B}" + } + } + } + } + }, + { + "Id": { + "id": 57025381737912 + }, + "Name": "SC-Node(Start)", + "Components": { + "Component_[1888047318201703857]": { + "$type": "Start", + "Id": 1888047318201703857, + "Slots": [ + { + "id": { + "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled when the entity that owns this graph is fully activated.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ] + } + } + }, + { + "Id": { + "id": 57008201868728 + }, + "Name": "SC-Node(AuthorityToClientNoParams_PlaySomeSuperficialFxByEntityId)", + "Components": { + "Component_[5156950796673122600]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 5156950796673122600, + "Slots": [ + { + "id": { + "m_id": "{AF45BF64-D202-411F-9CE1-A7139ABC6E65}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Source", + "toolTip": "The Source containing the NetworkTestPlayerComponentController", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{A6449574-6CD4-4986-ABED-2E10136D1B2C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{F8CE0394-770E-4F0D-B908-3E01D0E04AE1}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Source" + } + ], + "methodType": 2, + "methodName": "AuthorityToClientNoParams_PlaySomeSuperficialFxByEntityId", + "className": "NetworkTestPlayerComponent", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{AF45BF64-D202-411F-9CE1-A7139ABC6E65}" + } + ], + "prettyClassName": "NetworkTestPlayerComponent" + } + } + }, + { + "Id": { + "id": 57012496836024 + }, + "Name": "SC-Node(TimeDelayNodeableNode)", + "Components": { + "Component_[8951348653904382148]": { + "$type": "TimeDelayNodeableNode", + "Id": 8951348653904382148, + "Slots": [ + { + "id": { + "m_id": "{EA0DF0AE-2FF7-4670-8D99-7CF863038E68}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{9C6D8500-B49B-4407-B2EB-40B1CD4CE762}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Delay", + "toolTip": "The amount of time to delay before the Done is signalled.", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{FE2A3D2F-7AC2-431D-B80C-C363DB475919}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Done", + "toolTip": "Signaled after waiting for the specified amount of times.", + "DisplayGroup": { + "Value": 271442091 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 1.0, + "label": "Delay" + } + ], + "nodeable": { + "m_timeUnits": 2 + }, + "slotExecutionMap": { + "ins": [ + { + "_slotId": { + "m_id": "{EA0DF0AE-2FF7-4670-8D99-7CF863038E68}" + }, + "_inputs": [ + { + "_slotId": { + "m_id": "{9C6D8500-B49B-4407-B2EB-40B1CD4CE762}" + } + } + ], + "_outs": [ + { + "_slotId": { + "m_id": "{FE2A3D2F-7AC2-431D-B80C-C363DB475919}" + }, + "_name": "On Start", + "_interfaceSourceId": "{4C400000-7C02-0000-B86E-0FACE0000000}" + } + ], + "_interfaceSourceId": "{24000000-0000-0000-0000-F421FC7F0000}" + } + ], + "latents": [ + { + "_slotId": { + "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" + }, + "_name": "Done", + "_interfaceSourceId": "{24000000-0000-0000-0000-F421FC7F0000}" + } + ] + } + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 57029676705208 + }, + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(TimeDelay: Start)", + "Components": { + "Component_[5204535376548158590]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 5204535376548158590, + "sourceEndpoint": { + "nodeId": { + "id": 57025381737912 + }, + "slotId": { + "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 57012496836024 + }, + "slotId": { + "m_id": "{EA0DF0AE-2FF7-4670-8D99-7CF863038E68}" + } + } + } + } + }, + { + "Id": { + "id": 57033971672504 + }, + "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId: Event<>), destEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event)", + "Components": { + "Component_[9588403027578693736]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 9588403027578693736, + "sourceEndpoint": { + "nodeId": { + "id": 57021086770616 + }, + "slotId": { + "m_id": "{C18E637D-BFD1-42C8-A30D-C2B52D157142}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 57016791803320 + }, + "slotId": { + "m_id": "{F5D0C2B0-F557-4D94-B747-6F3EF01AF54B}" + } + } + } + } + }, + { + "Id": { + "id": 57038266639800 + }, + "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId: Out), destEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: Connect)", + "Components": { + "Component_[1452138089363094396]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 1452138089363094396, + "sourceEndpoint": { + "nodeId": { + "id": 57021086770616 + }, + "slotId": { + "m_id": "{2FC162C0-D717-4053-9842-39DAD3E8EA86}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 57016791803320 + }, + "slotId": { + "m_id": "{6F8A1DAB-76A6-445F-B532-6B71CD5DB48F}" + } + } + } + } + }, + { + "Id": { + "id": 57042561607096 + }, + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId: In)", + "Components": { + "Component_[17563947682404363417]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 17563947682404363417, + "sourceEndpoint": { + "nodeId": { + "id": 57025381737912 + }, + "slotId": { + "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 57021086770616 + }, + "slotId": { + "m_id": "{5CDED810-9455-424A-9A1D-40B9366D1F94}" + } + } + } + } + }, + { + "Id": { + "id": 57046856574392 + }, + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: OnEvent), destEndpoint=(Print: In)", + "Components": { + "Component_[12226462283795741406]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 12226462283795741406, + "sourceEndpoint": { + "nodeId": { + "id": 57016791803320 + }, + "slotId": { + "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 56995316966840 + }, + "slotId": { + "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" + } + } + } + } + }, + { + "Id": { + "id": 57051151541688 + }, + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: OnEvent), destEndpoint=(DrawTextOnEntity: In)", + "Components": { + "Component_[7209285242155620531]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 7209285242155620531, + "sourceEndpoint": { + "nodeId": { + "id": 57016791803320 + }, + "slotId": { + "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 57003906901432 + }, + "slotId": { + "m_id": "{1673B8A0-D4EC-4CC7-8F80-0419BB5560EB}" + } + } + } + } + }, + { + "Id": { + "id": 57055446508984 + }, + "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(Repeater: Start)", + "Components": { + "Component_[6292481678297438578]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 6292481678297438578, + "sourceEndpoint": { + "nodeId": { + "id": 57012496836024 + }, + "slotId": { + "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 56986727032248 + }, + "slotId": { + "m_id": "{07267CBA-B377-4B57-8A04-E322F8BFC07F}" + } + } + } + } + }, + { + "Id": { + "id": 57059741476280 + }, + "Name": "srcEndpoint=(Repeater: Action), destEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFxByEntityId: In)", + "Components": { + "Component_[8833903103579494596]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 8833903103579494596, + "sourceEndpoint": { + "nodeId": { + "id": 56986727032248 + }, + "slotId": { + "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 57008201868728 + }, + "slotId": { + "m_id": "{A6449574-6CD4-4986-ABED-2E10136D1B2C}" + } + } + } + } + }, + { + "Id": { + "id": 57064036443576 + }, + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFxByEntityId: Out), destEndpoint=(Print: In)", + "Components": { + "Component_[8297971328953001309]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 8297971328953001309, + "sourceEndpoint": { + "nodeId": { + "id": 57008201868728 + }, + "slotId": { + "m_id": "{F8CE0394-770E-4F0D-B908-3E01D0E04AE1}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 56999611934136 + }, + "slotId": { + "m_id": "{2F11CF04-DC4B-4881-8D74-AB0E51B4A278}" + } + } + } + } + }, + { + "Id": { + "id": 57068331410872 + }, + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(Print: In)", + "Components": { + "Component_[11504712829988319988]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 11504712829988319988, + "sourceEndpoint": { + "nodeId": { + "id": 57025381737912 + }, + "slotId": { + "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 56991021999544 + }, + "slotId": { + "m_id": "{8E1B9705-148A-42E4-831E-D7B2877358E3}" + } + } + } + } + } + ] + }, + "m_assetType": "{3E2AC8CD-713F-453E-967F-29517F331784}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1, + "_fileVersion": 1 + }, + "GraphCanvasData": [ + { + "Key": { + "id": 56982432064952 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "Scale": 1.0440124999999998, + "AnchorX": 173.36956787109375, + "AnchorY": -153.25486755371094 + } + } + } + } + }, + { + "Key": { + "id": 56986727032248 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "DefaultNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 80.0, + -60.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{41B7477C-D5B9-49AC-AFA3-AAAE2A6ED7C5}" + } + } + } + }, + { + "Key": { + "id": 56991021999544 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -240.0, + -300.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{0CF0846C-1D21-4B33-8723-1538FD4FD04A}" + } + } + } + }, + { + "Key": { + "id": 56995316966840 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 800.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{0D04EBA6-E1E7-4DF7-BAA9-CC87F4689CD2}" + } + } + } + }, + { + "Key": { + "id": 56999611934136 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 960.0, + -40.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{A4FDCB87-B021-48B9-ABCB-AECA986B33D6}" + } + } + } + }, + { + "Key": { + "id": 57003906901432 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 800.0, + 460.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{82D0ED1B-98D3-4AEF-B1DA-2F27CACD3A4D}" + } + } + } + }, + { + "Key": { + "id": 57008201868728 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 380.0, + -40.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{FD25E23C-E976-4F9A-8C16-80B125D80485}" + } + } + } + }, + { + "Key": { + "id": 57012496836024 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "DefaultNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -220.0, + -40.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{D3F081D7-40C1-4C31-B298-B18C6AFDFD25}" + } + } + } + }, + { + "Key": { + "id": 57016791803320 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "HandlerNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 220.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".azeventhandler" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{58CEEB80-152A-4B8E-8698-8B8EE5F31A41}" + } + } + } + }, + { + "Key": { + "id": 57021086770616 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -220.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{30443D97-4B57-482D-BA92-005DB39A9FA7}" + } + } + } + }, + { + "Key": { + "id": 57025381737912 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TimeNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -380.0, + -20.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{675C7E90-B89E-4347-A3C6-B8D12B6EA698}" + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 4199610336680704683, + "Value": 1 + }, + { + "Key": 4847610523576971761, + "Value": 1 + }, + { + "Key": 6462358712820489356, + "Value": 1 + }, + { + "Key": 10684225535275896474, + "Value": 3 + }, + { + "Key": 11941188735314642437, + "Value": 1 + }, + { + "Key": 11983076003173356132, + "Value": 1 + }, + { + "Key": 13774516226790665785, + "Value": 1 + }, + { + "Key": 17705307213431043531, + "Value": 1 + } + ] + } + }, + "Component_[630514155173445772]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 630514155173445772 + } + } + } + } +} \ No newline at end of file diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp index 66b14579fa..11615137ca 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp @@ -41,6 +41,9 @@ namespace Multiplayer // Automated testing listens for these logs if (editorsv_isDedicated) { + // Server logs piped to the editor. Change the buffering policy to ensure every write to stdout is flushed. + setvbuf(stdout, NULL, _IONBF, 0); + // If the settings registry is not available at this point, // then something catastrophic has happened in the application startup. // That should have been caught and messaged out earlier in startup. @@ -235,5 +238,4 @@ namespace Multiplayer { return MultiplayerEditorPackets::DispatchPacket(connection, packetHeader, serializer, *this); } - } diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h index 0c892c847f..721c7e0a0f 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h @@ -12,6 +12,7 @@ #include #include #include +#include namespace AzNetworking { From 363007363a35154d04d8cc25896f378205cb1bb1 Mon Sep 17 00:00:00 2001 From: Tobias Alexander Franke Date: Fri, 29 Oct 2021 15:28:51 +0800 Subject: [PATCH 008/399] In the entity outliner search box, the matching results are not expanded and displayed Signed-off-by: T.J. McGrath-Daly --- .../AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp index d6e9cac754..f3902023b7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp @@ -1088,6 +1088,8 @@ namespace AzToolsFramework m_listModel->SearchStringChanged(filterString); m_proxyModel->UpdateFilter(); + + m_gui->m_objectTree->expandAll(); } void EntityOutlinerWidget::OnFilterChanged(const AzQtComponents::SearchTypeFilterList& activeTypeFilters) From 8b1e14cc7e18ddfe3e7c408b4f0970513b8f3fe5 Mon Sep 17 00:00:00 2001 From: Andre Mitchell Date: Wed, 8 Dec 2021 08:19:10 -0500 Subject: [PATCH 009/399] Prevent some slice-related commands from being enabled when the slice editor is not. Fixes o3de/o3de#6198 Fixes an additional menu option that was visible (Resave all slices) Signed-off-by: Andre Mitchell --- Code/Editor/Core/LevelEditorMenuHandler.cpp | 6 +++--- Code/Editor/CryEdit.cpp | 4 +++- Code/Editor/MainWindow.cpp | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Code/Editor/Core/LevelEditorMenuHandler.cpp b/Code/Editor/Core/LevelEditorMenuHandler.cpp index 70aff10f87..6be2456d2a 100644 --- a/Code/Editor/Core/LevelEditorMenuHandler.cpp +++ b/Code/Editor/Core/LevelEditorMenuHandler.cpp @@ -374,7 +374,6 @@ QMenu* LevelEditorMenuHandler::CreateFileMenu() { DisableActionWhileLevelChanges(fileOpenSlice, e); })); -#endif // Save Selected Slice auto saveSelectedSlice = fileMenu.AddAction(ID_FILE_SAVE_SELECTED_SLICE); @@ -391,7 +390,7 @@ QMenu* LevelEditorMenuHandler::CreateFileMenu() { HideActionWhileEntitiesDeselected(saveSliceToRoot, e); })); - +#endif // Open Recent m_mostRecentLevelsMenu = fileMenu.AddMenu(tr("Open Recent")); connect(m_mostRecentLevelsMenu, &QMenu::aboutToShow, this, &LevelEditorMenuHandler::UpdateMRUFiles); @@ -439,9 +438,10 @@ QMenu* LevelEditorMenuHandler::CreateFileMenu() // Show Log File fileMenu.AddAction(ID_FILE_EDITLOGFILE); +#ifdef ENABLE_SLICE_EDITOR fileMenu.AddSeparator(); - fileMenu.AddAction(ID_FILE_RESAVESLICES); +#endif fileMenu.AddSeparator(); diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp index d5f2305dfb..4e9eb6bada 100644 --- a/Code/Editor/CryEdit.cpp +++ b/Code/Editor/CryEdit.cpp @@ -380,13 +380,13 @@ void CCryEditApp::RegisterActionHandlers() ON_COMMAND(ID_IMPORT_ASSET, OnOpenAssetImporter) ON_COMMAND(ID_EDIT_LEVELDATA, OnEditLevelData) ON_COMMAND(ID_FILE_EDITLOGFILE, OnFileEditLogFile) - ON_COMMAND(ID_FILE_RESAVESLICES, OnFileResaveSlices) ON_COMMAND(ID_FILE_EDITEDITORINI, OnFileEditEditorini) ON_COMMAND(ID_PREFERENCES, OnPreferences) ON_COMMAND(ID_REDO, OnRedo) ON_COMMAND(ID_TOOLBAR_WIDGET_REDO, OnRedo) ON_COMMAND(ID_FILE_OPEN_LEVEL, OnOpenLevel) #ifdef ENABLE_SLICE_EDITOR + ON_COMMAND(ID_FILE_RESAVESLICES, OnFileResaveSlices) ON_COMMAND(ID_FILE_NEW_SLICE, OnCreateSlice) ON_COMMAND(ID_FILE_OPEN_SLICE, OnOpenSlice) #endif @@ -2636,6 +2636,7 @@ void CCryEditApp::OnFileEditLogFile() CFileUtil::EditTextFile(CLogFile::GetLogFileName(), 0, IFileUtil::FILE_TYPE_SCRIPT); } +#ifdef ENABLE_SLICE_EDITOR void CCryEditApp::OnFileResaveSlices() { AZStd::vector sliceAssetInfos; @@ -2766,6 +2767,7 @@ void CCryEditApp::OnFileResaveSlices() } } +#endif ////////////////////////////////////////////////////////////////////////// void CCryEditApp::OnFileEditEditorini() diff --git a/Code/Editor/MainWindow.cpp b/Code/Editor/MainWindow.cpp index 38e433c3a3..2e9bb723ac 100644 --- a/Code/Editor/MainWindow.cpp +++ b/Code/Editor/MainWindow.cpp @@ -642,11 +642,11 @@ void MainWindow::InitActions() .SetStatusTip(tr("Create a new slice")); am->AddAction(ID_FILE_OPEN_SLICE, tr("Open Slice...")) .SetStatusTip(tr("Open an existing slice")); -#endif am->AddAction(ID_FILE_SAVE_SELECTED_SLICE, tr("Save selected slice")).SetShortcut(tr("Alt+S")) .SetStatusTip(tr("Save the selected slice to the first level root")); am->AddAction(ID_FILE_SAVE_SLICE_TO_ROOT, tr("Save Slice to root")).SetShortcut(tr("Ctrl+Alt+S")) .SetStatusTip(tr("Save the selected slice to the top level root")); +#endif am->AddAction(ID_FILE_SAVE_LEVEL, tr("&Save")) .SetShortcut(tr("Ctrl+S")) .SetReserved() @@ -676,7 +676,9 @@ void MainWindow::InitActions() .RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateSelected); am->AddAction(ID_FILE_EXPORTOCCLUSIONMESH, tr("Export Occlusion Mesh")); am->AddAction(ID_FILE_EDITLOGFILE, tr("Show Log File")); +#ifdef ENABLE_SLICE_EDITOR am->AddAction(ID_FILE_RESAVESLICES, tr("Resave All Slices")); +#endif am->AddAction(ID_FILE_PROJECT_MANAGER_SETTINGS, tr("Edit Project Settings...")); am->AddAction(ID_FILE_PROJECT_MANAGER_NEW, tr("New Project...")); am->AddAction(ID_FILE_PROJECT_MANAGER_OPEN, tr("Open Project...")); From b5e61356b13fd3b4868a05a807c93740d94e9d79 Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Wed, 8 Dec 2021 14:30:45 -0500 Subject: [PATCH 010/399] Compile time fixes for AZ_PROFILE macros Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h | 1 + Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h index 23caed3031..d96c34aa68 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h @@ -7,6 +7,7 @@ */ #pragma once +#include #include #include #include diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp index 4b8604fa51..a80bdad21e 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp @@ -5,9 +5,11 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ + #include #include +#include #include #include From d39ae32f2d6e8e4177a662ad448ca15c9384c75f Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Wed, 8 Dec 2021 14:32:20 -0500 Subject: [PATCH 011/399] Cleanup Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp index a80bdad21e..8121f6a1ab 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ - #include #include From f36255b22ad0115c2cd86b184ff9f8518419857e Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Wed, 8 Dec 2021 13:57:24 -0800 Subject: [PATCH 012/399] Initial value implementation Signed-off-by: Nicholas Van Sickle --- .../AzCore/AzCore/DOM/DomDocument.cpp | 0 .../Framework/AzCore/AzCore/DOM/DomDocument.h | 0 Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 747 ++++++++++++++++++ Code/Framework/AzCore/AzCore/DOM/DomValue.h | 289 +++++++ .../AzCore/AzCore/azcore_files.cmake | 4 + 5 files changed, 1040 insertions(+) create mode 100644 Code/Framework/AzCore/AzCore/DOM/DomDocument.cpp create mode 100644 Code/Framework/AzCore/AzCore/DOM/DomDocument.h create mode 100644 Code/Framework/AzCore/AzCore/DOM/DomValue.cpp create mode 100644 Code/Framework/AzCore/AzCore/DOM/DomValue.h diff --git a/Code/Framework/AzCore/AzCore/DOM/DomDocument.cpp b/Code/Framework/AzCore/AzCore/DOM/DomDocument.cpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Code/Framework/AzCore/AzCore/DOM/DomDocument.h b/Code/Framework/AzCore/AzCore/DOM/DomDocument.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp new file mode 100644 index 0000000000..ad6e648620 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -0,0 +1,747 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +#include + +namespace AZ::Dom +{ + template + AZStd::shared_ptr& CheckCopyOnWrite(AZStd::shared_ptr& refCountedPointer) + { + if (refCountedPointer.use_count() > 1) + { + AZStd::shared_ptr newPointer = AZStd::make_shared(); + *newPointer = *refCountedPointer; + refCountedPointer = AZStd::move(newPointer); + } + return refCountedPointer; + } + + AZ::Name Node::GetName() const + { + return m_name; + } + + void Node::SetName(AZ::Name name) + { + m_name = name; + } + + ObjectPtr Node::GetMutableProperties() + { + CheckCopyOnWrite(m_object); + return m_object; + } + + ConstObjectPtr Node::GetProperties() const + { + return m_object; + } + + ArrayPtr Node::GetMutableChildren() + { + CheckCopyOnWrite(m_array); + return m_array; + } + + ConstArrayPtr Node::GetChildren() const + { + return m_array; + } + + bool Node::operator==(const Node& rhs) const + { + return m_name == rhs.m_name && m_array == rhs.m_array && m_object == rhs.m_object; + } + + Value::Value() + { + } + + Value::Value(const Value& value) + : m_value(value.m_value) + { + } + + Value::Value(Value&& value) noexcept + : m_value(value.m_value) + { + } + + Value::Value(AZStd::string_view string, bool copy) + { + if (copy) + { + CopyFromString(string); + } + else + { + SetString(string); + } + } + + Value::Value(AZStd::any* value) + : m_value(value) + { + } + + Value Value::FromOpaqueValue(AZStd::any& value) + { + return Value(&value); + } + + Value::Value(int64_t value) + : m_value(value) + { + } + + Value::Value(uint64_t value) + : m_value(value) + { + } + + Value::Value(double value) + : m_value(value) + { + } + + Value::Value(bool value) + : m_value(value) + { + } + + Value& Value::operator=(const Value& other) + { + m_value = other.m_value; + return *this; + } + + Value& Value::operator=(Value&& other) noexcept + { + m_value = other.m_value; + return *this; + } + + bool Value::operator==(const Value& rhs) const + { + if (IsString() && rhs.IsString()) + { + return GetString() == rhs.GetString(); + } + else if (IsNumber() && rhs.IsNumber()) + { + if (IsInt()) + { + return GetInt() == rhs.GetInt(); + } + else if (IsUint()) + { + return GetUint() == rhs.GetUint(); + } + else + { + return GetDouble() == rhs.GetDouble(); + } + } + else + { + return m_value == rhs.m_value; + } + } + + bool Value::operator!=(const Value& rhs) const + { + return !operator==(rhs); + } + + void Value::Swap(Value& other) noexcept + { + AZStd::swap(m_value, other.m_value); + } + + Type Dom::Value::GetType() const + { + switch (m_value.index()) + { + case 0: // AZStd::monostate + return Type::NullType; + case 1: // int64_t + case 2: // uint64_t + case 3: // double + return Type::NumberType; + case 4: // bool + return AZStd::get(m_value) ? Type::TrueType : Type::FalseType; + case 5: // AZStd::string_view + case 6: // AZStd::shared_ptr + return Type::StringType; + case 7: // ObjectPtr + return Type::ObjectType; + case 8: // ArrayPtr + return Type::ArrayType; + case 9: // Node + return Type::NodeType; + case 10: // AZStd::any* + return Type::OpaqueType; + } + AZ_Assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); + return Type::NullType; + } + + bool Value::IsNull() const + { + return GetType() == Type::NullType; + } + + bool Value::IsFalse() const + { + return GetType() == Type::FalseType; + } + + bool Value::IsTrue() const + { + return GetType() == Type::TrueType; + } + + bool Value::IsBool() const + { + return AZStd::holds_alternative(m_value); + } + + bool Value::IsNode() const + { + return GetType() == Type::NodeType; + } + + bool Value::IsObject() const + { + return GetType() == Type::ObjectType; + } + + bool Value::IsArray() const + { + return GetType() == Type::ArrayType; + } + + bool Value::IsOpaqueValue() const + { + return GetType() == Type::OpaqueType; + } + + bool Value::IsNumber() const + { + return GetType() == Type::NumberType; + } + + bool Value::IsInt() const + { + return AZStd::holds_alternative(m_value); + } + + bool Value::IsUint() const + { + return AZStd::holds_alternative(m_value); + } + + bool Value::IsDouble() const + { + return AZStd::holds_alternative(m_value); + } + + bool Value::IsString() const + { + return GetType() == Type::StringType; + } + + Value& Value::SetObject() + { + m_value = AZStd::make_shared(); + return *this; + } + + const Object::ContainerType& Value::GetObjectInternal() const + { + const Type type = GetType(); + AZ_Assert( + type == Type::ObjectType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an object from a non-object value"); + if (type == Type::ObjectType) + { + return AZStd::get(m_value)->m_values; + } + else + { + return AZStd::get(m_value).GetProperties()->m_values; + } + } + + Object::ContainerType& Value::GetObjectInternal() + { + const Type type = GetType(); + AZ_Assert( + type == Type::ObjectType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an object from a non-object value"); + if (type == Type::ObjectType) + { + return CheckCopyOnWrite(AZStd::get(m_value))->m_values; + } + else + { + return AZStd::get(m_value).GetMutableProperties()->m_values; + } + } + + const Array::ContainerType& Value::GetArrayInternal() const + { + const Type type = GetType(); + AZ_Assert( + type == Type::ArrayType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an array from a non-array value"); + if (type == Type::ObjectType) + { + return AZStd::get(m_value)->m_values; + } + else + { + return AZStd::get(m_value).GetChildren()->m_values; + } + } + + Array::ContainerType& Value::GetArrayInternal() + { + const Type type = GetType(); + AZ_Assert( + type == Type::ArrayType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an array from a non-array value"); + if (type == Type::ObjectType) + { + return CheckCopyOnWrite(AZStd::get(m_value))->m_values; + } + else + { + return AZStd::get(m_value).GetMutableChildren()->m_values; + } + } + + size_t Value::MemberCount() const + { + return GetObjectInternal().size(); + } + + size_t Value::MemberCapacity() const + { + return GetObjectInternal().size(); + } + + bool Value::ObjectEmpty() const + { + return GetObjectInternal().empty(); + } + + Value& Value::operator[](KeyType name) + { + return FindMember(name)->second; + } + + const Value& Value::operator[](KeyType name) const + { + return FindMember(name)->second; + } + + Value& Value::operator[](AZStd::string_view name) + { + return operator[](AZ::Name(name)); + } + + const Value& Value::operator[](AZStd::string_view name) const + { + return operator[](AZ::Name(name)); + } + + Object::ConstIterator Value::MemberBegin() const + { + return GetObjectInternal().begin(); + } + + Object::ConstIterator Value::MemberEnd() const + { + return GetObjectInternal().end(); + } + + Object::Iterator Value::MemberBegin() + { + return GetObjectInternal().begin(); + } + + Object::Iterator Value::MemberEnd() + { + return GetObjectInternal().end(); + } + + Object::ConstIterator Value::FindMember(KeyType name) const + { + const Object::ContainerType& object = GetObjectInternal(); + return AZStd::find_if( + object.begin(), object.end(), + [&name](const Object::EntryType& entry) + { + return entry.first == name; + }); + } + + Object::ConstIterator Value::FindMember(AZStd::string_view name) const + { + return FindMember(AZ::Name(name)); + } + + Object::Iterator Value::FindMember(KeyType name) + { + Object::ContainerType& object = GetObjectInternal(); + return AZStd::find_if( + object.begin(), object.end(), + [&name](const Object::EntryType& entry) + { + return entry.first == name; + }); + } + + Object::Iterator Value::FindMember(AZStd::string_view name) + { + return FindMember(AZ::Name(name)); + } + + Value& Value::MemberReserve(size_t newCapacity) + { + GetObjectInternal().reserve(newCapacity); + return *this; + } + + bool Value::HasMember(KeyType name) const + { + return FindMember(name) != GetObjectInternal().end(); + } + + bool Value::HasMember(AZStd::string_view name) const + { + return HasMember(AZ::Name(name)); + } + + Value& Value::AddMember(KeyType name, const Value& value) + { + Object::ContainerType& object = GetObjectInternal(); + if (auto memberIt = FindMember(name); memberIt != object.end()) + { + memberIt->second = value; + } + else + { + object.emplace_back(name, value); + } + return *this; + } + + Value& Value::AddMember(AZStd::string_view name, const Value& value) + { + return AddMember(AZ::Name(name), value); + } + + Value& Value::AddMember(AZ::Name name, Value&& value) + { + Object::ContainerType& object = GetObjectInternal(); + if (auto memberIt = FindMember(name); memberIt != object.end()) + { + memberIt->second = value; + } + else + { + object.emplace_back(name, value); + } + return *this; + } + + Value& Value::AddMember(AZStd::string_view name, Value&& value) + { + return AddMember(AZ::Name(name), value); + } + + void Value::RemoveAllMembers() + { + GetObjectInternal().clear(); + } + + void Value::RemoveMember(KeyType name) + { + Object::ContainerType& object = GetObjectInternal(); + object.erase(AZStd::remove_if( + object.begin(), object.end(), + [&name](const Object::EntryType& entry) + { + return entry.first == name; + })); + } + + void Value::RemoveMember(AZStd::string_view name) + { + RemoveMember(AZ::Name(name)); + } + + Object::Iterator Value::RemoveMember(Object::Iterator pos) + { + Object::ContainerType& object = GetObjectInternal(); + Object::Iterator nextIndex = object.end(); + auto lastEntry = object.end() - 1; + if (pos != lastEntry) + { + AZStd::swap(*pos, *lastEntry); + nextIndex = pos; + } + object.resize(object.size() - 1); + return nextIndex; + } + + Object::Iterator Value::EraseMember(Object::ConstIterator pos) + { + return GetObjectInternal().erase(pos); + } + + Object::Iterator Value::EraseMember(Object::ConstIterator first, Object::ConstIterator last) + { + return GetObjectInternal().erase(first, last); + } + + Object::Iterator Value::EraseMember(KeyType name) + { + return GetObjectInternal().erase(FindMember(name)); + } + + Object::Iterator Value::EraseMember(AZStd::string_view name) + { + return EraseMember(AZ::Name(name)); + } + + Object::ContainerType& Value::GetObject() + { + return GetObjectInternal(); + } + + const Object::ContainerType& Value::GetObject() const + { + return GetObjectInternal(); + } + + Value& Value::SetArray() + { + m_value = AZStd::make_shared(); + return *this; + } + + size_t Value::Size() const + { + return GetArrayInternal().size(); + } + + size_t Value::Capacity() const + { + return GetArrayInternal().capacity(); + } + + bool Value::Empty() const + { + return GetArrayInternal().empty(); + } + + void Value::Clear() + { + GetArrayInternal().clear(); + } + + Value& Value::operator[](size_t index) + { + return GetArrayInternal()[index]; + } + + const Value& Value::operator[](size_t index) const + { + return GetArrayInternal()[index]; + } + + Array::ConstIterator Value::Begin() const + { + return GetArrayInternal().begin(); + } + + Array::ConstIterator Value::End() const + { + return GetArrayInternal().end(); + } + + Array::Iterator Value::Begin() + { + return GetArrayInternal().begin(); + } + + Array::Iterator Value::End() + { + return GetArrayInternal().end(); + } + + Value& Value::Reserve(size_t newCapacity) + { + GetArrayInternal().reserve(newCapacity); + return *this; + } + + Value& Value::PushBack(Value value) + { + GetArrayInternal().push_back(AZStd::move(value)); + return *this; + } + + Value& Value::PopBack() + { + GetArrayInternal().pop_back(); + return *this; + } + + Array::Iterator Value::Erase(Array::ConstIterator pos) + { + return GetArrayInternal().erase(pos); + } + + Array::Iterator Value::Erase(Array::ConstIterator first, Array::ConstIterator last) + { + return GetArrayInternal().erase(first, last); + } + + Array::ContainerType& Value::GetArray() + { + return GetArrayInternal(); + } + + const Array::ContainerType& Value::GetArray() const + { + return GetArrayInternal(); + } + + int64_t Value::GetInt() const + { + switch (m_value.index()) + { + case 1: // int64_t + return AZStd::get(m_value); + case 2: // uint64_t + return aznumeric_cast(AZStd::get(m_value)); + case 3: // double + return aznumeric_cast(AZStd::get(m_value)); + } + AZ_Assert(false, "AZ::Dom::Value: Called GetInt on a non-numeric type"); + return {}; + } + + void Value::SetInt(int64_t value) + { + m_value = value; + } + + uint64_t Value::GetUint() const + { + switch (m_value.index()) + { + case 1: // int64_t + return aznumeric_cast(AZStd::get(m_value)); + case 2: // uint64_t + return AZStd::get(m_value); + case 3: // double + return aznumeric_cast(AZStd::get(m_value)); + } + AZ_Assert(false, "AZ::Dom::Value: Called GetInt on a non-numeric type"); + return {}; + } + + void Value::SetUint(uint64_t value) + { + m_value = value; + } + + bool Value::GetBool() const + { + if (IsBool()) + { + return AZStd::get(m_value); + } + AZ_Assert(false, "AZ::Dom::Value: Called GetBool on a non-bool type"); + return {}; + } + + void Value::SetBool(bool value) + { + m_value = value; + } + + double Value::GetDouble() const + { + switch (m_value.index()) + { + case 1: // int64_t + return aznumeric_cast(AZStd::get(m_value)); + case 2: // uint64_t + return aznumeric_cast(AZStd::get(m_value)); + case 3: // double + return AZStd::get(m_value); + } + AZ_Assert(false, "AZ::Dom::Value: Called GetInt on a non-numeric type"); + return {}; + } + + void Value::SetDouble(double value) + { + m_value = value; + } + + AZStd::string_view Value::GetString() const + { + switch (m_value.index()) + { + case 5: // AZStd::string_view + return AZStd::get(m_value); + case 6: // AZStd::shared_ptr + return *AZStd::get>(m_value); + } + AZ_Assert(false, "AZ::Dom::Value: Called GetString on a non-string type"); + return {}; + } + + size_t Value::GetStringLength() const + { + return GetString().size(); + } + + void Value::SetString(AZStd::string_view value) + { + m_value = value; + } + + void Value::CopyFromString(AZStd::string_view value) + { + m_value = AZStd::make_shared(value); + } + + AZStd::any& Value::GetOpaqueValue() const + { + return *AZStd::get(m_value); + } + + void Value::SetOpaqueValue(AZStd::any& value) + { + m_value = &value; + } + + void Value::SetNull() + { + m_value = AZStd::monostate(); + } +} // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h new file mode 100644 index 0000000000..f73dbb2549 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -0,0 +1,289 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +#include +#include +#include +#include +#include + +namespace AZ::Dom +{ + using KeyType = AZ::Name; + + enum class Type + { + NullType = 0, + FalseType = 1, + TrueType = 2, + ObjectType = 3, + ArrayType = 4, + StringType = 5, + NumberType = 6, + NodeType = 7, + OpaqueType = 8, + }; + + class Value; + + class Array + { + public: + using ContainerType = AZStd::vector; + using Iterator = ContainerType::iterator; + using ConstIterator = ContainerType::const_iterator; + + private: + ContainerType m_values; + + friend class Value; + }; + + using ArrayPtr = AZStd::shared_ptr; + using ConstArrayPtr = AZStd::shared_ptr; + + class Object + { + public: + using EntryType = AZStd::pair; + using ContainerType = AZStd::vector; + using Iterator = ContainerType::iterator; + using ConstIterator = ContainerType::const_iterator; + + private: + ContainerType m_values; + + friend class Value; + }; + + using ObjectPtr = AZStd::shared_ptr; + using ConstObjectPtr = AZStd::shared_ptr; + + class Node + { + public: + AZ::Name GetName() const; + void SetName(AZ::Name name); + + ObjectPtr GetMutableProperties(); + ConstObjectPtr GetProperties() const; + + ArrayPtr GetMutableChildren(); + ConstArrayPtr GetChildren() const; + + bool operator==(const Node& rhs) const; + + private: + AZ::Name m_name; + ArrayPtr m_array; + ObjectPtr m_object; + + friend class Value; + }; + + class Value + { + public: + // Constructors... + Value(); + Value(const Value&); + Value(Value&&) noexcept; + Value(AZStd::string_view string, bool copy); + + explicit Value(int64_t value); + explicit Value(uint64_t value); + explicit Value(double value); + explicit Value(bool value); + + static Value FromOpaqueValue(AZStd::any& value); + + // Equality / comparison / swap... + Value& operator=(const Value&); + Value& operator=(Value&&) noexcept; + + bool operator==(const Value& rhs) const; + bool operator!=(const Value& rhs) const; + + void Swap(Value& other) noexcept; + + // Type info... + Type GetType() const; + bool IsNull() const; + bool IsFalse() const; + bool IsTrue() const; + bool IsBool() const; + bool IsNode() const; + bool IsObject() const; + bool IsArray() const; + bool IsOpaqueValue() const; + bool IsNumber() const; + bool IsInt() const; + bool IsUint() const; + bool IsDouble() const; + bool IsString() const; + + // Object API (also used by Node)... + Value& SetObject(); + size_t MemberCount() const; + size_t MemberCapacity() const; + bool ObjectEmpty() const; + + Value& operator[](KeyType name); + const Value& operator[](KeyType name) const; + Value& operator[](AZStd::string_view name); + const Value& operator[](AZStd::string_view name) const; + + Object::ConstIterator MemberBegin() const; + Object::ConstIterator MemberEnd() const; + Object::Iterator MemberBegin(); + Object::Iterator MemberEnd(); + + Object::ConstIterator FindMember(KeyType name) const; + Object::ConstIterator FindMember(AZStd::string_view name) const; + Object::Iterator FindMember(KeyType name); + Object::Iterator FindMember(AZStd::string_view name); + + Value& MemberReserve(size_t newCapacity); + bool HasMember(KeyType name) const; + bool HasMember(AZStd::string_view name) const; + + Value& AddMember(KeyType name, const Value& value); + Value& AddMember(AZStd::string_view name, const Value& value); + Value& AddMember(KeyType name, Value&& value); + Value& AddMember(AZStd::string_view name, Value&& value); + + void RemoveAllMembers(); + void RemoveMember(KeyType name); + void RemoveMember(AZStd::string_view name); + Object::Iterator RemoveMember(Object::Iterator pos); + Object::Iterator EraseMember(Object::ConstIterator pos); + Object::Iterator EraseMember(Object::ConstIterator first, Object::ConstIterator last); + Object::Iterator EraseMember(KeyType name); + Object::Iterator EraseMember(AZStd::string_view name); + + Object::ContainerType& GetObject(); + const Object::ContainerType& GetObject() const; + + // Array API (also used by Node)... + Value& SetArray(); + + size_t Size() const; + size_t Capacity() const; + bool Empty() const; + void Clear(); + + Value& operator[](size_t index); + const Value& operator[](size_t index) const; + + Array::ConstIterator Begin() const; + Array::ConstIterator End() const; + Array::Iterator Begin(); + Array::Iterator End(); + + Value& Reserve(size_t newCapacity); + Value& PushBack(Value value); + Value& PopBack(); + + Array::Iterator Erase(Array::ConstIterator pos); + Array::Iterator Erase(Array::ConstIterator first, Array::ConstIterator last); + + Array::ContainerType& GetArray(); + const Array::ContainerType& GetArray() const; + + // Node API (supports both object + array API, plus a dedicated NodeName)... + // bool CanConvertToNodeFromObject() const; + // Value& ConvertToNodeFromObject(); + // Value& ConvertToObjectFromNode(); + + void SetNode(AZ::Name name); + void SetNode(AZStd::string_view name); + + AZ::Name GetNodeName() const; + void SetNodeName(AZ::Name name); + void SetNodeName(AZStd::string_view name); + //! Convenience method, sets the first non-node element of a Node. + void SetNodeValue(Value value); + //! Convenience method, gets the first non-node element of a Node. + Value GetNodeValue() const; + + // int API... + int64_t GetInt() const; + void SetInt(int64_t); + + // uint API... + uint64_t GetUint() const; + void SetUint(uint64_t); + + // bool API... + bool GetBool() const; + void SetBool(bool); + + // double API... + double GetDouble() const; + void SetDouble(double); + + // string API... + AZStd::string_view GetString() const; + size_t GetStringLength() const; + void SetString(AZStd::string_view); + void CopyFromString(AZStd::string_view); + + // opaque type API... + AZStd::any& GetOpaqueValue() const; + //! This sets this Value to represent a value of an type that the DOM has + //! no formal knowledge of. Where possible, it should be preferred to + //! serialize an opaque type into a DOM value instead, as serializers + //! and other systems will have no means of dealing with fully arbitrary + //! values. + void SetOpaqueValue(AZStd::any&); + + // null API... + void SetNull(); + + private: + const Object::ContainerType& GetObjectInternal() const; + Object::ContainerType& GetObjectInternal(); + const Array::ContainerType& GetArrayInternal() const; + Array::ContainerType& GetArrayInternal(); + + explicit Value(AZStd::any* opaqueValue); + + // If using the the copy on write model, anything stored internally as a shared_ptr will + // detach and copy when doing a mutating operation if use_count() > 1. + + // This internal storage will not have a 1:1 mapping to the public Type, as there may be + // multiple storage options (e.g. strings being stored as non-owning string_view or + // owning shared_ptr) + using ValueType = AZStd::variant< + // NullType + AZStd::monostate, + // NumberType + int64_t, + uint64_t, + double, + // FalseType & TrueType + bool, + // StringType + AZStd::string_view, + AZStd::shared_ptr, + // ObjectType + ObjectPtr, + // ArrayType + ArrayPtr, + // NodeType + Node, + // OpaqueType + AZStd::any*>; + + ValueType m_value; + }; +} // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/azcore_files.cmake b/Code/Framework/AzCore/AzCore/azcore_files.cmake index ef6c7434cc..fa9f94505f 100644 --- a/Code/Framework/AzCore/AzCore/azcore_files.cmake +++ b/Code/Framework/AzCore/AzCore/azcore_files.cmake @@ -127,8 +127,12 @@ set(FILES Debug/TraceReflection.h DOM/DomBackend.cpp DOM/DomBackend.h + DOM/DomDocument.cpp + DOM/DomDocument.h DOM/DomUtils.cpp DOM/DomUtils.h + DOM/DomValue.cpp + DOM/DomValue.h DOM/DomVisitor.cpp DOM/DomVisitor.h DOM/Backends/JSON/JsonBackend.h From fada7ace232457b578730be5870df61fb9c7cfa6 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Wed, 8 Dec 2021 22:22:18 -0800 Subject: [PATCH 013/399] Add visitor support to Value Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp | 2 +- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 306 ++++++++++++++++++ Code/Framework/AzCore/AzCore/DOM/DomValue.h | 49 ++- 3 files changed, 355 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp index 9751b9cecc..2e78661518 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp @@ -21,4 +21,4 @@ namespace AZ::Dom::Utils { return backend.ReadFromBufferInPlace(string.data(), string.size(), visitor); } -} +} // namespace AZ::Dom::Utils diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index ad6e648620..032e5795da 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -744,4 +744,310 @@ namespace AZ::Dom { m_value = AZStd::monostate(); } + + Visitor::Result Value::Accept(Visitor& visitor, bool copyStrings) const + { + Visitor::Result result = AZ::Success(); + + AZStd::visit( + [&](auto&& arg) + { + using Alternative = AZStd::decay_t; + + if constexpr (AZStd::is_same_v) + { + result = visitor.Null(); + } + else if constexpr (AZStd::is_same_v) + { + result = visitor.Int64(arg); + } + else if constexpr (AZStd::is_same_v) + { + result = visitor.Uint64(arg); + } + else if constexpr (AZStd::is_same_v) + { + result = visitor.Double(arg); + } + else if constexpr (AZStd::is_same_v) + { + result = visitor.String(arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); + } + else if constexpr (AZStd::is_same_v>) + { + result = visitor.String(*arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); + } + else if constexpr (AZStd::is_same_v) + { + result = visitor.StartObject(); + if (result.IsSuccess()) + { + const Object::ContainerType& object = GetObjectInternal(); + for (const Object::EntryType& entry : object) + { + result = entry.second.Accept(visitor, copyStrings); + if (!result.IsSuccess()) + { + return; + } + } + result = visitor.EndObject(object.size()); + } + } + else if constexpr (AZStd::is_same_v) + { + result = visitor.StartArray(); + if (result.IsSuccess()) + { + const Array::ContainerType& arrayContainer = GetArrayInternal(); + for (const Value& entry : arrayContainer) + { + result = entry.Accept(visitor, copyStrings); + if (!result.IsSuccess()) + { + return; + } + } + result = visitor.EndArray(arrayContainer.size()); + } + } + else if constexpr (AZStd::is_same_v) + { + const Node& node = AZStd::get(m_value); + result = visitor.StartNode(node.GetName()); + if (result.IsSuccess()) + { + const Object::ContainerType& object = GetObjectInternal(); + for (const Object::EntryType& entry : object) + { + result = entry.second.Accept(visitor, copyStrings); + if (!result.IsSuccess()) + { + return; + } + } + + const Array::ContainerType& arrayContainer = GetArrayInternal(); + for (const Value& entry : arrayContainer) + { + result = entry.Accept(visitor, copyStrings); + if (!result.IsSuccess()) + { + return; + } + } + + result = visitor.EndNode(object.size(), arrayContainer.size()); + } + } + else if constexpr (AZStd::is_same_v) + { + result = visitor.OpaqueValue(*arg); + } + }, + m_value); + return result; + } + + ValueWriter::ValueWriter(Value& outputValue) + : m_result(outputValue) + { + } + + VisitorFlags ValueWriter::GetVisitorFlags() const + { + return VisitorFlags::SupportsRawKeys | VisitorFlags::SupportsArrays | VisitorFlags::SupportsObjects | VisitorFlags::SupportsNodes; + } + + ValueWriter::ValueInfo::ValueInfo(Value& container) + : m_container(container) + { + } + + Visitor::Result ValueWriter::Null() + { + CurrentValue().SetNull(); + return FinishWrite(); + } + + Visitor::Result ValueWriter::Bool(bool value) + { + CurrentValue().SetBool(value); + return FinishWrite(); + } + + Visitor::Result ValueWriter::Int64(AZ::s64 value) + { + CurrentValue().SetInt(value); + return FinishWrite(); + } + + Visitor::Result ValueWriter::Uint64(AZ::u64 value) + { + CurrentValue().SetUint(value); + return FinishWrite(); + } + + Visitor::Result ValueWriter::Double(double value) + { + CurrentValue().SetDouble(value); + return FinishWrite(); + } + + Visitor::Result ValueWriter::String(AZStd::string_view value, Lifetime lifetime) + { + if (lifetime == Lifetime::Persistent) + { + CurrentValue().SetString(value); + } + else + { + CurrentValue().CopyFromString(value); + } + return FinishWrite(); + } + + Visitor::Result ValueWriter::StartObject() + { + CurrentValue().SetObject(); + + m_entryStack.emplace(CurrentValue()); + return VisitorSuccess(); + } + + Visitor::Result ValueWriter::EndContainer(Type containerType, AZ::u64 attributeCount, AZ::u64 elementCount) + { + const char* endMethodName; + switch (containerType) + { + case Type::ObjectType: + endMethodName = "EndObject"; + break; + case Type::ArrayType: + endMethodName = "EndArray"; + break; + case Type::NodeType: + endMethodName = "EndNode"; + break; + default: + AZ_Assert(false, "Invalid container type specified"); + return VisitorFailure(VisitorErrorCode::InternalError, "AZ::Dom::ValueWriter: EndContainer called with invalid container type"); + } + + if (m_entryStack.empty()) + { + return VisitorFailure( + VisitorErrorCode::InternalError, + AZStd::string::format("AZ::Dom::ValueWriter: %s called without a matching call", endMethodName)); + } + + const ValueInfo& topEntry = m_entryStack.top(); + if (topEntry.m_container.GetType() != containerType) + { + return VisitorFailure( + VisitorErrorCode::InternalError, + AZStd::string::format("AZ::Dom::ValueWriter: %s called from within a different container type", endMethodName)); + } + + if (topEntry.m_attributeCount != attributeCount) + { + return VisitorFailure( + VisitorErrorCode::InternalError, + AZStd::string::format( + "AZ::Dom::ValueWriter: %s expected %llu attributes but received %llu attributes instead", endMethodName, attributeCount, + topEntry.m_attributeCount)); + } + + if (topEntry.m_elementCount != elementCount) + { + return VisitorFailure( + VisitorErrorCode::InternalError, + AZStd::string::format( + "AZ::Dom::ValueWriter: %s expected %llu elements but received %llu elements instead", endMethodName, elementCount, + topEntry.m_elementCount)); + } + + m_entryStack.pop(); + return FinishWrite(); + } + + Visitor::Result ValueWriter::EndObject(AZ::u64 attributeCount) + { + return EndContainer(Type::ObjectType, attributeCount, 0); + } + + Visitor::Result ValueWriter::Key(AZ::Name key) + { + AZ_Assert(!m_entryStack.empty(), "Attempmted to push a key with no object"); + AZ_Assert(!m_entryStack.top().m_container.IsArray(), "Attempted to push a key to an array"); + m_entryStack.top().m_key = key; + return VisitorSuccess(); + } + + Visitor::Result ValueWriter::RawKey(AZStd::string_view key, [[maybe_unused]] Lifetime lifetime) + { + return Key(AZ::Name(key)); + } + + Visitor::Result ValueWriter::StartArray() + { + CurrentValue().SetArray(); + + m_entryStack.emplace(CurrentValue()); + return VisitorSuccess(); + } + + Visitor::Result ValueWriter::EndArray(AZ::u64 elementCount) + { + return EndContainer(Type::ArrayType, 0, elementCount); + } + + Visitor::Result ValueWriter::StartNode(AZ::Name name) + { + CurrentValue().SetNode(name); + + m_entryStack.emplace(CurrentValue()); + return VisitorSuccess(); + } + + Visitor::Result ValueWriter::EndNode(AZ::u64 attributeCount, AZ::u64 elementCount) + { + return EndContainer(Type::NodeType, attributeCount, elementCount); + } + + Visitor::Result ValueWriter::FinishWrite() + { + if (m_entryStack.empty()) + { + return VisitorSuccess(); + } + + Value value; + m_entryStack.top().m_value.Swap(value); + ValueInfo& newEntry = m_entryStack.top(); + + if (!newEntry.m_key.IsEmpty()) + { + newEntry.m_container.AddMember(newEntry.m_key, AZStd::move(value)); + newEntry.m_key = AZ::Name(); + ++newEntry.m_attributeCount; + } + else + { + newEntry.m_container.PushBack(AZStd::move(value)); + ++newEntry.m_elementCount; + } + + return VisitorSuccess(); + } + + Value& ValueWriter::CurrentValue() + { + if (m_entryStack.empty()) + { + return m_result; + } + return m_entryStack.top().m_value; + } } // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index f73dbb2549..439971a5a0 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -14,6 +14,7 @@ #include #include #include +#include #include namespace AZ::Dom @@ -249,6 +250,9 @@ namespace AZ::Dom // null API... void SetNull(); + // Visitor API + Visitor::Result Accept(Visitor& visitor, bool copyStrings) const; + private: const Object::ContainerType& GetObjectInternal() const; Object::ContainerType& GetObjectInternal(); @@ -286,4 +290,47 @@ namespace AZ::Dom ValueType m_value; }; -} // namespace AZ::Dom + + class ValueWriter : public Visitor + { + public: + ValueWriter(Value& outputValue); + + VisitorFlags GetVisitorFlags() const override; + Result Null() override; + Result Bool(bool value) override; + Result Int64(AZ::s64 value) override; + Result Uint64(AZ::u64 value) override; + Result Double(double value) override; + + Result String(AZStd::string_view value, Lifetime lifetime) override; + Result StartObject() override; + Result EndObject(AZ::u64 attributeCount) override; + Result Key(AZ::Name key) override; + Result RawKey(AZStd::string_view key, Lifetime lifetime) override; + Result StartArray() override; + Result EndArray(AZ::u64 elementCount) override; + Result StartNode(AZ::Name name) override; + Result RawStartNode(AZStd::string_view name, Lifetime lifetime) override; + Result EndNode(AZ::u64 attributeCount, AZ::u64 elementCount) override; + + private: + Result FinishWrite(); + Value& CurrentValue(); + Visitor::Result EndContainer(Type containerType, AZ::u64 attributeCount, AZ::u64 elementCount); + + struct ValueInfo + { + ValueInfo(Value& container); + + KeyType m_key; + Value m_value; + Value& m_container; + AZ::u64 m_attributeCount = 0; + AZ::u64 m_elementCount = 0; + }; + + Value& m_result; + AZStd::stack m_entryStack; + }; + } // namespace AZ::Dom From 8b4527c64bca858bb72f2e9e1faf126e6d5b4a5e Mon Sep 17 00:00:00 2001 From: Tobias Alexander Franke Date: Thu, 2 Sep 2021 19:10:38 +0800 Subject: [PATCH 014/399] Fix: illegal exe name and version no. when opening Project Settings Tool Signed-off-by: T.J. McGrath-Daly --- AutomatedTesting/project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutomatedTesting/project.json b/AutomatedTesting/project.json index 5ee4ee68f8..5759f860c4 100644 --- a/AutomatedTesting/project.json +++ b/AutomatedTesting/project.json @@ -7,7 +7,7 @@ "android_settings": { "package_name": "com.lumberyard.yourgame", "version_number": 1, - "version_name": "1.0.0.0", + "version_name": "1.0.0", "orientation": "landscape" }, "engine": "o3de" From ce0c62268a106cb278335d1e38ac5979f8e028bc Mon Sep 17 00:00:00 2001 From: Tobias Alexander Franke Date: Fri, 15 Oct 2021 14:26:37 +0800 Subject: [PATCH 015/399] Parameters of the Simple LOD distance component still take effect after Enable anim graph is disabled. Signed-off-by: T.J. McGrath-Daly --- .../Code/Source/Integration/Components/SimpleLODComponent.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Gems/EMotionFX/Code/Source/Integration/Components/SimpleLODComponent.cpp b/Gems/EMotionFX/Code/Source/Integration/Components/SimpleLODComponent.cpp index fdc6426e4c..ec94a9a15d 100644 --- a/Gems/EMotionFX/Code/Source/Integration/Components/SimpleLODComponent.cpp +++ b/Gems/EMotionFX/Code/Source/Integration/Components/SimpleLODComponent.cpp @@ -232,6 +232,10 @@ namespace EMotionFX const float updateRateInSeconds = animGraphSampleRate > 0.0f ? 1.0f / animGraphSampleRate : 0.0f; actorInstance->SetMotionSamplingRate(updateRateInSeconds); } + else if (actorInstance->GetMotionSamplingRate() != 0) + { + actorInstance->SetMotionSamplingRate(0); + } // Disable the automatic mesh LOD level adjustment based on screen space in case a simple LOD component is present. // The simple LOD component overrides the mesh LOD level and syncs the skeleton with the mesh LOD level. From bbbe28208d96b0ad9b02c1d8548b86220be11a46 Mon Sep 17 00:00:00 2001 From: "T.J. McGrath-Daly" Date: Tue, 16 Nov 2021 14:24:03 +0800 Subject: [PATCH 016/399] Limit the max number to 1 when adding white box component or white box collider component. Signed-off-by: T.J. McGrath-Daly --- .../Code/Source/Components/EditorWhiteBoxColliderComponent.cpp | 1 + Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/Gems/WhiteBox/Code/Source/Components/EditorWhiteBoxColliderComponent.cpp b/Gems/WhiteBox/Code/Source/Components/EditorWhiteBoxColliderComponent.cpp index c245f60fed..17d374fab1 100644 --- a/Gems/WhiteBox/Code/Source/Components/EditorWhiteBoxColliderComponent.cpp +++ b/Gems/WhiteBox/Code/Source/Components/EditorWhiteBoxColliderComponent.cpp @@ -73,6 +73,7 @@ namespace WhiteBox void EditorWhiteBoxColliderComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) { incompatible.push_back(AZ_CRC_CE("NonUniformScaleService")); + incompatible.push_back(AZ_CRC_CE("WhiteBoxColliderService")); } void EditorWhiteBoxColliderComponent::Activate() diff --git a/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp b/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp index 5c6fa73bb2..0da92b4a27 100644 --- a/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp +++ b/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp @@ -265,6 +265,7 @@ namespace WhiteBox { incompatible.push_back(AZ_CRC_CE("NonUniformScaleService")); incompatible.push_back(AZ_CRC_CE("MeshService")); + incompatible.push_back(AZ_CRC_CE("WhiteBoxService")); } EditorWhiteBoxComponent::EditorWhiteBoxComponent() = default; From 7276ad0dbfdb06914a8966a9b0a1c4d37075ada1 Mon Sep 17 00:00:00 2001 From: "T.J. McGrath-Daly" Date: Thu, 18 Nov 2021 15:11:26 +0800 Subject: [PATCH 017/399] The Groups and Ungroups shortcut keys in Script Canvas Editor do not take effect Signed-off-by: T.J. McGrath-Daly --- Code/Editor/EditorPanelUtils.cpp | 4 ++-- .../Widgets/AssetEditorToolbar/AssetEditorToolbar.ui | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Code/Editor/EditorPanelUtils.cpp b/Code/Editor/EditorPanelUtils.cpp index a270de5978..1a3c9bcb4a 100644 --- a/Code/Editor/EditorPanelUtils.cpp +++ b/Code/Editor/EditorPanelUtils.cpp @@ -319,8 +319,8 @@ public: keys.push_back(QPair("Edit Menu.Duplicate", "Ctrl+D")); keys.push_back(QPair("Edit Menu.Undo", "Ctrl+Z")); keys.push_back(QPair("Edit Menu.Redo", "Ctrl+Shift+Z")); - keys.push_back(QPair("Edit Menu.Group", "Ctrl+G")); - keys.push_back(QPair("Edit Menu.Ungroup", "Ctrl+Shift+G")); + keys.push_back(QPair("Edit Menu.Group", "Ctrl+Alt+O")); + keys.push_back(QPair("Edit Menu.Ungroup", "Ctrl+Alt+P")); keys.push_back(QPair("Edit Menu.Rename", "Ctrl+R")); keys.push_back(QPair("Edit Menu.Reset", "")); keys.push_back(QPair("Edit Menu.Edit Hotkeys", "")); diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/AssetEditorToolbar/AssetEditorToolbar.ui b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/AssetEditorToolbar/AssetEditorToolbar.ui index 688b3724e4..cf7a8e31d1 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/AssetEditorToolbar/AssetEditorToolbar.ui +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/AssetEditorToolbar/AssetEditorToolbar.ui @@ -56,7 +56,7 @@ - Groups the current selection in the active graph [Ctrl+Shift+G] + Groups the current selection in the active graph [Ctrl+Alt+O] ... @@ -66,14 +66,14 @@ :/GraphCanvasEditorResources/group.svg:/GraphCanvasEditorResources/group.svg - Ctrl+Shift+G + Ctrl+Alt+O - <html><head/><body><p>Ungroups the selected element in the active graph [Ctrl+Shift+H]</p></body></html> + Ungroups the selected element in the active graph [Ctrl+Alt+P] ... @@ -83,7 +83,7 @@ :/GraphCanvasEditorResources/ungroup.svg:/GraphCanvasEditorResources/ungroup.svg - Ctrl+Shift+H + Ctrl+Alt+P From ac03b6f50b3b417f723bb4d0699d254dc3edc78d Mon Sep 17 00:00:00 2001 From: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> Date: Fri, 10 Dec 2021 00:55:23 +0530 Subject: [PATCH 018/399] Improve error messaging when duplicating entities before they are created (#4922) (#6279) * Improved error messaging when user tries to duplicate before entities are created Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> --- .../Application/EditorEntityManager.cpp | 29 +++++++++++++++++-- .../Application/EditorEntityManager.h | 1 - .../Prefab/PrefabPublicHandler.cpp | 3 +- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.cpp index ce50fc7e00..6a926b89fd 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.cpp @@ -9,9 +9,27 @@ #include #include +#include namespace AzToolsFramework { + static bool AreEntitiesValidForDuplication(const EntityIdList& entityIds) + { + for (AZ::EntityId entityId : entityIds) + { + if (GetEntityById(entityId) == nullptr) + { + AZ_Error( + "Entity", false, + "Entity with id '%llu' is not found. This can happen when you try to duplicate the entity before it is created. Please " + "ensure entities are created before trying to duplicate them.", + static_cast(entityId)); + return false; + } + } + return true; + } + void EditorEntityManager::Start() { m_prefabPublicInterface = AZ::Interface::Get(); @@ -62,7 +80,11 @@ namespace AzToolsFramework EntityIdList selectedEntities; ToolsApplicationRequestBus::BroadcastResult(selectedEntities, &ToolsApplicationRequests::GetSelectedEntities); - m_prefabPublicInterface->DuplicateEntitiesInInstance(selectedEntities); + if (AreEntitiesValidForDuplication(selectedEntities)) + { + m_prefabPublicInterface->DuplicateEntitiesInInstance(selectedEntities); + } + } void EditorEntityManager::DuplicateEntityById(AZ::EntityId entityId) @@ -72,7 +94,10 @@ namespace AzToolsFramework void EditorEntityManager::DuplicateEntities(const EntityIdList& entities) { - m_prefabPublicInterface->DuplicateEntitiesInInstance(entities); + if (AreEntitiesValidForDuplication(entities)) + { + m_prefabPublicInterface->DuplicateEntitiesInInstance(entities); + } } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.h index 5786cc3fbc..c4311de672 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.h @@ -34,5 +34,4 @@ namespace AzToolsFramework private: Prefab::PrefabPublicInterface* m_prefabPublicInterface = nullptr; }; - } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp index 26cc16f34b..a44cb320ee 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp @@ -1158,7 +1158,8 @@ namespace AzToolsFramework // Select the duplicated entities/instances auto selectionUndo = aznew SelectionCommand(duplicatedEntityAndInstanceIds, "Select Duplicated Entities/Instances"); selectionUndo->SetParent(undoBatch.GetUndoBatch()); - ToolsApplicationRequestBus::Broadcast(&ToolsApplicationRequestBus::Events::SetSelectedEntities, duplicatedEntityAndInstanceIds); + ToolsApplicationRequestBus::Broadcast( + &ToolsApplicationRequestBus::Events::SetSelectedEntities, duplicatedEntityAndInstanceIds); } return AZ::Success(AZStd::move(duplicatedEntityAndInstanceIds)); From e7c92b5658a0829885a729039356fbad1bf939bb Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Thu, 9 Dec 2021 15:25:20 -0800 Subject: [PATCH 019/399] Move ValueWriter out, add DeepCompareIsEqual Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 405 +++++++++--------- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 81 ++-- .../AzCore/AzCore/DOM/DomValueWriter.cpp | 218 ++++++++++ .../AzCore/AzCore/DOM/DomValueWriter.h | 58 +++ .../AzCore/AzCore/azcore_files.cmake | 2 + 5 files changed, 504 insertions(+), 260 deletions(-) create mode 100644 Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp create mode 100644 Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 032e5795da..68a88ed35a 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -9,7 +9,7 @@ #pragma once #include - +#include #include namespace AZ::Dom @@ -26,6 +26,11 @@ namespace AZ::Dom return refCountedPointer; } + Node::Node(AZ::Name name) + : m_name(name) + { + } + AZ::Name Node::GetName() const { return m_name; @@ -36,31 +41,24 @@ namespace AZ::Dom m_name = name; } - ObjectPtr Node::GetMutableProperties() + Object::ContainerType& Node::GetProperties() { - CheckCopyOnWrite(m_object); - return m_object; + return m_properties; } - ConstObjectPtr Node::GetProperties() const + const Object::ContainerType& Node::GetProperties() const { - return m_object; + return m_properties; } - ArrayPtr Node::GetMutableChildren() + Array::ContainerType& Node::GetChildren() { - CheckCopyOnWrite(m_array); - return m_array; + return m_children; } - ConstArrayPtr Node::GetChildren() const + const Array::ContainerType& Node::GetChildren() const { - return m_array; - } - - bool Node::operator==(const Node& rhs) const - { - return m_name == rhs.m_name && m_array == rhs.m_array && m_object == rhs.m_object; + return m_children; } Value::Value() @@ -187,7 +185,7 @@ namespace AZ::Dom return Type::ObjectType; case 8: // ArrayPtr return Type::ArrayType; - case 9: // Node + case 9: // NodePtr return Type::NodeType; case 10: // AZStd::any* return Type::OpaqueType; @@ -267,18 +265,31 @@ namespace AZ::Dom return *this; } + const Node& Value::GetNodeInternal() const + { + AZ_Assert(GetType() == Type::NodeType, "AZ::Dom::Value: attempted to retrieve a node from a non-node value"); + return *AZStd::get(m_value); + } + + Node& Value::GetNodeInternal() + { + AZ_Assert(GetType() == Type::NodeType, "AZ::Dom::Value: attempted to retrieve a node from a non-node value"); + return *CheckCopyOnWrite(AZStd::get(m_value)); + } + const Object::ContainerType& Value::GetObjectInternal() const { const Type type = GetType(); AZ_Assert( - type == Type::ObjectType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an object from a non-object value"); + type == Type::ObjectType || type == Type::NodeType, + "AZ::Dom::Value: attempted to retrieve an object from a value that isn't an object or a node"); if (type == Type::ObjectType) { return AZStd::get(m_value)->m_values; } else { - return AZStd::get(m_value).GetProperties()->m_values; + return AZStd::get(m_value)->GetProperties(); } } @@ -286,14 +297,15 @@ namespace AZ::Dom { const Type type = GetType(); AZ_Assert( - type == Type::ObjectType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an object from a non-object value"); + type == Type::ObjectType || type == Type::NodeType, + "AZ::Dom::Value: attempted to retrieve an object from a value that isn't an object or a node"); if (type == Type::ObjectType) { return CheckCopyOnWrite(AZStd::get(m_value))->m_values; } else { - return AZStd::get(m_value).GetMutableProperties()->m_values; + return CheckCopyOnWrite(AZStd::get(m_value))->GetProperties(); } } @@ -301,14 +313,15 @@ namespace AZ::Dom { const Type type = GetType(); AZ_Assert( - type == Type::ArrayType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an array from a non-array value"); + type == Type::ArrayType || type == Type::NodeType, + "AZ::Dom::Value: attempted to retrieve an array from a value that isn't an array or a node"); if (type == Type::ObjectType) { return AZStd::get(m_value)->m_values; } else { - return AZStd::get(m_value).GetChildren()->m_values; + return AZStd::get(m_value)->GetChildren(); } } @@ -316,14 +329,15 @@ namespace AZ::Dom { const Type type = GetType(); AZ_Assert( - type == Type::ArrayType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an array from a non-array value"); + type == Type::ArrayType || type == Type::NodeType, + "AZ::Dom::Value: attempted to retrieve an array from a value that isn't an array or node"); if (type == Type::ObjectType) { return CheckCopyOnWrite(AZStd::get(m_value))->m_values; } else { - return AZStd::get(m_value).GetMutableChildren()->m_values; + return CheckCopyOnWrite(AZStd::get(m_value))->GetChildren(); } } @@ -627,6 +641,67 @@ namespace AZ::Dom return GetArrayInternal(); } + void Value::SetNode(AZ::Name name) + { + m_value = AZStd::make_shared(name); + } + + void Value::SetNode(AZStd::string_view name) + { + SetNode(AZ::Name(name)); + } + + AZ::Name Value::GetNodeName() const + { + return GetNodeInternal().GetName(); + } + + void Value::SetNodeName(AZ::Name name) + { + GetNodeInternal().SetName(name); + } + + void Value::SetNodeName(AZStd::string_view name) + { + SetNodeName(AZ::Name(name)); + } + + void Value::SetNodeValue(Value value) + { + AZ_Assert(GetType() == Type::NodeType, "AZ::Dom::Value: Attempted to set value for non-node type"); + Array::ContainerType& nodeChildren = GetArrayInternal(); + + // Set the first non-node child, if one is found + for (Value& entry : nodeChildren) + { + if (entry.GetType() != Type::NodeType) + { + entry = AZStd::move(value); + return; + } + } + + // Otherwise, append the value entry + nodeChildren.push_back(AZStd::move(value)); + } + + Value Value::GetNodeValue() const + { + AZ_Assert(GetType() == Type::NodeType, "AZ::Dom::Value: Attempted to get value for non-node type"); + const Array::ContainerType& nodeChildren = GetArrayInternal(); + + // Get the first non-node child, if one is found + for (const Value& entry : nodeChildren) + { + if (entry.GetType() != Type::NodeType) + { + return entry; + } + } + + return Value(); + } + int64_t Value::GetInt() const { switch (m_value.index()) @@ -812,9 +887,9 @@ namespace AZ::Dom result = visitor.EndArray(arrayContainer.size()); } } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { - const Node& node = AZStd::get(m_value); + const Node& node = *AZStd::get(m_value); result = visitor.StartNode(node.GetName()); if (result.IsSuccess()) { @@ -850,204 +925,124 @@ namespace AZ::Dom return result; } - ValueWriter::ValueWriter(Value& outputValue) - : m_result(outputValue) - { - } - - VisitorFlags ValueWriter::GetVisitorFlags() const - { - return VisitorFlags::SupportsRawKeys | VisitorFlags::SupportsArrays | VisitorFlags::SupportsObjects | VisitorFlags::SupportsNodes; - } - - ValueWriter::ValueInfo::ValueInfo(Value& container) - : m_container(container) - { - } - - Visitor::Result ValueWriter::Null() - { - CurrentValue().SetNull(); - return FinishWrite(); - } - - Visitor::Result ValueWriter::Bool(bool value) - { - CurrentValue().SetBool(value); - return FinishWrite(); - } - - Visitor::Result ValueWriter::Int64(AZ::s64 value) + AZStd::unique_ptr Value::GetWriteHandler() { - CurrentValue().SetInt(value); - return FinishWrite(); + return AZStd::make_unique(*this); } - Visitor::Result ValueWriter::Uint64(AZ::u64 value) + bool Value::DeepCompareIsEqual(const Value& other) const { - CurrentValue().SetUint(value); - return FinishWrite(); - } - - Visitor::Result ValueWriter::Double(double value) - { - CurrentValue().SetDouble(value); - return FinishWrite(); - } - - Visitor::Result ValueWriter::String(AZStd::string_view value, Lifetime lifetime) - { - if (lifetime == Lifetime::Persistent) - { - CurrentValue().SetString(value); - } - else - { - CurrentValue().CopyFromString(value); - } - return FinishWrite(); - } - - Visitor::Result ValueWriter::StartObject() - { - CurrentValue().SetObject(); - - m_entryStack.emplace(CurrentValue()); - return VisitorSuccess(); - } - - Visitor::Result ValueWriter::EndContainer(Type containerType, AZ::u64 attributeCount, AZ::u64 elementCount) - { - const char* endMethodName; - switch (containerType) - { - case Type::ObjectType: - endMethodName = "EndObject"; - break; - case Type::ArrayType: - endMethodName = "EndArray"; - break; - case Type::NodeType: - endMethodName = "EndNode"; - break; - default: - AZ_Assert(false, "Invalid container type specified"); - return VisitorFailure(VisitorErrorCode::InternalError, "AZ::Dom::ValueWriter: EndContainer called with invalid container type"); - } - - if (m_entryStack.empty()) - { - return VisitorFailure( - VisitorErrorCode::InternalError, - AZStd::string::format("AZ::Dom::ValueWriter: %s called without a matching call", endMethodName)); - } - - const ValueInfo& topEntry = m_entryStack.top(); - if (topEntry.m_container.GetType() != containerType) + if (m_value.index() != other.m_value.index()) { - return VisitorFailure( - VisitorErrorCode::InternalError, - AZStd::string::format("AZ::Dom::ValueWriter: %s called from within a different container type", endMethodName)); + return false; } - if (topEntry.m_attributeCount != attributeCount) - { - return VisitorFailure( - VisitorErrorCode::InternalError, - AZStd::string::format( - "AZ::Dom::ValueWriter: %s expected %llu attributes but received %llu attributes instead", endMethodName, attributeCount, - topEntry.m_attributeCount)); - } - - if (topEntry.m_elementCount != elementCount) - { - return VisitorFailure( - VisitorErrorCode::InternalError, - AZStd::string::format( - "AZ::Dom::ValueWriter: %s expected %llu elements but received %llu elements instead", endMethodName, elementCount, - topEntry.m_elementCount)); - } - - m_entryStack.pop(); - return FinishWrite(); - } + return AZStd::visit( + [&](auto&& ourValue) -> bool + { + using Alternative = AZStd::decay_t; + auto&& theirValue = AZStd::get>(other.m_value); - Visitor::Result ValueWriter::EndObject(AZ::u64 attributeCount) - { - return EndContainer(Type::ObjectType, attributeCount, 0); - } + if constexpr (AZStd::is_same_v) + { + return true; + } + else if constexpr (AZStd::is_same_v) + { + if (ourValue == theirValue) + { + return true; + } - Visitor::Result ValueWriter::Key(AZ::Name key) - { - AZ_Assert(!m_entryStack.empty(), "Attempmted to push a key with no object"); - AZ_Assert(!m_entryStack.top().m_container.IsArray(), "Attempted to push a key to an array"); - m_entryStack.top().m_key = key; - return VisitorSuccess(); - } + if (ourValue->m_values.size() != theirValue->m_values.size()) + { + return false; + } - Visitor::Result ValueWriter::RawKey(AZStd::string_view key, [[maybe_unused]] Lifetime lifetime) - { - return Key(AZ::Name(key)); - } + for (size_t i = 0; i < ourValue->m_values.size(); ++i) + { + const Object::EntryType& lhs = ourValue->m_values[i]; + const Object::EntryType& rhs = theirValue->m_values[i]; + if (lhs.first != rhs.first || !lhs.second.DeepCompareIsEqual(rhs.second)) + { + return false; + } + } - Visitor::Result ValueWriter::StartArray() - { - CurrentValue().SetArray(); + return true; + } + else if constexpr (AZStd::is_same_v) + { + if (ourValue == theirValue) + { + return true; + } - m_entryStack.emplace(CurrentValue()); - return VisitorSuccess(); - } + if (ourValue->m_values.size() != theirValue->m_values.size()) + { + return false; + } - Visitor::Result ValueWriter::EndArray(AZ::u64 elementCount) - { - return EndContainer(Type::ArrayType, 0, elementCount); - } + for (size_t i = 0; i < ourValue->m_values.size(); ++i) + { + const Value& lhs = ourValue->m_values[i]; + const Value& rhs = theirValue->m_values[i]; + if (!lhs.DeepCompareIsEqual(rhs)) + { + return false; + } + } - Visitor::Result ValueWriter::StartNode(AZ::Name name) - { - CurrentValue().SetNode(name); + return true; + } + else if constexpr (AZStd::is_same_v) + { + if (ourValue == theirValue) + { + return true; + } - m_entryStack.emplace(CurrentValue()); - return VisitorSuccess(); - } + const Node& ourNode = *ourValue; + const Node& theirNode = *theirValue; - Visitor::Result ValueWriter::EndNode(AZ::u64 attributeCount, AZ::u64 elementCount) - { - return EndContainer(Type::NodeType, attributeCount, elementCount); - } + const Object::ContainerType& ourProperties = ourNode.GetProperties(); + const Object::ContainerType& theirProperties = theirNode.GetProperties(); - Visitor::Result ValueWriter::FinishWrite() - { - if (m_entryStack.empty()) - { - return VisitorSuccess(); - } + if (ourProperties.size() != theirProperties.size()) + { + return false; + } - Value value; - m_entryStack.top().m_value.Swap(value); - ValueInfo& newEntry = m_entryStack.top(); + for (size_t i = 0; i < ourProperties.size(); ++i) + { + const Object::EntryType& lhs = ourProperties[i]; + const Object::EntryType& rhs = theirProperties[i]; + if (lhs.first != rhs.first || !lhs.second.DeepCompareIsEqual(rhs.second)) + { + return false; + } + } - if (!newEntry.m_key.IsEmpty()) - { - newEntry.m_container.AddMember(newEntry.m_key, AZStd::move(value)); - newEntry.m_key = AZ::Name(); - ++newEntry.m_attributeCount; - } - else - { - newEntry.m_container.PushBack(AZStd::move(value)); - ++newEntry.m_elementCount; - } + const Array::ContainerType& ourChildren = ourNode.GetChildren(); + const Array::ContainerType& theirChildren = theirNode.GetChildren(); - return VisitorSuccess(); - } + for (size_t i = 0; i < ourChildren.size(); ++i) + { + const Value& lhs = ourChildren[i]; + const Value& rhs = theirChildren[i]; + if (!lhs.DeepCompareIsEqual(rhs)) + { + return false; + } + } - Value& ValueWriter::CurrentValue() - { - if (m_entryStack.empty()) - { - return m_result; - } - return m_entryStack.top().m_value; + return true; + } + else + { + return ourValue == theirValue; + } + }, + m_value); } } // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 439971a5a0..a460274602 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -8,13 +8,13 @@ #pragma once +#include #include - #include +#include #include #include #include -#include #include namespace AZ::Dom @@ -72,25 +72,34 @@ namespace AZ::Dom class Node { public: + Node() = default; + Node(AZ::Name name); + Node(const Node&) = default; + Node(Node&&) = default; + + Node& operator=(const Node&) = default; + Node& operator=(Node&&) = default; + AZ::Name GetName() const; void SetName(AZ::Name name); - ObjectPtr GetMutableProperties(); - ConstObjectPtr GetProperties() const; - - ArrayPtr GetMutableChildren(); - ConstArrayPtr GetChildren() const; + Object::ContainerType& GetProperties(); + const Object::ContainerType& GetProperties() const; - bool operator==(const Node& rhs) const; + Array::ContainerType& GetChildren(); + const Array::ContainerType& GetChildren() const; private: AZ::Name m_name; - ArrayPtr m_array; - ObjectPtr m_object; + Object::ContainerType m_properties; + Array::ContainerType m_children; friend class Value; }; + using NodePtr = AZStd::shared_ptr; + using ConstNodePtr = AZStd::shared_ptr; + class Value { public: @@ -252,8 +261,13 @@ namespace AZ::Dom // Visitor API Visitor::Result Accept(Visitor& visitor, bool copyStrings) const; + AZStd::unique_ptr GetWriteHandler(); + + bool DeepCompareIsEqual(const Value& other) const; private: + const Node& GetNodeInternal() const; + Node& GetNodeInternal(); const Object::ContainerType& GetObjectInternal() const; Object::ContainerType& GetObjectInternal(); const Array::ContainerType& GetArrayInternal() const; @@ -284,53 +298,10 @@ namespace AZ::Dom // ArrayType ArrayPtr, // NodeType - Node, + NodePtr, // OpaqueType AZStd::any*>; ValueType m_value; }; - - class ValueWriter : public Visitor - { - public: - ValueWriter(Value& outputValue); - - VisitorFlags GetVisitorFlags() const override; - Result Null() override; - Result Bool(bool value) override; - Result Int64(AZ::s64 value) override; - Result Uint64(AZ::u64 value) override; - Result Double(double value) override; - - Result String(AZStd::string_view value, Lifetime lifetime) override; - Result StartObject() override; - Result EndObject(AZ::u64 attributeCount) override; - Result Key(AZ::Name key) override; - Result RawKey(AZStd::string_view key, Lifetime lifetime) override; - Result StartArray() override; - Result EndArray(AZ::u64 elementCount) override; - Result StartNode(AZ::Name name) override; - Result RawStartNode(AZStd::string_view name, Lifetime lifetime) override; - Result EndNode(AZ::u64 attributeCount, AZ::u64 elementCount) override; - - private: - Result FinishWrite(); - Value& CurrentValue(); - Visitor::Result EndContainer(Type containerType, AZ::u64 attributeCount, AZ::u64 elementCount); - - struct ValueInfo - { - ValueInfo(Value& container); - - KeyType m_key; - Value m_value; - Value& m_container; - AZ::u64 m_attributeCount = 0; - AZ::u64 m_elementCount = 0; - }; - - Value& m_result; - AZStd::stack m_entryStack; - }; - } // namespace AZ::Dom +} // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp new file mode 100644 index 0000000000..71710f543b --- /dev/null +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -0,0 +1,218 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +namespace AZ::Dom +{ + ValueWriter::ValueWriter(Value& outputValue) + : m_result(outputValue) + { + } + + VisitorFlags ValueWriter::GetVisitorFlags() const + { + return VisitorFlags::SupportsRawKeys | VisitorFlags::SupportsArrays | VisitorFlags::SupportsObjects | VisitorFlags::SupportsNodes; + } + + ValueWriter::ValueInfo::ValueInfo(Value& container) + : m_container(container) + { + } + + Visitor::Result ValueWriter::Null() + { + CurrentValue().SetNull(); + return FinishWrite(); + } + + Visitor::Result ValueWriter::Bool(bool value) + { + CurrentValue().SetBool(value); + return FinishWrite(); + } + + Visitor::Result ValueWriter::Int64(AZ::s64 value) + { + CurrentValue().SetInt(value); + return FinishWrite(); + } + + Visitor::Result ValueWriter::Uint64(AZ::u64 value) + { + CurrentValue().SetUint(value); + return FinishWrite(); + } + + Visitor::Result ValueWriter::Double(double value) + { + CurrentValue().SetDouble(value); + return FinishWrite(); + } + + Visitor::Result ValueWriter::String(AZStd::string_view value, Lifetime lifetime) + { + if (lifetime == Lifetime::Persistent) + { + CurrentValue().SetString(value); + } + else + { + CurrentValue().CopyFromString(value); + } + return FinishWrite(); + } + + Visitor::Result ValueWriter::StartObject() + { + CurrentValue().SetObject(); + + m_entryStack.emplace(CurrentValue()); + return VisitorSuccess(); + } + + Visitor::Result ValueWriter::EndContainer(Type containerType, AZ::u64 attributeCount, AZ::u64 elementCount) + { + const char* endMethodName; + switch (containerType) + { + case Type::ObjectType: + endMethodName = "EndObject"; + break; + case Type::ArrayType: + endMethodName = "EndArray"; + break; + case Type::NodeType: + endMethodName = "EndNode"; + break; + default: + AZ_Assert(false, "Invalid container type specified"); + return VisitorFailure(VisitorErrorCode::InternalError, "AZ::Dom::ValueWriter: EndContainer called with invalid container type"); + } + + if (m_entryStack.empty()) + { + return VisitorFailure( + VisitorErrorCode::InternalError, + AZStd::string::format("AZ::Dom::ValueWriter: %s called without a matching call", endMethodName)); + } + + const ValueInfo& topEntry = m_entryStack.top(); + if (topEntry.m_container.GetType() != containerType) + { + return VisitorFailure( + VisitorErrorCode::InternalError, + AZStd::string::format("AZ::Dom::ValueWriter: %s called from within a different container type", endMethodName)); + } + + if (topEntry.m_attributeCount != attributeCount) + { + return VisitorFailure( + VisitorErrorCode::InternalError, + AZStd::string::format( + "AZ::Dom::ValueWriter: %s expected %llu attributes but received %llu attributes instead", endMethodName, attributeCount, + topEntry.m_attributeCount)); + } + + if (topEntry.m_elementCount != elementCount) + { + return VisitorFailure( + VisitorErrorCode::InternalError, + AZStd::string::format( + "AZ::Dom::ValueWriter: %s expected %llu elements but received %llu elements instead", endMethodName, elementCount, + topEntry.m_elementCount)); + } + + m_entryStack.pop(); + return FinishWrite(); + } + + Visitor::Result ValueWriter::EndObject(AZ::u64 attributeCount) + { + return EndContainer(Type::ObjectType, attributeCount, 0); + } + + Visitor::Result ValueWriter::Key(AZ::Name key) + { + AZ_Assert(!m_entryStack.empty(), "Attempmted to push a key with no object"); + AZ_Assert(!m_entryStack.top().m_container.IsArray(), "Attempted to push a key to an array"); + m_entryStack.top().m_key = key; + return VisitorSuccess(); + } + + Visitor::Result ValueWriter::RawKey(AZStd::string_view key, [[maybe_unused]] Lifetime lifetime) + { + return Key(AZ::Name(key)); + } + + Visitor::Result ValueWriter::StartArray() + { + CurrentValue().SetArray(); + + m_entryStack.emplace(CurrentValue()); + return VisitorSuccess(); + } + + Visitor::Result ValueWriter::EndArray(AZ::u64 elementCount) + { + return EndContainer(Type::ArrayType, 0, elementCount); + } + + Visitor::Result ValueWriter::StartNode(AZ::Name name) + { + CurrentValue().SetNode(name); + + m_entryStack.emplace(CurrentValue()); + return VisitorSuccess(); + } + + Visitor::Result ValueWriter::RawStartNode(AZStd::string_view name, [[maybe_unused]] Lifetime lifetime) + { + return StartNode(AZ::Name(name)); + } + + Visitor::Result ValueWriter::EndNode(AZ::u64 attributeCount, AZ::u64 elementCount) + { + return EndContainer(Type::NodeType, attributeCount, elementCount); + } + + Visitor::Result ValueWriter::FinishWrite() + { + if (m_entryStack.empty()) + { + return VisitorSuccess(); + } + + Value value; + m_entryStack.top().m_value.Swap(value); + ValueInfo& newEntry = m_entryStack.top(); + + if (!newEntry.m_key.IsEmpty()) + { + newEntry.m_container.AddMember(newEntry.m_key, AZStd::move(value)); + newEntry.m_key = AZ::Name(); + ++newEntry.m_attributeCount; + } + else + { + newEntry.m_container.PushBack(AZStd::move(value)); + ++newEntry.m_elementCount; + } + + return VisitorSuccess(); + } + + Value& ValueWriter::CurrentValue() + { + if (m_entryStack.empty()) + { + return m_result; + } + return m_entryStack.top().m_value; + } +} // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h new file mode 100644 index 0000000000..fb5f4324a6 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include + +namespace AZ::Dom +{ + class ValueWriter : public Visitor + { + public: + ValueWriter(Value& outputValue); + + VisitorFlags GetVisitorFlags() const override; + Result Null() override; + Result Bool(bool value) override; + Result Int64(AZ::s64 value) override; + Result Uint64(AZ::u64 value) override; + Result Double(double value) override; + + Result String(AZStd::string_view value, Lifetime lifetime) override; + Result StartObject() override; + Result EndObject(AZ::u64 attributeCount) override; + Result Key(AZ::Name key) override; + Result RawKey(AZStd::string_view key, Lifetime lifetime) override; + Result StartArray() override; + Result EndArray(AZ::u64 elementCount) override; + Result StartNode(AZ::Name name) override; + Result RawStartNode(AZStd::string_view name, Lifetime lifetime) override; + Result EndNode(AZ::u64 attributeCount, AZ::u64 elementCount) override; + + private: + Result FinishWrite(); + Value& CurrentValue(); + Visitor::Result EndContainer(Type containerType, AZ::u64 attributeCount, AZ::u64 elementCount); + + struct ValueInfo + { + ValueInfo(Value& container); + + KeyType m_key; + Value m_value; + Value& m_container; + AZ::u64 m_attributeCount = 0; + AZ::u64 m_elementCount = 0; + }; + + Value& m_result; + AZStd::stack m_entryStack; + }; +} // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/azcore_files.cmake b/Code/Framework/AzCore/AzCore/azcore_files.cmake index fa9f94505f..e17fb941b8 100644 --- a/Code/Framework/AzCore/AzCore/azcore_files.cmake +++ b/Code/Framework/AzCore/AzCore/azcore_files.cmake @@ -133,6 +133,8 @@ set(FILES DOM/DomUtils.h DOM/DomValue.cpp DOM/DomValue.h + DOM/DomValueWriter.cpp + DOM/DomValueWriter.h DOM/DomVisitor.cpp DOM/DomVisitor.h DOM/Backends/JSON/JsonBackend.h From a2d474cc4f30c17b7354221a1c0e55dfb20c6de4 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Thu, 9 Dec 2021 17:47:01 -0800 Subject: [PATCH 020/399] Add some intial tests Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 123 +++++++++- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 28 ++- .../AzCore/AzCore/DOM/DomValueWriter.cpp | 4 +- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 0 .../AzCore/Tests/DOM/DomValueTests.cpp | 211 ++++++++++++++++++ .../AzCore/Tests/azcoretests_files.cmake | 2 + 6 files changed, 350 insertions(+), 18 deletions(-) create mode 100644 Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp create mode 100644 Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 68a88ed35a..2f41835a37 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -97,6 +97,16 @@ namespace AZ::Dom return Value(&value); } + Value::Value(int32_t value) + : m_value(aznumeric_cast(value)) + { + } + + Value::Value(uint32_t value) + : m_value(aznumeric_cast(value)) + { + } + Value::Value(int64_t value) : m_value(value) { @@ -107,6 +117,11 @@ namespace AZ::Dom { } + Value::Value(float value) + : m_value(aznumeric_cast(value)) + { + } + Value::Value(double value) : m_value(value) { @@ -117,6 +132,40 @@ namespace AZ::Dom { } + Value::Value(Type type) + { + switch (type) + { + case Type::NullType: + // Null is the default initialized value + break; + case Type::FalseType: + m_value = false; + break; + case Type::TrueType: + m_value = true; + break; + case Type::ObjectType: + SetObject(); + break; + case Type::ArrayType: + SetArray(); + break; + case Type::StringType: + SetString(""); + break; + case Type::NumberType: + m_value = 0.0; + break; + case Type::NodeType: + SetNode(""); + break; + case Type::OpaqueType: + AZ_Assert(false, "AZ::Dom::Value may not be constructed with an empty opaque type"); + break; + } + } + Value& Value::operator=(const Value& other) { m_value = other.m_value; @@ -139,11 +188,11 @@ namespace AZ::Dom { if (IsInt()) { - return GetInt() == rhs.GetInt(); + return GetInt64() == rhs.GetInt64(); } else if (IsUint()) { - return GetUint() == rhs.GetUint(); + return GetUint64() == rhs.GetUint64(); } else { @@ -315,7 +364,7 @@ namespace AZ::Dom AZ_Assert( type == Type::ArrayType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an array from a value that isn't an array or a node"); - if (type == Type::ObjectType) + if (type == Type::ArrayType) { return AZStd::get(m_value)->m_values; } @@ -331,7 +380,7 @@ namespace AZ::Dom AZ_Assert( type == Type::ArrayType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an array from a value that isn't an array or node"); - if (type == Type::ObjectType) + if (type == Type::ArrayType) { return CheckCopyOnWrite(AZStd::get(m_value))->m_values; } @@ -702,7 +751,7 @@ namespace AZ::Dom return Value(); } - int64_t Value::GetInt() const + int64_t Value::GetInt64() const { switch (m_value.index()) { @@ -717,12 +766,22 @@ namespace AZ::Dom return {}; } - void Value::SetInt(int64_t value) + void Value::SetInt64(int64_t value) { m_value = value; } - uint64_t Value::GetUint() const + int32_t Value::GetInt32() const + { + return aznumeric_cast(GetInt64()); + } + + void Value::SetInt32(int32_t value) + { + m_value = aznumeric_cast(value); + } + + uint64_t Value::GetUint64() const { switch (m_value.index()) { @@ -737,11 +796,21 @@ namespace AZ::Dom return {}; } - void Value::SetUint(uint64_t value) + void Value::SetUint64(uint64_t value) { m_value = value; } + uint32_t Value::GetUint32() const + { + return aznumeric_cast(GetUint64()); + } + + void Value::SetUint32(uint32_t value) + { + m_value = aznumeric_cast(value); + } + bool Value::GetBool() const { if (IsBool()) @@ -777,6 +846,16 @@ namespace AZ::Dom m_value = value; } + float Value::GetFloat() const + { + return aznumeric_cast(GetDouble()); + } + + void Value::SetFloat(float value) + { + m_value = aznumeric_cast(value); + } + AZStd::string_view Value::GetString() const { switch (m_value.index()) @@ -861,6 +940,11 @@ namespace AZ::Dom const Object::ContainerType& object = GetObjectInternal(); for (const Object::EntryType& entry : object) { + result = visitor.Key(entry.first); + if (!result.IsSuccess()) + { + return; + } result = entry.second.Accept(visitor, copyStrings); if (!result.IsSuccess()) { @@ -896,6 +980,11 @@ namespace AZ::Dom const Object::ContainerType& object = GetObjectInternal(); for (const Object::EntryType& entry : object) { + result = visitor.Key(entry.first); + if (!result.IsSuccess()) + { + return; + } result = entry.second.Accept(visitor, copyStrings); if (!result.IsSuccess()) { @@ -932,6 +1021,16 @@ namespace AZ::Dom bool Value::DeepCompareIsEqual(const Value& other) const { + if (IsString() && other.IsString()) + { + // If we both hold the same ref counted string we don't need to do a full comparison + if (AZStd::holds_alternative>(m_value) && m_value == other.m_value) + { + return true; + } + return GetString() == other.GetString(); + } + if (m_value.index() != other.m_value.index()) { return false; @@ -1045,4 +1144,12 @@ namespace AZ::Dom }, m_value); } + + Value Value::DeepCopy(bool copyStrings) const + { + Value newValue; + AZStd::unique_ptr writer = newValue.GetWriteHandler(); + Accept(*writer, copyStrings); + return newValue; + } } // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index a460274602..61c3207ea4 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -109,10 +109,15 @@ namespace AZ::Dom Value(Value&&) noexcept; Value(AZStd::string_view string, bool copy); - explicit Value(int64_t value); - explicit Value(uint64_t value); - explicit Value(double value); - explicit Value(bool value); + Value(int32_t value); + Value(uint32_t value); + Value(int64_t value); + Value(uint64_t value); + Value(float value); + Value(double value); + Value(bool value); + + explicit Value(Type type); static Value FromOpaqueValue(AZStd::any& value); @@ -226,12 +231,16 @@ namespace AZ::Dom Value GetNodeValue() const; // int API... - int64_t GetInt() const; - void SetInt(int64_t); + int64_t GetInt64() const; + void SetInt64(int64_t); + int32_t GetInt32() const; + void SetInt32(int32_t); // uint API... - uint64_t GetUint() const; - void SetUint(uint64_t); + uint64_t GetUint64() const; + void SetUint64(uint64_t); + uint32_t GetUint32() const; + void SetUint32(uint32_t); // bool API... bool GetBool() const; @@ -240,6 +249,8 @@ namespace AZ::Dom // double API... double GetDouble() const; void SetDouble(double); + float GetFloat() const; + void SetFloat(float); // string API... AZStd::string_view GetString() const; @@ -264,6 +275,7 @@ namespace AZ::Dom AZStd::unique_ptr GetWriteHandler(); bool DeepCompareIsEqual(const Value& other) const; + Value DeepCopy(bool copyStrings = true) const; private: const Node& GetNodeInternal() const; diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index 71710f543b..a760cc5b28 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -39,13 +39,13 @@ namespace AZ::Dom Visitor::Result ValueWriter::Int64(AZ::s64 value) { - CurrentValue().SetInt(value); + CurrentValue().SetInt64(value); return FinishWrite(); } Visitor::Result ValueWriter::Uint64(AZ::u64 value) { - CurrentValue().SetUint(value); + CurrentValue().SetUint64(value); return FinishWrite(); } diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp new file mode 100644 index 0000000000..02777bf6dd --- /dev/null +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -0,0 +1,211 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace AZ::Dom::Tests +{ + class DomValueTests : public UnitTest::AllocatorsFixture + { + public: + void SetUp() override + { + UnitTest::AllocatorsFixture::SetUp(); + NameDictionary::Create(); + } + + void TearDown() override + { + m_value = Value(); + + NameDictionary::Destroy(); + UnitTest::AllocatorsFixture::TearDown(); + } + + void PerformValueChecks() + { + Value shallowCopy = m_value; + EXPECT_EQ(m_value, shallowCopy); + EXPECT_TRUE(m_value.DeepCompareIsEqual(shallowCopy)); + + Value deepCopy = m_value.DeepCopy(); + EXPECT_TRUE(m_value.DeepCompareIsEqual(deepCopy)); + } + + Value m_value; + }; + + TEST_F(DomValueTests, EmptyArray) + { + m_value.SetArray(); + + EXPECT_TRUE(m_value.IsArray()); + EXPECT_EQ(m_value.Size(), 0); + + PerformValueChecks(); + } + + TEST_F(DomValueTests, SimpleArray) + { + m_value.SetArray(); + + for (int i = 0; i < 5; ++i) + { + m_value.PushBack(Value(i)); + EXPECT_EQ(m_value.Size(), i + 1); + EXPECT_EQ(m_value[i].GetInt32(), i); + } + + PerformValueChecks(); + } + + TEST_F(DomValueTests, NestedArrays) + { + m_value.SetArray(); + for (int j = 0; j < 5; ++j) + { + Value nestedArray(Type::ArrayType); + for (int i = 0; i < 5; ++i) + { + nestedArray.PushBack(Value(i)); + } + m_value.PushBack(AZStd::move(nestedArray)); + } + + EXPECT_EQ(m_value.Size(), 5); + for (int i = 0; i < 3; ++i) + { + EXPECT_EQ(m_value[i].Size(), 5); + for (int j = 0; j < 5; ++j) + { + EXPECT_EQ(m_value[i][j].GetInt32(), j); + } + } + + PerformValueChecks(); + } + + TEST_F(DomValueTests, EmptyObject) + { + m_value.SetObject(); + EXPECT_EQ(m_value.MemberCount(), 0); + + PerformValueChecks(); + } + + TEST_F(DomValueTests, SimpleObject) + { + m_value.SetObject(); + for (int i = 0; i < 5; ++i) + { + AZStd::string key = AZStd::string::format("Key%i", i); + m_value.AddMember(key, Value(i)); + EXPECT_EQ(m_value.MemberCount(), i + 1); + EXPECT_EQ(m_value[key].GetInt32(), i); + } + + PerformValueChecks(); + } + + TEST_F(DomValueTests, NestedObjects) + { + m_value.SetObject(); + for (int j = 0; j < 3; ++j) + { + Value nestedObject(Type::ObjectType); + for (int i = 0; i < 5; ++i) + { + nestedObject.AddMember(AZStd::string::format("Key%i", i), Value(i)); + } + m_value.AddMember(AZStd::string::format("Obj%i", j), AZStd::move(nestedObject)); + } + + EXPECT_EQ(m_value.MemberCount(), 3); + for (int j = 0; j < 3; ++j) + { + const Value& nestedObject = m_value[AZStd::string::format("Obj%i", j)]; + EXPECT_EQ(nestedObject.MemberCount(), 5); + for (int i = 0; i < 5; ++i) + { + EXPECT_EQ(nestedObject[AZStd::string::format("Key%i", i)].GetInt32(), i); + } + } + + PerformValueChecks(); + } + + TEST_F(DomValueTests, EmptyNode) + { + m_value.SetNode("Test"); + EXPECT_EQ(m_value.GetNodeName(), AZ::Name("Test")); + EXPECT_EQ(m_value.MemberCount(), 0); + EXPECT_EQ(m_value.Size(), 0); + + PerformValueChecks(); + } + + TEST_F(DomValueTests, SimpleNode) + { + m_value.SetNode("Test"); + + for (int i = 0; i < 10; ++i) + { + m_value.PushBack(Value(i)); + EXPECT_EQ(m_value.Size(), i + 1); + EXPECT_EQ(m_value[i].GetInt32(), i); + + if (i < 5) + { + AZ::Name key = AZ::Name(AZStd::string::format("TwoTimes%i", i)); + m_value.AddMember(key, Value(i * 2)); + EXPECT_EQ(m_value.MemberCount(), i + 1); + EXPECT_EQ(m_value[key].GetInt32(), i * 2); + } + } + + PerformValueChecks(); + } + + TEST_F(DomValueTests, NestedNodes) + { + m_value.SetNode("TopLevel"); + + const AZ::Name childNodeName("ChildNode"); + + for (int i = 0; i < 5; ++i) + { + Value childNode(Type::NodeType); + childNode.SetNodeName(childNodeName); + childNode.SetNodeValue(i); + + childNode.AddMember("foo", i); + childNode.AddMember("bar", Value("test", false)); + + m_value.PushBack(childNode); + } + + EXPECT_EQ(m_value.Size(), 5); + for (int i = 0; i < 5; ++i) + { + const Value& childNode = m_value[i]; + EXPECT_EQ(childNode.GetNodeName(), childNodeName); + EXPECT_EQ(childNode.GetNodeValue().GetInt32(), i); + EXPECT_EQ(childNode["foo"].GetInt32(), i); + EXPECT_EQ(childNode["bar"].GetString(), "test"); + } + + PerformValueChecks(); + } +} // namespace AZ::Dom::Tests diff --git a/Code/Framework/AzCore/Tests/azcoretests_files.cmake b/Code/Framework/AzCore/Tests/azcoretests_files.cmake index 0fca75e2a8..14a8bbbac0 100644 --- a/Code/Framework/AzCore/Tests/azcoretests_files.cmake +++ b/Code/Framework/AzCore/Tests/azcoretests_files.cmake @@ -215,6 +215,8 @@ set(FILES AZStd/VectorAndArray.cpp DOM/DomJsonTests.cpp DOM/DomJsonBenchmarks.cpp + DOM/DomValueTests.cpp + DOM/DomValueBenchmarks.cpp ) # Prevent the following files from being grouped in UNITY builds From 0a7e9388ad71f79b192fc8dd781856004e05e238 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Thu, 9 Dec 2021 19:23:48 -0800 Subject: [PATCH 021/399] Cleanup: Adding wait_for_critical_expected_line as a public method to utils.py and updated the RPC test to use it. Signed-off-by: Gene Walters --- .../editor_python_test_tools/utils.py | 54 +++++++++++-------- .../tests/Multiplayer_AutoComponent_RPC.py | 30 +++-------- 2 files changed, 39 insertions(+), 45 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py index 7b526033dd..92ac279627 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py @@ -101,30 +101,38 @@ class TestHelper: Report.critical_result(msgtuple_success_fail, general.is_in_game_mode()) @staticmethod - def multiplayer_enter_game_mode(msgtuple_success_fail: Tuple[str, str], sv_default_player_spawn_asset: str) -> None: + def find_expected_line(window, expected_message, print_infos): """ - :param msgtuple_success_fail: The tuple with the expected/unexpected messages for entering game mode. - :param sv_default_player_spawn_asset: The path to the network player prefab that will be automatically spawned upon entering gamemode. The engine default is "prefabs/player.network.spawnable" + Looks for an expected line in a list of tracer log lines + :param window: The log's window name. For example, logs printed via script-canvas use the "Script" window. + :param expected_message: The log message to search. + :param print_infos: A list of PrintInfos collected by Tracer to search. Example options: your_tracer.warnings, your_tracer.errors, your_tracer.asserts, or your_tracer.prints - :return: None + :return: True if the message is found, otherwise false. """ + for printInfo in print_infos: + if printInfo.window == window.strip() and printInfo.message.strip() == expected_message: + return True + return False - # looks for an expected line in a list of tracers lines - # lines: the tracer list of lines to search. options are section_tracer.warnings, section_tracer.errors, section_tracer.asserts, section_tracer.prints - # return: true if the line is found, otherwise false - def find_expected_line(expected_line, lines): - found_lines = [printInfo.message.strip() for printInfo in lines] - return expected_line in found_lines - - def wait_for_critical_expected_line(expected_line, lines, time_out): - TestHelper.wait_for_condition(lambda : find_expected_line(expected_line, lines), time_out) - Report.critical_result(("Found expected line: " + expected_line, "Failed to find expected line: " + expected_line), find_expected_line(expected_line, lines)) + @staticmethod + def wait_for_critical_expected_line(window, expected_message, print_infos, time_out): + TestHelper.wait_for_condition(lambda : TestHelper.find_expected_line(window, expected_message, print_infos), time_out) + Report.critical_result(("Found expected line: " + expected_message, "Failed to find expected line: " + expected_message), TestHelper.find_expected_line(window, expected_message, print_infos)) - def wait_for_critical_unexpected_line(unexpected_line, lines, time_out): - TestHelper.wait_for_condition(lambda : find_expected_line(unexpected_line, lines), time_out) - Report.critical_result(("Unexpected line not found: " + unexpected_line, "Unexpected line found: " + unexpected_line), not find_expected_line(unexpected_line, lines)) + @staticmethod + def wait_for_critical_unexpected_line(window, unexpected_line, print_infos, time_out): + TestHelper.wait_for_condition(lambda : TestHelper.find_expected_line(window, unexpected_line, print_infos), time_out) + Report.critical_result(("Unexpected line not found: " + unexpected_line, "Unexpected line found: " + unexpected_line), not TestHelper.find_expected_line(window, unexpected_line, print_infos)) + @staticmethod + def multiplayer_enter_game_mode(msgtuple_success_fail: Tuple[str, str], sv_default_player_spawn_asset: str) -> None: + """ + :param msgtuple_success_fail: The tuple with the expected/unexpected messages for entering game mode. + :param sv_default_player_spawn_asset: The path to the network player prefab that will be automatically spawned upon entering gamemode. The engine default is "prefabs/player.network.spawnable" + :return: None + """ Report.info("Entering game mode") if sv_default_player_spawn_asset : general.set_cvar("sv_defaultPlayerSpawnAsset", sv_default_player_spawn_asset) @@ -135,20 +143,20 @@ class TestHelper: multiplayer.PythonEditorFuncs_enter_game_mode() # make sure the server launcher binary exists - wait_for_critical_unexpected_line("LaunchEditorServer failed! The ServerLauncher binary is missing!", section_tracer.errors, 0.5) + TestHelper.wait_for_critical_unexpected_line("MultiplayerEditor", "LaunchEditorServer failed! The ServerLauncher binary is missing!", section_tracer.errors, 0.5) # make sure the server launcher is running waiter.wait_for(lambda: process_utils.process_exists("AutomatedTesting.ServerLauncher", ignore_extensions=True), timeout=5.0, exc=AssertionError("AutomatedTesting.ServerLauncher has NOT launched!"), interval=1.0) - wait_for_critical_expected_line("MultiplayerEditorConnection: Editor-server activation has found and connected to the editor.", section_tracer.prints, 15.0) + TestHelper.wait_for_critical_expected_line("EditorServer", "MultiplayerEditorConnection: Editor-server activation has found and connected to the editor.", section_tracer.prints, 15.0) - wait_for_critical_expected_line("Editor is sending the editor-server the level data packet.", section_tracer.prints, 5.0) + TestHelper.wait_for_critical_expected_line("MultiplayerEditor", "Editor is sending the editor-server the level data packet.", section_tracer.prints, 5.0) - wait_for_critical_expected_line("Logger: Editor Server completed receiving the editor's level assets, responding to Editor...", section_tracer.prints, 5.0) + TestHelper.wait_for_critical_expected_line("EditorServer", "Logger: Editor Server completed receiving the editor's level assets, responding to Editor...", section_tracer.prints, 5.0) - wait_for_critical_expected_line("Editor-server ready. Editor has successfully connected to the editor-server's network simulation.", section_tracer.prints, 5.0) + TestHelper.wait_for_critical_expected_line("MultiplayerEditorConnection", "Editor-server ready. Editor has successfully connected to the editor-server's network simulation.", section_tracer.prints, 5.0) - wait_for_critical_unexpected_line(f"MultiplayerSystemComponent: SpawnDefaultPlayerPrefab failed. Missing sv_defaultPlayerSpawnAsset at path '{sv_default_player_spawn_asset.lower()}'.", section_tracer.prints, 0.5) + TestHelper.wait_for_critical_unexpected_line("EditorServer", f"MultiplayerSystemComponent: SpawnDefaultPlayerPrefab failed. Missing sv_defaultPlayerSpawnAsset at path '{sv_default_player_spawn_asset.lower()}'.", section_tracer.prints, 0.5) TestHelper.wait_for_condition(lambda : multiplayer.PythonEditorFuncs_is_in_game_mode(), 5.0) Report.critical_result(msgtuple_success_fail, multiplayer.PythonEditorFuncs_is_in_game_mode()) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py index 3f971e4abf..387de66acd 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py @@ -14,27 +14,25 @@ class Tests(): enter_game_mode = ("Entered game mode", "Failed to enter game mode") exit_game_mode = ("Exited game mode", "Couldn't exit game mode") find_network_player = ("Found network player", "Couldn't find network player") - found_lines = ("Expected log lines were found", "Expected log lines were not found") - found_unexpected_lines = ("Unexpected log lines were not found", "Unexpected log lines were found") # fmt: on def Multiplayer_AutoComponent_RPC(): r""" Summary: - Runs a test to make sure that network input can be sent from the autonomous player, received by the authority, and processed + Runs a test to make sure that RPCs can be sent and received via script canvas Level Description: - Dynamic - 1. Although the level is empty, when the server and editor connect the server will spawn and replicate the player network prefab. - a. The player network prefab has a NetworkTestPlayerComponent.AutoComponent and a script canvas attached which will listen for the CreateInput and ProcessInput events. - Print logs occur upon triggering the CreateInput and ProcessInput events along with their values; we are testing to make sure the expected events are values are recieved. + 1. Although the level is nearly empty, when the server and editor connect the server will spawn and replicate the player network prefab. + a. The player network prefab has a NetworkTestPlayerComponent.AutoComponent and a script canvas attached which sends and receives various RPCs. + Print logs occur upon sending and receiving the RPCs; we are testing to make sure the expected events and values are received. - Static - 1. This is an empty level. All the logic occurs on the Player.network.spawnable (see the above Dynamic description) + 1. NetLevelEntity. This is a networked entity which has a script attached. Used for cross-entity communication. The net-player prefab will send this level entity Server->Authority RPCs Expected Outcome: - We should see editor logs stating that network input has been created and processed. + We should see editor logs stating that RPCs have been sent and received. However, if the script receives unexpected values for the Process event we will see print logs for bad data as well. :return: @@ -46,18 +44,6 @@ def Multiplayer_AutoComponent_RPC(): from editor_python_test_tools.utils import TestHelper as helper from ly_remote_console.remote_console_commands import RemoteConsole as RemoteConsole - - # looks for an expected line in a list of tracers lines - # lines: the tracer list of lines to search. options are section_tracer.warnings, section_tracer.errors, section_tracer.asserts, section_tracer.prints - # return: true if the line is found, otherwise false - def find_expected_line(expected_line, lines): - found_lines = [printInfo.message.strip() for printInfo in lines] - return expected_line in found_lines - - def wait_for_critical_expected_line(expected_line, lines, time_out): - helper.wait_for_condition(lambda : find_expected_line(expected_line, lines), time_out) - Report.critical_result(("Found expected line: " + expected_line, "Failed to find expected line: " + expected_line), find_expected_line(expected_line, lines)) - level_name = "AutoComponent_RPC" player_prefab_name = "Player" player_prefab_path = f"levels/multiplayer/{level_name}/{player_prefab_name}.network.spawnable" @@ -77,8 +63,8 @@ def Multiplayer_AutoComponent_RPC(): # 4) Check the editor logs for expected and unexpected log output EXPECTEDLINE_WAIT_TIME_SECONDS = 1.0 - wait_for_critical_expected_line('Script: AutoComponent_RPC: Sending client PlayerNumber 1', section_tracer.prints, EXPECTEDLINE_WAIT_TIME_SECONDS) - wait_for_critical_expected_line("AutoComponent_RPC: I'm Player #1", section_tracer.prints, EXPECTEDLINE_WAIT_TIME_SECONDS) + helper.wait_for_critical_expected_line('EditorServer', 'Script: AutoComponent_RPC: Sending client PlayerNumber 1', section_tracer.prints, EXPECTEDLINE_WAIT_TIME_SECONDS) + helper.wait_for_critical_expected_line('Script', "AutoComponent_RPC: I'm Player #1", section_tracer.prints, EXPECTEDLINE_WAIT_TIME_SECONDS) # Exit game mode From 15e0bb16939b38b578cd075e297794a72fee4eac Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Thu, 9 Dec 2021 21:37:22 -0800 Subject: [PATCH 022/399] Add tests, fix missing bool in Accept and operator[] insert Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 21 ++++- .../AzCore/Tests/DOM/DomValueTests.cpp | 87 +++++++++++++++++++ 2 files changed, 107 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 2f41835a37..675a6931f5 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -407,7 +407,22 @@ namespace AZ::Dom Value& Value::operator[](KeyType name) { - return FindMember(name)->second; + Object::ContainerType& object = GetObjectInternal(); + auto existingEntry = AZStd::find_if( + object.begin(), object.end(), + [&name](const Object::EntryType& entry) + { + return entry.first == name; + }); + if (existingEntry != object.end()) + { + return existingEntry->second; + } + else + { + object.emplace_back(name, Value()); + return object[object.size() - 1].second; + } } const Value& Value::operator[](KeyType name) const @@ -924,6 +939,10 @@ namespace AZ::Dom { result = visitor.Double(arg); } + else if constexpr (AZStd::is_same_v) + { + result = visitor.Bool(arg); + } else if constexpr (AZStd::is_same_v) { result = visitor.String(arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp index 02777bf6dd..75cb71248f 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace AZ::Dom::Tests { @@ -208,4 +209,90 @@ namespace AZ::Dom::Tests PerformValueChecks(); } + + TEST_F(DomValueTests, Int64) + { + m_value.SetObject(); + m_value["int64_min"] = AZStd::numeric_limits::min(); + m_value["int64_max"] = AZStd::numeric_limits::max(); + + EXPECT_EQ(m_value["int64_min"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["int64_min"].GetInt64(), AZStd::numeric_limits::min()); + EXPECT_EQ(m_value["int64_max"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["int64_max"].GetInt64(), AZStd::numeric_limits::max()); + + PerformValueChecks(); + } + + TEST_F(DomValueTests, Uint64) + { + m_value.SetObject(); + m_value["uint64_min"] = AZStd::numeric_limits::min(); + m_value["uint64_max"] = AZStd::numeric_limits::max(); + + EXPECT_EQ(m_value["uint64_min"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["uint64_min"].GetInt64(), AZStd::numeric_limits::min()); + EXPECT_EQ(m_value["uint64_max"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["uint64_max"].GetInt64(), AZStd::numeric_limits::max()); + + PerformValueChecks(); + } + + TEST_F(DomValueTests, Double) + { + m_value.SetObject(); + m_value["double_min"] = AZStd::numeric_limits::min(); + m_value["double_max"] = AZStd::numeric_limits::max(); + + EXPECT_EQ(m_value["double_min"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["double_min"].GetDouble(), AZStd::numeric_limits::min()); + EXPECT_EQ(m_value["double_max"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["double_max"].GetDouble(), AZStd::numeric_limits::max()); + + PerformValueChecks(); + } + + TEST_F(DomValueTests, Null) + { + m_value.SetObject(); + m_value["null_value"] = Value(Type::NullType); + + EXPECT_EQ(m_value["null_value"].GetType(), Type::NullType); + EXPECT_EQ(m_value["null_type"], Value()); + + PerformValueChecks(); + } + + TEST_F(DomValueTests, Bool) + { + m_value.SetObject(); + m_value["true_value"] = true; + m_value["false_value"] = false; + + EXPECT_EQ(m_value["true_value"].GetType(), Type::TrueType); + EXPECT_EQ(m_value["true_value"].GetBool(), true); + EXPECT_EQ(m_value["false_value"].GetType(), Type::FalseType); + EXPECT_EQ(m_value["false_value"].GetBool(), false); + + PerformValueChecks(); + } + + TEST_F(DomValueTests, String) + { + m_value.SetObject(); + AZStd::string stringToReference = "foo"; + m_value["no_copy"] = Value(stringToReference, false); + AZStd::string stringToCopy = "bar"; + m_value["copy"] = Value(stringToCopy, true); + + EXPECT_EQ(m_value["no_copy"].GetType(), Type::StringType); + EXPECT_EQ(m_value["no_copy"].GetString(), stringToReference); + EXPECT_EQ(m_value["no_copy"].GetString().data(), stringToReference.data()); + + EXPECT_EQ(m_value["copy"].GetType(), Type::StringType); + EXPECT_EQ(m_value["copy"].GetString(), stringToCopy); + EXPECT_NE(m_value["copy"].GetString().data(), stringToCopy.data()); + + PerformValueChecks(); + } } // namespace AZ::Dom::Tests From 947951b6c7473ccd45647e5e5c3938b5122718e7 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Thu, 9 Dec 2021 23:43:22 -0800 Subject: [PATCH 023/399] Add copy on write tests Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 34 ++++++-- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 14 ++- .../AzCore/Tests/DOM/DomValueTests.cpp | 86 +++++++++++++++++++ 3 files changed, 123 insertions(+), 11 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 675a6931f5..d9398da116 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -476,7 +476,7 @@ namespace AZ::Dom return FindMember(AZ::Name(name)); } - Object::Iterator Value::FindMember(KeyType name) + Object::Iterator Value::FindMutableMember(KeyType name) { Object::ContainerType& object = GetObjectInternal(); return AZStd::find_if( @@ -487,9 +487,9 @@ namespace AZ::Dom }); } - Object::Iterator Value::FindMember(AZStd::string_view name) + Object::Iterator Value::FindMutableMember(AZStd::string_view name) { - return FindMember(AZ::Name(name)); + return FindMutableMember(AZ::Name(name)); } Value& Value::MemberReserve(size_t newCapacity) @@ -511,7 +511,7 @@ namespace AZ::Dom Value& Value::AddMember(KeyType name, const Value& value) { Object::ContainerType& object = GetObjectInternal(); - if (auto memberIt = FindMember(name); memberIt != object.end()) + if (auto memberIt = FindMutableMember(name); memberIt != object.end()) { memberIt->second = value; } @@ -530,7 +530,7 @@ namespace AZ::Dom Value& Value::AddMember(AZ::Name name, Value&& value) { Object::ContainerType& object = GetObjectInternal(); - if (auto memberIt = FindMember(name); memberIt != object.end()) + if (auto memberIt = FindMutableMember(name); memberIt != object.end()) { memberIt->second = value; } @@ -601,7 +601,7 @@ namespace AZ::Dom return EraseMember(AZ::Name(name)); } - Object::ContainerType& Value::GetObject() + Object::ContainerType& Value::GetMutableObject() { return GetObjectInternal(); } @@ -647,6 +647,16 @@ namespace AZ::Dom return GetArrayInternal()[index]; } + Value& Value::MutableAt(size_t index) + { + return operator[](index); + } + + const Value& Value::At(size_t index) const + { + return operator[](index); + } + Array::ConstIterator Value::Begin() const { return GetArrayInternal().begin(); @@ -695,7 +705,7 @@ namespace AZ::Dom return GetArrayInternal().erase(first, last); } - Array::ContainerType& Value::GetArray() + Array::ContainerType& Value::GetMutableArray() { return GetArrayInternal(); } @@ -766,6 +776,16 @@ namespace AZ::Dom return Value(); } + Node& Value::GetMutableNode() + { + return GetNodeInternal(); + } + + const Node& Value::GetNode() const + { + return GetNodeInternal(); + } + int64_t Value::GetInt64() const { switch (m_value.index()) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 61c3207ea4..39ae5a5c37 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -162,10 +162,10 @@ namespace AZ::Dom Object::Iterator MemberBegin(); Object::Iterator MemberEnd(); + Object::Iterator FindMutableMember(KeyType name); + Object::Iterator FindMutableMember(AZStd::string_view name); Object::ConstIterator FindMember(KeyType name) const; Object::ConstIterator FindMember(AZStd::string_view name) const; - Object::Iterator FindMember(KeyType name); - Object::Iterator FindMember(AZStd::string_view name); Value& MemberReserve(size_t newCapacity); bool HasMember(KeyType name) const; @@ -185,7 +185,7 @@ namespace AZ::Dom Object::Iterator EraseMember(KeyType name); Object::Iterator EraseMember(AZStd::string_view name); - Object::ContainerType& GetObject(); + Object::ContainerType& GetMutableObject(); const Object::ContainerType& GetObject() const; // Array API (also used by Node)... @@ -199,6 +199,9 @@ namespace AZ::Dom Value& operator[](size_t index); const Value& operator[](size_t index) const; + Value& MutableAt(size_t index); + const Value& At(size_t index) const; + Array::ConstIterator Begin() const; Array::ConstIterator End() const; Array::Iterator Begin(); @@ -211,7 +214,7 @@ namespace AZ::Dom Array::Iterator Erase(Array::ConstIterator pos); Array::Iterator Erase(Array::ConstIterator first, Array::ConstIterator last); - Array::ContainerType& GetArray(); + Array::ContainerType& GetMutableArray(); const Array::ContainerType& GetArray() const; // Node API (supports both object + array API, plus a dedicated NodeName)... @@ -230,6 +233,9 @@ namespace AZ::Dom //! Convenience method, gets the first non-node element of a Node. Value GetNodeValue() const; + Node& GetMutableNode(); + const Node& GetNode() const; + // int API... int64_t GetInt64() const; void SetInt64(int64_t); diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp index 75cb71248f..84e2e16958 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -295,4 +295,90 @@ namespace AZ::Dom::Tests PerformValueChecks(); } + + TEST_F(DomValueTests, CopyOnWrite_Object) + { + Value v1(Type::ObjectType); + v1["foo"] = 5; + + Value nestedObject(Type::ObjectType); + v1["obj"] = nestedObject; + + Value v2 = v1; + EXPECT_EQ(&v1.GetObject(), &v2.GetObject()); + EXPECT_EQ(&v1.FindMember("obj")->second.GetObject(), &v2.FindMember("obj")->second.GetObject()); + + v2["foo"] = 0; + + EXPECT_NE(&v1.GetObject(), &v2.GetObject()); + EXPECT_EQ(&v1.FindMember("obj")->second.GetObject(), &v2.FindMember("obj")->second.GetObject()); + + v2["obj"]["key"] = true; + + EXPECT_NE(&v1.GetObject(), &v2.GetObject()); + EXPECT_NE(&v1.FindMember("obj")->second.GetObject(), &v2.FindMember("obj")->second.GetObject()); + + v2 = v1; + + EXPECT_EQ(&v1.GetObject(), &v2.GetObject()); + EXPECT_EQ(&v1.FindMember("obj")->second.GetObject(), &v2.FindMember("obj")->second.GetObject()); + } + + TEST_F(DomValueTests, CopyOnWrite_Array) + { + Value v1(Type::ArrayType); + v1.PushBack(1); + v1.PushBack(2); + + Value nestedArray(Type::ArrayType); + v1.PushBack(nestedArray); + Value v2 = v1; + + EXPECT_EQ(&v1.GetArray(), &v2.GetArray()); + EXPECT_EQ(&v1.At(2).GetArray(), &v2.At(2).GetArray()); + + v2[0] = 0; + + EXPECT_NE(&v1.GetArray(), &v2.GetArray()); + EXPECT_EQ(&v1.At(2).GetArray(), &v2.At(2).GetArray()); + + v2[2].PushBack(42); + + EXPECT_NE(&v1.GetArray(), &v2.GetArray()); + EXPECT_NE(&v1.At(2).GetArray(), &v2.At(2).GetArray()); + + v2 = v1; + + EXPECT_EQ(&v1.GetArray(), &v2.GetArray()); + EXPECT_EQ(&v1.At(2).GetArray(), &v2.At(2).GetArray()); + } + + TEST_F(DomValueTests, CopyOnWrite_Node) + { + Value v1; + v1.SetNode("TopLevel"); + + v1.PushBack(1); + v1.PushBack(2); + v1["obj"].SetNode("Nested"); + Value v2 = v1; + + EXPECT_EQ(&v1.GetNode(), &v2.GetNode()); + EXPECT_EQ(&v1["obj"].GetNode(), &v2["obj"].GetNode()); + + v2[0] = 0; + + EXPECT_NE(&v1.GetNode(), &v2.GetNode()); + EXPECT_EQ(&v1["obj"].GetNode(), &v2["obj"].GetNode()); + + v2["obj"].PushBack(42); + + EXPECT_NE(&v1.GetNode(), &v2.GetNode()); + EXPECT_NE(&v1["obj"].GetNode(), &v2["obj"].GetNode()); + + v2 = v1; + + EXPECT_EQ(&v1.GetNode(), &v2.GetNode()); + EXPECT_EQ(&v1["obj"].GetNode(), &v2["obj"].GetNode()); + } } // namespace AZ::Dom::Tests From 6613030fe691d87c3a870f17c448746616c44787 Mon Sep 17 00:00:00 2001 From: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> Date: Fri, 10 Dec 2021 10:15:39 -0800 Subject: [PATCH 024/399] Fix Visual Studio requirements text and doc link (#6312) Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> --- .../Platform/Windows/ProjectUtils_windows.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Code/Tools/ProjectManager/Platform/Windows/ProjectUtils_windows.cpp b/Code/Tools/ProjectManager/Platform/Windows/ProjectUtils_windows.cpp index 38bb867244..41a878f0ae 100644 --- a/Code/Tools/ProjectManager/Platform/Windows/ProjectUtils_windows.cpp +++ b/Code/Tools/ProjectManager/Platform/Windows/ProjectUtils_windows.cpp @@ -106,10 +106,8 @@ namespace O3DE::ProjectManager } return AZ::Failure(QObject::tr("Visual Studio 2019 version 16.9.2 or higher not found.

" - "Visual Studio 2019 is required to build this project." - " Install any edition of Visual Studio 2019" - " or update to a newer version before proceeding to the next step." - " While installing configure Visual Studio with these workloads.")); + "A compatible version of Visual Studio is required to build this project.
" + "Refer to the Visual Studio requirements for more information.")); } AZ::Outcome OpenCMakeGUI(const QString& projectPath) From 31c627defc405e850ad8d0fb0f6962d252e07950 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 14 Oct 2021 09:06:54 -0700 Subject: [PATCH 025/399] initial scriptcanvas source handle Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/Utils/Utils.cpp | 5 +- .../Builder/ScriptCanvasBuilderWorker.cpp | 112 ++++---- .../Code/Builder/ScriptCanvasBuilderWorker.h | 5 +- .../Assets/ScriptCanvasAssetHandler.cpp | 46 +--- .../Assets/ScriptCanvasFileHandling.cpp | 129 ++++++++++ .../Editor/Assets/ScriptCanvasMemoryAsset.h | 1 - .../Code/Editor/Components/EditorGraph.cpp | 19 ++ .../Assets/ScriptCanvasAssetHandler.h | 5 - .../Assets/ScriptCanvasBaseAssetData.cpp | 14 +- .../Assets/ScriptCanvasBaseAssetData.h | 6 +- .../Assets/ScriptCanvasFileHandling.h | 35 +++ .../Assets/ScriptCanvasSourceFileHandle.cpp | 61 +++++ .../Assets/ScriptCanvasSourceFileHandle.h | 47 ++++ .../Include/ScriptCanvas/Bus/RequestBus.h | 2 +- .../ScriptCanvas/Components/EditorGraph.h | 2 + .../Code/Editor/View/Windows/MainWindow.cpp | 239 ++++++++++-------- .../Code/Editor/View/Windows/MainWindow.h | 95 ++++--- .../Asset/ScriptCanvasAssetBase.h | 3 +- .../Code/Include/ScriptCanvas/Core/Core.h | 24 ++ .../Code/Include/ScriptCanvas/Core/Graph.h | 4 +- .../Code/scriptcanvasgem_editor_files.cmake | 4 + 21 files changed, 577 insertions(+), 281 deletions(-) create mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp create mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h create mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp create mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h diff --git a/Code/Framework/AzCore/AzCore/Utils/Utils.cpp b/Code/Framework/AzCore/AzCore/Utils/Utils.cpp index 12c6473905..1623aca56b 100644 --- a/Code/Framework/AzCore/AzCore/Utils/Utils.cpp +++ b/Code/Framework/AzCore/AzCore/Utils/Utils.cpp @@ -165,13 +165,12 @@ namespace AZ::Utils } Container fileContent; - fileContent.resize(length); + fileContent.resize_no_construct(length); AZ::IO::SizeType bytesRead = file.Read(length, fileContent.data()); file.Close(); // Resize again just in case bytesRead is less than length for some reason - fileContent.resize(bytesRead); - + fileContent.resize_no_construct(bytesRead); return AZ::Success(AZStd::move(fileContent)); } diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index f474c10532..7a7dbfff0b 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -16,9 +16,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -44,54 +46,73 @@ namespace ScriptCanvasBuilder AzFramework::StringFunc::Path::ConstructFull(request.m_watchFolder.data(), request.m_sourceFile.data(), fullPath, false); AzFramework::StringFunc::Path::Normalize(fullPath); - if (!m_editorAssetHandler) - { - AZ_Error(s_scriptCanvasBuilder, false, R"(CreateJobs for %s failed because the ScriptCanvas Editor Asset handler is missing.)", fullPath.data()); - } + AZ::Data::Asset asset; + const ScriptCanvasEditor::Graph* sourceGraph = nullptr; + const ScriptCanvas::GraphData* graphData = nullptr; - AZStd::shared_ptr assetDataStream = AZStd::make_shared(); + ScriptCanvasEditor::SourceHandle sourceHandle; - AZ::IO::FileIOStream stream(fullPath.c_str(), AZ::IO::OpenMode::ModeRead); - if (!AZ::IO::RetryOpenStream(stream)) + auto sourceOutcome = ScriptCanvasEditor::LoadFromFile(fullPath); + if (sourceOutcome.IsSuccess()) { - AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the source file could not be opened.", fullPath.data()); - return; + sourceHandle = sourceOutcome.TakeValue(); + sourceGraph = sourceHandle.Get(); + graphData = sourceGraph->GetGraphDataConst(); } - - // Read the asset into a memory buffer, then hand ownership of the buffer to assetDataStream + +#if defined(EDITOR_ASSET_SUPPORT_ENABLED) + if (graphData == nullptr) { - AZ::IO::FileIOStream ioStream; - if (!ioStream.Open(fullPath.data(), AZ::IO::OpenMode::ModeRead)) + if (!m_editorAssetHandler) + { + AZ_Error(s_scriptCanvasBuilder, false, R"(CreateJobs for %s failed because the ScriptCanvas Editor Asset handler is missing.)", fullPath.data()); + } + + AZStd::shared_ptr assetDataStream = AZStd::make_shared(); + + AZ::IO::FileIOStream stream(fullPath.c_str(), AZ::IO::OpenMode::ModeRead); + if (!AZ::IO::RetryOpenStream(stream)) { AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the source file could not be opened.", fullPath.data()); return; } - AZStd::vector fileBuffer(ioStream.GetLength()); - size_t bytesRead = ioStream.Read(fileBuffer.size(), fileBuffer.data()); - if (bytesRead != ioStream.GetLength()) + // Read the asset into a memory buffer, then hand ownership of the buffer to assetDataStream { - AZ_Warning(s_scriptCanvasBuilder, false, AZStd::string::format("File failed to read completely: %s", fullPath.data()).c_str()); - return; + AZ::IO::FileIOStream ioStream; + if (!ioStream.Open(fullPath.data(), AZ::IO::OpenMode::ModeRead)) + { + AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the source file could not be opened.", fullPath.data()); + return; + } + + AZStd::vector fileBuffer(ioStream.GetLength()); + size_t bytesRead = ioStream.Read(fileBuffer.size(), fileBuffer.data()); + if (bytesRead != ioStream.GetLength()) + { + AZ_Warning(s_scriptCanvasBuilder, false, AZStd::string::format("File failed to read completely: %s", fullPath.data()).c_str()); + return; + } + + assetDataStream->Open(AZStd::move(fileBuffer)); } - assetDataStream->Open(AZStd::move(fileBuffer)); - } + m_processEditorAssetDependencies.clear(); - m_processEditorAssetDependencies.clear(); + asset.Create(AZ::Data::AssetId(AZ::Uuid::CreateRandom())); + if (m_editorAssetHandler->LoadAssetDataFromStream(asset, assetDataStream, {}) != AZ::Data::AssetHandler::LoadResult::LoadComplete) + { + AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the asset data could not be loaded from the file", fullPath.data()); + return; + } - AZ::Data::Asset asset; - asset.Create(AZ::Data::AssetId(AZ::Uuid::CreateRandom())); - if (m_editorAssetHandler->LoadAssetDataFromStream(asset, assetDataStream, {}) != AZ::Data::AssetHandler::LoadResult::LoadComplete) - { - AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the asset data could not be loaded from the file", fullPath.data()); - return; + sourceGraph = AZ::EntityUtils::FindFirstDerivedComponent(asset.Get()->GetScriptCanvasEntity()); + graphData = sourceGraph->GetGraphDataConst(); } +#endif - auto* scriptCanvasEntity = asset.Get()->GetScriptCanvasEntity(); - auto* sourceGraph = AZ::EntityUtils::FindFirstDerivedComponent(scriptCanvasEntity); AZ_Assert(sourceGraph, "Graph component is missing from entity."); - AZ_Assert(sourceGraph->GetGraphData(), "GraphData is missing from entity"); + AZ_Assert(graphData, "GraphData is missing from entity"); struct EntityIdComparer { @@ -102,7 +123,7 @@ namespace ScriptCanvasBuilder return lhsEntityId < rhsEntityId; } }; - const AZStd::set sortedEntities(sourceGraph->GetGraphData()->m_nodes.begin(), sourceGraph->GetGraphData()->m_nodes.end()); + const AZStd::set sortedEntities(graphData->m_nodes.begin(), graphData->m_nodes.end()); size_t fingerprint = 0; for (const auto& nodeEntity : sortedEntities) @@ -155,7 +176,7 @@ namespace ScriptCanvasBuilder }; AZ_Verify(serializeContext->EnumerateInstanceConst - ( sourceGraph->GetGraphData() + ( graphData , azrtti_typeid() , assetFilter , {} @@ -168,17 +189,6 @@ namespace ScriptCanvasBuilder for (const AssetBuilderSDK::PlatformInfo& info : request.m_enabledPlatforms) { - if (info.HasTag("tools")) - { - AssetBuilderSDK::JobDescriptor copyDescriptor; - copyDescriptor.m_priority = 2; - copyDescriptor.m_critical = true; - copyDescriptor.m_jobKey = s_scriptCanvasCopyJobKey; - copyDescriptor.SetPlatformIdentifier(info.m_identifier.c_str()); - copyDescriptor.m_additionalFingerprintInfo = AZStd::string(GetFingerprintString()).append("|").append(AZStd::to_string(static_cast(fingerprint))); - response.m_createJobOutputs.push_back(copyDescriptor); - } - AssetBuilderSDK::JobDescriptor jobDescriptor; jobDescriptor.m_priority = 2; jobDescriptor.m_critical = true; @@ -299,23 +309,9 @@ namespace ScriptCanvasBuilder AzFramework::StringFunc::Path::Join(request.m_tempDirPath.c_str(), fileNameOnly.c_str(), runtimeScriptCanvasOutputPath, true, true); AzFramework::StringFunc::Path::ReplaceExtension(runtimeScriptCanvasOutputPath, ScriptCanvas::RuntimeAsset::GetFileExtension()); - if (request.m_jobDescription.m_jobKey == s_scriptCanvasCopyJobKey) - { - // ScriptCanvas Editor Asset Copy job - // The SubID is zero as this represents the main asset - AssetBuilderSDK::JobProduct jobProduct; - jobProduct.m_productFileName = fullPath; - jobProduct.m_productAssetType = azrtti_typeid(); - jobProduct.m_productSubID = 0; - jobProduct.m_dependenciesHandled = true; - jobProduct.m_dependencies.clear(); - response.m_outputProducts.push_back(AZStd::move(jobProduct)); - response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - } - else + if (request.m_jobDescription.m_jobKey == s_scriptCanvasProcessJobKey) { AZ::Entity* buildEntity = asset.Get()->GetScriptCanvasEntity(); - ProcessTranslationJobInput input; input.assetID = AZ::Data::AssetId(request.m_sourceFileUUID, AZ_CRC("RuntimeData", 0x163310ae)); input.request = &request; diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index 668e1a0bcd..84c9285362 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -42,7 +42,6 @@ namespace ScriptCanvasEditor namespace ScriptCanvasBuilder { constexpr const char* s_scriptCanvasBuilder = "ScriptCanvasBuilder"; - constexpr const char* s_scriptCanvasCopyJobKey = "Script Canvas Copy Job"; constexpr const char* s_scriptCanvasProcessJobKey = "Script Canvas Process Job"; constexpr const char* s_unitTestParseErrorPrefix = "LY_SC_UnitTest"; @@ -59,6 +58,10 @@ namespace ScriptCanvasBuilder PrefabIntegration, CorrectGraphVariableVersion, ReflectEntityIdNodes, + + ForceBuildForDevTest0, + ForceBuildForDevTest1, + // add new entries above Current, }; diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp index dea63ab852..bac1f770cb 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -93,49 +94,6 @@ namespace ScriptCanvasEditor } } - AZ::Outcome LoadScriptCanvasDataFromJson - ( ScriptCanvas::ScriptCanvasData& dataTarget - , AZStd::string_view source - , AZ::SerializeContext& serializeContext) - { - namespace JSRU = AZ::JsonSerializationUtils; - using namespace ScriptCanvas; - - AZ::JsonDeserializerSettings settings; - settings.m_serializeContext = &serializeContext; - settings.m_metadata.Create(); - - auto loadResult = JSRU::LoadObjectFromStringByType - ( &dataTarget - , azrtti_typeid() - , source - , &settings); - - if (!loadResult.IsSuccess()) - { - return loadResult; - } - - if (auto graphData = dataTarget.ModGraph()) - { - auto listeners = settings.m_metadata.Find(); - AZ_Assert(listeners, "Failed to find SerializationListeners"); - - ScriptCanvasAssetHandlerCpp::CollectNodes(graphData->GetGraphData()->m_nodes, *listeners); - - for (auto listener : *listeners) - { - listener->OnDeserialize(); - } - } - else - { - return AZ::Failure(AZStd::string("Failed to find graph data after loading source")); - } - - return AZ::Success(); - } - AZ::Data::AssetHandler::LoadResult ScriptCanvasAssetHandler::LoadAssetData ( const AZ::Data::Asset& assetTarget , AZStd::shared_ptr streamSource @@ -167,7 +125,7 @@ namespace ScriptCanvasEditor settings.m_serializeContext = m_serializeContext; settings.m_metadata.Create(); // attempt JSON deserialization... - auto jsonResult = LoadScriptCanvasDataFromJson + auto jsonResult = LoadDataFromJson ( scriptCanvasDataTarget , AZStd::string_view{ byteBuffer.begin(), byteBuffer.size() } , *m_serializeContext); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp new file mode 100644 index 0000000000..c21f01bb88 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -0,0 +1,129 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace ScriptCanvasFileHandlingCpp +{ + using namespace ScriptCanvas; + + void CollectNodes(const GraphData::NodeContainer& container, SerializationListeners& listeners) + { + for (auto& nodeEntity : container) + { + if (nodeEntity) + { + if (auto listener = azrtti_cast(AZ::EntityUtils::FindFirstDerivedComponent(nodeEntity))) + { + listeners.push_back(listener); + } + } + } + } +} + +namespace ScriptCanvasEditor +{ + AZ::Outcome LoadDataFromJson + ( ScriptCanvas::ScriptCanvasData& dataTarget + , AZStd::string_view source + , AZ::SerializeContext& serializeContext) + { + namespace JSRU = AZ::JsonSerializationUtils; + using namespace ScriptCanvas; + + AZ::JsonDeserializerSettings settings; + settings.m_serializeContext = &serializeContext; + settings.m_metadata.Create(); + + auto loadResult = JSRU::LoadObjectFromStringByType + ( &dataTarget + , azrtti_typeid() + , source + , &settings); + + if (!loadResult.IsSuccess()) + { + return loadResult; + } + + if (auto graphData = dataTarget.ModGraph()) + { + auto listeners = settings.m_metadata.Find(); + AZ_Assert(listeners, "Failed to find SerializationListeners"); + + ScriptCanvasFileHandlingCpp::CollectNodes(graphData->GetGraphData()->m_nodes, *listeners); + + for (auto listener : *listeners) + { + listener->OnDeserialize(); + } + } + else + { + return AZ::Failure(AZStd::string("Failed to find graph data after loading source")); + } + + return AZ::Success(); + } + + AZ::Outcome LoadFromFile(AZStd::string_view path) + { + namespace JSRU = AZ::JsonSerializationUtils; + using namespace ScriptCanvas; + + auto fileStringOutcome = AZ::Utils::ReadFile(path); + if (!fileStringOutcome) + { + return AZ::Failure(fileStringOutcome.TakeError()); + } + + const auto& asString = fileStringOutcome.GetValue(); + DataPtr scriptCanvasData = Graph::Create(); + + AZ::SerializeContext* serializeContext = nullptr; + AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); + if (!serializeContext) + { + return AZ::Failure(AZStd::string("no serialize context available to properly parse source file")); + } + + // attempt JSON deserialization... + auto jsonResult = LoadDataFromJson(*scriptCanvasData, AZStd::string_view{ asString.begin(), asString.size() }, *serializeContext); + if (!jsonResult.IsSuccess()) + { + // ...try legacy xml as a failsafe + AZ::IO::ByteContainerStream byteStream(&asString); + if (!AZ::Utils::LoadObjectFromStreamInPlace + ( byteStream + , *scriptCanvasData + , serializeContext + , AZ::ObjectStream::FilterDescriptor(nullptr, AZ::ObjectStream::FILTERFLAG_IGNORE_UNKNOWN_CLASSES))) + { + return AZ::Failure(AZStd::string::format("XML and JSON load attempts failed: %s", jsonResult.GetError().c_str())); + } + } + + return AZ::Success(ScriptCanvasEditor::SourceHandle(scriptCanvasData, {}, path)); + } +} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h index 9665e8ec64..d7f6ae87b6 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h @@ -172,7 +172,6 @@ namespace ScriptCanvasEditor bool IsSourceInError() const; - void OnSourceAssetFinalized(const AZStd::string& fullPath, AZ::Uuid sourceAssetId); void SavingComplete(const AZStd::string& fullPath, AZ::Uuid sourceAssetId); AZ::Data::AssetId GetSourceUuid() const { return m_sourceUuid; } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 77f791483b..fc2c2ace41 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -77,6 +77,7 @@ AZ_POP_DISABLE_WARNING #include #include #include +#include #include #include #include @@ -1041,6 +1042,24 @@ namespace ScriptCanvasEditor } } + ScriptCanvas::DataPtr Graph::Create() + { + if (AZ::Entity* entity = aznew AZ::Entity("Script Canvas Graph")) + { + auto graph = entity->CreateComponent(); + graph->SetAssetType(azrtti_typeid()); + entity->CreateComponent(graph->GetScriptCanvasId()); + + if (ScriptCanvas::DataPtr data = AZStd::make_shared()) + { + data->m_scriptCanvasEntity.reset(entity); + return data; + } + } + + return nullptr; + } + bool Graph::CreateConnection(const GraphCanvas::ConnectionId& connectionId, const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) { if (!sourcePoint.IsValid() || !targetPoint.IsValid()) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetHandler.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetHandler.h index f29d5aa9cb..a0e00b40fd 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetHandler.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetHandler.h @@ -20,11 +20,6 @@ namespace AZ namespace ScriptCanvasEditor { - AZ::Outcome LoadScriptCanvasDataFromJson - ( ScriptCanvas::ScriptCanvasData& dataTarget - , AZStd::string_view source - , AZ::SerializeContext& serializeContext); - /** * Manages editor Script Canvas graph assets. */ diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp index 6da134ed6a..2b451b0de8 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp @@ -11,13 +11,23 @@ namespace ScriptCanvas { - Graph* ScriptCanvasData::ModGraph() + const Graph* ScriptCanvasData::GetGraph() const { return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); } - const Graph* ScriptCanvasData::GetGraph() const + const ScriptCanvasEditor::Graph* ScriptCanvasData::GetEditorGraph() const + { + return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); + } + + Graph* ScriptCanvasData::ModGraph() { return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); } + + ScriptCanvasEditor::Graph* ScriptCanvasData::ModEditorGraph() + { + return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); + } } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h index f4b02b56b6..5340f1128a 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h @@ -28,9 +28,13 @@ namespace ScriptCanvas AZ::Entity* GetScriptCanvasEntity() const { return m_scriptCanvasEntity.get(); } + const Graph* GetGraph() const; + + const ScriptCanvasEditor::Graph* GetEditorGraph() const; + Graph* ModGraph(); - const Graph* GetGraph() const; + ScriptCanvasEditor::Graph* ModEditorGraph(); AZStd::unique_ptr m_scriptCanvasEntity; private: diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h new file mode 100644 index 0000000000..154ff5f2b0 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include +#include + +namespace AZ +{ + class SerializeContext; +} + +namespace ScriptCanvas +{ + class ScriptCanvasData; +} + +namespace ScriptCanvasEditor +{ + AZ::Outcome LoadFromFile(AZStd::string_view path); + + AZ::Outcome LoadDataFromJson + ( ScriptCanvas::ScriptCanvasData& dataTarget + , AZStd::string_view source + , AZ::SerializeContext& serializeContext); + } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp new file mode 100644 index 0000000000..e6ed773e83 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp @@ -0,0 +1,61 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace ScriptCanvasEditor +{ + SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path) + : m_data(graph) + , m_id(id) + , m_path(path) + {} + + void SourceHandle::Clear() + { + m_data = nullptr; + m_id = AZ::Uuid::CreateNull(); + m_path.clear(); + } + + GraphPtrConst SourceHandle::Get() const + { + return m_data ? m_data->GetEditorGraph() : nullptr; + } + + const AZ::Uuid& SourceHandle::Id() const + { + return m_id; + } + + bool SourceHandle::IsValid() const + { + return *this; + } + + GraphPtr SourceHandle::Mod() const + { + return m_data ? m_data->ModEditorGraph() : nullptr; + } + + SourceHandle::operator bool() const + { + return m_data != nullptr; + } + + bool SourceHandle::operator!() const + { + return m_data == nullptr; + } + + const AZStd::string& SourceHandle::Path() const + { + return m_path; + } +} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h new file mode 100644 index 0000000000..045221310a --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include + +namespace ScriptCanvasEditor +{ + class SourceHandle + { + public: + AZ_TYPE_INFO(SourceHandle, "{65855A98-AE2F-427F-BFC8-69D45265E312}"); + AZ_CLASS_ALLOCATOR(SourceHandle, AZ::SystemAllocator, 0); + + SourceHandle() = default; + + SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path); + + void Clear(); + + GraphPtrConst Get() const; + + const AZ::Uuid& Id() const; + + bool IsValid() const; + + GraphPtr Mod() const; + + operator bool() const; + + bool operator!() const; + + const AZStd::string& Path() const; + + private: + ScriptCanvas::DataPtr m_data; + AZ::Uuid m_id = AZ::Uuid::CreateNull(); + AZStd::string m_path; + }; +} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h index 8fa7beab2b..dedfdd8d20 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h @@ -126,7 +126,7 @@ namespace ScriptCanvasEditor virtual void DisconnectEndpoints(const AZ::EntityId& /*sceneId*/, const AZStd::vector& /*endpoints*/) {} virtual void PostUndoPoint(ScriptCanvas::ScriptCanvasId) = 0; - virtual void SignalSceneDirty(AZ::Data::AssetId) = 0; + virtual void SignalSceneDirty(SourceHandle) = 0; // Increment the value of the ignore undo point tracker virtual void PushPreventUndoStateUpdate() = 0; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index 9913fa838b..1d7ea0afbc 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -101,6 +101,8 @@ namespace ScriptCanvasEditor public: AZ_COMPONENT(Graph, "{4D755CA9-AB92-462C-B24F-0B3376F19967}", ScriptCanvas::Graph); + static ScriptCanvas::DataPtr Create(); + static void Reflect(AZ::ReflectContext* context); Graph(const ScriptCanvas::ScriptCanvasId& scriptCanvasId = AZ::Entity::MakeId()) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index e61b015aae..f2eeae1c3c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -135,6 +135,7 @@ #include #include #include +#include #include @@ -235,7 +236,7 @@ namespace ScriptCanvasEditor Widget::GraphTabBar* tabBar = m_mainWindow->m_tabBar; AZStd::vector activeAssets; - AZ::Data::AssetId focusedAssetId = tabBar->FindAssetId(tabBar->currentIndex()); + ScriptCanvasEditor::SourceHandle focusedAssetId = tabBar->FindAssetId(tabBar->currentIndex()); if (m_rememberOpenCanvases) { @@ -243,13 +244,13 @@ namespace ScriptCanvasEditor for (int i = 0; i < tabBar->count(); ++i) { - AZ::Data::AssetId assetId = tabBar->FindAssetId(i); + ScriptCanvasEditor::SourceHandle assetId = tabBar->FindAssetId(i); const Tracker::ScriptCanvasFileState& fileState = m_mainWindow->GetAssetFileState(assetId); if (fileState == Tracker::ScriptCanvasFileState::MODIFIED || fileState == Tracker::ScriptCanvasFileState::UNMODIFIED) { - AZ::Data::AssetId sourceId = GetSourceAssetId(assetId); + ScriptCanvasEditor::SourceHandle sourceId = GetSourceAssetId(assetId); if (sourceId.IsValid()) { EditorSettings::EditorWorkspace::WorkspaceAssetSaveData assetSaveData; @@ -316,7 +317,7 @@ namespace ScriptCanvasEditor if (m_loadingAssets.empty()) { - m_mainWindow->OnWorkspaceRestoreEnd(AZ::Data::AssetId()); + m_mainWindow->OnWorkspaceRestoreEnd(ScriptCanvasEditor::SourceHandle()); } else { @@ -336,7 +337,7 @@ namespace ScriptCanvasEditor { if (assetSaveData.m_assetId == m_queuedAssetFocus) { - m_queuedAssetFocus = AZ::Data::AssetId(); + m_queuedAssetFocus = ScriptCanvasEditor::SourceHandle(); } SignalAssetComplete(asset.GetFileAssetId()); @@ -350,7 +351,7 @@ namespace ScriptCanvasEditor { if (assetSaveData.m_assetId == m_queuedAssetFocus) { - m_queuedAssetFocus = AZ::Data::AssetId(); + m_queuedAssetFocus = ScriptCanvasEditor::SourceHandle(); } SignalAssetComplete(assetSaveData.m_assetId); @@ -359,14 +360,14 @@ namespace ScriptCanvasEditor } else { - m_mainWindow->OnWorkspaceRestoreEnd(AZ::Data::AssetId()); + m_mainWindow->OnWorkspaceRestoreEnd(ScriptCanvasEditor::SourceHandle()); } } } void Workspace::OnAssetReady(const ScriptCanvasMemoryAsset::pointer memoryAsset) { - const AZ::Data::AssetId& fileAssetId = memoryAsset->GetFileAssetId(); + const ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset->GetFileAssetId(); if (AssetTrackerNotificationBus::MultiHandler::BusIsConnectedId(fileAssetId)) { @@ -378,7 +379,7 @@ namespace ScriptCanvasEditor } } - void Workspace::SignalAssetComplete(const AZ::Data::AssetId& fileAssetId) + void Workspace::SignalAssetComplete(const ScriptCanvasEditor::SourceHandle& fileAssetId) { auto it = AZStd::find(m_loadingAssets.begin(), m_loadingAssets.end(), fileAssetId); if (it != m_loadingAssets.end()) @@ -394,7 +395,7 @@ namespace ScriptCanvasEditor } } - AZ::Data::AssetId Workspace::GetSourceAssetId(const AZ::Data::AssetId& memoryAssetId) const + ScriptCanvasEditor::SourceHandle Workspace::GetSourceAssetId(const ScriptCanvasEditor::SourceHandle& memoryAssetId) const { ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, memoryAssetId); @@ -404,7 +405,7 @@ namespace ScriptCanvasEditor return memoryAsset->GetFileAssetId(); } - return AZ::Data::AssetId(); + return ScriptCanvasEditor::SourceHandle(); } //////////////// @@ -655,9 +656,9 @@ namespace ScriptCanvasEditor QTimer::singleShot(0, [this]() { SetDefaultLayout(); - if (m_activeAssetId.IsValid()) + if (m_activeGraph.IsValid()) { - m_queuedFocusOverride = m_activeAssetId; + m_queuedFocusOverride = m_activeGraph; } m_workspace->Restore(); @@ -831,7 +832,7 @@ namespace ScriptCanvasEditor connect(ui->action_ViewRestoreDefaultLayout, &QAction::triggered, this, &MainWindow::OnRestoreDefaultLayout); } - void MainWindow::SignalActiveSceneChanged(AZ::Data::AssetId assetId) + void MainWindow::SignalActiveSceneChanged(ScriptCanvasEditor::SourceHandle assetId) { ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -927,7 +928,7 @@ namespace ScriptCanvasEditor for (int tabCounter = 0; tabCounter < m_tabBar->count(); ++tabCounter) { - AZ::Data::AssetId assetId = m_tabBar->FindAssetId(tabCounter); + ScriptCanvasEditor::SourceHandle assetId = m_tabBar->FindAssetId(tabCounter); auto resultIterator = m_processedClosedAssetIds.insert(assetId); if (!resultIterator.second) @@ -950,7 +951,7 @@ namespace ScriptCanvasEditor if (shouldSaveResults == UnsavedChangesOptions::SAVE) { - Callbacks::OnSave saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr, AZ::Data::AssetId) + Callbacks::OnSave saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr, ScriptCanvasEditor::SourceHandle) { if (isSuccessful) { @@ -992,7 +993,7 @@ namespace ScriptCanvasEditor for (auto trackedAsset : allAssets) { - const AZ::Data::AssetId& assetId = trackedAsset->GetAsset().GetId(); + const ScriptCanvasEditor::SourceHandle& assetId = trackedAsset->GetAsset().GetId(); CloseScriptCanvasAsset(assetId); } @@ -1032,7 +1033,7 @@ namespace ScriptCanvasEditor DequeuePropertyGridUpdate(); UndoRequestBus::Event(GetActiveScriptCanvasId(), &UndoRequests::Undo); - SignalSceneDirty(m_activeAssetId); + SignalSceneDirty(m_activeGraph); m_propertyGrid->ClearSelection(); GeneralEditorNotificationBus::Event(GetActiveScriptCanvasId(), &GeneralEditorNotifications::OnUndoRedoEnd); @@ -1044,7 +1045,7 @@ namespace ScriptCanvasEditor DequeuePropertyGridUpdate(); UndoRequestBus::Event(GetActiveScriptCanvasId(), &UndoRequests::Redo); - SignalSceneDirty(m_activeAssetId); + SignalSceneDirty(m_activeGraph); m_propertyGrid->ClearSelection(); GeneralEditorNotificationBus::Event(GetActiveScriptCanvasId(), &GeneralEditorNotifications::OnUndoRedoEnd); @@ -1117,14 +1118,14 @@ namespace ScriptCanvasEditor { ScopedUndoBatch scopedUndoBatch("Modify Graph Canvas Scene"); UndoRequestBus::Event(scriptCanvasId, &UndoRequests::AddGraphItemChangeUndo, "Graph Change"); - MarkAssetModified(m_activeAssetId); + MarkAssetModified(m_activeGraph); } const bool forceTimer = true; RestartAutoTimerSave(forceTimer); } - void MainWindow::SignalSceneDirty(AZ::Data::AssetId assetId) + void MainWindow::SignalSceneDirty(ScriptCanvasEditor::SourceHandle assetId) { MarkAssetModified(assetId); } @@ -1147,7 +1148,7 @@ namespace ScriptCanvasEditor m_preventUndoStateUpdateCount = 0; } - void MainWindow::MarkAssetModified(const AZ::Data::AssetId& assetId) + void MainWindow::MarkAssetModified(const ScriptCanvasEditor::SourceHandle& assetId) { if (!assetId.IsValid()) { @@ -1200,7 +1201,7 @@ namespace ScriptCanvasEditor } } - AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const AZ::Data::AssetId& fileAssetId) + AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& fileAssetId) { if (!fileAssetId.IsValid()) { @@ -1264,7 +1265,7 @@ namespace ScriptCanvasEditor AZ::Outcome MainWindow::OpenScriptCanvasAsset(const ScriptCanvasMemoryAsset& scriptCanvasAsset, int tabIndex /*= -1*/) { - const AZ::Data::AssetId& fileAssetId = scriptCanvasAsset.GetFileAssetId(); + const ScriptCanvasEditor::SourceHandle& fileAssetId = scriptCanvasAsset.GetFileAssetId(); if (!fileAssetId.IsValid()) { return AZ::Failure(AZStd::string("Unable to open asset with invalid asset id")); @@ -1337,7 +1338,7 @@ namespace ScriptCanvasEditor return AZ::Success(outTabIndex); } - AZ::Outcome MainWindow::OpenScriptCanvasAsset(AZ::Data::AssetId scriptCanvasAssetId, int tabIndex /*= -1*/) + AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, int tabIndex /*= -1*/) { ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, scriptCanvasAssetId); @@ -1353,7 +1354,7 @@ namespace ScriptCanvasEditor } } - int MainWindow::CreateAssetTab(const AZ::Data::AssetId& assetId, int tabIndex) + int MainWindow::CreateAssetTab(const ScriptCanvasEditor::SourceHandle& assetId, int tabIndex) { return m_tabBar->InsertGraphTab(tabIndex, assetId); } @@ -1378,7 +1379,7 @@ namespace ScriptCanvasEditor return AZ::Success(outTabIndex); } - void MainWindow::RemoveScriptCanvasAsset(const AZ::Data::AssetId& assetId) + void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) { AssetHelpers::PrintInfo("RemoveScriptCanvasAsset : %s", AssetHelpers::AssetIdToString(assetId).c_str()); @@ -1404,13 +1405,13 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(tabIndex); if (tabdata.isValid()) { - auto tabAssetId = tabdata.value(); + auto tabAssetId = tabdata.value(); SetActiveAsset(tabAssetId); } } - int MainWindow::CloseScriptCanvasAsset(const AZ::Data::AssetId& assetId) + int MainWindow::CloseScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) { int tabIndex = -1; if (IsTabOpen(assetId, tabIndex)) @@ -1431,26 +1432,26 @@ namespace ScriptCanvasEditor } } - AZ::Data::AssetId previousAssetId = m_activeAssetId; + ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; OnFileNew(); - bool createdNewAsset = m_activeAssetId != previousAssetId; + bool createdNewAsset = m_activeGraph != previousAssetId; if (createdNewAsset) { - m_assetCreationRequests[m_activeAssetId] = requestingEntityId; + m_assetCreationRequests[m_activeGraph] = requestingEntityId; } if (m_isRestoringWorkspace) { - m_queuedFocusOverride = m_activeAssetId; + m_queuedFocusOverride = m_activeGraph; } return createdNewAsset; } - bool MainWindow::IsScriptCanvasAssetOpen(const AZ::Data::AssetId& assetId) const + bool MainWindow::IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& assetId) const { ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -1468,7 +1469,7 @@ namespace ScriptCanvasEditor return m_nodePaletteModel.FindNodePaletteInformation(nodeType); } - void MainWindow::GetSuggestedFullFilenameToSaveAs(const AZ::Data::AssetId& assetId, AZStd::string& filePath, AZStd::string& fileFilter) + void MainWindow::GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& assetId, AZStd::string& filePath, AZStd::string& fileFilter) { ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -1514,6 +1515,21 @@ namespace ScriptCanvasEditor void MainWindow::OpenFile(const char* fullPath) { + AZ::Outcome outcome = LoadFromFile(fullPath); + + if (!outcome.IsSuccess()) + { + m_errorFilePath = fullPath; + AZ_Warning("ScriptCanvas", false, "Unable to open file as a ScriptCanvas graph: %s", fullPath); + } + else + { + m_errorFilePath.clear(); + m_activeGraph = outcome.TakeValue(); + return; + } + +#if defined(EDITOR_ASSET_SUPPORT_ENABLED) m_errorFilePath = fullPath; // Let's find the source file on disk @@ -1566,6 +1582,7 @@ namespace ScriptCanvasEditor { QMessageBox::warning(this, "Invalid Source Asset", QString("'%1' is not a valid asset path.").arg(fullPath), QMessageBox::Ok); } +#endif } GraphCanvas::Endpoint MainWindow::HandleProposedConnection(const GraphCanvas::GraphId&, const GraphCanvas::ConnectionId&, const GraphCanvas::Endpoint& endpoint, const GraphCanvas::NodeId& nodeId, const QPoint& screenPoint) @@ -1676,7 +1693,7 @@ namespace ScriptCanvasEditor MakeNewFile(); } - int MainWindow::InsertTabForAsset(AZStd::string_view assetPath, AZ::Data::AssetId assetId, int tabIndex) + int MainWindow::InsertTabForAsset(AZStd::string_view assetPath, ScriptCanvasEditor::SourceHandle assetId, int tabIndex) { int outTabIndex = -1; @@ -1698,7 +1715,7 @@ namespace ScriptCanvasEditor return outTabIndex; } - void MainWindow::UpdateUndoCache(AZ::Data::AssetId) + void MainWindow::UpdateUndoCache(ScriptCanvasEditor::SourceHandle) { UndoCache* undoCache = nullptr; UndoRequestBus::EventResult(undoCache, GetActiveScriptCanvasId(), &UndoRequests::GetSceneUndoCache); @@ -1712,10 +1729,10 @@ namespace ScriptCanvasEditor { int outTabIndex = -1; - AZ::Data::AssetId newAssetId; + ScriptCanvasEditor::SourceHandle newAssetId; auto onAssetCreated = [this, assetPath, tabIndex, &outTabIndex](ScriptCanvasMemoryAsset& asset) { - const AZ::Data::AssetId& assetId = asset.GetId(); + const ScriptCanvasEditor::SourceHandle& assetId = asset.GetId(); outTabIndex = InsertTabForAsset(assetPath, assetId, tabIndex); @@ -1737,15 +1754,15 @@ namespace ScriptCanvasEditor bool MainWindow::OnFileSave(const Callbacks::OnSave& saveCB) { - return SaveAssetImpl(m_activeAssetId, saveCB); + return SaveAssetImpl(m_activeGraph, saveCB); } bool MainWindow::OnFileSaveAs(const Callbacks::OnSave& saveCB) { - return SaveAssetAsImpl(m_activeAssetId, saveCB); + return SaveAssetAsImpl(m_activeGraph, saveCB); } - bool MainWindow::SaveAssetImpl(const AZ::Data::AssetId& assetId, const Callbacks::OnSave& saveCB) + bool MainWindow::SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB) { if (!assetId.IsValid()) { @@ -1772,14 +1789,14 @@ namespace ScriptCanvasEditor return saveSuccessful; } - bool MainWindow::SaveAssetAsImpl(const AZ::Data::AssetId& inMemoryAssetId, const Callbacks::OnSave& saveCB) + bool MainWindow::SaveAssetAsImpl(const ScriptCanvasEditor::SourceHandle& inMemoryAssetId, const Callbacks::OnSave& saveCB) { if (!inMemoryAssetId.IsValid()) { return false; } - if (m_activeAssetId != inMemoryAssetId) + if (m_activeGraph != inMemoryAssetId) { OnChangeActiveGraphTab(inMemoryAssetId); } @@ -1858,7 +1875,7 @@ namespace ScriptCanvasEditor return false; } - void MainWindow::OnSaveCallback(bool saveSuccess, AZ::Data::AssetPtr fileAsset, AZ::Data::AssetId previousFileAssetId) + void MainWindow::OnSaveCallback(bool saveSuccess, AZ::Data::AssetPtr fileAsset, ScriptCanvasEditor::SourceHandle previousFileAssetId) { ScriptCanvasMemoryAsset::pointer memoryAsset; AZStd::string tabName = m_tabBar->tabText(m_tabBar->currentIndex()).toUtf8().data(); @@ -1871,7 +1888,7 @@ namespace ScriptCanvasEditor AZ_Assert(memoryAsset, "At this point we must have a MemoryAsset"); // Update the editor with the new information about this asset. - const AZ::Data::AssetId& fileAssetId = memoryAsset->GetFileAssetId(); + const ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset->GetFileAssetId(); saveTabIndex = m_tabBar->FindTab(fileAssetId); @@ -1879,7 +1896,7 @@ namespace ScriptCanvasEditor if (saveTabIndex != m_tabBar->currentIndex()) { // Invalidate the file asset id so we don't delete trigger the asset flow. - m_tabBar->setTabData(saveTabIndex, QVariant::fromValue(AZ::Data::AssetId())); + m_tabBar->setTabData(saveTabIndex, QVariant::fromValue(ScriptCanvasEditor::SourceHandle())); m_tabBar->CloseTab(saveTabIndex); saveTabIndex = -1; @@ -1935,12 +1952,12 @@ namespace ScriptCanvasEditor } // Soft switch the asset id here. We'll do a double scene switch down below to actually switch the active assetid - m_activeAssetId = fileAssetId; + m_activeGraph = fileAssetId; } else { // Use the previous memory asset to find what we had setup as our display - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); // Drop off our file modifier status for our display name when we fail to save. if (tabName.at(tabName.size() -1) == '*') @@ -1956,9 +1973,9 @@ namespace ScriptCanvasEditor else { // Something weird happens with our saving. Where we are relying on these scene changes being called. - AZ::Data::AssetId previousAssetId = m_activeAssetId; + ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; - OnChangeActiveGraphTab(AZ::Data::AssetId()); + OnChangeActiveGraphTab(ScriptCanvasEditor::SourceHandle()); OnChangeActiveGraphTab(previousAssetId); } @@ -1984,17 +2001,17 @@ namespace ScriptCanvasEditor UnblockCloseRequests(); } - bool MainWindow::ActivateAndSaveAsset(const AZ::Data::AssetId& unsavedAssetId, const Callbacks::OnSave& saveCB) + bool MainWindow::ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId, const Callbacks::OnSave& saveCB) { SetActiveAsset(unsavedAssetId); return OnFileSave(saveCB); } - void MainWindow::SaveAsset(AZ::Data::AssetId assetId, const Callbacks::OnSave& onSave) + void MainWindow::SaveAsset(ScriptCanvasEditor::SourceHandle assetId, const Callbacks::OnSave& onSave) { PrepareAssetForSave(assetId); - auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, AZ::Data::AssetId previousAssetId) + auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle previousAssetId) { OnSaveCallback(saveSuccess, asset, previousAssetId); if (onSave) @@ -2007,7 +2024,7 @@ namespace ScriptCanvasEditor UpdateSaveState(); ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); // Disable the current view if we are saving. if (memoryAsset) @@ -2018,11 +2035,11 @@ namespace ScriptCanvasEditor BlockCloseRequests(); } - void MainWindow::SaveNewAsset(AZStd::string_view path, AZ::Data::AssetId inMemoryAssetId, const Callbacks::OnSave& onSave) + void MainWindow::SaveNewAsset(AZStd::string_view path, ScriptCanvasEditor::SourceHandle inMemoryAssetId, const Callbacks::OnSave& onSave) { PrepareAssetForSave(inMemoryAssetId); - auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, AZ::Data::AssetId previousAssetId) + auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle previousAssetId) { OnSaveCallback(saveSuccess, asset, previousAssetId); if (onSave) @@ -2052,7 +2069,7 @@ namespace ScriptCanvasEditor EBUS_EVENT_RESULT(serializeContext, AZ::ComponentApplicationBus, GetSerializeContext); AZ_Assert(serializeContext, "Failed to acquire application serialize context."); - AZ::Data::AssetId openId = ReadRecentAssetId(); + ScriptCanvasEditor::SourceHandle openId = ReadRecentAssetId(); AZStd::string assetRoot; { @@ -2456,7 +2473,7 @@ namespace ScriptCanvasEditor void MainWindow::UpdateWorkspaceStatus(const ScriptCanvasMemoryAsset& memoryAsset) { - AZ::Data::AssetId fileAssetId = memoryAsset.GetFileAssetId(); + ScriptCanvasEditor::SourceHandle fileAssetId = memoryAsset.GetFileAssetId(); size_t eraseCount = m_loadingAssets.erase(fileAssetId); @@ -2519,7 +2536,7 @@ namespace ScriptCanvasEditor { if (m_allowAutoSave) { - const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(m_activeAssetId); + const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(m_activeGraph); if (fileState != Tracker::ScriptCanvasFileState::INVALID && fileState != Tracker::ScriptCanvasFileState::NEW) { OnFileSaveCaller(); @@ -2528,7 +2545,7 @@ namespace ScriptCanvasEditor } //! GeneralRequestBus - void MainWindow::OnChangeActiveGraphTab(AZ::Data::AssetId assetId) + void MainWindow::OnChangeActiveGraphTab(ScriptCanvasEditor::SourceHandle assetId) { SetActiveAsset(assetId); } @@ -2536,14 +2553,14 @@ namespace ScriptCanvasEditor AZ::EntityId MainWindow::GetActiveGraphCanvasGraphId() const { AZ::EntityId graphId; - AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, m_activeGraph); return graphId; } ScriptCanvas::ScriptCanvasId MainWindow::GetActiveScriptCanvasId() const { ScriptCanvas::ScriptCanvasId sceneId; - AssetTrackerRequestBus::BroadcastResult(sceneId, &AssetTrackerRequests::GetScriptCanvasId, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(sceneId, &AssetTrackerRequests::GetScriptCanvasId, m_activeGraph); return sceneId; } @@ -2555,14 +2572,14 @@ namespace ScriptCanvasEditor return graphCanvasId; } - GraphCanvas::GraphId MainWindow::FindGraphCanvasGraphIdByAssetId(const AZ::Data::AssetId& assetId) const + GraphCanvas::GraphId MainWindow::FindGraphCanvasGraphIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const { AZ::EntityId graphId; AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, assetId); return graphId; } - ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const AZ::Data::AssetId& assetId) const + ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const { ScriptCanvas::ScriptCanvasId scriptCanvasId; AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasId, assetId); @@ -2602,14 +2619,14 @@ namespace ScriptCanvasEditor return isActive; } - QVariant MainWindow::GetTabData(const AZ::Data::AssetId& assetId) + QVariant MainWindow::GetTabData(const ScriptCanvasEditor::SourceHandle& assetId) { for (int tabIndex = 0; tabIndex < m_tabBar->count(); ++tabIndex) { QVariant tabdata = m_tabBar->tabData(tabIndex); if (tabdata.isValid()) { - auto tabAssetId = tabdata.value(); + auto tabAssetId = tabdata.value(); if (tabAssetId == assetId) { return tabdata; @@ -2619,7 +2636,7 @@ namespace ScriptCanvasEditor return QVariant(); } - bool MainWindow::IsTabOpen(const AZ::Data::AssetId& fileAssetId, int& outTabIndex) const + bool MainWindow::IsTabOpen(const ScriptCanvasEditor::SourceHandle& fileAssetId, int& outTabIndex) const { int tabIndex = m_tabBar->FindTab(fileAssetId); if (-1 != tabIndex) @@ -2630,7 +2647,7 @@ namespace ScriptCanvasEditor return false; } - void MainWindow::ReconnectSceneBuses(AZ::Data::AssetId previousAssetId, AZ::Data::AssetId nextAssetId) + void MainWindow::ReconnectSceneBuses(ScriptCanvasEditor::SourceHandle previousAssetId, ScriptCanvasEditor::SourceHandle nextAssetId) { ScriptCanvasMemoryAsset::pointer previousAsset; AssetTrackerRequestBus::BroadcastResult(previousAsset, &AssetTrackerRequests::GetAsset, previousAssetId); @@ -2666,14 +2683,14 @@ namespace ScriptCanvasEditor } - void MainWindow::SetActiveAsset(const AZ::Data::AssetId& fileAssetId) + void MainWindow::SetActiveAsset(const ScriptCanvasEditor::SourceHandle& fileAssetId) { - if (m_activeAssetId == fileAssetId) + if (m_activeGraph == fileAssetId) { return; } - AssetHelpers::PrintInfo("SetActiveAsset : from: %s to %s", AssetHelpers::AssetIdToString(m_activeAssetId).c_str(), AssetHelpers::AssetIdToString(fileAssetId).c_str()); + AssetHelpers::PrintInfo("SetActiveAsset : from: %s to %s", AssetHelpers::AssetIdToString(m_activeGraph).c_str(), AssetHelpers::AssetIdToString(fileAssetId).c_str()); if (fileAssetId.IsValid()) { @@ -2688,10 +2705,10 @@ namespace ScriptCanvasEditor } } - if (m_activeAssetId.IsValid()) + if (m_activeGraph.IsValid()) { ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); // If we are saving the asset, the Id may have changed from the in-memory to the file asset Id, in that case, // there's no need to hide the view or remove the widget @@ -2704,23 +2721,23 @@ namespace ScriptCanvasEditor if (fileAssetId.IsValid()) { - AZ::Data::AssetId previousAssetId = m_activeAssetId; + ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; - m_activeAssetId = fileAssetId; + m_activeGraph = fileAssetId; RefreshActiveAsset(); - ReconnectSceneBuses(previousAssetId, m_activeAssetId); + ReconnectSceneBuses(previousAssetId, m_activeGraph); } else { - AZ::Data::AssetId previousAssetId = m_activeAssetId; + ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; - m_activeAssetId.SetInvalid(); + m_activeGraph.SetInvalid(); m_emptyCanvas->show(); - ReconnectSceneBuses(previousAssetId, m_activeAssetId); + ReconnectSceneBuses(previousAssetId, m_activeGraph); - SignalActiveSceneChanged(AZ::Data::AssetId()); + SignalActiveSceneChanged(ScriptCanvasEditor::SourceHandle()); } UpdateUndoCache(fileAssetId); @@ -2730,12 +2747,12 @@ namespace ScriptCanvasEditor void MainWindow::RefreshActiveAsset() { - if (m_activeAssetId.IsValid()) + if (m_activeGraph.IsValid()) { - AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeAssetId (%s)", AssetHelpers::AssetIdToString(m_activeAssetId).c_str()); + AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", AssetHelpers::AssetIdToString(m_activeGraph).c_str()); ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); if (memoryAsset) { @@ -2754,7 +2771,7 @@ namespace ScriptCanvasEditor AZ_Assert(view, "Asset should have a view"); if (view) { - AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeAssetId (%s)", AssetHelpers::AssetIdToString(m_activeAssetId).c_str()); + AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", AssetHelpers::AssetIdToString(m_activeGraph).c_str()); view->ShowScene(sceneEntityId); m_layout->addWidget(view); @@ -2763,7 +2780,7 @@ namespace ScriptCanvasEditor m_emptyCanvas->hide(); } - SignalActiveSceneChanged(m_activeAssetId); + SignalActiveSceneChanged(m_activeGraph); } } else @@ -2794,7 +2811,7 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto fileAssetId = tabdata.value(); + auto fileAssetId = tabdata.value(); Tracker::ScriptCanvasFileState fileState; AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); @@ -2821,7 +2838,7 @@ namespace ScriptCanvasEditor if (saveDialogResults == UnsavedChangesOptions::SAVE) { - auto saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr asset, AZ::Data::AssetId) + auto saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle) { if (isSuccessful) { @@ -2862,7 +2879,7 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto assetId = tabdata.value(); + auto assetId = tabdata.value(); SaveAssetImpl(assetId, nullptr); } @@ -2881,7 +2898,7 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto assetId = tabdata.value(); + auto assetId = tabdata.value(); m_isClosingTabs = true; m_skipTabOnClose = assetId; @@ -2897,7 +2914,7 @@ namespace ScriptCanvasEditor { QClipboard* clipBoard = QGuiApplication::clipboard(); - auto assetId = tabdata.value(); + auto assetId = tabdata.value(); ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -2938,7 +2955,7 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(tab); if (tabdata.isValid()) { - auto assetId = tabdata.value(); + auto assetId = tabdata.value(); if (assetId != m_skipTabOnClose) { @@ -2958,9 +2975,9 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto tabAssetId = tabdata.value(); + auto tabAssetId = tabdata.value(); - if (tabAssetId == m_activeAssetId) + if (tabAssetId == m_activeGraph) { SetActiveAsset({}); } @@ -3164,7 +3181,7 @@ namespace ScriptCanvasEditor bool hasCopiableSelection = false; bool hasSelection = false; - if (m_activeAssetId.IsValid()) + if (m_activeGraph.IsValid()) { if (graphCanvasGraphId.IsValid()) { @@ -3552,7 +3569,7 @@ namespace ScriptCanvasEditor m_isRestoringWorkspace = true; } - void MainWindow::OnWorkspaceRestoreEnd(AZ::Data::AssetId lastFocusAsset) + void MainWindow::OnWorkspaceRestoreEnd(ScriptCanvasEditor::SourceHandle lastFocusAsset) { if (m_isRestoringWorkspace) { @@ -3568,7 +3585,7 @@ namespace ScriptCanvasEditor SetActiveAsset(lastFocusAsset); } - if (!m_activeAssetId.IsValid()) + if (!m_activeGraph.IsValid()) { if (m_tabBar->count() > 0) { @@ -3591,11 +3608,11 @@ namespace ScriptCanvasEditor void MainWindow::UpdateAssignToSelectionState() { - bool buttonEnabled = m_activeAssetId.IsValid(); + bool buttonEnabled = m_activeGraph.IsValid(); if (buttonEnabled) { - const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(m_activeAssetId); + const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(m_activeGraph); if (fileState == Tracker::ScriptCanvasFileState::INVALID || fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED) { buttonEnabled = false; @@ -3624,18 +3641,18 @@ namespace ScriptCanvasEditor void MainWindow::UpdateSaveState() { - bool enabled = m_activeAssetId.IsValid(); + bool enabled = m_activeGraph.IsValid(); bool isSaving = false; bool hasModifications = false; if (enabled) { - Tracker::ScriptCanvasFileState fileState = GetAssetFileState(m_activeAssetId); + Tracker::ScriptCanvasFileState fileState = GetAssetFileState(m_activeGraph); hasModifications = ( fileState == Tracker::ScriptCanvasFileState::MODIFIED || fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED); - AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, m_activeGraph); } ui->action_Save->setEnabled(enabled && !isSaving && hasModifications); @@ -3837,14 +3854,14 @@ namespace ScriptCanvasEditor return findChild(elementName); } - AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId(const AZ::Data::AssetId& assetId, AZ::EntityId assetNodeId) const + AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId assetNodeId) const { AZ::EntityId editorEntityId; AssetTrackerRequestBus::BroadcastResult(editorEntityId, &AssetTrackerRequests::GetEditorEntityIdFromSceneEntityId, assetId, assetNodeId); return editorEntityId; } - AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId(const AZ::Data::AssetId& assetId, AZ::EntityId editorNodeId) const + AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId editorNodeId) const { AZ::EntityId sceneEntityId; AssetTrackerRequestBus::BroadcastResult(sceneEntityId, &AssetTrackerRequests::GetSceneEntityIdFromEditorEntityId, assetId, editorNodeId); @@ -3961,7 +3978,7 @@ namespace ScriptCanvasEditor OnFileNew(); - if (m_activeAssetId.IsValid()) + if (m_activeGraph.IsValid()) { graphId = GetActiveGraphCanvasGraphId(); } @@ -4265,10 +4282,10 @@ namespace ScriptCanvasEditor void MainWindow::PrepareActiveAssetForSave() { - PrepareAssetForSave(m_activeAssetId); + PrepareAssetForSave(m_activeGraph); } - void MainWindow::PrepareAssetForSave(const AZ::Data::AssetId& assetId) + void MainWindow::PrepareAssetForSave(const ScriptCanvasEditor::SourceHandle& assetId) { ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -4337,7 +4354,7 @@ namespace ScriptCanvasEditor void MainWindow::OnAssignToSelectedEntities() { Tracker::ScriptCanvasFileState fileState; - AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, m_activeGraph); bool isDocumentOpen = false; AzToolsFramework::EditorRequests::Bus::BroadcastResult(isDocumentOpen, &AzToolsFramework::EditorRequests::IsLevelDocumentOpen); @@ -4398,7 +4415,7 @@ namespace ScriptCanvasEditor void MainWindow::OnAssignToEntity(const AZ::EntityId& entityId) { - Tracker::ScriptCanvasFileState fileState = GetAssetFileState(m_activeAssetId); + Tracker::ScriptCanvasFileState fileState = GetAssetFileState(m_activeGraph); if (fileState == Tracker::ScriptCanvasFileState::MODIFIED || fileState == Tracker::ScriptCanvasFileState::UNMODIFIED) @@ -4407,7 +4424,7 @@ namespace ScriptCanvasEditor } } - ScriptCanvasEditor::Tracker::ScriptCanvasFileState MainWindow::GetAssetFileState(AZ::Data::AssetId assetId) const + ScriptCanvasEditor::Tracker::ScriptCanvasFileState MainWindow::GetAssetFileState(ScriptCanvasEditor::SourceHandle assetId) const { Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, assetId); @@ -4460,7 +4477,7 @@ namespace ScriptCanvasEditor if (usableRequestBus) { ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); if (memoryAsset) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 7672f0a199..77a85ec448 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -43,7 +43,7 @@ #include #include #include - +#include #include #include #include @@ -175,9 +175,9 @@ namespace ScriptCanvasEditor private: void OnAssetReady(const ScriptCanvasMemoryAsset::pointer asset) override; - void SignalAssetComplete(const AZ::Data::AssetId& fileAssetId); + void SignalAssetComplete(const ScriptCanvasEditor::SourceHandle& fileAssetId); - AZ::Data::AssetId GetSourceAssetId(const AZ::Data::AssetId& memoryAssetId) const; + ScriptCanvasEditor::SourceHandle GetSourceAssetId(const ScriptCanvasEditor::SourceHandle& memoryAssetId) const; bool m_rememberOpenCanvases; MainWindow* m_mainWindow; @@ -185,10 +185,10 @@ namespace ScriptCanvasEditor //! Setting focus is problematic unless it is done until after all currently loading graphs have finished loading //! This vector is used to track the list of graphs being opened to restore the workspace and as assets are fully //! ready and activated they are removed from this list. - AZStd::vector m_loadingAssets; + AZStd::vector m_loadingAssets; //! During restore we queue the asset Id to focus in order to do it last - AZ::Data::AssetId m_queuedAssetFocus; + ScriptCanvasEditor::SourceHandle m_queuedAssetFocus; }; enum class UnsavedChangesOptions; @@ -269,7 +269,7 @@ namespace ScriptCanvasEditor // Undo Handlers void PostUndoPoint(ScriptCanvas::ScriptCanvasId scriptCanvasId) override; - void SignalSceneDirty(AZ::Data::AssetId assetId) override; + void SignalSceneDirty(ScriptCanvasEditor::SourceHandle assetId) override; void PushPreventUndoStateUpdate() override; void PopPreventUndoStateUpdate() override; @@ -329,8 +329,8 @@ namespace ScriptCanvasEditor bool OnFileSaveAs(const Callbacks::OnSave& saveCB); bool OnFileSaveCaller(){return OnFileSave(nullptr);}; bool OnFileSaveAsCaller(){return OnFileSaveAs(nullptr);}; - bool SaveAssetImpl(const AZ::Data::AssetId& assetId, const Callbacks::OnSave& saveCB); - bool SaveAssetAsImpl(const AZ::Data::AssetId& assetId, const Callbacks::OnSave& saveCB); + bool SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB); + bool SaveAssetAsImpl(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB); void OnFileOpen(); // Edit menu @@ -415,17 +415,17 @@ namespace ScriptCanvasEditor void CloseNextTab(); - bool IsTabOpen(const AZ::Data::AssetId& assetId, int& outTabIndex) const; - QVariant GetTabData(const AZ::Data::AssetId& assetId); + bool IsTabOpen(const ScriptCanvasEditor::SourceHandle& assetId, int& outTabIndex) const; + QVariant GetTabData(const ScriptCanvasEditor::SourceHandle& assetId); //! GeneralRequestBus - AZ::Outcome OpenScriptCanvasAssetId(const AZ::Data::AssetId& assetId) override; - AZ::Outcome OpenScriptCanvasAsset(AZ::Data::AssetId scriptCanvasAssetId, int tabIndex = -1) override; + AZ::Outcome OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& assetId) override; + AZ::Outcome OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, int tabIndex = -1) override; AZ::Outcome OpenScriptCanvasAsset(const ScriptCanvasMemoryAsset& scriptCanvasAsset, int tabIndex = -1); - int CloseScriptCanvasAsset(const AZ::Data::AssetId& assetId) override; + int CloseScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) override; bool CreateScriptCanvasAssetFor(const TypeDefs::EntityComponentId& requestingEntityId) override; - bool IsScriptCanvasAssetOpen(const AZ::Data::AssetId& assetId) const override; + bool IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& assetId) const override; const CategoryInformation* FindNodePaletteCategoryInformation(AZStd::string_view categoryPath) const override; const NodePaletteModelInformation* FindNodePaletteModelInformation(const ScriptCanvas::NodeTypeIdentifier& nodeType) const override; @@ -437,8 +437,8 @@ namespace ScriptCanvasEditor void RefreshScriptCanvasAsset(const AZ::Data::Asset& scriptCanvasAsset); //! Removes the assetId -> ScriptCanvasAsset mapping and disconnects from the asset tracker - void RemoveScriptCanvasAsset(const AZ::Data::AssetId& assetId); - void OnChangeActiveGraphTab(AZ::Data::AssetId) override; + void RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId); + void OnChangeActiveGraphTab(ScriptCanvasEditor::SourceHandle) override; void CreateNewRuntimeAsset() override { OnFileNew(); } @@ -448,8 +448,8 @@ namespace ScriptCanvasEditor GraphCanvas::GraphId GetGraphCanvasGraphId(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) const override; - GraphCanvas::GraphId FindGraphCanvasGraphIdByAssetId(const AZ::Data::AssetId& assetId) const override; - ScriptCanvas::ScriptCanvasId FindScriptCanvasIdByAssetId(const AZ::Data::AssetId& assetId) const override; + GraphCanvas::GraphId FindGraphCanvasGraphIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const override; + ScriptCanvas::ScriptCanvasId FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const override; bool IsInUndoRedo(const AZ::EntityId& graphCanvasGraphId) const override; bool IsScriptCanvasInUndoRedo(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) const override; @@ -517,8 +517,8 @@ namespace ScriptCanvasEditor QObject* FindElementByName(QString elementName) override; //// - AZ::EntityId FindEditorNodeIdByAssetNodeId(const AZ::Data::AssetId& assetId, AZ::EntityId assetNodeId) const override; - AZ::EntityId FindAssetNodeIdByEditorNodeId(const AZ::Data::AssetId& assetId, AZ::EntityId editorNodeId) const override; + AZ::EntityId FindEditorNodeIdByAssetNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId assetNodeId) const override; + AZ::EntityId FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId editorNodeId) const override; private: void DeleteNodes(const AZ::EntityId& sceneId, const AZStd::vector& nodes) override; @@ -546,26 +546,23 @@ namespace ScriptCanvasEditor //! Helper function which serializes a file to disk //! \param filename name of file to serialize the Entity //! \param asset asset to save - void GetSuggestedFullFilenameToSaveAs(const AZ::Data::AssetId& assetId, AZStd::string& filePath, AZStd::string& fileFilter); + void GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& assetId, AZStd::string& filePath, AZStd::string& fileFilter); - void MarkAssetModified(const AZ::Data::AssetId& assetId); + void MarkAssetModified(const ScriptCanvasEditor::SourceHandle& assetId); // QMainWindow void closeEvent(QCloseEvent *event) override; UnsavedChangesOptions ShowSaveDialog(const QString& filename); - bool ActivateAndSaveAsset(const AZ::Data::AssetId& unsavedAssetId, const Callbacks::OnSave& onSave); + bool ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId, const Callbacks::OnSave& onSave); - void SaveNewAsset(AZStd::string_view path, AZ::Data::AssetId assetId, const Callbacks::OnSave& onSave); - void SaveAsset(AZ::Data::AssetId assetId, const Callbacks::OnSave& onSave); + void SaveNewAsset(AZStd::string_view path, ScriptCanvasEditor::SourceHandle assetId, const Callbacks::OnSave& onSave); + void SaveAsset(ScriptCanvasEditor::SourceHandle assetId, const Callbacks::OnSave& onSave); void OpenFile(const char* fullPath); void CreateMenus(); - void SignalActiveSceneChanged(const AZ::Data::AssetId assetId); - - void SaveWorkspace(bool updateAssetList = true); - void RestoreWorkspace(); + void SignalActiveSceneChanged(const ScriptCanvasEditor::SourceHandle assetId); void RunUpgradeTool(); @@ -593,7 +590,7 @@ namespace ScriptCanvasEditor void UpdateMenuState(bool enabledState); void OnWorkspaceRestoreStart(); - void OnWorkspaceRestoreEnd(AZ::Data::AssetId lastFocusAsset); + void OnWorkspaceRestoreEnd(ScriptCanvasEditor::SourceHandle lastFocusAsset); void UpdateAssignToSelectionState(); void UpdateUndoRedoState(); @@ -604,18 +601,16 @@ namespace ScriptCanvasEditor void CreateFunctionDefinitionNode(int positionOffset); - int CreateAssetTab(const AZ::Data::AssetId& assetId, int tabIndex = -1); + int CreateAssetTab(const ScriptCanvasEditor::SourceHandle& assetId, int tabIndex = -1); //! \param asset The AssetId of the ScriptCanvas Asset. - void SetActiveAsset(const AZ::Data::AssetId& assetId); + void SetActiveAsset(const ScriptCanvasEditor::SourceHandle& assetId); void RefreshActiveAsset(); - void ReconnectSceneBuses(AZ::Data::AssetId previousAssetId, AZ::Data::AssetId nextAssetId); - - void SignalBatchOperationComplete(BatchOperatorTool* batchTool); + void ReconnectSceneBuses(ScriptCanvasEditor::SourceHandle previousAssetId, ScriptCanvasEditor::SourceHandle nextAssetId); void PrepareActiveAssetForSave(); - void PrepareAssetForSave(const AZ::Data::AssetId& asssetId); + void PrepareAssetForSave(const ScriptCanvasEditor::SourceHandle& asssetId); void RestartAutoTimerSave(bool forceTimer = false); @@ -626,9 +621,9 @@ namespace ScriptCanvasEditor void AssignGraphToEntityImpl(const AZ::EntityId& entityId); //// - Tracker::ScriptCanvasFileState GetAssetFileState(AZ::Data::AssetId assetId) const; + Tracker::ScriptCanvasFileState GetAssetFileState(ScriptCanvasEditor::SourceHandle assetId) const; - AZ::Data::AssetId GetSourceAssetId(const AZ::Data::AssetId& memoryAssetId) const + ScriptCanvasEditor::SourceHandle GetSourceAssetId(const ScriptCanvasEditor::SourceHandle& memoryAssetId) const { ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, memoryAssetId); @@ -638,12 +633,12 @@ namespace ScriptCanvasEditor return memoryAsset->GetFileAssetId(); } - return AZ::Data::AssetId(); + return ScriptCanvasEditor::SourceHandle(); } - int InsertTabForAsset(AZStd::string_view assetPath, AZ::Data::AssetId assetId, int tabIndex = -1); + int InsertTabForAsset(AZStd::string_view assetPath, ScriptCanvasEditor::SourceHandle assetId, int tabIndex = -1); - void UpdateUndoCache(AZ::Data::AssetId assetId); + void UpdateUndoCache(ScriptCanvasEditor::SourceHandle assetId); bool HasSystemTickAction(SystemTickActionFlag action); @@ -741,22 +736,22 @@ namespace ScriptCanvasEditor GraphCanvas::GraphCanvasEditorEmptyDockWidget* m_emptyCanvas; // Displayed when there is no open graph QVBoxLayout* m_layout; - AZ::Data::AssetId m_activeAssetId; - + ScriptCanvasEditor::SourceHandle m_activeGraph; + bool m_loadingNewlySavedFile; AZStd::string m_newlySavedFile; AZStd::string m_errorFilePath; bool m_isClosingTabs; - AZ::Data::AssetId m_skipTabOnClose; + ScriptCanvasEditor::SourceHandle m_skipTabOnClose; bool m_enterState; bool m_ignoreSelection; AZ::s32 m_preventUndoStateUpdateCount; bool m_isRestoringWorkspace; - AZ::Data::AssetId m_queuedFocusOverride; + ScriptCanvasEditor::SourceHandle m_queuedFocusOverride; Ui::MainWindow* ui; AZStd::array, c_scriptCanvasEditorSettingsRecentFilesCountMax> m_recentActions; @@ -778,17 +773,17 @@ namespace ScriptCanvasEditor AZStd::vector m_selectedVariableIds; AZ::u32 m_systemTickActions; - AZStd::unordered_set< AZ::Data::AssetId > m_processedClosedAssetIds; + AZStd::unordered_set< ScriptCanvasEditor::SourceHandle > m_processedClosedAssetIds; - AZStd::unordered_set< AZ::Data::AssetId > m_loadingWorkspaceAssets; - AZStd::unordered_set< AZ::Data::AssetId > m_loadingAssets; + AZStd::unordered_set< ScriptCanvasEditor::SourceHandle > m_loadingWorkspaceAssets; + AZStd::unordered_set< ScriptCanvasEditor::SourceHandle > m_loadingAssets; AZStd::unordered_set< AZ::Uuid > m_variablePaletteTypes; AZStd::unordered_map< AZ::Crc32, QObject* > m_automationLookUpMap; bool m_closeCurrentGraphAfterSave; - AZStd::unordered_map< AZ::Data::AssetId, TypeDefs::EntityComponentId > m_assetCreationRequests; + AZStd::unordered_map< ScriptCanvasEditor::SourceHandle, TypeDefs::EntityComponentId > m_assetCreationRequests; ScriptCanvas::Debugger::ClientTransceiver m_clientTRX; GraphCanvas::StyleManager m_styleManager; @@ -797,6 +792,6 @@ namespace ScriptCanvasEditor //! this object manages the Save/Restore operations Workspace* m_workspace; - void OnSaveCallback(bool saveSuccess, AZ::Data::AssetPtr, AZ::Data::AssetId previousFileAssetId); + void OnSaveCallback(bool saveSuccess, AZ::Data::AssetPtr, ScriptCanvasEditor::SourceHandle previousFileAssetId); }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetBase.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetBase.h index 265c35d310..1dc0b38e01 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetBase.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetBase.h @@ -8,16 +8,17 @@ #pragma once +#include #include #include #include - #include namespace ScriptCanvas { class ScriptCanvasAssetBase : public AZ::Data::AssetData + , public AZStd::enable_shared_from_this , ScriptCanvas::ScriptCanvasAssetBusRequestBus::Handler { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 0e64c19dcb..85f76280d2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -26,6 +26,8 @@ #define OBJECT_STREAM_EDITOR_ASSET_LOADING_SUPPORT_ENABLED +#define EDITOR_ASSET_SUPPORT_ENABLED + namespace AZ { class Entity; @@ -61,6 +63,10 @@ namespace ScriptCanvas class Node; class Edge; + class Graph; + + using GraphPtr = Graph*; + using GraphPtrConst = const Graph*; using ID = AZ::EntityId; @@ -297,6 +303,24 @@ namespace ScriptCanvas void ReflectEventTypeOnDemand(const AZ::TypeId& typeId, AZStd::string_view name, AZ::IRttiHelper* rttiHelper = nullptr); } +namespace ScriptCanvas +{ + class ScriptCanvasData; + + using DataPtr = AZStd::shared_ptr; + using DataPtrConst = AZStd::shared_ptr; +} + +namespace ScriptCanvasEditor +{ + class Graph; + + using GraphPtr = Graph*; + using GraphPtrConst = const Graph*; + + class SourceHandle; +} + namespace AZStd { template<> diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h index 46e8a103bb..786e693a04 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h @@ -14,14 +14,12 @@ #include #include #include - #include #include #include #include #include #include - #include namespace ScriptCanvas @@ -209,7 +207,7 @@ namespace ScriptCanvas GraphVariableManagerRequests* m_variableRequests = nullptr; // Keeps a mapping of the Node EntityId -> NodeComponent. - // Saves looking up the NodeComponent everytime we need the Node. + // Saves looking up the NodeComponent every time we need the Node. AZStd::unordered_map m_nodeMapping; bool m_isObserved; diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index 609f7cd454..49f89d8e48 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -27,7 +27,11 @@ set(FILES Editor/Assets/ScriptCanvasAsset.cpp Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetBus.h Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetTypes.h + Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h + Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h + Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetHandler.h + Editor/Assets/ScriptCanvasFileHandling.cpp Editor/Assets/ScriptCanvasAssetHandler.cpp Editor/Assets/ScriptCanvasAssetHolder.h Editor/Assets/ScriptCanvasAssetHolder.cpp From c5cd8541729c63779c934a8c85bfd8008355f79a Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 18 Oct 2021 11:56:14 -0700 Subject: [PATCH 026/399] Git MainWindow.cpp to point where it compiles, and reveals the radius of changes for everything to work without assets Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Editor/Assets/ScriptCanvasAssetTracker.h | 3 + .../Assets/ScriptCanvasSourceFileHandle.cpp | 52 -- .../Assets/ScriptCanvasSourceFileHandle.h | 37 - .../ScriptCanvas/Bus/EditorScriptCanvasBus.h | 2 - .../Include/ScriptCanvas/Bus/RequestBus.h | 14 +- .../ScriptCanvas/Components/EditorGraph.h | 6 +- Gems/ScriptCanvas/Code/Editor/QtMetaTypes.h | 4 +- Gems/ScriptCanvas/Code/Editor/Settings.h | 13 +- .../Code/Editor/Utilities/RecentAssetPath.cpp | 4 +- .../Code/Editor/Utilities/RecentAssetPath.h | 4 +- .../View/Widgets/AssetGraphSceneDataBus.h | 6 +- .../Code/Editor/View/Widgets/GraphTabBar.h | 14 +- .../Code/Editor/View/Windows/MainWindow.cpp | 746 ++++++++++-------- .../Code/Editor/View/Windows/MainWindow.h | 24 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 51 ++ .../Code/Include/ScriptCanvas/Core/Core.h | 36 +- 16 files changed, 536 insertions(+), 480 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h index 78e85651e1..b55e5c06c8 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h @@ -22,6 +22,9 @@ namespace ScriptCanvasEditor { class ScriptCanvasMemoryAsset; + + // MOVE THIS MOSTLY TO TAB BAR, MAIN WINDOW AND THE CANVAS WIDGET + // This class tracks all things related to the assets that the Script Canvas editor // has in play. It also provides helper functionality to quickly getting asset information // from GraphCanvas diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp index e6ed773e83..258a862a19 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp @@ -7,55 +7,3 @@ */ #include -#include - -namespace ScriptCanvasEditor -{ - SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path) - : m_data(graph) - , m_id(id) - , m_path(path) - {} - - void SourceHandle::Clear() - { - m_data = nullptr; - m_id = AZ::Uuid::CreateNull(); - m_path.clear(); - } - - GraphPtrConst SourceHandle::Get() const - { - return m_data ? m_data->GetEditorGraph() : nullptr; - } - - const AZ::Uuid& SourceHandle::Id() const - { - return m_id; - } - - bool SourceHandle::IsValid() const - { - return *this; - } - - GraphPtr SourceHandle::Mod() const - { - return m_data ? m_data->ModEditorGraph() : nullptr; - } - - SourceHandle::operator bool() const - { - return m_data != nullptr; - } - - bool SourceHandle::operator!() const - { - return m_data == nullptr; - } - - const AZStd::string& SourceHandle::Path() const - { - return m_path; - } -} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h index 045221310a..1d14b9b21b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h @@ -8,40 +8,3 @@ #pragma once -#include -#include - -namespace ScriptCanvasEditor -{ - class SourceHandle - { - public: - AZ_TYPE_INFO(SourceHandle, "{65855A98-AE2F-427F-BFC8-69D45265E312}"); - AZ_CLASS_ALLOCATOR(SourceHandle, AZ::SystemAllocator, 0); - - SourceHandle() = default; - - SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path); - - void Clear(); - - GraphPtrConst Get() const; - - const AZ::Uuid& Id() const; - - bool IsValid() const; - - GraphPtr Mod() const; - - operator bool() const; - - bool operator!() const; - - const AZStd::string& Path() const; - - private: - ScriptCanvas::DataPtr m_data; - AZ::Uuid m_id = AZ::Uuid::CreateNull(); - AZStd::string m_path; - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h index 7e7b600081..7c57d661f0 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h @@ -121,8 +121,6 @@ namespace ScriptCanvasEditor static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; using BusIdType = ScriptCanvas::ScriptCanvasId; - virtual void SetAssetId(const AZ::Data::AssetId& assetId) = 0; - virtual void CreateGraphCanvasScene() = 0; virtual void ClearGraphCanvasScene() = 0; virtual GraphCanvas::GraphId GetGraphCanvasGraphId() const = 0; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h index dedfdd8d20..2d9a7d6b58 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h @@ -70,16 +70,16 @@ namespace ScriptCanvasEditor //! Opens an existing graph and returns the tab index in which it was open in. //! \param File AssetId //! \return index of open tab if the asset was able to be open successfully or error message of why the open failed - virtual AZ::Outcome OpenScriptCanvasAsset(AZ::Data::AssetId scriptCanvasAssetId, int tabIndex = -1) = 0; - virtual AZ::Outcome OpenScriptCanvasAssetId(const AZ::Data::AssetId& scriptCanvasAsset) = 0; + virtual AZ::Outcome OpenScriptCanvasAsset(SourceHandle scriptCanvasAssetId, int tabIndex = -1) = 0; + virtual AZ::Outcome OpenScriptCanvasAssetId(const SourceHandle& scriptCanvasAsset) = 0; - virtual int CloseScriptCanvasAsset(const AZ::Data::AssetId&) = 0; + virtual int CloseScriptCanvasAsset(const SourceHandle&) = 0; virtual bool CreateScriptCanvasAssetFor(const TypeDefs::EntityComponentId& requestingComponent) = 0; - virtual bool IsScriptCanvasAssetOpen(const AZ::Data::AssetId& assetId) const = 0; + virtual bool IsScriptCanvasAssetOpen(const SourceHandle& assetId) const = 0; - virtual void OnChangeActiveGraphTab(AZ::Data::AssetId) {} + virtual void OnChangeActiveGraphTab(SourceHandle) {} virtual void CreateNewRuntimeAsset() = 0; @@ -103,12 +103,12 @@ namespace ScriptCanvasEditor return ScriptCanvas::ScriptCanvasId(); } - virtual GraphCanvas::GraphId FindGraphCanvasGraphIdByAssetId([[maybe_unused]] const AZ::Data::AssetId& assetId) const + virtual GraphCanvas::GraphId FindGraphCanvasGraphIdByAssetId([[maybe_unused]] const SourceHandle& assetId) const { return GraphCanvas::GraphId(); } - virtual ScriptCanvas::ScriptCanvasId FindScriptCanvasIdByAssetId([[maybe_unused]] const AZ::Data::AssetId& assetId) const + virtual ScriptCanvas::ScriptCanvasId FindScriptCanvasIdByAssetId([[maybe_unused]] const SourceHandle& assetId) const { return ScriptCanvas::ScriptCanvasId(); } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index 1d7ea0afbc..c0c8584cbd 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -141,7 +141,7 @@ namespace ScriptCanvasEditor //// // RuntimeBus - AZ::Data::AssetId GetAssetId() const override { return m_assetId; } + //AZ::Data::AssetId GetAssetId() const override { return m_assetId; } //// // GraphCanvas::GraphModelRequestBus @@ -224,7 +224,7 @@ namespace ScriptCanvasEditor /////////////////////////// // EditorGraphRequestBus - void SetAssetId(const AZ::Data::AssetId& assetId) override { m_assetId = assetId; } + // void SetAssetId(const AZ::Data::AssetId& assetId) override { m_assetId = assetId; } void CreateGraphCanvasScene() override; void ClearGraphCanvasScene() override; @@ -392,6 +392,6 @@ namespace ScriptCanvasEditor //! Defaults to true to signal that this graph does not have the GraphCanvas stuff intermingled bool m_saveFormatConverted = true; - AZ::Data::AssetId m_assetId; + ScriptCanvasEditor::SourceHandle m_assetId; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/QtMetaTypes.h b/Gems/ScriptCanvas/Code/Editor/QtMetaTypes.h index 9058e27b03..5e413f0266 100644 --- a/Gems/ScriptCanvas/Code/Editor/QtMetaTypes.h +++ b/Gems/ScriptCanvas/Code/Editor/QtMetaTypes.h @@ -11,11 +11,13 @@ AZ_PUSH_DISABLE_WARNING(4251 4800 4244, "-Wunknown-warning-option") #include AZ_POP_DISABLE_WARNING +#include #include #include - // VariableId is a UUID typedef for now. So we don't want to double reflect the UUID. Q_DECLARE_METATYPE(AZ::Uuid); Q_DECLARE_METATYPE(AZ::Data::AssetId); Q_DECLARE_METATYPE(ScriptCanvas::Data::Type); Q_DECLARE_METATYPE(ScriptCanvas::VariableId); +Q_DECLARE_METATYPE(ScriptCanvasEditor::SourceHandle); + diff --git a/Gems/ScriptCanvas/Code/Editor/Settings.h b/Gems/ScriptCanvas/Code/Editor/Settings.h index dee55f8272..8359e2a580 100644 --- a/Gems/ScriptCanvas/Code/Editor/Settings.h +++ b/Gems/ScriptCanvas/Code/Editor/Settings.h @@ -53,11 +53,10 @@ namespace ScriptCanvasEditor AZ_RTTI(WorkspaceAssetSaveData, "{927368CA-096F-4CF1-B2E0-1B9E4A93EA57}"); WorkspaceAssetSaveData(); - WorkspaceAssetSaveData(const AZ::Data::AssetId& assetId); + WorkspaceAssetSaveData(SourceHandle assetId); virtual ~WorkspaceAssetSaveData() = default; - AZ::Data::AssetId m_assetId; - AZ::Data::AssetType m_assetType; + SourceHandle m_assetId; }; @@ -69,9 +68,9 @@ namespace ScriptCanvasEditor EditorWorkspace() = default; - void ConfigureActiveAssets(AZ::Data::AssetId focusedAssetId, const AZStd::vector< WorkspaceAssetSaveData >& activeAssetIds); + void ConfigureActiveAssets(SourceHandle focusedAsset, const AZStd::vector< WorkspaceAssetSaveData >& activeAssetIds); - AZ::Data::AssetId GetFocusedAssetId() const; + SourceHandle GetFocusedAssetId() const; AZStd::vector< WorkspaceAssetSaveData > GetActiveAssetData() const; void Init(const QByteArray& windowState, const QByteArray& windowGeometry); @@ -79,7 +78,7 @@ namespace ScriptCanvasEditor void Clear() { - m_focusedAssetId.SetInvalid(); + m_focusedAssetId.Clear(); m_activeAssetData.clear(); } @@ -91,7 +90,7 @@ namespace ScriptCanvasEditor AZStd::vector m_windowGeometry; AZStd::vector m_windowState; - AZ::Data::AssetId m_focusedAssetId; + SourceHandle m_focusedAssetId; AZStd::vector< WorkspaceAssetSaveData > m_activeAssetData; }; diff --git a/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.cpp b/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.cpp index 06bbd29250..f2da3868de 100644 --- a/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.cpp @@ -15,7 +15,7 @@ namespace ScriptCanvasEditor { - AZ::Data::AssetId ReadRecentAssetId() + SourceHandle ReadRecentAssetId() { QSettings settings(QSettings::IniFormat, QSettings::UserScope, SCRIPTCANVASEDITOR_AZ_QCOREAPPLICATION_SETTINGS_ORGANIZATION_NAME); @@ -34,7 +34,7 @@ namespace ScriptCanvasEditor return assetId; } - void SetRecentAssetId(const AZ::Data::AssetId& assetId) + void SetRecentAssetId(SourceHandle assetId) { QSettings settings(QSettings::IniFormat, QSettings::UserScope, SCRIPTCANVASEDITOR_AZ_QCOREAPPLICATION_SETTINGS_ORGANIZATION_NAME); diff --git a/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.h b/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.h index 0aa4332ca4..35666d7c34 100644 --- a/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.h +++ b/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.h @@ -11,7 +11,7 @@ namespace ScriptCanvasEditor { - AZ::Data::AssetId ReadRecentAssetId(); - void SetRecentAssetId(const AZ::Data::AssetId& assetId); + SourceHandle ReadRecentAssetId(); + void SetRecentAssetId(SourceHandle assetId); void ClearRecentAssetId(); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/AssetGraphSceneDataBus.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/AssetGraphSceneDataBus.h index cbb8ef12d6..6d2c3280ac 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/AssetGraphSceneDataBus.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/AssetGraphSceneDataBus.h @@ -11,14 +11,16 @@ #include #include #include +#include namespace ScriptCanvasEditor { + // #sc-editor-asset remove this class AssetGraphScene : public AZ::EBusTraits { public: - virtual AZ::EntityId FindEditorNodeIdByAssetNodeId(const AZ::Data::AssetId& assetId, AZ::EntityId assetNodeId) const = 0; - virtual AZ::EntityId FindAssetNodeIdByEditorNodeId(const AZ::Data::AssetId& assetId, AZ::EntityId editorNodeId) const = 0; + virtual AZ::EntityId FindEditorNodeIdByAssetNodeId(const SourceHandle& assetId, AZ::EntityId assetNodeId) const = 0; + virtual AZ::EntityId FindAssetNodeIdByEditorNodeId(const SourceHandle& assetId, AZ::EntityId editorNodeId) const = 0; }; using AssetGraphSceneBus = AZ::EBus; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h index 47a5cb8651..490c17cc29 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h @@ -45,14 +45,14 @@ namespace ScriptCanvasEditor GraphTabBar(QWidget* parent = nullptr); ~GraphTabBar() override = default; - void AddGraphTab(const AZ::Data::AssetId& assetId); - int InsertGraphTab(int tabIndex, const AZ::Data::AssetId& assetId); - bool SelectTab(const AZ::Data::AssetId& assetId); + void AddGraphTab(ScriptCanvasEditor::SourceHandle assetId); + int InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId); + bool SelectTab(ScriptCanvasEditor::SourceHandle assetId); - void ConfigureTab(int tabIndex, AZ::Data::AssetId fileAssetId, const AZStd::string& tabName); + void ConfigureTab(int tabIndex, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName); - int FindTab(const AZ::Data::AssetId& assetId) const; - AZ::Data::AssetId FindAssetId(int tabIndex); + int FindTab(ScriptCanvasEditor::SourceHandle assetId) const; + ScriptCanvasEditor::SourceHandle FindAssetId(int tabIndex); void CloseTab(int index); void CloseAllTabs(); @@ -92,7 +92,7 @@ namespace ScriptCanvasEditor // Called when the selected tab changes void currentChangedTab(int index); - void SetFileState(AZ::Data::AssetId assetId, Tracker::ScriptCanvasFileState fileState); + void SetFileState(ScriptCanvasEditor::SourceHandle, Tracker::ScriptCanvasFileState fileState); int m_signalSaveOnChangeTo = -1; }; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index f2eeae1c3c..424ef60ecc 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -257,20 +257,12 @@ namespace ScriptCanvasEditor assetSaveData.m_assetId = sourceId; ScriptCanvas::ScriptCanvasId scriptCanvasId = m_mainWindow->FindScriptCanvasIdByAssetId(assetId); - - EditorGraphRequests* editorRequests = EditorGraphRequestBus::FindFirstHandler(scriptCanvasId); - - if (editorRequests) - { - assetSaveData.m_assetType = azrtti_typeid(); - } - activeAssets.push_back(assetSaveData); } } else if (assetId == focusedAssetId) { - focusedAssetId.SetInvalid(); + focusedAssetId.Clear(); } } @@ -326,36 +318,38 @@ namespace ScriptCanvasEditor m_queuedAssetFocus = workspace->GetFocusedAssetId(); - for (const auto& assetSaveData : workspace->GetActiveAssetData()) + // #sc-asset-editor + //for (const auto& assetSaveData : workspace->GetActiveAssetData()) { - AssetTrackerNotificationBus::MultiHandler::BusConnect(assetSaveData.m_assetId); - - Callbacks::OnAssetReadyCallback onAssetReady = [this, assetSaveData](ScriptCanvasMemoryAsset& asset) - { - // If we get an error callback. Just remove it from out active lists. - if (asset.IsSourceInError()) - { - if (assetSaveData.m_assetId == m_queuedAssetFocus) - { - m_queuedAssetFocus = ScriptCanvasEditor::SourceHandle(); - } - - SignalAssetComplete(asset.GetFileAssetId()); - } - }; - - bool loadedFile = true; - AssetTrackerRequestBus::BroadcastResult(loadedFile, &AssetTrackerRequests::Load, assetSaveData.m_assetId, assetSaveData.m_assetType, onAssetReady); - - if (!loadedFile) - { - if (assetSaveData.m_assetId == m_queuedAssetFocus) - { - m_queuedAssetFocus = ScriptCanvasEditor::SourceHandle(); - } - - SignalAssetComplete(assetSaveData.m_assetId); - } + // load all the files +// AssetTrackerNotificationBus::MultiHandler::BusConnect(assetSaveData.m_assetId); +// +// Callbacks::OnAssetReadyCallback onAssetReady = [this, assetSaveData](ScriptCanvasMemoryAsset& asset) +// { +// // If we get an error callback. Just remove it from out active lists. +// if (asset.IsSourceInError()) +// { +// if (assetSaveData.m_assetId == m_queuedAssetFocus) +// { +// m_queuedAssetFocus = ScriptCanvasEditor::SourceHandle(); +// } +// +// SignalAssetComplete(asset.GetFileAssetId()); +// } +// }; +// +// bool loadedFile = true; +// AssetTrackerRequestBus::BroadcastResult(loadedFile, &AssetTrackerRequests::Load, assetSaveData.m_assetId, assetSaveData.m_assetType, onAssetReady); +// +// if (!loadedFile) +// { +// if (assetSaveData.m_assetId == m_queuedAssetFocus) +// { +// m_queuedAssetFocus = ScriptCanvasEditor::SourceHandle(); +// } +// +// SignalAssetComplete(assetSaveData.m_assetId); +// } } } else @@ -367,45 +361,38 @@ namespace ScriptCanvasEditor void Workspace::OnAssetReady(const ScriptCanvasMemoryAsset::pointer memoryAsset) { - const ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset->GetFileAssetId(); - - if (AssetTrackerNotificationBus::MultiHandler::BusIsConnectedId(fileAssetId)) - { - AssetTrackerNotificationBus::MultiHandler::BusDisconnect(fileAssetId); - - m_mainWindow->OpenScriptCanvasAsset(*memoryAsset); - - SignalAssetComplete(fileAssetId); - } - } - - void Workspace::SignalAssetComplete(const ScriptCanvasEditor::SourceHandle& fileAssetId) - { - auto it = AZStd::find(m_loadingAssets.begin(), m_loadingAssets.end(), fileAssetId); - if (it != m_loadingAssets.end()) - { - m_loadingAssets.erase(it); - } - - //! When we are done loading all assets we can safely set the focus to the recorded asset - if (m_loadingAssets.empty()) - { - m_mainWindow->OnWorkspaceRestoreEnd(m_queuedAssetFocus); - m_queuedAssetFocus.SetInvalid(); - } + // open the file in the main window +// const ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset->GetFileAssetId(); +// +// if (AssetTrackerNotificationBus::MultiHandler::BusIsConnectedId(fileAssetId)) +// { +// AssetTrackerNotificationBus::MultiHandler::BusDisconnect(fileAssetId); +// +// m_mainWindow->OpenScriptCanvasAsset(*memoryAsset); +// +// SignalAssetComplete(fileAssetId); +// } + } + + void Workspace::SignalAssetComplete(const ScriptCanvasEditor::SourceHandle& /*fileAssetId*/) + { + // When we are done loading all assets we can safely set the focus to the recorded asset +// auto it = AZStd::find(m_loadingAssets.begin(), m_loadingAssets.end(), fileAssetId); +// if (it != m_loadingAssets.end()) +// { +// m_loadingAssets.erase(it); +// } +// +// if (m_loadingAssets.empty()) +// { +// m_mainWindow->OnWorkspaceRestoreEnd(m_queuedAssetFocus); +// m_queuedAssetFocus.SetInvalid(); +// } } ScriptCanvasEditor::SourceHandle Workspace::GetSourceAssetId(const ScriptCanvasEditor::SourceHandle& memoryAssetId) const { - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, memoryAssetId); - - if (memoryAsset) - { - return memoryAsset->GetFileAssetId(); - } - - return ScriptCanvasEditor::SourceHandle(); + return memoryAssetId; } //////////////// @@ -834,6 +821,8 @@ namespace ScriptCanvasEditor void MainWindow::SignalActiveSceneChanged(ScriptCanvasEditor::SourceHandle assetId) { + // #sc-editor-asset + /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -871,7 +860,7 @@ namespace ScriptCanvasEditor } UpdateMenuState(enabled); - + */ } void MainWindow::UpdateRecentMenu() @@ -951,21 +940,22 @@ namespace ScriptCanvasEditor if (shouldSaveResults == UnsavedChangesOptions::SAVE) { - Callbacks::OnSave saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr, ScriptCanvasEditor::SourceHandle) - { - if (isSuccessful) - { - // Continue closing. - qobject_cast(parent())->close(); - } - else - { - // Abort closing. - QMessageBox::critical(this, QString(), QObject::tr("Failed to save.")); - m_processedClosedAssetIds.clear(); - } - }; - ActivateAndSaveAsset(assetId, saveCB); + // #sc-editor-asset +// Callbacks::OnSave saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr, ScriptCanvasEditor::SourceHandle) +// { +// if (isSuccessful) +// { +// // Continue closing. +// qobject_cast(parent())->close(); +// } +// else +// { +// // Abort closing. +// QMessageBox::critical(this, QString(), QObject::tr("Failed to save.")); +// m_processedClosedAssetIds.clear(); +// } +// }; +// ActivateAndSaveAsset(assetId, saveCB); event->ignore(); return; } @@ -987,15 +977,15 @@ namespace ScriptCanvasEditor m_workspace->Save(); // Close all files. - - AssetTrackerRequests::AssetList allAssets; - AssetTrackerRequestBus::BroadcastResult(allAssets, &AssetTrackerRequests::GetAssets); - - for (auto trackedAsset : allAssets) - { - const ScriptCanvasEditor::SourceHandle& assetId = trackedAsset->GetAsset().GetId(); - CloseScriptCanvasAsset(assetId); - } +// +// AssetTrackerRequests::AssetList allAssets; +// AssetTrackerRequestBus::BroadcastResult(allAssets, &AssetTrackerRequests::GetAssets); +// +// for (auto trackedAsset : allAssets) +// { +// const ScriptCanvasEditor::SourceHandle& assetId = trackedAsset->GetAsset().GetId(); +// CloseScriptCanvasAsset(assetId); +// } m_processedClosedAssetIds.clear(); @@ -1148,29 +1138,31 @@ namespace ScriptCanvasEditor m_preventUndoStateUpdateCount = 0; } - void MainWindow::MarkAssetModified(const ScriptCanvasEditor::SourceHandle& assetId) + void MainWindow::MarkAssetModified(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { - if (!assetId.IsValid()) - { - return; - } - - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - - if (memoryAsset) - { - const auto& memoryAssetId = memoryAsset->GetId(); - const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(memoryAssetId); - if (fileState != Tracker::ScriptCanvasFileState::NEW) - { - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::UpdateFileState, memoryAssetId, Tracker::ScriptCanvasFileState::MODIFIED); - } - } +// #sc-editor-asset if (!assetId.IsValid()) +// { +// return; +// } +// +// ScriptCanvasMemoryAsset::pointer memoryAsset; +// AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); +// +// if (memoryAsset) +// { +// const auto& memoryAssetId = memoryAsset->GetId(); +// const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(memoryAssetId); +// if (fileState != Tracker::ScriptCanvasFileState::NEW) +// { +// AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::UpdateFileState, memoryAssetId, Tracker::ScriptCanvasFileState::MODIFIED); +// } +// } } - void MainWindow::RefreshScriptCanvasAsset(const AZ::Data::Asset& asset) + void MainWindow::RefreshScriptCanvasAsset(const AZ::Data::Asset& /*asset*/) { + // #sc-editor-asset + /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, asset.GetId()); @@ -1199,10 +1191,14 @@ namespace ScriptCanvasEditor GraphCanvas::SceneMemberNotificationBus::Event(graphCanvasId, &GraphCanvas::SceneMemberNotifications::OnSceneReady); } } + */ } - AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& fileAssetId) + AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& /*fileAssetId*/) { + // #sc-editor-asset + return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAssetId")); + /* if (!fileAssetId.IsValid()) { return AZ::Failure(AZStd::string("Unable to open asset with invalid asset id")); @@ -1261,10 +1257,14 @@ namespace ScriptCanvasEditor { return AZ::Failure(AZStd::string("Specified asset is in an error state and cannot be properly displayed.")); } + */ } - AZ::Outcome MainWindow::OpenScriptCanvasAsset(const ScriptCanvasMemoryAsset& scriptCanvasAsset, int tabIndex /*= -1*/) + AZ::Outcome MainWindow::OpenScriptCanvasAsset(const ScriptCanvasMemoryAsset& /*scriptCanvasAsset*/, int /*tabIndex*/ /*= -1*/) { + // #sc-editor-asset + return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAsset")); + /* const ScriptCanvasEditor::SourceHandle& fileAssetId = scriptCanvasAsset.GetFileAssetId(); if (!fileAssetId.IsValid()) { @@ -1336,10 +1336,14 @@ namespace ScriptCanvasEditor AssetTrackerNotificationBus::MultiHandler::BusConnect(fileAssetId); return AZ::Success(outTabIndex); + */ } - AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, int tabIndex /*= -1*/) + AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle /*scriptCanvasAssetId*/, int /*tabIndex*/ /*= -1*/) { + // #sc-editor-asset + return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAsset")); + /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, scriptCanvasAssetId); @@ -1352,15 +1356,22 @@ namespace ScriptCanvasEditor { return OpenScriptCanvasAssetId(scriptCanvasAssetId); } + */ } - int MainWindow::CreateAssetTab(const ScriptCanvasEditor::SourceHandle& assetId, int tabIndex) + int MainWindow::CreateAssetTab(const ScriptCanvasEditor::SourceHandle& /*assetId*/, int /*tabIndex*/) { - return m_tabBar->InsertGraphTab(tabIndex, assetId); + // #sc-editor-asset + return -1; + // return m_tabBar->InsertGraphTab(tabIndex, assetId); } - AZ::Outcome MainWindow::UpdateScriptCanvasAsset(const AZ::Data::Asset& scriptCanvasAsset) + AZ::Outcome MainWindow::UpdateScriptCanvasAsset(const AZ::Data::Asset& /*scriptCanvasAsset*/) { + // #sc-editor-asset + return AZ::Failure(AZStd::string("rewrite MainWindow::UpdateScriptCanvasAsset")); + + /* int outTabIndex = -1; PushPreventUndoStateUpdate(); @@ -1377,10 +1388,13 @@ namespace ScriptCanvasEditor } return AZ::Success(outTabIndex); + */ } - void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) + void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { + // #sc-editor-asset move what is necessary to the widget + /* AssetHelpers::PrintInfo("RemoveScriptCanvasAsset : %s", AssetHelpers::AssetIdToString(assetId).c_str()); m_assetCreationRequests.erase(assetId); @@ -1408,7 +1422,7 @@ namespace ScriptCanvasEditor auto tabAssetId = tabdata.value(); SetActiveAsset(tabAssetId); } - + */ } int MainWindow::CloseScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) @@ -1451,12 +1465,10 @@ namespace ScriptCanvasEditor return createdNewAsset; } - bool MainWindow::IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& assetId) const + bool MainWindow::IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const { - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - - return memoryAsset != nullptr; + // #sc-editor-asset + return false; } const CategoryInformation* MainWindow::FindNodePaletteCategoryInformation(AZStd::string_view categoryPath) const @@ -1469,8 +1481,10 @@ namespace ScriptCanvasEditor return m_nodePaletteModel.FindNodePaletteInformation(nodeType); } - void MainWindow::GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& assetId, AZStd::string& filePath, AZStd::string& fileFilter) + void MainWindow::GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZStd::string& /*filePath*/, AZStd::string& /*fileFilter*/) { + // #sc-editor-asset + /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -1511,6 +1525,7 @@ namespace ScriptCanvasEditor AZStd::array resolvedPath; AZ::IO::FileIOBase::GetInstance()->ResolvePath(assetPath.data(), resolvedPath.data(), resolvedPath.size()); filePath = resolvedPath.data(); + */ } void MainWindow::OpenFile(const char* fullPath) @@ -1529,7 +1544,8 @@ namespace ScriptCanvasEditor return; } -#if defined(EDITOR_ASSET_SUPPORT_ENABLED) +#if defined(EDITOR_ASSET_SUPPORT_ENABLED) + /* m_errorFilePath = fullPath; // Let's find the source file on disk @@ -1576,12 +1592,13 @@ namespace ScriptCanvasEditor }; // TODO-LS the assetInfo.m_assetType is always null for some reason, I know in this case we want default assets so it's ok to hardcode it - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Load, assetInfo.m_assetId, /*assetInfo.m_assetType*/azrtti_typeid(), onAssetReady); + AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Load, assetInfo.m_assetId, assetInfo.m_assetType, azrtti_typeid(), onAssetReady); } else { QMessageBox::warning(this, "Invalid Source Asset", QString("'%1' is not a valid asset path.").arg(fullPath), QMessageBox::Ok); } + */ #endif } @@ -1705,7 +1722,7 @@ namespace ScriptCanvasEditor 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()); + AZ_Assert(false, AZStd::string::format("Unable to open new Script Canvas Asset with id %s in the Script Canvas Editor", assetId.ToString().c_str()).c_str()); return -1; } @@ -1725,31 +1742,32 @@ namespace ScriptCanvasEditor } } - AZ::Outcome MainWindow::CreateScriptCanvasAsset(AZStd::string_view assetPath, AZ::Data::AssetType assetType, int tabIndex) + AZ::Outcome MainWindow::CreateScriptCanvasAsset(AZStd::string_view /*assetPath*/, AZ::Data::AssetType /*assetType*/, int /*tabIndex*/) { - int outTabIndex = -1; - - ScriptCanvasEditor::SourceHandle newAssetId; - auto onAssetCreated = [this, assetPath, tabIndex, &outTabIndex](ScriptCanvasMemoryAsset& asset) - { - const ScriptCanvasEditor::SourceHandle& assetId = asset.GetId(); - - outTabIndex = InsertTabForAsset(assetPath, assetId, tabIndex); - - SetActiveAsset(assetId); - - UpdateScriptCanvasAsset(asset.GetAsset()); + return AZ::Failure(AZStd::string("MainWindow::CreateScriptCanvasAsset just make a new thing with the project root + untitled...")); +// int outTabIndex = -1; +// +// ScriptCanvasEditor::SourceHandle newAssetId; +// auto onAssetCreated = [this, assetPath, tabIndex, &outTabIndex](ScriptCanvasMemoryAsset& asset) +// { +// const ScriptCanvasEditor::SourceHandle& assetId = asset.GetId(); +// +// outTabIndex = InsertTabForAsset(assetPath, assetId, tabIndex); +// +// SetActiveAsset(assetId); +// +// UpdateScriptCanvasAsset(asset.GetAsset()); +// +// AZ::EntityId scriptCanvasEntityId; +// AssetTrackerRequestBus::BroadcastResult(scriptCanvasEntityId, &AssetTrackerRequests::GetScriptCanvasId, assetId); +// +// GraphCanvas::GraphId graphCanvasGraphId = GetGraphCanvasGraphId(scriptCanvasEntityId); +// GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphLoaded, graphCanvasGraphId); +// +// }; +// AssetTrackerRequestBus::BroadcastResult(newAssetId, &AssetTrackerRequests::Create, assetPath, assetType, onAssetCreated); - AZ::EntityId scriptCanvasEntityId; - AssetTrackerRequestBus::BroadcastResult(scriptCanvasEntityId, &AssetTrackerRequests::GetScriptCanvasId, assetId); - - GraphCanvas::GraphId graphCanvasGraphId = GetGraphCanvasGraphId(scriptCanvasEntityId); - GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphLoaded, graphCanvasGraphId); - - }; - AssetTrackerRequestBus::BroadcastResult(newAssetId, &AssetTrackerRequests::Create, assetPath, assetType, onAssetCreated); - - return AZ::Success(outTabIndex); + // return AZ::Success(outTabIndex); } bool MainWindow::OnFileSave(const Callbacks::OnSave& saveCB) @@ -1875,8 +1893,11 @@ namespace ScriptCanvasEditor return false; } - void MainWindow::OnSaveCallback(bool saveSuccess, AZ::Data::AssetPtr fileAsset, ScriptCanvasEditor::SourceHandle previousFileAssetId) + void MainWindow::OnSaveCallback(bool /*saveSuccess*/, AZ::Data::AssetPtr /*fileAsset*/, ScriptCanvasEditor::SourceHandle /*previousFileAssetId*/) { + // #sc-editor-asset yikes...just save the thing...move to ::SaveAsset maybe + + /* ScriptCanvasMemoryAsset::pointer memoryAsset; AZStd::string tabName = m_tabBar->tabText(m_tabBar->currentIndex()).toUtf8().data(); @@ -1999,6 +2020,7 @@ namespace ScriptCanvasEditor EnableAssetView(memoryAsset); UnblockCloseRequests(); + */ } bool MainWindow::ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId, const Callbacks::OnSave& saveCB) @@ -2007,8 +2029,9 @@ namespace ScriptCanvasEditor return OnFileSave(saveCB); } - void MainWindow::SaveAsset(ScriptCanvasEditor::SourceHandle assetId, const Callbacks::OnSave& onSave) + void MainWindow::SaveAsset(ScriptCanvasEditor::SourceHandle /*assetId*/, const Callbacks::OnSave& /*onSave*/) { + /* PrepareAssetForSave(assetId); auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle previousAssetId) @@ -2033,10 +2056,12 @@ namespace ScriptCanvasEditor } BlockCloseRequests(); + */ } - void MainWindow::SaveNewAsset(AZStd::string_view path, ScriptCanvasEditor::SourceHandle inMemoryAssetId, const Callbacks::OnSave& onSave) + void MainWindow::SaveNewAsset(AZStd::string_view /*path*/, ScriptCanvasEditor::SourceHandle /*inMemoryAssetId*/, const Callbacks::OnSave& /*onSave*/) { + /* PrepareAssetForSave(inMemoryAssetId); auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle previousAssetId) @@ -2061,6 +2086,7 @@ namespace ScriptCanvasEditor } BlockCloseRequests(); + */ } void MainWindow::OnFileOpen() @@ -2069,8 +2095,6 @@ namespace ScriptCanvasEditor EBUS_EVENT_RESULT(serializeContext, AZ::ComponentApplicationBus, GetSerializeContext); AZ_Assert(serializeContext, "Failed to acquire application serialize context."); - ScriptCanvasEditor::SourceHandle openId = ReadRecentAssetId(); - AZStd::string assetRoot; { AZStd::array assetRootChar; @@ -2078,18 +2102,7 @@ namespace ScriptCanvasEditor assetRoot = assetRootChar.data(); } - AZStd::string assetPath; - AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetPath, &AZ::Data::AssetCatalogRequests::GetAssetPathById, openId); - if (!assetPath.empty()) - { - assetPath = AZStd::string::format("%s/%s", assetRoot.c_str(), assetPath.c_str()); - } - - if (!openId.IsValid() || !QFile::exists(assetPath.c_str())) - { - assetPath = AZStd::string::format("%s/scriptcanvas", assetRoot.c_str()); - } - assetPath = AZStd::string::format("%s/scriptcanvas", assetRoot.c_str()); + AZStd::string assetPath = AZStd::string::format("%s/scriptcanvas", assetRoot.c_str()); AZ::EBusAggregateResults> fileFilters; AssetRegistryRequestBus::BroadcastResult(fileFilters, &AssetRegistryRequests::GetAssetHandlerFileFilters); @@ -2471,8 +2484,10 @@ namespace ScriptCanvasEditor GraphCanvas::ViewRequestBus::Event(viewId, &GraphCanvas::ViewRequests::CenterOnEndOfChain); } - void MainWindow::UpdateWorkspaceStatus(const ScriptCanvasMemoryAsset& memoryAsset) + void MainWindow::UpdateWorkspaceStatus(const ScriptCanvasMemoryAsset& /*memoryAsset*/) { + // only occurs on file open, do it there, if necessary + /* ScriptCanvasEditor::SourceHandle fileAssetId = memoryAsset.GetFileAssetId(); size_t eraseCount = m_loadingAssets.erase(fileAssetId); @@ -2494,6 +2509,7 @@ namespace ScriptCanvasEditor } } } + */ } void MainWindow::OnCanUndoChanged(bool canUndo) @@ -2552,49 +2568,69 @@ namespace ScriptCanvasEditor AZ::EntityId MainWindow::GetActiveGraphCanvasGraphId() const { - AZ::EntityId graphId; - AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, m_activeGraph); - return graphId; + // #sc-editor-asset + + // AZ::EntityId graphId; + // AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, m_activeGraph); + /* + * Falls through to this, which falls through to editor graph, move to canvas widget + AZ::EntityId ScriptCanvasMemoryAsset::GetGraphId() + { + if (!m_graphId.IsValid()) + { + EditorGraphRequestBus::EventResult(m_graphId, m_scriptCanvasId, &EditorGraphRequests::GetGraphCanvasGraphId); + } + + return m_graphId; + } + */ + return AZ::EntityId{}; } ScriptCanvas::ScriptCanvasId MainWindow::GetActiveScriptCanvasId() const { - ScriptCanvas::ScriptCanvasId sceneId; - AssetTrackerRequestBus::BroadcastResult(sceneId, &AssetTrackerRequests::GetScriptCanvasId, m_activeGraph); - return sceneId; + // ScriptCanvas::ScriptCanvasId sceneId; + // AssetTrackerRequestBus::BroadcastResult(sceneId, &AssetTrackerRequests::GetScriptCanvasId, m_activeGraph); + // #sc-editor-asset + return ScriptCanvas::ScriptCanvasId{}; } - GraphCanvas::GraphId MainWindow::GetGraphCanvasGraphId(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) const + GraphCanvas::GraphId MainWindow::GetGraphCanvasGraphId(const ScriptCanvas::ScriptCanvasId& /*scriptCanvasId*/) const { - AZ::EntityId graphCanvasId; - AssetTrackerRequestBus::BroadcastResult(graphCanvasId, &AssetTrackerRequests::GetGraphCanvasId, scriptCanvasId); - - return graphCanvasId; + // #sc-editor-asset + // AZ::EntityId graphCanvasId; + // AssetTrackerRequestBus::BroadcastResult(graphCanvasId, &AssetTrackerRequests::GetGraphCanvasId, scriptCanvasId); + // move to widget + return AZ::EntityId{}; } - GraphCanvas::GraphId MainWindow::FindGraphCanvasGraphIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const + GraphCanvas::GraphId MainWindow::FindGraphCanvasGraphIdByAssetId(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const { - AZ::EntityId graphId; - AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, assetId); - return graphId; + // #sc-editor-asset + // AZ::EntityId graphId; + // AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, assetId); + return AZ::EntityId{}; } - ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const + ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const { - ScriptCanvas::ScriptCanvasId scriptCanvasId; - AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasId, assetId); - return scriptCanvasId; + // #sc-editor-asset + // ScriptCanvas::ScriptCanvasId scriptCanvasId; + // AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasId, assetId); + return ScriptCanvas::ScriptCanvasId{}; } - ScriptCanvas::ScriptCanvasId MainWindow::GetScriptCanvasId(const GraphCanvas::GraphId& graphCanvasGraphId) const + ScriptCanvas::ScriptCanvasId MainWindow::GetScriptCanvasId(const GraphCanvas::GraphId& /*graphCanvasGraphId*/) const { - ScriptCanvas::ScriptCanvasId scriptCanvasId; - AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasIdFromGraphId, graphCanvasGraphId); - return scriptCanvasId; + // #sc-editor-asset + // ScriptCanvas::ScriptCanvasId scriptCanvasId; + // AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasIdFromGraphId, graphCanvasGraphId); + return ScriptCanvas::ScriptCanvasId{}; } bool MainWindow::IsInUndoRedo(const AZ::EntityId& graphCanvasGraphId) const { + // #sc-editor-asset bool isActive = false; UndoRequestBus::EventResult(isActive, GetScriptCanvasId(graphCanvasGraphId), &UndoRequests::IsActive); return isActive; @@ -2647,8 +2683,10 @@ namespace ScriptCanvasEditor return false; } - void MainWindow::ReconnectSceneBuses(ScriptCanvasEditor::SourceHandle previousAssetId, ScriptCanvasEditor::SourceHandle nextAssetId) + void MainWindow::ReconnectSceneBuses(ScriptCanvasEditor::SourceHandle /*previousAssetId*/, ScriptCanvasEditor::SourceHandle /*nextAssetId*/) { + // #sc-editor-asset + /* ScriptCanvasMemoryAsset::pointer previousAsset; AssetTrackerRequestBus::BroadcastResult(previousAsset, &AssetTrackerRequests::GetAsset, previousAssetId); @@ -2680,17 +2718,19 @@ namespace ScriptCanvasEditor // Notify about the graph refresh GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphRefreshed, previousScriptCanvasSceneId, nextAssetGraphCanvasId); - + */ } - void MainWindow::SetActiveAsset(const ScriptCanvasEditor::SourceHandle& fileAssetId) + void MainWindow::SetActiveAsset(const ScriptCanvasEditor::SourceHandle& /*fileAssetId*/) { + // #sc-editor-asset + /* if (m_activeGraph == fileAssetId) { return; } - AssetHelpers::PrintInfo("SetActiveAsset : from: %s to %s", AssetHelpers::AssetIdToString(m_activeGraph).c_str(), AssetHelpers::AssetIdToString(fileAssetId).c_str()); + AssetHelpers::PrintInfo("SetActiveAsset : from: %s to %s", m_activeGraph.ToString().c_str(), fileAssetId.ToString().c_str()); if (fileAssetId.IsValid()) { @@ -2732,7 +2772,7 @@ namespace ScriptCanvasEditor { ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; - m_activeGraph.SetInvalid(); + m_activeGraph.Clear(); m_emptyCanvas->show(); ReconnectSceneBuses(previousAssetId, m_activeGraph); @@ -2743,13 +2783,16 @@ namespace ScriptCanvasEditor UpdateUndoCache(fileAssetId); RefreshSelection(); + */ } void MainWindow::RefreshActiveAsset() { + // #sc-editor-asset + /* if (m_activeGraph.IsValid()) { - AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", AssetHelpers::AssetIdToString(m_activeGraph).c_str()); + AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", m_activeGraph.ToString().c_str()); ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); @@ -2771,7 +2814,7 @@ namespace ScriptCanvasEditor AZ_Assert(view, "Asset should have a view"); if (view) { - AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", AssetHelpers::AssetIdToString(m_activeGraph).c_str()); + AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", m_activeGraph.ToString().c_str()); view->ShowScene(sceneEntityId); m_layout->addWidget(view); @@ -2789,36 +2832,41 @@ namespace ScriptCanvasEditor SetActiveAsset({}); } } + */ } void MainWindow::Clear() { m_tabBar->CloseAllTabs(); - - AssetTrackerRequests::AssetList assets; - AssetTrackerRequestBus::BroadcastResult(assets, &AssetTrackerRequests::GetAssets); - - for (auto asset : assets) - { - RemoveScriptCanvasAsset(asset->GetAsset().GetId()); - } + // #sc-editor-asset +// +// AssetTrackerRequests::AssetList assets; +// AssetTrackerRequestBus::BroadcastResult(assets, &AssetTrackerRequests::GetAssets); +// +// for (auto asset : assets) +// { +// RemoveScriptCanvasAsset(asset->GetAsset().GetId()); +// } SetActiveAsset({}); } void MainWindow::OnTabCloseButtonPressed(int index) { + QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { auto fileAssetId = tabdata.value(); - Tracker::ScriptCanvasFileState fileState; - AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); - + Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::NEW; bool isSaving = false; - AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, fileAssetId); + // #sc-editor-asset Get from widgets + /* + AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); + AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, fileAssetId); + */ if (isSaving) { m_closeCurrentGraphAfterSave = true; @@ -2830,42 +2878,44 @@ namespace ScriptCanvasEditor { SetActiveAsset(fileAssetId); - AZStd::string tabName; - AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, fileAssetId); + // #sc-editor-asset + AZStd::string tabName = "Get from widget"; + // AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, fileAssetId); saveDialogResults = ShowSaveDialog(tabName.c_str()); } if (saveDialogResults == UnsavedChangesOptions::SAVE) { - auto saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle) - { - if (isSuccessful) - { - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, asset->GetId()); - AZ_Assert(memoryAsset, "At this point we must have a MemoryAsset"); - - int tabIndex = -1; - if (IsTabOpen(memoryAsset->GetFileAssetId(), tabIndex)) - { - OnTabCloseRequest(tabIndex); - } - } - else - { - QMessageBox::critical(this, QString(), QObject::tr("Failed to save.")); - } - }; - - if (fileState == Tracker::ScriptCanvasFileState::NEW) - { - SaveAssetAsImpl(fileAssetId, saveCB); - } - else - { - SaveAsset(fileAssetId, saveCB); - } + // #sc-editor-asset +// auto saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle) +// { +// if (isSuccessful) +// { +// ScriptCanvasMemoryAsset::pointer memoryAsset; +// AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, asset->GetId()); +// AZ_Assert(memoryAsset, "At this point we must have a MemoryAsset"); +// +// int tabIndex = -1; +// if (IsTabOpen(memoryAsset->GetFileAssetId(), tabIndex)) +// { +// OnTabCloseRequest(tabIndex); +// } +// } +// else +// { +// QMessageBox::critical(this, QString(), QObject::tr("Failed to save.")); +// } +// }; +// +// if (fileState == Tracker::ScriptCanvasFileState::NEW) +// { +// SaveAssetAsImpl(fileAssetId, saveCB); +// } +// else +// { +// SaveAsset(fileAssetId, saveCB); +// } } else if (saveDialogResults == UnsavedChangesOptions::CONTINUE_WITHOUT_SAVING) { @@ -2888,7 +2938,7 @@ namespace ScriptCanvasEditor void MainWindow::CloseAllTabs() { m_isClosingTabs = true; - m_skipTabOnClose.SetInvalid(); + m_skipTabOnClose.Clear(); CloseNextTab(); } @@ -2906,8 +2956,10 @@ namespace ScriptCanvasEditor } } - void MainWindow::CopyPathToClipboard(int index) + void MainWindow::CopyPathToClipboard(int /*index*/) { + // #sc-editor-asset + /* QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) @@ -2928,6 +2980,7 @@ namespace ScriptCanvasEditor clipBoard->setText(m_tabBar->tabText(index)); } } + */ } void MainWindow::OnActiveFileStateChanged() @@ -2944,7 +2997,7 @@ namespace ScriptCanvasEditor || (m_tabBar->count() == 1 && m_skipTabOnClose.IsValid())) { m_isClosingTabs = false; - m_skipTabOnClose.SetInvalid(); + m_skipTabOnClose.Clear(); return; } @@ -2970,8 +3023,9 @@ namespace ScriptCanvasEditor } } - void MainWindow::OnTabCloseRequest(int index) + void MainWindow::OnTabCloseRequest(int /*index*/) { + /* QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { @@ -3005,6 +3059,7 @@ namespace ScriptCanvasEditor // information AddSystemTickAction(SystemTickActionFlag::CloseNextTabAction); } + */ } void MainWindow::OnNodeAdded(const AZ::EntityId& nodeId, bool isPaste) @@ -3578,7 +3633,7 @@ namespace ScriptCanvasEditor if (m_queuedFocusOverride.IsValid()) { SetActiveAsset(m_queuedFocusOverride); - m_queuedFocusOverride.SetInvalid(); + m_queuedFocusOverride.Clear(); } else if (lastFocusAsset.IsValid()) { @@ -3641,22 +3696,23 @@ namespace ScriptCanvasEditor void MainWindow::UpdateSaveState() { - bool enabled = m_activeGraph.IsValid(); - bool isSaving = false; - bool hasModifications = false; - - if (enabled) - { - Tracker::ScriptCanvasFileState fileState = GetAssetFileState(m_activeGraph); - hasModifications = ( fileState == Tracker::ScriptCanvasFileState::MODIFIED - || fileState == Tracker::ScriptCanvasFileState::NEW - || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED); - - AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, m_activeGraph); - } - - ui->action_Save->setEnabled(enabled && !isSaving && hasModifications); - ui->action_Save_As->setEnabled(enabled && !isSaving); + // #sc-editor-asset todo, consider making blocking +// bool enabled = m_activeGraph.IsValid(); +// bool isSaving = false; +// bool hasModifications = false; +// +// if (enabled) +// { +// Tracker::ScriptCanvasFileState fileState = GetAssetFileState(m_activeGraph); +// hasModifications = ( fileState == Tracker::ScriptCanvasFileState::MODIFIED +// || fileState == Tracker::ScriptCanvasFileState::NEW +// || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED); +// +// AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, m_activeGraph); +// } +// +// ui->action_Save->setEnabled(enabled && !isSaving && hasModifications); +// ui->action_Save_As->setEnabled(enabled && !isSaving); } void MainWindow::CreateFunctionInput() @@ -3854,18 +3910,22 @@ namespace ScriptCanvasEditor return findChild(elementName); } - AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId assetNodeId) const + AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZ::EntityId /*assetNodeId*/) const { - AZ::EntityId editorEntityId; - AssetTrackerRequestBus::BroadcastResult(editorEntityId, &AssetTrackerRequests::GetEditorEntityIdFromSceneEntityId, assetId, assetNodeId); - return editorEntityId; + // #sc-editor-asset + return AZ::EntityId{}; + // AZ::EntityId editorEntityId; + // AssetTrackerRequestBus::BroadcastResult(editorEntityId, &AssetTrackerRequests::GetEditorEntityIdFromSceneEntityId, assetId, assetNodeId); + //return AZ::EntityId{};// editorEntityId; } - AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId editorNodeId) const + AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZ::EntityId /*editorNodeId*/) const { - AZ::EntityId sceneEntityId; - AssetTrackerRequestBus::BroadcastResult(sceneEntityId, &AssetTrackerRequests::GetSceneEntityIdFromEditorEntityId, assetId, editorNodeId); - return sceneEntityId; + // #sc-editor-asset + return AZ::EntityId{}; + // AZ::EntityId sceneEntityId; + // AssetTrackerRequestBus::BroadcastResult(sceneEntityId, &AssetTrackerRequests::GetSceneEntityIdFromEditorEntityId, assetId, editorNodeId); + // return sceneEntityId; } GraphCanvas::Endpoint MainWindow::CreateNodeForProposalWithGroup(const AZ::EntityId& connectionId, const GraphCanvas::Endpoint& endpoint, const QPointF& scenePoint, const QPoint& screenPoint, AZ::EntityId groupTarget) @@ -4285,8 +4345,9 @@ namespace ScriptCanvasEditor PrepareAssetForSave(m_activeGraph); } - void MainWindow::PrepareAssetForSave(const ScriptCanvasEditor::SourceHandle& assetId) + void MainWindow::PrepareAssetForSave(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { + /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -4311,6 +4372,7 @@ namespace ScriptCanvasEditor graph->MarkVersion(); } } + */ } void MainWindow::RestartAutoTimerSave(bool forceTimer) @@ -4353,64 +4415,65 @@ namespace ScriptCanvasEditor void MainWindow::OnAssignToSelectedEntities() { - Tracker::ScriptCanvasFileState fileState; - AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, m_activeGraph); - - bool isDocumentOpen = false; - AzToolsFramework::EditorRequests::Bus::BroadcastResult(isDocumentOpen, &AzToolsFramework::EditorRequests::IsLevelDocumentOpen); - - if (fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED || !isDocumentOpen) - { - return; - } - - AzToolsFramework::EntityIdList selectedEntityIds; - AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - - auto selectedEntityIdIter = selectedEntityIds.begin(); - - bool isLayerAmbiguous = false; - AZ::EntityId targetLayer; - - while (selectedEntityIdIter != selectedEntityIds.end()) - { - bool isLayerEntity = false; - AzToolsFramework::Layers::EditorLayerComponentRequestBus::EventResult(isLayerEntity, (*selectedEntityIdIter), &AzToolsFramework::Layers::EditorLayerComponentRequestBus::Events::HasLayer); - - if (isLayerEntity) - { - if (targetLayer.IsValid()) - { - isLayerAmbiguous = true; - } - - targetLayer = (*selectedEntityIdIter); - - selectedEntityIdIter = selectedEntityIds.erase(selectedEntityIdIter); - } - else - { - ++selectedEntityIdIter; - } - } - - if (selectedEntityIds.empty()) - { - AZ::EntityId createdId; - AzToolsFramework::EditorRequests::Bus::BroadcastResult(createdId, &AzToolsFramework::EditorRequests::CreateNewEntity, AZ::EntityId()); - - selectedEntityIds.emplace_back(createdId); - - if (targetLayer.IsValid() && !isLayerAmbiguous) - { - AZ::TransformBus::Event(createdId, &AZ::TransformBus::Events::SetParent, targetLayer); - } - } - - for (const AZ::EntityId& entityId : selectedEntityIds) - { - AssignGraphToEntityImpl(entityId); - } + // #sc-editor-asset consider cutting +// Tracker::ScriptCanvasFileState fileState; +// AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, m_activeGraph); +// +// bool isDocumentOpen = false; +// AzToolsFramework::EditorRequests::Bus::BroadcastResult(isDocumentOpen, &AzToolsFramework::EditorRequests::IsLevelDocumentOpen); +// +// if (fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED || !isDocumentOpen) +// { +// return; +// } +// +// AzToolsFramework::EntityIdList selectedEntityIds; +// AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); +// +// auto selectedEntityIdIter = selectedEntityIds.begin(); +// +// bool isLayerAmbiguous = false; +// AZ::EntityId targetLayer; +// +// while (selectedEntityIdIter != selectedEntityIds.end()) +// { +// bool isLayerEntity = false; +// AzToolsFramework::Layers::EditorLayerComponentRequestBus::EventResult(isLayerEntity, (*selectedEntityIdIter), &AzToolsFramework::Layers::EditorLayerComponentRequestBus::Events::HasLayer); +// +// if (isLayerEntity) +// { +// if (targetLayer.IsValid()) +// { +// isLayerAmbiguous = true; +// } +// +// targetLayer = (*selectedEntityIdIter); +// +// selectedEntityIdIter = selectedEntityIds.erase(selectedEntityIdIter); +// } +// else +// { +// ++selectedEntityIdIter; +// } +// } +// +// if (selectedEntityIds.empty()) +// { +// AZ::EntityId createdId; +// AzToolsFramework::EditorRequests::Bus::BroadcastResult(createdId, &AzToolsFramework::EditorRequests::CreateNewEntity, AZ::EntityId()); +// +// selectedEntityIds.emplace_back(createdId); +// +// if (targetLayer.IsValid() && !isLayerAmbiguous) +// { +// AZ::TransformBus::Event(createdId, &AZ::TransformBus::Events::SetParent, targetLayer); +// } +// } +// +// for (const AZ::EntityId& entityId : selectedEntityIds) +// { +// AssignGraphToEntityImpl(entityId); +// } } void MainWindow::OnAssignToEntity(const AZ::EntityId& entityId) @@ -4424,11 +4487,13 @@ namespace ScriptCanvasEditor } } - ScriptCanvasEditor::Tracker::ScriptCanvasFileState MainWindow::GetAssetFileState(ScriptCanvasEditor::SourceHandle assetId) const + ScriptCanvasEditor::Tracker::ScriptCanvasFileState MainWindow::GetAssetFileState(ScriptCanvasEditor::SourceHandle /*assetId*/) const { - Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; - AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, assetId); - return fileState; + // #sc-editor-asset + return Tracker::ScriptCanvasFileState::INVALID; + // Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; + // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, assetId); + // return fileState; } void MainWindow::AssignGraphToEntityImpl(const AZ::EntityId& entityId) @@ -4477,7 +4542,8 @@ namespace ScriptCanvasEditor if (usableRequestBus) { ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); + // #sc-editor-asset + // AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); if (memoryAsset) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 77a85ec448..1c98769463 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -153,7 +153,7 @@ namespace ScriptCanvasEditor } }; - //! Manages the Save/Restore operations of the user's las topened and focused graphs + //! Manages the Save/Restore operations of the user's last opened and focused graphs class Workspace : AssetTrackerNotificationBus::MultiHandler { @@ -415,17 +415,17 @@ namespace ScriptCanvasEditor void CloseNextTab(); - bool IsTabOpen(const ScriptCanvasEditor::SourceHandle& assetId, int& outTabIndex) const; - QVariant GetTabData(const ScriptCanvasEditor::SourceHandle& assetId); + bool IsTabOpen(const SourceHandle& assetId, int& outTabIndex) const; + QVariant GetTabData(const SourceHandle& assetId); //! GeneralRequestBus - AZ::Outcome OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& assetId) override; - AZ::Outcome OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, int tabIndex = -1) override; + AZ::Outcome OpenScriptCanvasAssetId(const SourceHandle& assetId) override; + AZ::Outcome OpenScriptCanvasAsset(SourceHandle scriptCanvasAssetId, int tabIndex = -1) override; AZ::Outcome OpenScriptCanvasAsset(const ScriptCanvasMemoryAsset& scriptCanvasAsset, int tabIndex = -1); - int CloseScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) override; + int CloseScriptCanvasAsset(const SourceHandle& assetId) override; bool CreateScriptCanvasAssetFor(const TypeDefs::EntityComponentId& requestingEntityId) override; - bool IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& assetId) const override; + bool IsScriptCanvasAssetOpen(const SourceHandle& assetId) const override; const CategoryInformation* FindNodePaletteCategoryInformation(AZStd::string_view categoryPath) const override; const NodePaletteModelInformation* FindNodePaletteModelInformation(const ScriptCanvas::NodeTypeIdentifier& nodeType) const override; @@ -625,15 +625,7 @@ namespace ScriptCanvasEditor ScriptCanvasEditor::SourceHandle GetSourceAssetId(const ScriptCanvasEditor::SourceHandle& memoryAssetId) const { - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, memoryAssetId); - - if (memoryAsset) - { - return memoryAsset->GetFileAssetId(); - } - - return ScriptCanvasEditor::SourceHandle(); + return memoryAssetId; } int InsertTabForAsset(AZStd::string_view assetPath, ScriptCanvasEditor::SourceHandle assetId, int tabIndex = -1); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 9b2d0e4982..e598700899 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include "Core.h" #include "Attributes.h" @@ -182,5 +183,55 @@ namespace ScriptCanvas serializeContext->RegisterType(typeId, AZStd::move(classData), EventPlaceholderAnyCreator); } +} + +namespace ScriptCanvasEditor +{ + SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path) + : m_data(graph) + , m_id(id) + , m_path(path) + {} + + void SourceHandle::Clear() + { + m_data = nullptr; + m_id = AZ::Uuid::CreateNull(); + m_path.clear(); + } + + GraphPtrConst SourceHandle::Get() const + { + return m_data ? m_data->GetEditorGraph() : nullptr; + } + + const AZ::Uuid& SourceHandle::Id() const + { + return m_id; + } + + bool SourceHandle::IsValid() const + { + return *this; + } + GraphPtr SourceHandle::Mod() const + { + return m_data ? m_data->ModEditorGraph() : nullptr; + } + + SourceHandle::operator bool() const + { + return m_data != nullptr; + } + + bool SourceHandle::operator!() const + { + return m_data == nullptr; + } + + const AZStd::string& SourceHandle::Path() const + { + return m_path; + } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 85f76280d2..e2b2ef5919 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -20,7 +20,7 @@ #include #include #include - +#include #include #include @@ -318,7 +318,39 @@ namespace ScriptCanvasEditor using GraphPtr = Graph*; using GraphPtrConst = const Graph*; - class SourceHandle; + class SourceHandle + { + public: + AZ_TYPE_INFO(SourceHandle, "{65855A98-AE2F-427F-BFC8-69D45265E312}"); + AZ_CLASS_ALLOCATOR(SourceHandle, AZ::SystemAllocator, 0); + + SourceHandle() = default; + + SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path); + + void Clear(); + + GraphPtrConst Get() const; + + const AZ::Uuid& Id() const; + + bool IsValid() const; + + GraphPtr Mod() const; + + operator bool() const; + + bool operator!() const; + + const AZStd::string& Path() const; + + AZStd::string ToString() const; + + private: + ScriptCanvas::DataPtr m_data; + AZ::Uuid m_id = AZ::Uuid::CreateNull(); + AZStd::string m_path; + }; } namespace AZStd From bc342df6b4898ae2bebc61cce7b19c2e47cecb5b Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Fri, 29 Oct 2021 16:23:20 -0700 Subject: [PATCH 027/399] initial compile of detailed path of change to regular sc files Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Asset/EditorAssetSystemComponent.cpp | 33 ++-- .../Editor/Assets/ScriptCanvasAssetHolder.cpp | 49 +++--- .../Code/Editor/Components/EditorGraph.cpp | 3 +- .../EditorScriptCanvasComponent.cpp | 11 +- .../FunctionNodeDescriptorComponent.cpp | 2 +- .../Assets/ScriptCanvasBaseAssetData.cpp | 23 --- .../Assets/ScriptCanvasBaseAssetData.h | 28 +--- .../Include/ScriptCanvas/Bus/RequestBus.h | 14 +- .../Components/EditorScriptCanvasComponent.h | 3 +- Gems/ScriptCanvas/Code/Editor/Settings.cpp | 40 ++--- Gems/ScriptCanvas/Code/Editor/Settings.h | 1 + .../Code/Editor/SystemComponent.cpp | 94 +++++------ .../Code/Editor/Utilities/RecentAssetPath.cpp | 9 +- .../Code/Editor/Utilities/RecentAssetPath.h | 1 + .../Code/Editor/View/Widgets/CanvasWidget.cpp | 7 - .../Code/Editor/View/Widgets/GraphTabBar.cpp | 151 +++++++++--------- .../LoggingPanel/LoggingWindowSession.cpp | 18 +-- .../LoggingPanel/LoggingWindowTreeItems.cpp | 98 ++++++------ .../PivotTree/PivotTreeWidget.cpp | 24 +-- .../FunctionNodePaletteTreeItemTypes.cpp | 8 +- .../ScriptCanvasStatisticsDialog.cpp | 3 +- .../UnitTestPanel/UnitTestDockWidget.cpp | 2 +- .../Code/Editor/View/Windows/MainWindow.cpp | 68 ++++---- .../Tools/UpgradeTool/UpgradeHelper.cpp | 3 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 35 ++++ .../Code/Include/ScriptCanvas/Core/Core.h | 31 ++++ 26 files changed, 390 insertions(+), 369 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp index 4df2a57c36..1c383d04bd 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp @@ -122,7 +122,7 @@ namespace ScriptCanvasEditor return ScriptCanvasBuilder::CreateLuaAsset(editAsset->GetScriptCanvasEntity(), editAsset->GetId(), graphPathForRawLuaFile); } - void EditorAssetSystemComponent::AddSourceFileOpeners([[maybe_unused]] const char* fullSourceFileName, const AZ::Uuid& sourceUuid, AzToolsFramework::AssetBrowser::SourceFileOpenerList& openers) + void EditorAssetSystemComponent::AddSourceFileOpeners([[maybe_unused]] const char* fullSourceFileName, [[maybe_unused]] const AZ::Uuid& sourceUuid, [[maybe_unused]] AzToolsFramework::AssetBrowser::SourceFileOpenerList& openers) { using namespace AzToolsFramework; using namespace AzToolsFramework::AssetBrowser; @@ -139,21 +139,22 @@ namespace ScriptCanvasEditor return; } // You can push back any number of "Openers" - choose a unique identifier, and icon, and then a lambda which will be activated if the user chooses to open it with your opener: - openers.push_back({ "ScriptCanvas_Editor_Asset_Edit", "Script Canvas Editor...", QIcon(), - [](const char*, const AZ::Uuid& scSourceUuid) - { - AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); - AZ::Data::AssetId sourceAssetId(scSourceUuid, 0); - - auto& assetManager = AZ::Data::AssetManager::Instance(); - AZ::Data::Asset scriptCanvasAsset = assetManager.GetAsset(sourceAssetId, azrtti_typeid(), AZ::Data::AssetLoadBehavior::Default); - AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, scriptCanvasAsset.GetId(), -1); - if (!openOutcome) - { - AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); - } - } }); + // #sc_editor_asset + // openers.push_back({ "ScriptCanvas_Editor_Asset_Edit", "Script Canvas Editor...", QIcon(), +// [](const char*, const AZ::Uuid& scSourceUuid) +// { +// AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); +// AZ::Data::AssetId sourceAssetId(scSourceUuid, 0); +// +// auto& assetManager = AZ::Data::AssetManager::Instance(); +// AZ::Data::Asset scriptCanvasAsset = assetManager.GetAsset(sourceAssetId, azrtti_typeid(), AZ::Data::AssetLoadBehavior::Default); +// AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); +// GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, scriptCanvasAsset.GetId(), -1); +// if (!openOutcome) +// { +// AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); +// } +// } }); } } diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp index a42a9bad48..c5c08d5bbe 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp @@ -82,30 +82,31 @@ namespace ScriptCanvasEditor void ScriptCanvasAssetHolder::OpenEditor() const { - AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); - - AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - - if (m_scriptCanvasAsset.IsReady()) - { - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_scriptCanvasAsset.GetId(), -1); - - if (!openOutcome) - { - AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); - } - } - else if (m_ownerId.first.IsValid()) - { - AzToolsFramework::EntityIdList selectedEntityIds; - AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - - // Going to bypass the multiple selected entities flow for right now. - if (selectedEntityIds.size() == 1) - { - GeneralRequestBus::Broadcast(&GeneralRequests::CreateScriptCanvasAssetFor, m_ownerId); - } - } + // #sc_editor_asset +// AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); +// +// AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); +// +// if (m_scriptCanvasAsset.IsReady()) +// { +// GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_scriptCanvasAsset.GetId(), -1); +// +// if (!openOutcome) +// { +// AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); +// } +// } +// else if (m_ownerId.first.IsValid()) +// { +// AzToolsFramework::EntityIdList selectedEntityIds; +// AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); +// +// // Going to bypass the multiple selected entities flow for right now. +// if (selectedEntityIds.size() == 1) +// { +// GeneralRequestBus::Broadcast(&GeneralRequests::CreateScriptCanvasAssetFor, m_ownerId); +// } +// } } ScriptCanvas::ScriptCanvasId ScriptCanvasAssetHolder::GetScriptCanvasId() const diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index fc2c2ace41..c70e4b74f3 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -1342,7 +1342,8 @@ namespace ScriptCanvasEditor void Graph::SignalDirty() { - GeneralRequestBus::Broadcast(&GeneralRequests::SignalSceneDirty, GetAssetId()); + // #sc_editor_asset + // GeneralRequestBus::Broadcast(&GeneralRequests::SignalSceneDirty, GetAssetId()); } void Graph::HighlightNodesByType(const ScriptCanvas::NodeTypeIdentifier& nodeTypeIdentifier) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 043e034062..d73273103c 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -247,21 +247,12 @@ namespace ScriptCanvasEditor m_scriptCanvasAssetHolder.OpenEditor(); } - void EditorScriptCanvasComponent::CloseGraph() - { - AZ::Data::AssetId assetId = m_scriptCanvasAssetHolder.GetAssetId(); - if (assetId.IsValid()) - { - GeneralRequestBus::Broadcast(&GeneralRequests::CloseScriptCanvasAsset, assetId); - } - } - void EditorScriptCanvasComponent::Init() { EditorComponentBase::Init(); AzFramework::AssetCatalogEventBus::Handler::BusConnect(); AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusConnect(); - m_scriptCanvasAssetHolder.Init(GetEntityId(), GetId()); + // m_scriptCanvasAssetHolder.Init(GetEntityId(), GetId()); } //========================================================================= diff --git a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp index db41fa70ca..f649bb9f7d 100644 --- a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp @@ -97,7 +97,7 @@ namespace ScriptCanvasEditor } AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, assetInfo.m_assetId, -1); + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, SourceHandle( nullptr, assetInfo.m_assetId.m_guid, {} ), -1); return openOutcome.IsSuccess(); } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp index 2b451b0de8..efb20e3518 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp @@ -7,27 +7,4 @@ */ #include -#include -namespace ScriptCanvas -{ - const Graph* ScriptCanvasData::GetGraph() const - { - return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); - } - - const ScriptCanvasEditor::Graph* ScriptCanvasData::GetEditorGraph() const - { - return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); - } - - Graph* ScriptCanvasData::ModGraph() - { - return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); - } - - ScriptCanvasEditor::Graph* ScriptCanvasData::ModEditorGraph() - { - return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); - } -} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h index 5340f1128a..7597da9081 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h @@ -13,31 +13,5 @@ namespace ScriptCanvas { - class ScriptCanvasData - { - public: - - AZ_RTTI(ScriptCanvasData, "{1072E894-0C67-4091-8B64-F7DB324AD13C}"); - AZ_CLASS_ALLOCATOR(ScriptCanvasData, AZ::SystemAllocator, 0); - ScriptCanvasData() {} - virtual ~ScriptCanvasData() {} - ScriptCanvasData(ScriptCanvasData&& other); - ScriptCanvasData& operator=(ScriptCanvasData&& other); - - static void Reflect(AZ::ReflectContext* reflectContext); - - AZ::Entity* GetScriptCanvasEntity() const { return m_scriptCanvasEntity.get(); } - - const Graph* GetGraph() const; - - const ScriptCanvasEditor::Graph* GetEditorGraph() const; - - Graph* ModGraph(); - - ScriptCanvasEditor::Graph* ModEditorGraph(); - - AZStd::unique_ptr m_scriptCanvasEntity; - private: - ScriptCanvasData(const ScriptCanvasData&) = delete; - }; + } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h index 2d9a7d6b58..8dbaf5b31a 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h @@ -8,18 +8,16 @@ #pragma once -#include -#include -#include #include -#include +#include +#include +#include #include - +#include #include - -#include #include - +#include +#include #include class QLineEdit; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 5dbe718eca..87ffff8b19 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -67,8 +67,7 @@ namespace ScriptCanvasEditor //===================================================================== void OpenEditor(); - void CloseGraph(); - + void SetName(const AZStd::string& name) { m_name = name; } const AZStd::string& GetName() const; AZ::EntityId GetEditorEntityId() const { return GetEntity() ? GetEntityId() : AZ::EntityId(); } diff --git a/Gems/ScriptCanvas/Code/Editor/Settings.cpp b/Gems/ScriptCanvas/Code/Editor/Settings.cpp index 8d24a30aab..997ef4eadf 100644 --- a/Gems/ScriptCanvas/Code/Editor/Settings.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Settings.cpp @@ -92,13 +92,11 @@ namespace ScriptCanvasEditor // WorkspaceAssetSaveData EditorWorkspace::WorkspaceAssetSaveData::WorkspaceAssetSaveData() - : m_assetType(azrtti_typeid()) { } - EditorWorkspace::WorkspaceAssetSaveData::WorkspaceAssetSaveData(const AZ::Data::AssetId& assetId) + EditorWorkspace::WorkspaceAssetSaveData::WorkspaceAssetSaveData(SourceHandle assetId) : m_assetId(assetId) - , m_assetType(azrtti_typeid()) { } @@ -108,24 +106,31 @@ namespace ScriptCanvasEditor { AZStd::vector assetSaveData; AZStd::vector assetIds; - auto subElement = rootDataElementNode.FindSubElement(AZ_CRC("ActiveAssetIds", 0xe445268a)); + auto subElement = rootDataElementNode.FindSubElement(AZ_CRC_CE("ActiveAssetIds")); if (subElement) { - if (subElement->GetData(assetIds)) - { - assetSaveData.reserve(assetIds.size()); - for (const AZ::Data::AssetId& assetId : assetIds) - { - assetSaveData.emplace_back(assetId); - } - } +// #sc_editor_asset +// if (subElement->GetData(assetIds)) +// { +// assetSaveData.reserve(assetIds.size()); +// for (const AZ::Data::AssetId& assetId : assetIds) +// { +// assetSaveData.emplace_back(assetId); +// } +// } } - rootDataElementNode.RemoveElementByName(AZ_CRC("ActiveAssetIds", 0xe445268a)); + rootDataElementNode.RemoveElementByName(AZ_CRC_CE("ActiveAssetIds")); rootDataElementNode.AddElementWithData(context, "ActiveAssetData", assetSaveData); } + if (rootDataElementNode.GetVersion() < 4) + { + rootDataElementNode.RemoveElementByName(AZ_CRC_CE("ActiveAssetIds")); + rootDataElementNode.RemoveElementByName(AZ_CRC_CE("FocusedAssetId")); + } + return true; } @@ -135,13 +140,12 @@ namespace ScriptCanvasEditor if (serialize) { serialize->Class() - ->Version(1) + ->Version(2) ->Field("AssetId", &WorkspaceAssetSaveData::m_assetId) - ->Field("AssetType", &WorkspaceAssetSaveData::m_assetType) ; serialize->Class() - ->Version(3, &EditorWorkspace::VersionConverter) + ->Version(4, &EditorWorkspace::VersionConverter) ->Field("m_storedWindowState", &EditorWorkspace::m_storedWindowState) ->Field("m_windowGeometry", &EditorWorkspace::m_windowGeometry) ->Field("FocusedAssetId", &EditorWorkspace::m_focusedAssetId) @@ -150,13 +154,13 @@ namespace ScriptCanvasEditor } } - void EditorWorkspace::ConfigureActiveAssets(AZ::Data::AssetId focussedAssetId, const AZStd::vector< WorkspaceAssetSaveData >& activeAssetData) + void EditorWorkspace::ConfigureActiveAssets(SourceHandle focussedAssetId, const AZStd::vector< WorkspaceAssetSaveData >& activeAssetData) { m_focusedAssetId = focussedAssetId; m_activeAssetData = activeAssetData; } - AZ::Data::AssetId EditorWorkspace::GetFocusedAssetId() const + SourceHandle EditorWorkspace::GetFocusedAssetId() const { return m_focusedAssetId; } diff --git a/Gems/ScriptCanvas/Code/Editor/Settings.h b/Gems/ScriptCanvas/Code/Editor/Settings.h index 8359e2a580..27039d8a70 100644 --- a/Gems/ScriptCanvas/Code/Editor/Settings.h +++ b/Gems/ScriptCanvas/Code/Editor/Settings.h @@ -11,6 +11,7 @@ #include #include #include +#include // qdatastream.h(173): warning C4251: 'QDataStream::d': class 'QScopedPointer>' needs to have dll-interface to be used by clients of class 'QDataStream' // qwidget.h(858): warning C4800: 'uint': forcing value to bool 'true' or 'false' (performance warning) diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index f901915fdb..0246071172 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -209,7 +209,7 @@ namespace ScriptCanvasEditor if (!entitiesWithScriptCanvas.empty()) { QMenu* scriptCanvasMenu = nullptr; - QAction* action = nullptr; + // QAction* action = nullptr; // For entities with script canvas component, create a context menu to open any existing script canvases within each selected entity. for (const AZ::EntityId& entityId : entitiesWithScriptCanvas) @@ -242,31 +242,32 @@ namespace ScriptCanvasEditor AZStd::unordered_set< AZ::Data::AssetId > usedIds; - for (const auto& assetId : assetIds.values) - { - if (!assetId.IsValid() || usedIds.count(assetId) != 0) - { - continue; - } - - entityMenu->setEnabled(true); - - usedIds.insert(assetId); - - AZStd::string rootPath; - AZ::Data::AssetInfo assetInfo = AssetHelpers::GetAssetInfo(assetId, rootPath); - - AZStd::string displayName; - AZ::StringFunc::Path::GetFileName(assetInfo.m_relativePath.c_str(), displayName); - - action = entityMenu->addAction(QString("%1").arg(QString(displayName.c_str()))); - - QObject::connect(action, &QAction::triggered, [assetId] - { - AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, assetId, -1); - }); - } + //#sc_editor_asset +// for (const auto& assetId : assetIds.values) +// { +// if (!assetId.IsValid() || usedIds.count(assetId) != 0) +// { +// continue; +// } +// +// entityMenu->setEnabled(true); +// +// usedIds.insert(assetId); +// +// AZStd::string rootPath; +// AZ::Data::AssetInfo assetInfo = AssetHelpers::GetAssetInfo(assetId, rootPath); +// +// AZStd::string displayName; +// AZ::StringFunc::Path::GetFileName(assetInfo.m_relativePath.c_str(), displayName); +// +// action = entityMenu->addAction(QString("%1").arg(QString(displayName.c_str()))); +// +// QObject::connect(action, &QAction::triggered, [assetId] +// { +// AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); +// GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, assetId, -1); +// }); +// } } } } @@ -301,7 +302,10 @@ namespace ScriptCanvasEditor return AzToolsFramework::AssetBrowser::SourceFileDetails(); } - void SystemComponent::AddSourceFileOpeners(const char* fullSourceFileName, [[maybe_unused]] const AZ::Uuid& sourceUUID, AzToolsFramework::AssetBrowser::SourceFileOpenerList& openers) + void SystemComponent::AddSourceFileOpeners + ( [[maybe_unused]] const char* fullSourceFileName + , [[maybe_unused]] const AZ::Uuid& sourceUUID + , [[maybe_unused]] AzToolsFramework::AssetBrowser::SourceFileOpenerList& openers) { using namespace AzToolsFramework; using namespace AzToolsFramework::AssetBrowser; @@ -312,24 +316,24 @@ namespace ScriptCanvasEditor { isScriptCanvasAsset = true; } - - if (isScriptCanvasAsset) - { - auto scriptCanvasEditorCallback = []([[maybe_unused]] const char* fullSourceFileNameInCall, const AZ::Uuid& sourceUUIDInCall) - { - AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - const SourceAssetBrowserEntry* fullDetails = SourceAssetBrowserEntry::GetSourceByUuid(sourceUUIDInCall); - if (fullDetails) - { - AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); - - AzToolsFramework::EditorRequests::Bus::Broadcast(&AzToolsFramework::EditorRequests::OpenViewPane, "Script Canvas"); - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, sourceUUIDInCall, -1); - } - }; - - openers.push_back({ "O3DE_ScriptCanvasEditor", "Open In Script Canvas Editor...", QIcon(), scriptCanvasEditorCallback }); - } + // #sc_editor_asset +// if (isScriptCanvasAsset) +// { +// auto scriptCanvasEditorCallback = []([[maybe_unused]] const char* fullSourceFileNameInCall, const AZ::Uuid& sourceUUIDInCall) +// { +// AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); +// const SourceAssetBrowserEntry* fullDetails = SourceAssetBrowserEntry::GetSourceByUuid(sourceUUIDInCall); +// if (fullDetails) +// { +// AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); +// +// AzToolsFramework::EditorRequests::Bus::Broadcast(&AzToolsFramework::EditorRequests::OpenViewPane, "Script Canvas"); +// GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, sourceUUIDInCall, -1); +// } +// }; +// +// openers.push_back({ "O3DE_ScriptCanvasEditor", "Open In Script Canvas Editor...", QIcon(), scriptCanvasEditorCallback }); +// } } void SystemComponent::OnUserSettingsActivated() diff --git a/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.cpp b/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.cpp index f2da3868de..5d415f5fd9 100644 --- a/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.cpp @@ -26,12 +26,7 @@ namespace ScriptCanvasEditor recentOpenFileLocation = settings.value(SCRIPTCANVASEDITOR_SETTINGS_RECENT_OPEN_FILE_LOCATION_KEY).toString(); settings.endGroup(); - if (recentOpenFileLocation.isEmpty()) - { - return {}; - } - AZ::Data::AssetId assetId(recentOpenFileLocation.toUtf8().constData()); - return assetId; + return { nullptr, {}, recentOpenFileLocation.toUtf8().constData() }; } void SetRecentAssetId(SourceHandle assetId) @@ -39,7 +34,7 @@ namespace ScriptCanvasEditor QSettings settings(QSettings::IniFormat, QSettings::UserScope, SCRIPTCANVASEDITOR_AZ_QCOREAPPLICATION_SETTINGS_ORGANIZATION_NAME); - AZStd::string guidStr = assetId.m_guid.ToString(); + AZStd::string guidStr = assetId.Id().ToString(); settings.beginGroup(SCRIPTCANVASEDITOR_NAME_SHORT); settings.setValue(SCRIPTCANVASEDITOR_SETTINGS_RECENT_OPEN_FILE_LOCATION_KEY, diff --git a/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.h b/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.h index 35666d7c34..aaef02ca58 100644 --- a/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.h +++ b/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.h @@ -8,6 +8,7 @@ #pragma once #include +#include namespace ScriptCanvasEditor { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp index dfa39b0047..359d262d6c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp @@ -69,8 +69,6 @@ namespace ScriptCanvasEditor void CanvasWidget::ShowScene(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) { EditorGraphRequests* editorGraphRequests = EditorGraphRequestBus::FindFirstHandler(scriptCanvasId); - - editorGraphRequests->SetAssetId(m_assetId); editorGraphRequests->CreateGraphCanvasScene(); AZ::EntityId graphCanvasSceneId = editorGraphRequests->GetGraphCanvasGraphId(); @@ -83,11 +81,6 @@ namespace ScriptCanvasEditor void CanvasWidget::SetAssetId(const AZ::Data::AssetId& assetId) { m_assetId = assetId; - - if (EditorGraphRequests* editorGraphRequests = EditorGraphRequestBus::FindFirstHandler(m_scriptCanvasId)) - { - editorGraphRequests->SetAssetId(m_assetId); - } } const GraphCanvas::ViewId& CanvasWidget::GetViewId() const diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index f2963287c6..6db4b5bd3e 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -44,49 +44,50 @@ namespace ScriptCanvasEditor connect(this, &QTabBar::customContextMenuRequested, this, &GraphTabBar::OnContextMenu); } - void GraphTabBar::AddGraphTab(const AZ::Data::AssetId& assetId) + void GraphTabBar::AddGraphTab(ScriptCanvasEditor::SourceHandle assetId) { InsertGraphTab(count(), assetId); } - int GraphTabBar::InsertGraphTab(int tabIndex, const AZ::Data::AssetId& assetId) + int GraphTabBar::InsertGraphTab([[maybe_unused]] int tabIndex, [[maybe_unused]] ScriptCanvasEditor::SourceHandle assetId) { - if (!SelectTab(assetId)) - { - AZStd::shared_ptr memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - - if (memoryAsset) - { - ScriptCanvas::AssetDescription assetDescription = memoryAsset->GetAsset().Get()->GetAssetDescription(); - - QIcon tabIcon = QIcon(assetDescription.GetIconPathImpl()); - int newTabIndex = qobject_cast(parent())->insertTab(tabIndex, new QWidget(), tabIcon, ""); - - CanvasWidget* canvasWidget = memoryAsset->CreateView(this); - - canvasWidget->SetDefaultBorderColor(assetDescription.GetDisplayColorImpl()); - - AZStd::string tabName; - AzFramework::StringFunc::Path::GetFileName(memoryAsset->GetAbsolutePath().c_str(), tabName); - - ConfigureTab(newTabIndex, assetId, tabName); - - // new graphs will need to use their in-memory assetid which we'll need to update - // upon saving the asset - if (!memoryAsset->GetFileAssetId().IsValid()) - { - setTabData(newTabIndex, QVariant::fromValue(memoryAsset->GetId())); - } - - return newTabIndex; - } - } + // #sc_editor_asset + // if (!SelectTab(assetId)) +// { +// AZStd::shared_ptr memoryAsset; +// AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); +// +// if (memoryAsset) +// { +// ScriptCanvas::AssetDescription assetDescription = memoryAsset->GetAsset().Get()->GetAssetDescription(); +// +// QIcon tabIcon = QIcon(assetDescription.GetIconPathImpl()); +// int newTabIndex = qobject_cast(parent())->insertTab(tabIndex, new QWidget(), tabIcon, ""); +// +// CanvasWidget* canvasWidget = memoryAsset->CreateView(this); +// +// canvasWidget->SetDefaultBorderColor(assetDescription.GetDisplayColorImpl()); +// +// AZStd::string tabName; +// AzFramework::StringFunc::Path::GetFileName(memoryAsset->GetAbsolutePath().c_str(), tabName); +// +// ConfigureTab(newTabIndex, assetId, tabName); +// +// // new graphs will need to use their in-memory assetid which we'll need to update +// // upon saving the asset +// if (!memoryAsset->GetFileAssetId().IsValid()) +// { +// setTabData(newTabIndex, QVariant::fromValue(memoryAsset->GetId())); +// } +// +// return newTabIndex; +// } +// } return -1; } - bool GraphTabBar::SelectTab(const AZ::Data::AssetId& assetId) + bool GraphTabBar::SelectTab(ScriptCanvasEditor::SourceHandle assetId) { int tabIndex = FindTab(assetId); if (-1 != tabIndex) @@ -97,7 +98,7 @@ namespace ScriptCanvasEditor return false; } - void GraphTabBar::ConfigureTab(int tabIndex, AZ::Data::AssetId fileAssetId, const AZStd::string& tabName) + void GraphTabBar::ConfigureTab(int tabIndex, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName) { if (fileAssetId.IsValid()) { @@ -105,29 +106,32 @@ namespace ScriptCanvasEditor if (tabDataVariant.isValid()) { - auto tabAssetId = tabDataVariant.value(); - MemoryAssetNotificationBus::MultiHandler::BusDisconnect(tabAssetId); + // #se_editor_asset + // auto tabAssetId = tabDataVariant.value(); + // MemoryAssetNotificationBus::MultiHandler::BusDisconnect(tabAssetId); } setTabData(tabIndex, QVariant::fromValue(fileAssetId)); - MemoryAssetNotificationBus::MultiHandler::BusConnect(fileAssetId); + // #se_editor_asset + // MemoryAssetNotificationBus::MultiHandler::BusConnect(fileAssetId); } + // #se_editor_asset Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; - AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); + // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); SetTabText(tabIndex, tabName.c_str(), fileState); } - int GraphTabBar::FindTab(const AZ::Data::AssetId& assetId) const + int GraphTabBar::FindTab(ScriptCanvasEditor::SourceHandle assetId) const { for (int tabIndex = 0; tabIndex < count(); ++tabIndex) { QVariant tabDataVariant = tabData(tabIndex); if (tabDataVariant.isValid()) { - auto tabAssetId = tabDataVariant.value(); + auto tabAssetId = tabDataVariant.value(); if (tabAssetId == assetId) { return tabIndex; @@ -137,16 +141,16 @@ namespace ScriptCanvasEditor return -1; } - AZ::Data::AssetId GraphTabBar::FindAssetId(int tabIndex) + ScriptCanvasEditor::SourceHandle GraphTabBar::FindAssetId(int tabIndex) { QVariant dataVariant = tabData(tabIndex); if (dataVariant.isValid()) { - auto tabAssetId = dataVariant.value(); + auto tabAssetId = dataVariant.value(); return tabAssetId; } - return AZ::Data::AssetId(); + return ScriptCanvasEditor::SourceHandle(); } void GraphTabBar::CloseTab(int index) @@ -263,19 +267,20 @@ namespace ScriptCanvasEditor AzQtComponents::TabBar::mouseReleaseEvent(event); } - void GraphTabBar::OnFileStateChanged(Tracker::ScriptCanvasFileState fileState) + void GraphTabBar::OnFileStateChanged(Tracker::ScriptCanvasFileState ) { - const AZ::Data::AssetId* fileAssetId = MemoryAssetNotificationBus::GetCurrentBusId(); - - if (fileAssetId) - { - SetFileState((*fileAssetId), fileState); - - if (FindTab((*fileAssetId)) == currentIndex()) - { - Q_EMIT OnActiveFileStateChanged(); - } - } + // #se_editor_asset + // const AZ::Data::AssetId* fileAssetId = MemoryAssetNotificationBus::GetCurrentBusId(); + +// if (fileAssetId) +// { +// SetFileState((*fileAssetId), fileState); +// +// if (FindTab((*fileAssetId)) == currentIndex()) +// { +// Q_EMIT OnActiveFileStateChanged(); +// } +// } } void GraphTabBar::SetTabText(int tabIndex, const QString& path, Tracker::ScriptCanvasFileState fileState) @@ -329,7 +334,8 @@ namespace ScriptCanvasEditor auto assetId = tabdata.value(); - ScriptCanvasEditor::GeneralRequestBus::Broadcast(&ScriptCanvasEditor::GeneralRequests::OnChangeActiveGraphTab, assetId); + // #sc_editor_asset + // ScriptCanvasEditor::GeneralRequestBus::Broadcast(&ScriptCanvasEditor::GeneralRequests::OnChangeActiveGraphTab, assetId); if (m_signalSaveOnChangeTo >= 0 && m_signalSaveOnChangeTo == index) { @@ -338,22 +344,23 @@ namespace ScriptCanvasEditor } } - void GraphTabBar::SetFileState(AZ::Data::AssetId assetId, Tracker::ScriptCanvasFileState fileState) + void GraphTabBar::SetFileState(ScriptCanvasEditor::SourceHandle, Tracker::ScriptCanvasFileState ) { - int index = FindTab(assetId); - - if (index >= 0 && index < count()) - { - QVariant tabdata = tabData(index); - if (tabdata.isValid()) - { - auto tabAssetId = tabdata.value(); - - AZStd::string tabName; - AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, tabAssetId); - SetTabText(index, tabName.c_str(), fileState); - } - } + // #se_editor_asset + // int index = FindTab(assetId); + +// if (index >= 0 && index < count()) +// { +// QVariant tabdata = tabData(index); +// if (tabdata.isValid()) +// { +// auto tabAssetId = tabdata.value(); +// +// AZStd::string tabName; +// AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, tabAssetId); +// SetTabText(index, tabName.c_str(), fileState); +// } +// } } #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowSession.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowSession.cpp index 5fadb0a81e..2e712cef08 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowSession.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowSession.cpp @@ -256,7 +256,7 @@ namespace ScriptCanvasEditor const AZ::Data::AssetId& assetId = executionItem->GetAssetId(); - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, assetId); + GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, SourceHandle(nullptr, assetId.m_guid, {})); } } } @@ -270,12 +270,12 @@ namespace ScriptCanvasEditor const AZ::Data::AssetId& assetId = executionItem->GetAssetId(); bool isAssetOpen = false; - GeneralRequestBus::BroadcastResult(isAssetOpen, &GeneralRequests::IsScriptCanvasAssetOpen, assetId); + GeneralRequestBus::BroadcastResult(isAssetOpen, &GeneralRequests::IsScriptCanvasAssetOpen, SourceHandle(nullptr, assetId.m_guid, {})); - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, assetId); + GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, SourceHandle(nullptr, assetId.m_guid, {})); AZ::EntityId graphCanvasGraphId; - GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, assetId); + GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, SourceHandle(nullptr, assetId.m_guid, {})); if (isAssetOpen) { @@ -348,7 +348,7 @@ namespace ScriptCanvasEditor GeneralRequestBus::BroadcastResult(activeGraphCanvasGraphId, &GeneralRequests::GetActiveGraphCanvasGraphId); AZ::EntityId graphCanvasGraphId; - GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, m_assetId); + GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, SourceHandle(nullptr, m_assetId.m_guid, {})); if (activeGraphCanvasGraphId == graphCanvasGraphId) { @@ -366,7 +366,7 @@ namespace ScriptCanvasEditor GraphCanvas::FocusConfig focusConfig; AZ::EntityId scriptCanvasNodeId; - AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, assetId, assetNodeId); + AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, SourceHandle(nullptr, assetId.m_guid, {}), assetNodeId); GraphCanvas::NodeId graphCanvasNodeId; SceneMemberMappingRequestBus::EventResult(graphCanvasNodeId, scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); @@ -403,12 +403,12 @@ namespace ScriptCanvasEditor void LoggingWindowSession::HighlightElement(const AZ::Data::AssetId& assetId, const AZ::EntityId& assetNodeId) { AZ::EntityId graphCanvasGraphId; - GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, assetId); + GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, SourceHandle(nullptr, assetId.m_guid, {})); if (graphCanvasGraphId.IsValid()) { AZ::EntityId scriptCanvasNodeId; - AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, assetId, assetNodeId); + AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, SourceHandle(nullptr, assetId.m_guid, {}), assetNodeId); GraphCanvas::NodeId graphCanvasNodeId; SceneMemberMappingRequestBus::EventResult(graphCanvasNodeId, scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); @@ -447,7 +447,7 @@ namespace ScriptCanvasEditor if (effectIter != m_highlightEffects.end()) { AZ::EntityId graphCanvasGraphId; - GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, assetId); + GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, SourceHandle(nullptr, assetId.m_guid, {})); if (graphCanvasGraphId.IsValid()) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp index b992d3a289..732aacc993 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp @@ -621,50 +621,51 @@ namespace ScriptCanvasEditor void ExecutionLogTreeItem::ScrapeGraphCanvasData() { - if (!m_graphCanvasGraphId.IsValid()) - { - GeneralRequestBus::BroadcastResult(m_graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, GetAssetId()); - - if (!EditorGraphNotificationBus::Handler::BusIsConnected()) - { - ScriptCanvas::ScriptCanvasId scriptCanvasId; - GeneralRequestBus::BroadcastResult(scriptCanvasId, &GeneralRequests::FindScriptCanvasIdByAssetId, GetAssetId()); - - EditorGraphNotificationBus::Handler::BusConnect(scriptCanvasId); - } - } - - if (m_graphCanvasGraphId.IsValid()) - { - if (!m_graphCanvasNodeId.IsValid()) - { - AssetGraphSceneBus::BroadcastResult(m_scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_scriptCanvasAssetNodeId); - SceneMemberMappingRequestBus::EventResult(m_graphCanvasNodeId, m_scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); - } - - if (m_graphCanvasNodeId.IsValid()) - { - const bool refreshDisplayData = false; - ResolveWrapperNode(refreshDisplayData); - - AZStd::string displayName; - GraphCanvas::NodeTitleRequestBus::EventResult(displayName, m_graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::GetTitle); - - if (!displayName.empty()) - { - m_displayName = displayName.c_str(); - } - - GraphCanvas::NodeTitleRequestBus::Event(m_graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::ConfigureIconConfiguration, m_paletteConfiguration); - - OnStylesLoaded(); - - PopulateInputSlotData(); - PopulateOutputSlotData(); - - SignalDataChanged(); - } - } + // #sc_editor_asset +// if (!m_graphCanvasGraphId.IsValid()) +// { +// GeneralRequestBus::BroadcastResult(m_graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, GetAssetId()); +// +// if (!EditorGraphNotificationBus::Handler::BusIsConnected()) +// { +// ScriptCanvas::ScriptCanvasId scriptCanvasId; +// GeneralRequestBus::BroadcastResult(scriptCanvasId, &GeneralRequests::FindScriptCanvasIdByAssetId, GetAssetId()); +// +// EditorGraphNotificationBus::Handler::BusConnect(scriptCanvasId); +// } +// } +// +// if (m_graphCanvasGraphId.IsValid()) +// { +// if (!m_graphCanvasNodeId.IsValid()) +// { +// AssetGraphSceneBus::BroadcastResult(m_scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_scriptCanvasAssetNodeId); +// SceneMemberMappingRequestBus::EventResult(m_graphCanvasNodeId, m_scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); +// } +// +// if (m_graphCanvasNodeId.IsValid()) +// { +// const bool refreshDisplayData = false; +// ResolveWrapperNode(refreshDisplayData); +// +// AZStd::string displayName; +// GraphCanvas::NodeTitleRequestBus::EventResult(displayName, m_graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::GetTitle); +// +// if (!displayName.empty()) +// { +// m_displayName = displayName.c_str(); +// } +// +// GraphCanvas::NodeTitleRequestBus::Event(m_graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::ConfigureIconConfiguration, m_paletteConfiguration); +// +// OnStylesLoaded(); +// +// PopulateInputSlotData(); +// PopulateOutputSlotData(); +// +// SignalDataChanged(); +// } +// } } void ExecutionLogTreeItem::PopulateInputSlotData() @@ -806,7 +807,8 @@ namespace ScriptCanvasEditor { if (!m_graphCanvasGraphId.IsValid()) { - GeneralRequestBus::BroadcastResult(m_graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, m_graphIdentifier.m_assetId); + // #sc_editor_asset + // GeneralRequestBus::BroadcastResult(m_graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, m_graphIdentifier.m_assetId); } ScrapeInputName(); @@ -828,7 +830,8 @@ namespace ScriptCanvasEditor if (m_graphCanvasGraphId.IsValid() && m_assetInputEndpoint.IsValid()) { AZ::EntityId scriptCanvasNodeId; - AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_assetInputEndpoint.GetNodeId()); + // #sc_editor_asset + // AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_assetInputEndpoint.GetNodeId()); GraphCanvas::NodeId graphCanvasNodeId; SceneMemberMappingRequestBus::EventResult(graphCanvasNodeId, scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); @@ -851,7 +854,8 @@ namespace ScriptCanvasEditor if (m_graphCanvasGraphId.IsValid() && m_assetOutputEndpoint.IsValid()) { AZ::EntityId scriptCanvasNodeId; - AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_assetOutputEndpoint.GetNodeId()); + // #sc_editor_asset + // AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_assetOutputEndpoint.GetNodeId()); GraphCanvas::NodeId graphCanvasNodeId; SceneMemberMappingRequestBus::EventResult(graphCanvasNodeId, scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp index a34b42bed8..d085ebbbcf 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp @@ -405,18 +405,18 @@ namespace ScriptCanvasEditor { sourceIndex = proxyModel->mapToSource(modelIndex); } - - PivotTreeItem* pivotTreeItem = static_cast(sourceIndex.internalPointer()); - - if (pivotTreeItem) - { - PivotTreeGraphItem* graphItem = azrtti_cast(pivotTreeItem); - - if (graphItem) - { - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, graphItem->GetAssetId()); - } - } + // #sc_editor_asset +// PivotTreeItem* pivotTreeItem = static_cast(sourceIndex.internalPointer()); +// +// if (pivotTreeItem) +// { +// PivotTreeGraphItem* graphItem = azrtti_cast(pivotTreeItem); +// +// if (graphItem) +// { +// GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, graphItem->GetAssetId()); +// } +// } } #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.cpp index 50a5e8ac1a..6473dcbb40 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.cpp @@ -129,7 +129,8 @@ namespace ScriptCanvasEditor { if (row == NodePaletteTreeItem::Column::Customization) { - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, GetSourceAssetId(), -1); + // #sc_editor_asset + // GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, GetSourceAssetId(), -1); } } @@ -137,8 +138,9 @@ namespace ScriptCanvasEditor { if (row != NodePaletteTreeItem::Column::Customization) { - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, GetSourceAssetId(), -1); - return true; + // #sc_editor_asset + // GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, GetSourceAssetId(), -1); + // return true; } return false; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp index ece93955bb..9538a5732a 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp @@ -257,7 +257,8 @@ namespace ScriptCanvasEditor if (treeItem->GetAssetId().IsValid()) { - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, treeItem->GetAssetId()); + // #sc_editor_asset + // GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, treeItem->GetAssetId()); } } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp index 6142729bfe..a60c59ad7e 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp @@ -433,7 +433,7 @@ namespace ScriptCanvasEditor AZ::Data::AssetId sourceAssetId(sourceUuid, 0); AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAssetId, sourceAssetId); + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAssetId, ScriptCanvasEditor::SourceHandle(nullptr, sourceUuid, {})); if (!openOutcome) { AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 424ef60ecc..207b7ec077 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -821,7 +821,7 @@ namespace ScriptCanvasEditor void MainWindow::SignalActiveSceneChanged(ScriptCanvasEditor::SourceHandle assetId) { - // #sc-editor-asset + // #se_editor_asset /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -940,7 +940,7 @@ namespace ScriptCanvasEditor if (shouldSaveResults == UnsavedChangesOptions::SAVE) { - // #sc-editor-asset + // #se_editor_asset // Callbacks::OnSave saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr, ScriptCanvasEditor::SourceHandle) // { // if (isSuccessful) @@ -1140,7 +1140,7 @@ namespace ScriptCanvasEditor void MainWindow::MarkAssetModified(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { -// #sc-editor-asset if (!assetId.IsValid()) +// #se_editor_asset if (!assetId.IsValid()) // { // return; // } @@ -1161,7 +1161,7 @@ namespace ScriptCanvasEditor void MainWindow::RefreshScriptCanvasAsset(const AZ::Data::Asset& /*asset*/) { - // #sc-editor-asset + // #se_editor_asset /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, asset.GetId()); @@ -1196,7 +1196,7 @@ namespace ScriptCanvasEditor AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& /*fileAssetId*/) { - // #sc-editor-asset + // #se_editor_asset return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAssetId")); /* if (!fileAssetId.IsValid()) @@ -1262,7 +1262,7 @@ namespace ScriptCanvasEditor AZ::Outcome MainWindow::OpenScriptCanvasAsset(const ScriptCanvasMemoryAsset& /*scriptCanvasAsset*/, int /*tabIndex*/ /*= -1*/) { - // #sc-editor-asset + // #se_editor_asset return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAsset")); /* const ScriptCanvasEditor::SourceHandle& fileAssetId = scriptCanvasAsset.GetFileAssetId(); @@ -1341,7 +1341,7 @@ namespace ScriptCanvasEditor AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle /*scriptCanvasAssetId*/, int /*tabIndex*/ /*= -1*/) { - // #sc-editor-asset + // #se_editor_asset return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAsset")); /* ScriptCanvasMemoryAsset::pointer memoryAsset; @@ -1361,14 +1361,14 @@ namespace ScriptCanvasEditor int MainWindow::CreateAssetTab(const ScriptCanvasEditor::SourceHandle& /*assetId*/, int /*tabIndex*/) { - // #sc-editor-asset + // #se_editor_asset return -1; // return m_tabBar->InsertGraphTab(tabIndex, assetId); } AZ::Outcome MainWindow::UpdateScriptCanvasAsset(const AZ::Data::Asset& /*scriptCanvasAsset*/) { - // #sc-editor-asset + // #se_editor_asset return AZ::Failure(AZStd::string("rewrite MainWindow::UpdateScriptCanvasAsset")); /* @@ -1393,7 +1393,7 @@ namespace ScriptCanvasEditor void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { - // #sc-editor-asset move what is necessary to the widget + // #se_editor_asset move what is necessary to the widget /* AssetHelpers::PrintInfo("RemoveScriptCanvasAsset : %s", AssetHelpers::AssetIdToString(assetId).c_str()); @@ -1467,7 +1467,7 @@ namespace ScriptCanvasEditor bool MainWindow::IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const { - // #sc-editor-asset + // #se_editor_asset return false; } @@ -1483,7 +1483,7 @@ namespace ScriptCanvasEditor void MainWindow::GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZStd::string& /*filePath*/, AZStd::string& /*fileFilter*/) { - // #sc-editor-asset + // #se_editor_asset /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -1895,7 +1895,7 @@ namespace ScriptCanvasEditor void MainWindow::OnSaveCallback(bool /*saveSuccess*/, AZ::Data::AssetPtr /*fileAsset*/, ScriptCanvasEditor::SourceHandle /*previousFileAssetId*/) { - // #sc-editor-asset yikes...just save the thing...move to ::SaveAsset maybe + // #se_editor_asset yikes...just save the thing...move to ::SaveAsset maybe /* ScriptCanvasMemoryAsset::pointer memoryAsset; @@ -2568,7 +2568,7 @@ namespace ScriptCanvasEditor AZ::EntityId MainWindow::GetActiveGraphCanvasGraphId() const { - // #sc-editor-asset + // #se_editor_asset // AZ::EntityId graphId; // AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, m_activeGraph); @@ -2591,13 +2591,13 @@ namespace ScriptCanvasEditor { // ScriptCanvas::ScriptCanvasId sceneId; // AssetTrackerRequestBus::BroadcastResult(sceneId, &AssetTrackerRequests::GetScriptCanvasId, m_activeGraph); - // #sc-editor-asset + // #se_editor_asset return ScriptCanvas::ScriptCanvasId{}; } GraphCanvas::GraphId MainWindow::GetGraphCanvasGraphId(const ScriptCanvas::ScriptCanvasId& /*scriptCanvasId*/) const { - // #sc-editor-asset + // #se_editor_asset // AZ::EntityId graphCanvasId; // AssetTrackerRequestBus::BroadcastResult(graphCanvasId, &AssetTrackerRequests::GetGraphCanvasId, scriptCanvasId); // move to widget @@ -2606,7 +2606,7 @@ namespace ScriptCanvasEditor GraphCanvas::GraphId MainWindow::FindGraphCanvasGraphIdByAssetId(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const { - // #sc-editor-asset + // #se_editor_asset // AZ::EntityId graphId; // AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, assetId); return AZ::EntityId{}; @@ -2614,7 +2614,7 @@ namespace ScriptCanvasEditor ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const { - // #sc-editor-asset + // #se_editor_asset // ScriptCanvas::ScriptCanvasId scriptCanvasId; // AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasId, assetId); return ScriptCanvas::ScriptCanvasId{}; @@ -2622,7 +2622,7 @@ namespace ScriptCanvasEditor ScriptCanvas::ScriptCanvasId MainWindow::GetScriptCanvasId(const GraphCanvas::GraphId& /*graphCanvasGraphId*/) const { - // #sc-editor-asset + // #se_editor_asset // ScriptCanvas::ScriptCanvasId scriptCanvasId; // AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasIdFromGraphId, graphCanvasGraphId); return ScriptCanvas::ScriptCanvasId{}; @@ -2630,7 +2630,7 @@ namespace ScriptCanvasEditor bool MainWindow::IsInUndoRedo(const AZ::EntityId& graphCanvasGraphId) const { - // #sc-editor-asset + // #se_editor_asset bool isActive = false; UndoRequestBus::EventResult(isActive, GetScriptCanvasId(graphCanvasGraphId), &UndoRequests::IsActive); return isActive; @@ -2685,7 +2685,7 @@ namespace ScriptCanvasEditor void MainWindow::ReconnectSceneBuses(ScriptCanvasEditor::SourceHandle /*previousAssetId*/, ScriptCanvasEditor::SourceHandle /*nextAssetId*/) { - // #sc-editor-asset + // #se_editor_asset /* ScriptCanvasMemoryAsset::pointer previousAsset; AssetTrackerRequestBus::BroadcastResult(previousAsset, &AssetTrackerRequests::GetAsset, previousAssetId); @@ -2723,7 +2723,7 @@ namespace ScriptCanvasEditor void MainWindow::SetActiveAsset(const ScriptCanvasEditor::SourceHandle& /*fileAssetId*/) { - // #sc-editor-asset + // #se_editor_asset /* if (m_activeGraph == fileAssetId) { @@ -2788,7 +2788,7 @@ namespace ScriptCanvasEditor void MainWindow::RefreshActiveAsset() { - // #sc-editor-asset + // #se_editor_asset /* if (m_activeGraph.IsValid()) { @@ -2838,7 +2838,7 @@ namespace ScriptCanvasEditor void MainWindow::Clear() { m_tabBar->CloseAllTabs(); - // #sc-editor-asset + // #se_editor_asset // // AssetTrackerRequests::AssetList assets; // AssetTrackerRequestBus::BroadcastResult(assets, &AssetTrackerRequests::GetAssets); @@ -2862,7 +2862,7 @@ namespace ScriptCanvasEditor Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::NEW; bool isSaving = false; - // #sc-editor-asset Get from widgets + // #se_editor_asset Get from widgets /* AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, fileAssetId); @@ -2878,7 +2878,7 @@ namespace ScriptCanvasEditor { SetActiveAsset(fileAssetId); - // #sc-editor-asset + // #se_editor_asset AZStd::string tabName = "Get from widget"; // AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, fileAssetId); @@ -2887,7 +2887,7 @@ namespace ScriptCanvasEditor if (saveDialogResults == UnsavedChangesOptions::SAVE) { - // #sc-editor-asset + // #se_editor_asset // auto saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle) // { // if (isSuccessful) @@ -2958,7 +2958,7 @@ namespace ScriptCanvasEditor void MainWindow::CopyPathToClipboard(int /*index*/) { - // #sc-editor-asset + // #se_editor_asset /* QVariant tabdata = m_tabBar->tabData(index); @@ -3696,7 +3696,7 @@ namespace ScriptCanvasEditor void MainWindow::UpdateSaveState() { - // #sc-editor-asset todo, consider making blocking + // #se_editor_asset todo, consider making blocking // bool enabled = m_activeGraph.IsValid(); // bool isSaving = false; // bool hasModifications = false; @@ -3912,7 +3912,7 @@ namespace ScriptCanvasEditor AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZ::EntityId /*assetNodeId*/) const { - // #sc-editor-asset + // #se_editor_asset return AZ::EntityId{}; // AZ::EntityId editorEntityId; // AssetTrackerRequestBus::BroadcastResult(editorEntityId, &AssetTrackerRequests::GetEditorEntityIdFromSceneEntityId, assetId, assetNodeId); @@ -3921,7 +3921,7 @@ namespace ScriptCanvasEditor AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZ::EntityId /*editorNodeId*/) const { - // #sc-editor-asset + // #se_editor_asset return AZ::EntityId{}; // AZ::EntityId sceneEntityId; // AssetTrackerRequestBus::BroadcastResult(sceneEntityId, &AssetTrackerRequests::GetSceneEntityIdFromEditorEntityId, assetId, editorNodeId); @@ -4415,7 +4415,7 @@ namespace ScriptCanvasEditor void MainWindow::OnAssignToSelectedEntities() { - // #sc-editor-asset consider cutting + // #se_editor_asset consider cutting // Tracker::ScriptCanvasFileState fileState; // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, m_activeGraph); // @@ -4489,7 +4489,7 @@ namespace ScriptCanvasEditor ScriptCanvasEditor::Tracker::ScriptCanvasFileState MainWindow::GetAssetFileState(ScriptCanvasEditor::SourceHandle /*assetId*/) const { - // #sc-editor-asset + // #se_editor_asset return Tracker::ScriptCanvasFileState::INVALID; // Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, assetId); @@ -4542,7 +4542,7 @@ namespace ScriptCanvasEditor if (usableRequestBus) { ScriptCanvasMemoryAsset::pointer memoryAsset; - // #sc-editor-asset + // #se_editor_asset // AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); if (memoryAsset) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp index 14bc1c4dc8..e88675814b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp @@ -99,7 +99,8 @@ namespace ScriptCanvasEditor if (assetId.IsValid()) { - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, assetId, -1); + // #sc_editor_asset + // GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, assetId, -1); } if (!openOutcome) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index e598700899..09c21fe43f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -13,10 +13,13 @@ #include #include #include +// #include #include "Core.h" #include "Attributes.h" +#include + namespace ScriptCanvas { ScopedAuxiliaryEntityHandler::ScopedAuxiliaryEntityHandler(AZ::Entity* buildEntity) @@ -234,4 +237,36 @@ namespace ScriptCanvasEditor { return m_path; } + + AZStd::string SourceHandle::ToString() const + { + return AZStd::string::format + ( "%s, %s, %s" + , IsValid() ? "O" : "X" + , m_path.empty() ? m_path.c_str() : "" + , m_id.IsNull() ? "" : m_id.ToString().c_str()); + } +} + +namespace ScriptCanvas +{ + const Graph* ScriptCanvasData::GetGraph() const + { + return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); + } + + const ScriptCanvasEditor::Graph* ScriptCanvasData::GetEditorGraph() const + { + return reinterpret_cast(GetGraph()); + } + + Graph* ScriptCanvasData::ModGraph() + { + return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); + } + + ScriptCanvasEditor::Graph* ScriptCanvasData::ModEditorGraph() + { + return reinterpret_cast(ModGraph()); + } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index e2b2ef5919..4c1734413c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -353,6 +353,37 @@ namespace ScriptCanvasEditor }; } +namespace ScriptCanvas +{ + class ScriptCanvasData + { + public: + + AZ_RTTI(ScriptCanvasData, "{1072E894-0C67-4091-8B64-F7DB324AD13C}"); + AZ_CLASS_ALLOCATOR(ScriptCanvasData, AZ::SystemAllocator, 0); + ScriptCanvasData() {} + virtual ~ScriptCanvasData() {} + ScriptCanvasData(ScriptCanvasData&& other); + ScriptCanvasData& operator=(ScriptCanvasData&& other); + + static void Reflect(AZ::ReflectContext* reflectContext); + + AZ::Entity* GetScriptCanvasEntity() const { return m_scriptCanvasEntity.get(); } + + const Graph* GetGraph() const; + + const ScriptCanvasEditor::Graph* GetEditorGraph() const; + + Graph* ModGraph(); + + ScriptCanvasEditor::Graph* ModEditorGraph(); + + AZStd::unique_ptr m_scriptCanvasEntity; + private: + ScriptCanvasData(const ScriptCanvasData&) = delete; + }; +} + namespace AZStd { template<> From cbbd6df0c5e5be14f03e8211d7b47f06d4806f11 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 3 Nov 2021 19:15:44 -0700 Subject: [PATCH 028/399] clean up open pipeline to render graph Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Assets/ScriptCanvasAssetTracker.cpp | 210 ++++----- .../ScriptCanvasAssetTrackerDefinitions.h | 2 +- .../Assets/ScriptCanvasFileHandling.cpp | 6 + .../Editor/Assets/ScriptCanvasMemoryAsset.cpp | 187 ++++---- .../Include/ScriptCanvas/Bus/RequestBus.h | 2 +- .../Code/Editor/View/Widgets/CanvasWidget.cpp | 4 +- .../Code/Editor/View/Widgets/CanvasWidget.h | 7 +- .../Code/Editor/View/Widgets/GraphTabBar.cpp | 203 +++++--- .../Code/Editor/View/Widgets/GraphTabBar.h | 19 +- .../LoggingPanel/LoggingWindowTreeItems.cpp | 31 +- .../LoggingPanel/LoggingWindowTreeItems.h | 12 +- .../Code/Editor/View/Windows/MainWindow.cpp | 437 +++++++----------- .../Code/Editor/View/Windows/MainWindow.h | 7 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 15 + .../Code/Include/ScriptCanvas/Core/Core.h | 23 +- 15 files changed, 606 insertions(+), 559 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp index b24e91889e..513dc6afe5 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp @@ -58,111 +58,111 @@ namespace ScriptCanvasEditor SaveAs(assetId, {}, onSaveCallback); } - void AssetTracker::SaveAs(AZ::Data::AssetId assetId, const AZStd::string& path, Callbacks::OnSave onSaveCallback) - { - auto assetIter = m_assetsInUse.find(assetId); - - if (assetIter != m_assetsInUse.end()) - { - auto onSave = [this, assetId, onSaveCallback](bool saveSuccess, AZ::Data::AssetPtr asset, AZ::Data::AssetId previousFileAssetId) - { - AZ::Data::AssetId signalId = assetId; - AZ::Data::AssetId fileAssetId = asset->GetId(); - - // If there is a previous file Id is valid, it means this is a save-as operation and we need to remap the tracking. - if (previousFileAssetId.IsValid()) - { - if (saveSuccess) - { - fileAssetId = m_assetsInUse[assetId]->GetFileAssetId(); - m_remappedAsset[asset->GetId()] = fileAssetId; - - // Erase the asset first so the smart pointer can deal with it's things. - m_assetsInUse.erase(fileAssetId); - - // Then perform the insert once we know nothing will attempt to delete this while we are operating on it. - m_assetsInUse[fileAssetId] = m_assetsInUse[assetId]; - m_assetsInUse.erase(assetId); - } - - m_savingAssets.erase(assetId); - m_savingAssets.insert(fileAssetId); - - signalId = fileAssetId; - - if (m_queuedCloses.erase(assetId)) - { - m_queuedCloses.insert(fileAssetId); - } - - auto assetIter = m_assetsInUse.find(fileAssetId); - - if (assetIter != m_assetsInUse.end()) - { - AZStd::invoke(onSaveCallback, saveSuccess, m_assetsInUse[fileAssetId]->GetAsset().Get(), previousFileAssetId); - } - else - { - AZ_Error("ScriptCanvas", !saveSuccess, "Unable to find Memory Asset for Asset(%s)", fileAssetId.ToString().c_str()); - AZStd::invoke(onSaveCallback, saveSuccess, asset, previousFileAssetId); - } - } - else - { - if (saveSuccess) - { - // This should be the case when we get a save as from a newly created file. - // - // If we find the 'memory' asset id in the assets in use. This means this was a new file that was saved. - // To maintain all of the look-up stuff, we need to treat this like a remapping stage. - auto assetInUseIter = m_assetsInUse.find(assetId); - if (assetInUseIter != m_assetsInUse.end()) - { - fileAssetId = assetInUseIter->second->GetFileAssetId(); - - if (assetId != fileAssetId) - { - m_remappedAsset[assetId] = fileAssetId; - - m_assetsInUse.erase(fileAssetId); - m_assetsInUse[fileAssetId] = AZStd::move(assetInUseIter->second); - m_assetsInUse.erase(assetId); - - m_savingAssets.erase(assetId); - m_savingAssets.insert(fileAssetId); - - if (m_queuedCloses.erase(assetId)) - { - m_queuedCloses.insert(fileAssetId); - } - } - } - else - { - fileAssetId = CheckAssetId(fileAssetId); - } - - signalId = fileAssetId; - } - - if (onSaveCallback) - { - AZStd::invoke(onSaveCallback, saveSuccess, m_assetsInUse[signalId]->GetAsset().Get(), previousFileAssetId); - } - - AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetSaved, m_assetsInUse[signalId], saveSuccess); - } - - SignalSaveComplete(signalId); - }; - - m_savingAssets.insert(assetId); - assetIter->second->SaveAs(path, onSave); - } - else - { - AZ_Assert(false, "Cannot SaveAs into an existing AssetId"); - } + void AssetTracker::SaveAs(AZ::Data::AssetId /*assetId*/, const AZStd::string& /*path*/, Callbacks::OnSave /*onSaveCallback*/) + { +// auto assetIter = m_assetsInUse.find(assetId); +// +// if (assetIter != m_assetsInUse.end()) +// { +// auto onSave = [this, assetId, onSaveCallback](bool saveSuccess, AZ::Data::AssetPtr asset, AZ::Data::AssetId previousFileAssetId) +// { +// AZ::Data::AssetId signalId = assetId; +// AZ::Data::AssetId fileAssetId = asset->GetId(); +// +// // If there is a previous file Id is valid, it means this is a save-as operation and we need to remap the tracking. +// if (previousFileAssetId.IsValid()) +// { +// if (saveSuccess) +// { +// fileAssetId = m_assetsInUse[assetId]->GetFileAssetId(); +// m_remappedAsset[asset->GetId()] = fileAssetId; +// +// // Erase the asset first so the smart pointer can deal with it's things. +// m_assetsInUse.erase(fileAssetId); +// +// // Then perform the insert once we know nothing will attempt to delete this while we are operating on it. +// m_assetsInUse[fileAssetId] = m_assetsInUse[assetId]; +// m_assetsInUse.erase(assetId); +// } +// +// m_savingAssets.erase(assetId); +// m_savingAssets.insert(fileAssetId); +// +// signalId = fileAssetId; +// +// if (m_queuedCloses.erase(assetId)) +// { +// m_queuedCloses.insert(fileAssetId); +// } +// +// auto assetIter = m_assetsInUse.find(fileAssetId); +// +// if (assetIter != m_assetsInUse.end()) +// { +// AZStd::invoke(onSaveCallback, saveSuccess, m_assetsInUse[fileAssetId]->GetAsset().Get(), previousFileAssetId); +// } +// else +// { +// AZ_Error("ScriptCanvas", !saveSuccess, "Unable to find Memory Asset for Asset(%s)", fileAssetId.ToString().c_str()); +// AZStd::invoke(onSaveCallback, saveSuccess, asset, previousFileAssetId); +// } +// } +// else +// { +// if (saveSuccess) +// { +// // This should be the case when we get a save as from a newly created file. +// // +// // If we find the 'memory' asset id in the assets in use. This means this was a new file that was saved. +// // To maintain all of the look-up stuff, we need to treat this like a remapping stage. +// auto assetInUseIter = m_assetsInUse.find(assetId); +// if (assetInUseIter != m_assetsInUse.end()) +// { +// fileAssetId = assetInUseIter->second->GetFileAssetId(); +// +// if (assetId != fileAssetId) +// { +// m_remappedAsset[assetId] = fileAssetId; +// +// m_assetsInUse.erase(fileAssetId); +// m_assetsInUse[fileAssetId] = AZStd::move(assetInUseIter->second); +// m_assetsInUse.erase(assetId); +// +// m_savingAssets.erase(assetId); +// m_savingAssets.insert(fileAssetId); +// +// if (m_queuedCloses.erase(assetId)) +// { +// m_queuedCloses.insert(fileAssetId); +// } +// } +// } +// else +// { +// fileAssetId = CheckAssetId(fileAssetId); +// } +// +// signalId = fileAssetId; +// } +// +// if (onSaveCallback) +// { +// AZStd::invoke(onSaveCallback, saveSuccess, m_assetsInUse[signalId]->GetAsset().Get(), previousFileAssetId); +// } +// +// AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetSaved, m_assetsInUse[signalId], saveSuccess); +// } +// +// SignalSaveComplete(signalId); +// }; +// +// m_savingAssets.insert(assetId); +// assetIter->second->SaveAs(path, onSave); +// } +// else +// { +// AZ_Assert(false, "Cannot SaveAs into an existing AssetId"); +// } } bool AssetTracker::Load(AZ::Data::AssetId fileAssetId, AZ::Data::AssetType assetType, Callbacks::OnAssetReadyCallback onAssetReadyCallback) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h index e08ce8b74b..2aebf29b24 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h @@ -18,7 +18,7 @@ namespace ScriptCanvasEditor namespace Callbacks { //! Callback used to know when a save operation failed or succeeded - using OnSave = AZStd::function; + using OnSave = AZStd::function; using OnAssetReadyCallback = AZStd::function; using OnAssetCreatedCallback = OnAssetReadyCallback; diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index c21f01bb88..e8ee2ed97c 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -124,6 +124,12 @@ namespace ScriptCanvasEditor } } + if (auto entity = scriptCanvasData->GetScriptCanvasEntity()) + { + entity->Init(); + entity->Activate(); + } + return AZ::Success(ScriptCanvasEditor::SourceHandle(scriptCanvasData, {}, path)); } } diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp index 165007b79b..7af1aa3d9f 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp @@ -283,10 +283,11 @@ namespace ScriptCanvasEditor m_undoHelper = AZStd::make_unique(*this); } - ScriptCanvasEditor::Widget::CanvasWidget* ScriptCanvasMemoryAsset::CreateView(QWidget* parent) + ScriptCanvasEditor::Widget::CanvasWidget* ScriptCanvasMemoryAsset::CreateView(QWidget* /*parent*/) { - m_canvasWidget = new Widget::CanvasWidget(m_fileAssetId, parent); - return m_canvasWidget; + //m_canvasWidget = new Widget::CanvasWidget(m_fileAssetId, parent); + //return m_canvasWidget; + return nullptr; } void ScriptCanvasMemoryAsset::ClearView() @@ -430,68 +431,68 @@ namespace ScriptCanvasEditor } } - void ScriptCanvasMemoryAsset::SourceFileFailed(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid) - { - AZStd::string fullPath; - AzFramework::StringFunc::Path::Join(scanFolder.data(), relativePath.data(), fullPath); - AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, fullPath); - - auto assetPathIdIt = AZStd::find(m_pendingSave.begin(), m_pendingSave.end(), fullPath); - - if (assetPathIdIt != m_pendingSave.end()) - { - if (m_onSaveCallback) - { - m_onSaveCallback(false, m_inMemoryAsset.Get(), AZ::Data::AssetId()); - m_onSaveCallback = nullptr; - } - - m_pendingSave.erase(assetPathIdIt); - } - } - - void ScriptCanvasMemoryAsset::SavingComplete(const AZStd::string& streamName, AZ::Uuid sourceAssetId) - { - AZStd::string normPath = streamName; - AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, normPath); - - auto assetPathIdIt = AZStd::find(m_pendingSave.begin(), m_pendingSave.end(), normPath); - if (assetPathIdIt != m_pendingSave.end()) - { - AZ::Data::AssetId previousFileAssetId; - - if (sourceAssetId != m_fileAssetId.m_guid) - { - previousFileAssetId = m_fileAssetId; - - // The source file has changed, store the AssetId to the canonical asset on file - SetFileAssetId(sourceAssetId); - - } - else if (!m_fileAssetId.IsValid()) - { - SetFileAssetId(sourceAssetId); - } - - m_formerGraphIdPair = AZStd::make_pair(m_scriptCanvasId, m_graphId); - - m_fileState = Tracker::ScriptCanvasFileState::UNMODIFIED; - - m_pendingSave.erase(assetPathIdIt); - - m_absolutePath = m_saveAsPath; - m_saveAsPath.clear(); - - // Connect to the source asset's bus to monitor for situations we may need to handle - AZ::Data::AssetBus::MultiHandler::BusConnect(m_inMemoryAsset.GetId()); - AZ::Data::AssetBus::MultiHandler::BusConnect(m_fileAssetId); - - if (m_onSaveCallback) - { - m_onSaveCallback(true, m_inMemoryAsset.Get(), previousFileAssetId); - m_onSaveCallback = nullptr; - } - } + void ScriptCanvasMemoryAsset::SourceFileFailed(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid) + { +// AZStd::string fullPath; +// AzFramework::StringFunc::Path::Join(scanFolder.data(), relativePath.data(), fullPath); +// AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, fullPath); +// +// auto assetPathIdIt = AZStd::find(m_pendingSave.begin(), m_pendingSave.end(), fullPath); +// +// if (assetPathIdIt != m_pendingSave.end()) +// { +// if (m_onSaveCallback) +// { +// m_onSaveCallback(false, m_inMemoryAsset.Get(), AZ::Data::AssetId()); +// m_onSaveCallback = nullptr; +// } +// +// m_pendingSave.erase(assetPathIdIt); +// } + } + + void ScriptCanvasMemoryAsset::SavingComplete(const AZStd::string& /*streamName*/, AZ::Uuid /*sourceAssetId*/) + { +// AZStd::string normPath = streamName; +// AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, normPath); +// +// auto assetPathIdIt = AZStd::find(m_pendingSave.begin(), m_pendingSave.end(), normPath); +// if (assetPathIdIt != m_pendingSave.end()) +// { +// AZ::Data::AssetId previousFileAssetId; +// +// if (sourceAssetId != m_fileAssetId.m_guid) +// { +// previousFileAssetId = m_fileAssetId; +// +// // The source file has changed, store the AssetId to the canonical asset on file +// SetFileAssetId(sourceAssetId); +// +// } +// else if (!m_fileAssetId.IsValid()) +// { +// SetFileAssetId(sourceAssetId); +// } +// +// m_formerGraphIdPair = AZStd::make_pair(m_scriptCanvasId, m_graphId); +// +// m_fileState = Tracker::ScriptCanvasFileState::UNMODIFIED; +// +// m_pendingSave.erase(assetPathIdIt); +// +// m_absolutePath = m_saveAsPath; +// m_saveAsPath.clear(); +// +// // Connect to the source asset's bus to monitor for situations we may need to handle +// AZ::Data::AssetBus::MultiHandler::BusConnect(m_inMemoryAsset.GetId()); +// AZ::Data::AssetBus::MultiHandler::BusConnect(m_fileAssetId); +// +// if (m_onSaveCallback) +// { +// m_onSaveCallback(true, m_inMemoryAsset.Get(), previousFileAssetId); +// m_onSaveCallback = nullptr; +// } +// } } void ScriptCanvasMemoryAsset::FinalizeAssetSave(bool, const AzToolsFramework::SourceControlFileInfo& fileInfo, const AZ::Data::AssetStreamInfo& saveInfo, Callbacks::OnSave onSaveCallback) @@ -525,14 +526,14 @@ namespace ScriptCanvasEditor UndoNotificationBus::Broadcast(&UndoNotifications::OnCanRedoChanged, m_undoState->m_undoStack->CanRedo()); } - void ScriptCanvasMemoryAsset::SetFileAssetId(const AZ::Data::AssetId& fileAssetId) + void ScriptCanvasMemoryAsset::SetFileAssetId(const AZ::Data::AssetId& /*fileAssetId*/) { - m_fileAssetId = fileAssetId; - - if (m_canvasWidget) - { - m_canvasWidget->SetAssetId(fileAssetId); - } +// m_fileAssetId = fileAssetId; +// +// if (m_canvasWidget) +// { +// m_canvasWidget->SetAssetId(fileAssetId); +// } } void ScriptCanvasMemoryAsset::SignalFileStateChanged() @@ -604,27 +605,27 @@ namespace ScriptCanvasEditor // AssetSaveFinalizer ////////////////////////////////////// - bool AssetSaveFinalizer::ValidateStatus(const AzToolsFramework::SourceControlFileInfo& fileInfo) - { - auto fileIO = AZ::IO::FileIOBase::GetInstance(); - if (fileInfo.IsLockedByOther()) - { - AZ_Error("Script Canvas", !fileInfo.IsLockedByOther(), "The file is already exclusively opened by another user: %s", fileInfo.m_filePath.data()); - AZStd::invoke(m_onSave, false, m_inMemoryAsset, m_fileAssetId); - return false; - } - else if (fileInfo.IsReadOnly() && fileIO->Exists(fileInfo.m_filePath.c_str())) - { - AZ_Error("Script Canvas", !fileInfo.IsReadOnly(), "File %s is read-only. It cannot be saved." - " If this file is in Perforce it may not have been checked out by the Source Control API.", fileInfo.m_filePath.data()); - AZStd::invoke(m_onSave, false, m_inMemoryAsset, m_fileAssetId); - return false; - } - else if (m_saving) - { - AZ_Warning("Script Canvas", false, "Trying to save the same file twice. Will result in one save callback being ignored."); - return false; - } + bool AssetSaveFinalizer::ValidateStatus(const AzToolsFramework::SourceControlFileInfo& /*fileInfo*/) + { +// auto fileIO = AZ::IO::FileIOBase::GetInstance(); +// if (fileInfo.IsLockedByOther()) +// { +// AZ_Error("Script Canvas", !fileInfo.IsLockedByOther(), "The file is already exclusively opened by another user: %s", fileInfo.m_filePath.data()); +// AZStd::invoke(m_onSave, false, m_inMemoryAsset, m_fileAssetId); +// return false; +// } +// else if (fileInfo.IsReadOnly() && fileIO->Exists(fileInfo.m_filePath.c_str())) +// { +// AZ_Error("Script Canvas", !fileInfo.IsReadOnly(), "File %s is read-only. It cannot be saved." +// " If this file is in Perforce it may not have been checked out by the Source Control API.", fileInfo.m_filePath.data()); +// AZStd::invoke(m_onSave, false, m_inMemoryAsset, m_fileAssetId); +// return false; +// } +// else if (m_saving) +// { +// AZ_Warning("Script Canvas", false, "Trying to save the same file twice. Will result in one save callback being ignored."); +// return false; +// } return true; } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h index 8dbaf5b31a..90468f5d8c 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h @@ -163,7 +163,7 @@ namespace ScriptCanvasEditor public: static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - using BusIdType = AZ::Data::AssetId; + using BusIdType = SourceHandle; virtual void OnAssetVisualized() {}; virtual void OnAssetUnloaded() {}; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp index 359d262d6c..722e9d1c71 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp @@ -36,7 +36,7 @@ namespace ScriptCanvasEditor { namespace Widget { - CanvasWidget::CanvasWidget(const AZ::Data::AssetId& assetId, QWidget* parent) + CanvasWidget::CanvasWidget(const ScriptCanvasEditor::SourceHandle& assetId, QWidget* parent) : QWidget(parent) , ui(new Ui::CanvasWidget()) , m_attached(false) @@ -78,7 +78,7 @@ namespace ScriptCanvasEditor m_scriptCanvasId = scriptCanvasId; } - void CanvasWidget::SetAssetId(const AZ::Data::AssetId& assetId) + void CanvasWidget::SetAssetId(const ScriptCanvasEditor::SourceHandle& assetId) { m_assetId = assetId; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.h index 9abb41aacc..fc04486c36 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.h @@ -21,6 +21,7 @@ AZ_POP_DISABLE_WARNING #include #include +#include #endif class QVBoxLayout; @@ -46,13 +47,13 @@ namespace ScriptCanvasEditor Q_OBJECT public: AZ_CLASS_ALLOCATOR(CanvasWidget, AZ::SystemAllocator, 0); - CanvasWidget(const AZ::Data::AssetId& assetId, QWidget* parent = nullptr); + CanvasWidget(const ScriptCanvasEditor::SourceHandle& assetId, QWidget* parent = nullptr); ~CanvasWidget() override; void SetDefaultBorderColor(AZ::Color defaultBorderColor); void ShowScene(const ScriptCanvas::ScriptCanvasId& scriptCanvasId); - void SetAssetId(const AZ::Data::AssetId& assetId); + void SetAssetId(const ScriptCanvasEditor::SourceHandle& assetId); const GraphCanvas::ViewId& GetViewId() const; @@ -69,7 +70,7 @@ namespace ScriptCanvasEditor void SetupGraphicsView(); - AZ::Data::AssetId m_assetId; + ScriptCanvasEditor::SourceHandle m_assetId; AZStd::unique_ptr ui; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index 6db4b5bd3e..ce8c280b35 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -23,6 +23,8 @@ #include +#include + namespace ScriptCanvasEditor { namespace Widget @@ -31,7 +33,7 @@ namespace ScriptCanvasEditor // GraphTabBar //////////////// - GraphTabBar::GraphTabBar(QWidget* parent /*= nullptr*/) + GraphTabBar::GraphTabBar(QWidget* parent) : AzQtComponents::TabBar(parent) { setTabsClosable(true); @@ -49,40 +51,81 @@ namespace ScriptCanvasEditor InsertGraphTab(count(), assetId); } - int GraphTabBar::InsertGraphTab([[maybe_unused]] int tabIndex, [[maybe_unused]] ScriptCanvasEditor::SourceHandle assetId) + void GraphTabBar::ClearTabView(int tabIndex) { - // #sc_editor_asset - // if (!SelectTab(assetId)) -// { -// AZStd::shared_ptr memoryAsset; -// AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); -// -// if (memoryAsset) -// { -// ScriptCanvas::AssetDescription assetDescription = memoryAsset->GetAsset().Get()->GetAssetDescription(); -// -// QIcon tabIcon = QIcon(assetDescription.GetIconPathImpl()); -// int newTabIndex = qobject_cast(parent())->insertTab(tabIndex, new QWidget(), tabIcon, ""); -// -// CanvasWidget* canvasWidget = memoryAsset->CreateView(this); -// -// canvasWidget->SetDefaultBorderColor(assetDescription.GetDisplayColorImpl()); -// -// AZStd::string tabName; -// AzFramework::StringFunc::Path::GetFileName(memoryAsset->GetAbsolutePath().c_str(), tabName); -// -// ConfigureTab(newTabIndex, assetId, tabName); -// -// // new graphs will need to use their in-memory assetid which we'll need to update -// // upon saving the asset -// if (!memoryAsset->GetFileAssetId().IsValid()) -// { -// setTabData(newTabIndex, QVariant::fromValue(memoryAsset->GetId())); -// } -// -// return newTabIndex; -// } -// } + if (tabIndex < count()) + { + if (QVariant tabDataVariant = tabData(tabIndex); tabDataVariant.isValid()) + { + GraphTabMetadata replacement = tabDataVariant.value(); + if (replacement.m_canvasWidget) + { + delete replacement.m_canvasWidget; + replacement.m_canvasWidget = nullptr; + tabDataVariant.setValue(replacement); + setTabData(tabIndex, tabDataVariant); + } + } + } + } + + CanvasWidget* GraphTabBar::ModOrCreateTabView(int tabIndex) + { + if (tabIndex < count()) + { + if (QVariant tabDataVariant = tabData(tabIndex); tabDataVariant.isValid()) + { + if (!tabDataVariant.value().m_canvasWidget) + { + CanvasWidget* canvasWidget = new CanvasWidget(tabDataVariant.value().m_assetId, this); + canvasWidget->SetDefaultBorderColor(ScriptCanvasAssetDescription().GetDisplayColorImpl()); + GraphTabMetadata replacement = tabDataVariant.value(); + replacement.m_canvasWidget = canvasWidget; + tabDataVariant.setValue(replacement); + setTabData(tabIndex, tabDataVariant); + } + + return tabDataVariant.value().m_canvasWidget; + } + } + + return nullptr; + } + + CanvasWidget* GraphTabBar::ModTabView(int tabIndex) + { + if (tabIndex < count()) + { + if (QVariant tabDataVariant = tabData(tabIndex); tabDataVariant.isValid()) + { + return tabDataVariant.value().m_canvasWidget; + } + } + + return nullptr; + } + + int GraphTabBar::InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId) + { + if (!SelectTab(assetId)) + { + QIcon tabIcon = QIcon(ScriptCanvasAssetDescription().GetIconPathImpl()); + tabIndex = qobject_cast(parent())->insertTab(tabIndex, new QWidget(), tabIcon, ""); + GraphTabMetadata metaData; + CanvasWidget* canvasWidget = new CanvasWidget(assetId, this); + canvasWidget->SetDefaultBorderColor(ScriptCanvasAssetDescription().GetDisplayColorImpl()); + metaData.m_canvasWidget = canvasWidget; + + AZStd::string tabName; + AzFramework::StringFunc::Path::GetFileName(assetId.Path().c_str(), tabName); + + // #sc_editor_asset filestate + Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; + // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); + SetTabText(tabIndex, tabName.c_str(), fileState); + setTabData(tabIndex, QVariant::fromValue(metaData)); + return tabIndex; + } return -1; } @@ -98,47 +141,46 @@ namespace ScriptCanvasEditor return false; } - void GraphTabBar::ConfigureTab(int tabIndex, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName) +// void GraphTabBar::ConfigureTab(int /*tabIndex*/, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName) +// { +// +// } + + int GraphTabBar::FindTab(ScriptCanvasEditor::SourceHandle assetId) const { - if (fileAssetId.IsValid()) + for (int tabIndex = 0; tabIndex < count(); ++tabIndex) { QVariant tabDataVariant = tabData(tabIndex); - if (tabDataVariant.isValid()) { - // #se_editor_asset - // auto tabAssetId = tabDataVariant.value(); - // MemoryAssetNotificationBus::MultiHandler::BusDisconnect(tabAssetId); + auto tabAssetId = tabDataVariant.value(); + if (tabAssetId.m_assetId == assetId) + { + return tabIndex; + } } - - setTabData(tabIndex, QVariant::fromValue(fileAssetId)); - - // #se_editor_asset - // MemoryAssetNotificationBus::MultiHandler::BusConnect(fileAssetId); } - - // #se_editor_asset - Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; - // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); - - SetTabText(tabIndex, tabName.c_str(), fileState); + return -1; } - int GraphTabBar::FindTab(ScriptCanvasEditor::SourceHandle assetId) const + ScriptCanvasEditor::SourceHandle GraphTabBar::FindTabByPath(AZStd::string_view path) const { - for (int tabIndex = 0; tabIndex < count(); ++tabIndex) + ScriptCanvasEditor::SourceHandle candidate(nullptr, {}, path); + + for (int index = 0; index < count(); ++index) { - QVariant tabDataVariant = tabData(tabIndex); - if (tabDataVariant.isValid()) + QVariant tabdata = tabData(index); + if (tabdata.isValid()) { - auto tabAssetId = tabDataVariant.value(); - if (tabAssetId == assetId) + auto tabAssetId = tabdata.value(); + if (tabAssetId.m_assetId.AnyEquals(candidate)) { - return tabIndex; + return tabAssetId.m_assetId; } } } - return -1; + + return {}; } ScriptCanvasEditor::SourceHandle GraphTabBar::FindAssetId(int tabIndex) @@ -146,13 +188,31 @@ namespace ScriptCanvasEditor QVariant dataVariant = tabData(tabIndex); if (dataVariant.isValid()) { - auto tabAssetId = dataVariant.value(); - return tabAssetId; + auto tabAssetId = dataVariant.value(); + return tabAssetId.m_assetId; } return ScriptCanvasEditor::SourceHandle(); } + ScriptCanvas::ScriptCanvasId GraphTabBar::FindScriptCanvasIdFromGraphCanvasId(const GraphCanvas::GraphId& graphCanvasGraphId) const + { + for (int index = 0; index < count(); ++index) + { + QVariant tabdata = tabData(index); + if (tabdata.isValid()) + { + auto tabAssetId = tabdata.value(); + if (tabAssetId.m_assetId && tabAssetId.m_assetId.Get()->GetGraphCanvasGraphId() == graphCanvasGraphId) + { + return tabAssetId.m_assetId.Get()->GetScriptCanvasId(); + } + } + } + + return ScriptCanvas::ScriptCanvasId{}; + } + void GraphTabBar::CloseTab(int index) { if (index >= 0 && index < count()) @@ -160,10 +220,11 @@ namespace ScriptCanvasEditor QVariant tabdata = tabData(index); if (tabdata.isValid()) { - auto tabAssetId = tabdata.value(); + // #sc_editor_asset fix tabData + auto tabAssetId = tabdata.value(); - MemoryAssetNotificationBus::MultiHandler::BusDisconnect(tabAssetId); - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::ClearView, tabAssetId); + //MemoryAssetNotificationBus::MultiHandler::BusDisconnect(tabAssetId); + //AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::ClearView, tabAssetId); } qobject_cast(parent())->removeTab(index); @@ -191,10 +252,10 @@ namespace ScriptCanvasEditor QVariant tabdata = tabData(tabIndex); if (tabdata.isValid()) { - auto tabAssetId = tabdata.value(); + auto tabAssetId = tabdata.value(); - Tracker::ScriptCanvasFileState fileState; - AssetTrackerRequestBus::BroadcastResult(fileState , &AssetTrackerRequests::GetFileState, tabAssetId); + Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; + //AssetTrackerRequestBus::BroadcastResult(fileState , &AssetTrackerRequests::GetFileState, tabAssetId); isModified = fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::MODIFIED; } @@ -269,7 +330,7 @@ namespace ScriptCanvasEditor void GraphTabBar::OnFileStateChanged(Tracker::ScriptCanvasFileState ) { - // #se_editor_asset + // #sc_editor_asset // const AZ::Data::AssetId* fileAssetId = MemoryAssetNotificationBus::GetCurrentBusId(); // if (fileAssetId) @@ -332,7 +393,7 @@ namespace ScriptCanvasEditor return; } - auto assetId = tabdata.value(); + auto assetId = tabdata.value(); // #sc_editor_asset // ScriptCanvasEditor::GeneralRequestBus::Broadcast(&ScriptCanvasEditor::GeneralRequests::OnChangeActiveGraphTab, assetId); @@ -346,7 +407,7 @@ namespace ScriptCanvasEditor void GraphTabBar::SetFileState(ScriptCanvasEditor::SourceHandle, Tracker::ScriptCanvasFileState ) { - // #se_editor_asset + // #sc_editor_asset // int index = FindTab(assetId); // if (index >= 0 && index < count()) @@ -354,7 +415,7 @@ namespace ScriptCanvasEditor // QVariant tabdata = tabData(index); // if (tabdata.isValid()) // { -// auto tabAssetId = tabdata.value(); +// auto tabAssetId = tabdata.value(); // // AZStd::string tabName; // AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, tabAssetId); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h index 490c17cc29..12e73b4ae5 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h @@ -16,6 +16,7 @@ #include #include +#include #include #endif @@ -26,11 +27,13 @@ namespace ScriptCanvasEditor { namespace Widget { + class CanvasWidget; + struct GraphTabMetadata { - AZ::Data::AssetId m_assetId; + SourceHandle m_assetId; QWidget* m_hostWidget = nullptr; - QString m_tabName; + CanvasWidget* m_canvasWidget = nullptr; Tracker::ScriptCanvasFileState m_fileState = Tracker::ScriptCanvasFileState::INVALID; }; @@ -46,16 +49,22 @@ namespace ScriptCanvasEditor ~GraphTabBar() override = default; void AddGraphTab(ScriptCanvasEditor::SourceHandle assetId); + void CloseTab(int index); + void CloseAllTabs(); + int InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId); bool SelectTab(ScriptCanvasEditor::SourceHandle assetId); - void ConfigureTab(int tabIndex, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName); + // void ConfigureTab(int tabIndex, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName); int FindTab(ScriptCanvasEditor::SourceHandle assetId) const; + ScriptCanvasEditor::SourceHandle FindTabByPath(AZStd::string_view path) const; ScriptCanvasEditor::SourceHandle FindAssetId(int tabIndex); + ScriptCanvas::ScriptCanvasId FindScriptCanvasIdFromGraphCanvasId(const GraphCanvas::GraphId& graphCanvasGraphId) const; - void CloseTab(int index); - void CloseAllTabs(); + void ClearTabView(int tabIndex); + CanvasWidget* ModOrCreateTabView(int tabIndex); + CanvasWidget* ModTabView(int tabIndex); void OnContextMenu(const QPoint& point); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp index 732aacc993..a9ffe30fb1 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp @@ -122,7 +122,11 @@ namespace ScriptCanvasEditor { } - ExecutionLogTreeItem* DebugLogRootItem::CreateExecutionItem(const LoggingDataId& loggingDataId, const ScriptCanvas::NodeTypeIdentifier& nodeType, const ScriptCanvas::GraphInfo& graphInfo, const ScriptCanvas::NamedNodeId& nodeId) + ExecutionLogTreeItem* DebugLogRootItem::CreateExecutionItem + ( [[maybe_unused]] const LoggingDataId& loggingDataId + , [[maybe_unused]] const ScriptCanvas::NodeTypeIdentifier& nodeType + , [[maybe_unused]] const ScriptCanvas::GraphInfo& graphInfo + , [[maybe_unused]] const ScriptCanvas::NamedNodeId& nodeId) { ExecutionLogTreeItem* treeItem = nullptr; @@ -136,11 +140,13 @@ namespace ScriptCanvasEditor if (m_updatePolicy == UpdatePolicy::SingleTime) { - treeItem = CreateChildNodeWithoutAddSignal(loggingDataId, nodeType, graphInfo, nodeId); + // #sc_editor_asset + // treeItem = CreateChildNodeWithoutAddSignal(loggingDataId, nodeType, graphInfo, nodeId); } else { - treeItem = CreateChildNode(loggingDataId, nodeType, graphInfo, nodeId); + // #sc_editor_asset + // treeItem = CreateChildNode(loggingDataId, nodeType, graphInfo, nodeId); } return treeItem; @@ -185,7 +191,11 @@ namespace ScriptCanvasEditor // ExecutionLogTreeItem ///////////////////////// - ExecutionLogTreeItem::ExecutionLogTreeItem(const LoggingDataId& loggingDataId, const ScriptCanvas::NodeTypeIdentifier& nodeType, const ScriptCanvas::GraphInfo& graphInfo, const ScriptCanvas::NamedNodeId& nodeId) + ExecutionLogTreeItem::ExecutionLogTreeItem + ( const LoggingDataId& loggingDataId + , const ScriptCanvas::NodeTypeIdentifier& nodeType + , const SourceHandle& graphInfo + , const ScriptCanvas::NamedNodeId& nodeId) : m_loggingDataId(loggingDataId) , m_nodeType(nodeType) , m_graphInfo(graphInfo) @@ -196,7 +206,9 @@ namespace ScriptCanvasEditor m_paletteConfiguration.SetColorPalette("MethodNodeTitlePalette"); AZ::NamedEntityId entityName; - LoggingDataRequestBus::EventResult(entityName, m_loggingDataId, &LoggingDataRequests::FindNamedEntityId, m_graphInfo.m_runtimeEntity); + + // #sc_editor_asset restore this + //LoggingDataRequestBus::EventResult(entityName, m_loggingDataId, &LoggingDataRequests::FindNamedEntityId, m_graphInfo.m_runtimeEntity); m_sourceEntityName = entityName.ToString().c_str(); m_displayName = nodeId.m_name.c_str(); @@ -207,7 +219,7 @@ namespace ScriptCanvasEditor m_inputName = "---"; m_outputName = "---"; - GeneralAssetNotificationBus::Handler::BusConnect(GetAssetId()); + GeneralAssetNotificationBus::Handler::BusConnect(graphInfo); } QVariant ExecutionLogTreeItem::Data(const QModelIndex& index, int role) const @@ -502,12 +514,13 @@ namespace ScriptCanvasEditor const ScriptCanvas::GraphIdentifier& ExecutionLogTreeItem::GetGraphIdentifier() const { - return m_graphInfo.m_graphIdentifier; + // #sc_editor_asset + return m_graphIdentifier; } - const AZ::Data::AssetId& ExecutionLogTreeItem::GetAssetId() const + AZ::Data::AssetId ExecutionLogTreeItem::GetAssetId() const { - return m_graphInfo.m_graphIdentifier.m_assetId; + return m_graphInfo.Id(); } AZ::EntityId ExecutionLogTreeItem::GetScriptCanvasAssetNodeId() const diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.h index 862b231f3a..5b6d23590b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.h @@ -131,7 +131,12 @@ namespace ScriptCanvasEditor AZ_CLASS_ALLOCATOR(ExecutionLogTreeItem, AZ::SystemAllocator, 0); AZ_RTTI(ExecutionLogTreeItem, "{71139142-A30C-4A16-81CC-D51314AEAF7D}", DebugLogTreeItem); - ExecutionLogTreeItem(const LoggingDataId& loggingDataId, const ScriptCanvas::NodeTypeIdentifier& nodeType, const ScriptCanvas::GraphInfo& graphInfo, const ScriptCanvas::NamedNodeId& nodeId); + ExecutionLogTreeItem + ( const LoggingDataId& loggingDataId + , const ScriptCanvas::NodeTypeIdentifier& nodeType + , const SourceHandle& graphInfo + , const ScriptCanvas::NamedNodeId& nodeId); + ~ExecutionLogTreeItem() override = default; QVariant Data(const QModelIndex& index, int role) const override final; @@ -163,7 +168,7 @@ namespace ScriptCanvasEditor //// const ScriptCanvas::GraphIdentifier& GetGraphIdentifier() const; - const AZ::Data::AssetId& GetAssetId() const; + AZ::Data::AssetId GetAssetId() const; AZ::EntityId GetScriptCanvasAssetNodeId() const; GraphCanvas::NodeId GetGraphCanvasNodeId() const; @@ -184,7 +189,8 @@ namespace ScriptCanvasEditor LoggingDataId m_loggingDataId; ScriptCanvas::NodeTypeIdentifier m_nodeType; - ScriptCanvas::GraphInfo m_graphInfo; + SourceHandle m_graphInfo; + ScriptCanvas::GraphIdentifier m_graphIdentifier; QString m_sourceEntityName; QString m_graphName; QString m_relativeGraphPath; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 207b7ec077..38e5f0172b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -821,16 +821,10 @@ namespace ScriptCanvasEditor void MainWindow::SignalActiveSceneChanged(ScriptCanvasEditor::SourceHandle assetId) { - // #se_editor_asset - /* - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - AZ::EntityId graphId; - - if (memoryAsset) + if (assetId) { - graphId = memoryAsset->GetGraphId(); + EditorGraphRequestBus::EventResult(graphId, assetId.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); } m_autoSaveTimer.stop(); @@ -849,18 +843,20 @@ namespace ScriptCanvasEditor GraphCanvas::ViewId viewId; GraphCanvas::SceneRequestBus::EventResult(viewId, graphId, &GraphCanvas::SceneRequests::GetViewId); - AZ_Assert(viewId.IsValid(), "SceneRequest must return a valid ViewId"); if (viewId.IsValid()) { GraphCanvas::ViewNotificationBus::Handler::BusDisconnect(); GraphCanvas::ViewNotificationBus::Handler::BusConnect(viewId); - enabled = memoryAsset->GetScriptCanvasId().IsValid(); + enabled = true; + } + else + { + AZ_Error("ScriptCanvasEditor", viewId.IsValid(), "SceneRequest must return a valid ViewId"); } } UpdateMenuState(enabled); - */ } void MainWindow::UpdateRecentMenu() @@ -940,7 +936,7 @@ namespace ScriptCanvasEditor if (shouldSaveResults == UnsavedChangesOptions::SAVE) { - // #se_editor_asset + // #sc_editor_asset // Callbacks::OnSave saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr, ScriptCanvasEditor::SourceHandle) // { // if (isSuccessful) @@ -1140,7 +1136,7 @@ namespace ScriptCanvasEditor void MainWindow::MarkAssetModified(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { -// #se_editor_asset if (!assetId.IsValid()) +// #sc_editor_asset if (!assetId.IsValid()) // { // return; // } @@ -1161,7 +1157,7 @@ namespace ScriptCanvasEditor void MainWindow::RefreshScriptCanvasAsset(const AZ::Data::Asset& /*asset*/) { - // #se_editor_asset + // #sc_editor_asset /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, asset.GetId()); @@ -1194,12 +1190,9 @@ namespace ScriptCanvasEditor */ } - AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& /*fileAssetId*/) + AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& fileAssetId) { - // #se_editor_asset - return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAssetId")); - /* - if (!fileAssetId.IsValid()) + if (fileAssetId.Id().IsNull()) { return AZ::Failure(AZStd::string("Unable to open asset with invalid asset id")); } @@ -1212,79 +1205,47 @@ namespace ScriptCanvasEditor return AZ::Success(outTabIndex); } - AZ::Data::AssetInfo assetInfo; - AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequests::GetAssetInfoById, fileAssetId); - - if (assetInfo.m_relativePath.empty()) - { - return AZ::Failure(AZStd::string("Unknown AssetId")); - } + outTabIndex = CreateAssetTab(fileAssetId); - if (assetInfo.m_assetType != azrtti_typeid()) + if (!m_isRestoringWorkspace) { - return AZ::Failure(AZStd::string("Invalid AssetId provided, it's not a Script Canvas supported type")); + SetActiveAsset(fileAssetId); } - AssetTrackerRequests::OnAssetReadyCallback onAssetReady = [this, fileAssetId, &outTabIndex](ScriptCanvasMemoryAsset& asset) - { - if (!asset.IsSourceInError()) - { - outTabIndex = CreateAssetTab(asset.GetFileAssetId()); - - if (!m_isRestoringWorkspace) - { - SetActiveAsset(fileAssetId); - } - - UpdateWorkspaceStatus(asset); - } - else - { - outTabIndex = -1; - m_loadingAssets.erase(fileAssetId); - } - }; - - m_loadingAssets.insert(fileAssetId); - - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Load, fileAssetId, assetInfo.m_assetType, onAssetReady); - if (outTabIndex >= 0) { + AddRecentFile(fileAssetId.Path().c_str()); + OpenScriptCanvasAssetImplementation(fileAssetId); return AZ::Success(outTabIndex); } else { return AZ::Failure(AZStd::string("Specified asset is in an error state and cannot be properly displayed.")); } - */ } - AZ::Outcome MainWindow::OpenScriptCanvasAsset(const ScriptCanvasMemoryAsset& /*scriptCanvasAsset*/, int /*tabIndex*/ /*= -1*/) + AZ::Outcome MainWindow::OpenScriptCanvasAssetImplementation(const SourceHandle& scriptCanvasAsset, int tabIndex) { - // #se_editor_asset - return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAsset")); - /* - const ScriptCanvasEditor::SourceHandle& fileAssetId = scriptCanvasAsset.GetFileAssetId(); + const ScriptCanvasEditor::SourceHandle& fileAssetId = scriptCanvasAsset; if (!fileAssetId.IsValid()) { return AZ::Failure(AZStd::string("Unable to open asset with invalid asset id")); } - if (scriptCanvasAsset.IsSourceInError()) + if (!scriptCanvasAsset.IsValid()) { if (!m_isRestoringWorkspace) { - AZStd::string errorPath = scriptCanvasAsset.GetAbsolutePath(); + AZStd::string errorPath = scriptCanvasAsset.Path(); if (errorPath.empty()) { errorPath = m_errorFilePath; } - if (m_queuedFocusOverride == fileAssetId) + if (m_queuedFocusOverride.AnyEquals(fileAssetId)) { - m_queuedFocusOverride.SetInvalid(); + m_queuedFocusOverride = fileAssetId; } QMessageBox::warning(this, "Unable to open source file", QString("Source File(%1) is in error and cannot be opened").arg(errorPath.c_str()), QMessageBox::StandardButton::Ok); @@ -1309,18 +1270,14 @@ namespace ScriptCanvasEditor if (outTabIndex == -1) { - return AZ::Failure(AZStd::string::format("Unable to open existing Script Canvas Asset with id %s in the Script Canvas Editor", AssetHelpers::AssetIdToString(fileAssetId).c_str())); + return AZ::Failure(AZStd::string::format("Unable to open existing Script Canvas Asset with id %s in the Script Canvas Editor" + , fileAssetId.ToString().c_str())); } - AZStd::string assetPath = scriptCanvasAsset.GetAbsolutePath(); + AZStd::string assetPath = scriptCanvasAsset.Path(); if (!assetPath.empty() && !m_loadingNewlySavedFile) { - const size_t eraseCount = m_loadingWorkspaceAssets.erase(fileAssetId); - - if (eraseCount == 0) - { - AddRecentFile(assetPath.c_str()); - } + AddRecentFile(assetPath.c_str()); } if (!m_isRestoringWorkspace) @@ -1328,47 +1285,34 @@ namespace ScriptCanvasEditor SetActiveAsset(fileAssetId); } - GraphCanvas::GraphId graphCanvasGraphId = GetGraphCanvasGraphId(scriptCanvasAsset.GetScriptCanvasId()); + GraphCanvas::GraphId graphCanvasGraphId = GetGraphCanvasGraphId(scriptCanvasAsset.Get()->GetScriptCanvasId()); GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphLoaded, graphCanvasGraphId); GeneralAssetNotificationBus::Event(fileAssetId, &GeneralAssetNotifications::OnAssetVisualized); - AssetTrackerNotificationBus::MultiHandler::BusConnect(fileAssetId); - return AZ::Success(outTabIndex); - */ } - AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle /*scriptCanvasAssetId*/, int /*tabIndex*/ /*= -1*/) + AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, int tabIndex) { - // #se_editor_asset - return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAsset")); - /* - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, scriptCanvasAssetId); - - // If the asset is already tracked we can go directly to opening it. - if (memoryAsset) + if (scriptCanvasAssetId) { - return OpenScriptCanvasAsset(*memoryAsset, tabIndex); + return OpenScriptCanvasAssetImplementation(scriptCanvasAssetId, tabIndex); } else { return OpenScriptCanvasAssetId(scriptCanvasAssetId); } - */ } - int MainWindow::CreateAssetTab(const ScriptCanvasEditor::SourceHandle& /*assetId*/, int /*tabIndex*/) + int MainWindow::CreateAssetTab(const ScriptCanvasEditor::SourceHandle& assetId, int tabIndex) { - // #se_editor_asset - return -1; - // return m_tabBar->InsertGraphTab(tabIndex, assetId); + return m_tabBar->InsertGraphTab(tabIndex, assetId); } AZ::Outcome MainWindow::UpdateScriptCanvasAsset(const AZ::Data::Asset& /*scriptCanvasAsset*/) { - // #se_editor_asset + // #sc_editor_asset return AZ::Failure(AZStd::string("rewrite MainWindow::UpdateScriptCanvasAsset")); /* @@ -1393,7 +1337,7 @@ namespace ScriptCanvasEditor void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { - // #se_editor_asset move what is necessary to the widget + // #sc_editor_asset move what is necessary to the widget /* AssetHelpers::PrintInfo("RemoveScriptCanvasAsset : %s", AssetHelpers::AssetIdToString(assetId).c_str()); @@ -1419,7 +1363,7 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(tabIndex); if (tabdata.isValid()) { - auto tabAssetId = tabdata.value(); + auto tabAssetId = tabdata.value(); SetActiveAsset(tabAssetId); } */ @@ -1467,7 +1411,7 @@ namespace ScriptCanvasEditor bool MainWindow::IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const { - // #se_editor_asset + // #sc_editor_asset return false; } @@ -1483,7 +1427,7 @@ namespace ScriptCanvasEditor void MainWindow::GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZStd::string& /*filePath*/, AZStd::string& /*fileFilter*/) { - // #se_editor_asset + // #sc_editor_asset /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -1530,18 +1474,50 @@ namespace ScriptCanvasEditor void MainWindow::OpenFile(const char* fullPath) { - AZ::Outcome outcome = LoadFromFile(fullPath); + auto tabIndex = m_tabBar->FindTabByPath(fullPath); + if (tabIndex.IsValid()) + { + SetActiveAsset(tabIndex); + return; + } + + AZStd::string watchFolder; + AZ::Data::AssetInfo assetInfo; + bool sourceInfoFound{}; + AzToolsFramework::AssetSystemRequestBus::BroadcastResult + ( sourceInfoFound + , &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, fullPath, assetInfo, watchFolder); + + if (!sourceInfoFound) + { + QMessageBox::warning(this, "Invalid Source Asset", QString("'%1' is not a valid asset path.").arg(fullPath), QMessageBox::Ok); + m_errorFilePath = fullPath; + AZ_Warning("ScriptCanvas", false, "Unable to open file as a ScriptCanvas graph: %s", fullPath); + return; + } + AZ::Outcome outcome = LoadFromFile(fullPath); if (!outcome.IsSuccess()) { + QMessageBox::warning(this, "Invalid Source File", QString("'%1' is not a valid file path.").arg(fullPath), QMessageBox::Ok); m_errorFilePath = fullPath; AZ_Warning("ScriptCanvas", false, "Unable to open file as a ScriptCanvas graph: %s", fullPath); + return; + } + + m_errorFilePath.clear(); + m_activeGraph = ScriptCanvasEditor::SourceHandle(outcome.TakeValue(), assetInfo.m_assetId.m_guid, fullPath); + + auto openOutcome = OpenScriptCanvasAsset(m_activeGraph); + if (openOutcome) + { + RunGraphValidation(false); + SetRecentAssetId(m_activeGraph); + SetActiveAsset(m_activeGraph); } else { - m_errorFilePath.clear(); - m_activeGraph = outcome.TakeValue(); - return; + AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); } #if defined(EDITOR_ASSET_SUPPORT_ENABLED) @@ -1772,7 +1748,7 @@ namespace ScriptCanvasEditor bool MainWindow::OnFileSave(const Callbacks::OnSave& saveCB) { - return SaveAssetImpl(m_activeGraph, saveCB); + return SaveAssetAsImpl(m_activeGraph, saveCB); } bool MainWindow::OnFileSaveAs(const Callbacks::OnSave& saveCB) @@ -1800,7 +1776,7 @@ namespace ScriptCanvasEditor else if (fileState == Tracker::ScriptCanvasFileState::MODIFIED || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED) { - SaveAsset(assetId, saveCB); + SaveAs(assetId.Path(), assetId, saveCB); saveSuccessful = true; } @@ -1880,7 +1856,7 @@ namespace ScriptCanvasEditor return false; } - SaveNewAsset(internalStringFile, inMemoryAssetId, saveCB); + SaveAs(internalStringFile, inMemoryAssetId, saveCB); m_newlySavedFile = internalStringFile; @@ -1895,7 +1871,7 @@ namespace ScriptCanvasEditor void MainWindow::OnSaveCallback(bool /*saveSuccess*/, AZ::Data::AssetPtr /*fileAsset*/, ScriptCanvasEditor::SourceHandle /*previousFileAssetId*/) { - // #se_editor_asset yikes...just save the thing...move to ::SaveAsset maybe + // #sc_editor_asset yikes...just save the thing...move to ::SaveAsset maybe /* ScriptCanvasMemoryAsset::pointer memoryAsset; @@ -1917,7 +1893,7 @@ namespace ScriptCanvasEditor if (saveTabIndex != m_tabBar->currentIndex()) { // Invalidate the file asset id so we don't delete trigger the asset flow. - m_tabBar->setTabData(saveTabIndex, QVariant::fromValue(ScriptCanvasEditor::SourceHandle())); + m_tabBar->setTabData(saveTabIndex, QVariant::fromValue(GraphTabMetaData)); m_tabBar->CloseTab(saveTabIndex); saveTabIndex = -1; @@ -1938,6 +1914,7 @@ namespace ScriptCanvasEditor 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) + // used to be configure tab...sets the name and file state m_tabBar->ConfigureTab(saveTabIndex, fileAssetId, tabName); GeneralAssetNotificationBus::Event(memoryAsset->GetId(), &GeneralAssetNotifications::OnAssetVisualized); @@ -2029,25 +2006,13 @@ namespace ScriptCanvasEditor return OnFileSave(saveCB); } - void MainWindow::SaveAsset(ScriptCanvasEditor::SourceHandle /*assetId*/, const Callbacks::OnSave& /*onSave*/) + void MainWindow::SaveAs(AZStd::string_view /*path*/, ScriptCanvasEditor::SourceHandle /*inMemoryAssetId*/, const Callbacks::OnSave& /*onSave*/) { /* - PrepareAssetForSave(assetId); - - auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle previousAssetId) - { - OnSaveCallback(saveSuccess, asset, previousAssetId); - if (onSave) - { - AZStd::invoke(onSave, saveSuccess, asset, previousAssetId); - } - }; - - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Save, assetId, onSaveCallback); - UpdateSaveState(); + PrepareAssetForSave(inMemoryAssetId); ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); + AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, inMemoryAssetId); // Disable the current view if we are saving. if (memoryAsset) @@ -2055,15 +2020,6 @@ namespace ScriptCanvasEditor DisableAssetView(memoryAsset); } - BlockCloseRequests(); - */ - } - - void MainWindow::SaveNewAsset(AZStd::string_view /*path*/, ScriptCanvasEditor::SourceHandle /*inMemoryAssetId*/, const Callbacks::OnSave& /*onSave*/) - { - /* - PrepareAssetForSave(inMemoryAssetId); - auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle previousAssetId) { OnSaveCallback(saveSuccess, asset, previousAssetId); @@ -2072,19 +2028,36 @@ namespace ScriptCanvasEditor AZStd::invoke(onSave, saveSuccess, asset, previousAssetId); } }; - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::SaveAs, inMemoryAssetId, path, onSaveCallback); - UpdateSaveState(); + AZ::Data::AssetStreamInfo streamInfo; + streamInfo.m_streamFlags = AZ::IO::OpenMode::ModeWrite; + streamInfo.m_streamName = m_saveAsPath; - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, inMemoryAssetId); + if (!streamInfo.IsValid()) + { + return; + } - // Disable the current view if we are saving. - if (memoryAsset) + bool sourceControlActive = false; + AzToolsFramework::SourceControlConnectionRequestBus::BroadcastResult(sourceControlActive, &AzToolsFramework::SourceControlConnectionRequests::IsActive); + // If Source Control is active then use it to check out the file before saving otherwise query the file info and save only if the file is not read-only + if (sourceControlActive) { - DisableAssetView(memoryAsset); + AzToolsFramework::SourceControlCommandBus::Broadcast(&AzToolsFramework::SourceControlCommandBus::Events::RequestEdit, + streamInfo.m_streamName.c_str(), + true, + [this, streamInfo, onSaveCallback](bool success, AzToolsFramework::SourceControlFileInfo info) { FinalizeAssetSave(success, info, streamInfo, onSaveCallback); } + ); + } + else + { + AzToolsFramework::SourceControlCommandBus::Broadcast(&AzToolsFramework::SourceControlCommandBus::Events::GetFileInfo, + streamInfo.m_streamName.c_str(), + [this, streamInfo, onSaveCallback](bool success, AzToolsFramework::SourceControlFileInfo info) { FinalizeAssetSave(success, info, streamInfo, onSaveCallback); } + ); } + UpdateSaveState(); BlockCloseRequests(); */ } @@ -2505,7 +2478,6 @@ namespace ScriptCanvasEditor if (eraseCount == 0) { AZStd::string fullPath = AZStd::string::format("%s/%s", rootFilePath.c_str(), assetInfo.m_relativePath.c_str()); - AddRecentFile(fullPath.c_str()); } } } @@ -2568,69 +2540,55 @@ namespace ScriptCanvasEditor AZ::EntityId MainWindow::GetActiveGraphCanvasGraphId() const { - // #se_editor_asset + AZ::EntityId graphId{}; - // AZ::EntityId graphId; - // AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, m_activeGraph); - /* - * Falls through to this, which falls through to editor graph, move to canvas widget - AZ::EntityId ScriptCanvasMemoryAsset::GetGraphId() - { - if (!m_graphId.IsValid()) + if (m_activeGraph) { - EditorGraphRequestBus::EventResult(m_graphId, m_scriptCanvasId, &EditorGraphRequests::GetGraphCanvasGraphId); + EditorGraphRequestBus::EventResult + ( graphId, m_activeGraph.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); } - return m_graphId; - } - */ - return AZ::EntityId{}; + return graphId; } ScriptCanvas::ScriptCanvasId MainWindow::GetActiveScriptCanvasId() const { - // ScriptCanvas::ScriptCanvasId sceneId; - // AssetTrackerRequestBus::BroadcastResult(sceneId, &AssetTrackerRequests::GetScriptCanvasId, m_activeGraph); - // #se_editor_asset - return ScriptCanvas::ScriptCanvasId{}; + return FindScriptCanvasIdByAssetId(m_activeGraph); } - GraphCanvas::GraphId MainWindow::GetGraphCanvasGraphId(const ScriptCanvas::ScriptCanvasId& /*scriptCanvasId*/) const + GraphCanvas::GraphId MainWindow::GetGraphCanvasGraphId(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) const { - // #se_editor_asset - // AZ::EntityId graphCanvasId; - // AssetTrackerRequestBus::BroadcastResult(graphCanvasId, &AssetTrackerRequests::GetGraphCanvasId, scriptCanvasId); - // move to widget - return AZ::EntityId{}; + AZ::EntityId graphId{}; + EditorGraphRequestBus::EventResult(graphId, scriptCanvasId, &EditorGraphRequests::GetGraphCanvasGraphId); + return graphId; } - GraphCanvas::GraphId MainWindow::FindGraphCanvasGraphIdByAssetId(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const + GraphCanvas::GraphId MainWindow::FindGraphCanvasGraphIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const { - // #se_editor_asset - // AZ::EntityId graphId; - // AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, assetId); - return AZ::EntityId{}; + AZ::EntityId graphId{}; + + if (assetId) + { + EditorGraphRequestBus::EventResult + ( graphId, assetId.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); + } + + return graphId; } - ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const + ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const { - // #se_editor_asset - // ScriptCanvas::ScriptCanvasId scriptCanvasId; - // AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasId, assetId); - return ScriptCanvas::ScriptCanvasId{}; + return assetId ? assetId.Get()->GetScriptCanvasId() : ScriptCanvas::ScriptCanvasId{}; } - ScriptCanvas::ScriptCanvasId MainWindow::GetScriptCanvasId(const GraphCanvas::GraphId& /*graphCanvasGraphId*/) const + ScriptCanvas::ScriptCanvasId MainWindow::GetScriptCanvasId(const GraphCanvas::GraphId& graphCanvasGraphId) const { - // #se_editor_asset - // ScriptCanvas::ScriptCanvasId scriptCanvasId; - // AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasIdFromGraphId, graphCanvasGraphId); - return ScriptCanvas::ScriptCanvasId{}; + return m_tabBar->FindScriptCanvasIdFromGraphCanvasId(graphCanvasGraphId); } bool MainWindow::IsInUndoRedo(const AZ::EntityId& graphCanvasGraphId) const { - // #se_editor_asset + // #sc_editor_asset bool isActive = false; UndoRequestBus::EventResult(isActive, GetScriptCanvasId(graphCanvasGraphId), &UndoRequests::IsActive); return isActive; @@ -2662,8 +2620,8 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(tabIndex); if (tabdata.isValid()) { - auto tabAssetId = tabdata.value(); - if (tabAssetId == assetId) + auto tabAssetId = tabdata.value(); + if (tabAssetId.m_assetId == assetId) { return tabdata; } @@ -2683,21 +2641,15 @@ namespace ScriptCanvasEditor return false; } - void MainWindow::ReconnectSceneBuses(ScriptCanvasEditor::SourceHandle /*previousAssetId*/, ScriptCanvasEditor::SourceHandle /*nextAssetId*/) + void MainWindow::ReconnectSceneBuses(ScriptCanvasEditor::SourceHandle previousAsset, ScriptCanvasEditor::SourceHandle nextAsset) { - // #se_editor_asset - /* - ScriptCanvasMemoryAsset::pointer previousAsset; - AssetTrackerRequestBus::BroadcastResult(previousAsset, &AssetTrackerRequests::GetAsset, previousAssetId); - - ScriptCanvasMemoryAsset::pointer nextAsset; - AssetTrackerRequestBus::BroadcastResult(nextAsset, &AssetTrackerRequests::GetAsset, nextAssetId); - + // #sc_editor_asset + // Disconnect previous asset AZ::EntityId previousScriptCanvasSceneId; if (previousAsset) { - previousScriptCanvasSceneId = previousAsset->GetScriptCanvasId(); + previousScriptCanvasSceneId = previousAsset.Get()->GetScriptCanvasId(); GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(previousScriptCanvasSceneId); } @@ -2705,7 +2657,8 @@ namespace ScriptCanvasEditor if (nextAsset) { // Connect the next asset - nextAssetGraphCanvasId = nextAsset->GetGraphId(); + EditorGraphRequestBus::EventResult(nextAssetGraphCanvasId, nextAsset.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); + if (nextAssetGraphCanvasId.IsValid()) { GraphCanvas::SceneNotificationBus::MultiHandler::BusConnect(nextAssetGraphCanvasId); @@ -2718,13 +2671,12 @@ namespace ScriptCanvasEditor // Notify about the graph refresh GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphRefreshed, previousScriptCanvasSceneId, nextAssetGraphCanvasId); - */ } - void MainWindow::SetActiveAsset(const ScriptCanvasEditor::SourceHandle& /*fileAssetId*/) + void MainWindow::SetActiveAsset(const ScriptCanvasEditor::SourceHandle& fileAssetId) { - // #se_editor_asset - /* + // #sc_editor_asset + if (m_activeGraph == fileAssetId) { return; @@ -2747,98 +2699,61 @@ namespace ScriptCanvasEditor if (m_activeGraph.IsValid()) { - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); - // If we are saving the asset, the Id may have changed from the in-memory to the file asset Id, in that case, // there's no need to hide the view or remove the widget - if (memoryAsset && memoryAsset->GetView()) + auto oldTab = m_tabBar->FindTab(m_activeGraph); + if (auto view = m_tabBar->ModTabView(oldTab)) { - memoryAsset->GetView()->hide(); - m_layout->removeWidget(memoryAsset->GetView()); + view->hide(); + m_layout->removeWidget(view); + m_tabBar->ClearTabView(oldTab); } } if (fileAssetId.IsValid()) { ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; - m_activeGraph = fileAssetId; RefreshActiveAsset(); - ReconnectSceneBuses(previousAssetId, m_activeGraph); } else { ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; - m_activeGraph.Clear(); m_emptyCanvas->show(); - ReconnectSceneBuses(previousAssetId, m_activeGraph); - SignalActiveSceneChanged(ScriptCanvasEditor::SourceHandle()); } UpdateUndoCache(fileAssetId); - - RefreshSelection(); - */ + RefreshSelection(); } void MainWindow::RefreshActiveAsset() { - // #se_editor_asset - /* if (m_activeGraph.IsValid()) { AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", m_activeGraph.ToString().c_str()); - - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); - - if (memoryAsset) + if (auto view = m_tabBar->ModOrCreateTabView(m_tabBar->FindTab(m_activeGraph))) { - AZ::EntityId sceneEntityId = memoryAsset->GetScriptCanvasId(); - - const auto& scriptCanvasAsset = memoryAsset->GetAsset(); - - if (scriptCanvasAsset.IsReady() && scriptCanvasAsset.Get()->GetScriptCanvasEntity()->GetState() == AZ::Entity::State::Active) - { - if (!memoryAsset->GetView()) - { - memoryAsset->CreateView(m_tabBar); - } - - auto view = memoryAsset->GetView(); - AZ_Assert(view, "Asset should have a view"); - if (view) - { - AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", m_activeGraph.ToString().c_str()); - - view->ShowScene(sceneEntityId); - m_layout->addWidget(view); - view->show(); - - m_emptyCanvas->hide(); - } - - SignalActiveSceneChanged(m_activeGraph); - } + view->ShowScene(m_activeGraph.Get()->GetScriptCanvasId()); + m_layout->addWidget(view); + view->show(); + m_emptyCanvas->hide(); + SignalActiveSceneChanged(m_activeGraph); } else { - // If we couldn't load a memory asset for our active asset. Just set ourselves to invalid. SetActiveAsset({}); } } - */ } void MainWindow::Clear() { m_tabBar->CloseAllTabs(); - // #se_editor_asset + // #sc_editor_asset // // AssetTrackerRequests::AssetList assets; // AssetTrackerRequestBus::BroadcastResult(assets, &AssetTrackerRequests::GetAssets); @@ -2857,12 +2772,12 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto fileAssetId = tabdata.value(); + auto fileAssetId = tabdata.value(); Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::NEW; bool isSaving = false; - // #se_editor_asset Get from widgets + // #sc_editor_asset Get from widgets /* AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, fileAssetId); @@ -2876,9 +2791,9 @@ namespace ScriptCanvasEditor UnsavedChangesOptions saveDialogResults = UnsavedChangesOptions::CONTINUE_WITHOUT_SAVING; if (!isSaving && (fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::MODIFIED || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED)) { - SetActiveAsset(fileAssetId); + SetActiveAsset(fileAssetId.m_assetId); - // #se_editor_asset + // #sc_editor_asset AZStd::string tabName = "Get from widget"; // AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, fileAssetId); @@ -2887,7 +2802,7 @@ namespace ScriptCanvasEditor if (saveDialogResults == UnsavedChangesOptions::SAVE) { - // #se_editor_asset + // #sc_editor_asset // auto saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle) // { // if (isSuccessful) @@ -2929,10 +2844,9 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto assetId = tabdata.value(); - SaveAssetImpl(assetId, nullptr); + auto assetId = tabdata.value(); + SaveAssetAsImpl(assetId.m_assetId, nullptr); } - } void MainWindow::CloseAllTabs() @@ -2948,7 +2862,7 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto assetId = tabdata.value(); + auto assetId = tabdata.value().m_assetId; m_isClosingTabs = true; m_skipTabOnClose = assetId; @@ -2958,7 +2872,7 @@ namespace ScriptCanvasEditor void MainWindow::CopyPathToClipboard(int /*index*/) { - // #se_editor_asset + // #sc_editor_asset /* QVariant tabdata = m_tabBar->tabData(index); @@ -2966,7 +2880,7 @@ namespace ScriptCanvasEditor { QClipboard* clipBoard = QGuiApplication::clipboard(); - auto assetId = tabdata.value(); + auto assetId = tabdata.value(); ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -3008,9 +2922,9 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(tab); if (tabdata.isValid()) { - auto assetId = tabdata.value(); + auto assetId = tabdata.value(); - if (assetId != m_skipTabOnClose) + if (assetId.m_assetId != m_skipTabOnClose) { break; } @@ -3029,7 +2943,7 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto tabAssetId = tabdata.value(); + auto tabAssetId = tabdata.value(); if (tabAssetId == m_activeGraph) { @@ -3696,7 +3610,7 @@ namespace ScriptCanvasEditor void MainWindow::UpdateSaveState() { - // #se_editor_asset todo, consider making blocking + // #sc_editor_asset todo, consider making blocking // bool enabled = m_activeGraph.IsValid(); // bool isSaving = false; // bool hasModifications = false; @@ -3912,7 +3826,7 @@ namespace ScriptCanvasEditor AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZ::EntityId /*assetNodeId*/) const { - // #se_editor_asset + // #sc_editor_asset return AZ::EntityId{}; // AZ::EntityId editorEntityId; // AssetTrackerRequestBus::BroadcastResult(editorEntityId, &AssetTrackerRequests::GetEditorEntityIdFromSceneEntityId, assetId, assetNodeId); @@ -3921,7 +3835,7 @@ namespace ScriptCanvasEditor AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZ::EntityId /*editorNodeId*/) const { - // #se_editor_asset + // #sc_editor_asset return AZ::EntityId{}; // AZ::EntityId sceneEntityId; // AssetTrackerRequestBus::BroadcastResult(sceneEntityId, &AssetTrackerRequests::GetSceneEntityIdFromEditorEntityId, assetId, editorNodeId); @@ -4415,7 +4329,7 @@ namespace ScriptCanvasEditor void MainWindow::OnAssignToSelectedEntities() { - // #se_editor_asset consider cutting + // #sc_editor_asset consider cutting // Tracker::ScriptCanvasFileState fileState; // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, m_activeGraph); // @@ -4489,7 +4403,7 @@ namespace ScriptCanvasEditor ScriptCanvasEditor::Tracker::ScriptCanvasFileState MainWindow::GetAssetFileState(ScriptCanvasEditor::SourceHandle /*assetId*/) const { - // #se_editor_asset + // #sc_editor_asset return Tracker::ScriptCanvasFileState::INVALID; // Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, assetId); @@ -4542,7 +4456,7 @@ namespace ScriptCanvasEditor if (usableRequestBus) { ScriptCanvasMemoryAsset::pointer memoryAsset; - // #se_editor_asset + // #sc_editor_asset // AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); if (memoryAsset) @@ -4599,6 +4513,7 @@ namespace ScriptCanvasEditor m_filesToOpen.pop_front(); OpenFile(nextFile.toUtf8().data()); + OpenNextFile(); } else { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 1c98769463..ee93308035 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -230,7 +230,7 @@ namespace ScriptCanvasEditor , private VariablePaletteRequestBus::Handler , private ScriptCanvas::BatchOperationNotificationBus::Handler , private AssetGraphSceneBus::Handler - , private AssetTrackerNotificationBus::MultiHandler + //, private AssetTrackerNotificationBus::MultiHandler #if SCRIPTCANVAS_EDITOR //, public IEditorNotifyListener #endif @@ -421,7 +421,7 @@ namespace ScriptCanvasEditor //! GeneralRequestBus AZ::Outcome OpenScriptCanvasAssetId(const SourceHandle& assetId) override; AZ::Outcome OpenScriptCanvasAsset(SourceHandle scriptCanvasAssetId, int tabIndex = -1) override; - AZ::Outcome OpenScriptCanvasAsset(const ScriptCanvasMemoryAsset& scriptCanvasAsset, int tabIndex = -1); + AZ::Outcome OpenScriptCanvasAssetImplementation(const SourceHandle& sourceHandle, int tabIndex = -1); int CloseScriptCanvasAsset(const SourceHandle& assetId) override; bool CreateScriptCanvasAssetFor(const TypeDefs::EntityComponentId& requestingEntityId) override; @@ -556,8 +556,7 @@ namespace ScriptCanvasEditor bool ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId, const Callbacks::OnSave& onSave); - void SaveNewAsset(AZStd::string_view path, ScriptCanvasEditor::SourceHandle assetId, const Callbacks::OnSave& onSave); - void SaveAsset(ScriptCanvasEditor::SourceHandle assetId, const Callbacks::OnSave& onSave); + void SaveAs(AZStd::string_view path, ScriptCanvasEditor::SourceHandle assetId, const Callbacks::OnSave& onSave); void OpenFile(const char* fullPath); void CreateMenus(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 09c21fe43f..15e2192ee8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -190,12 +190,27 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { + SourceHandle::SourceHandle(const SourceHandle& data, const AZ::Uuid& id, AZStd::string_view path) + : m_data(data.m_data) + , m_id(id) + , m_path(path) + { + + } + SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path) : m_data(graph) , m_id(id) , m_path(path) {} + bool SourceHandle::AnyEquals(const SourceHandle& other) const + { + return m_data == other.m_data + || m_id == other.m_id + || m_path == other.m_path; + } + void SourceHandle::Clear() { m_data = nullptr; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 4c1734413c..1a81345054 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -326,8 +326,12 @@ namespace ScriptCanvasEditor SourceHandle() = default; + SourceHandle(const SourceHandle& data, const AZ::Uuid& id, AZStd::string_view path); + SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path); + bool AnyEquals(const SourceHandle& other) const; + void Clear(); GraphPtrConst Get() const; @@ -391,11 +395,28 @@ namespace AZStd { using argument_type = ScriptCanvas::SlotId; using result_type = AZStd::size_t; - AZ_FORCE_INLINE size_t operator()(const argument_type& ref) const + + inline size_t operator()(const argument_type& ref) const { return AZStd::hash()(ref.m_id); } }; + + template<> + struct hash + { + using argument_type = ScriptCanvasEditor::SourceHandle; + using result_type = AZStd::size_t; + + inline size_t operator()(const argument_type& handle) const + { + size_t h = 0; + hash_combine(h, handle.Id()); + hash_combine(h, handle.Path()); + hash_combine(h, handle.Get()); + return h; + } + }; } #define SCRIPT_CANVAS_INFINITE_LOOP_DETECTION_COUNT (2000000) From 20147ddafbccd14831c9cbb1fa9b117f5891601f Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 3 Nov 2021 21:12:29 -0700 Subject: [PATCH 029/399] it renders! Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Source/Components/SceneComponent.cpp | 1 + .../Editor/Assets/ScriptCanvasFileHandling.cpp | 6 +++++- .../Code/Editor/Components/EditorGraph.cpp | 2 +- .../Code/Editor/View/Widgets/GraphTabBar.cpp | 1 + .../Code/Editor/View/Windows/MainWindow.cpp | 15 ++++----------- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Gems/GraphCanvas/Code/Source/Components/SceneComponent.cpp b/Gems/GraphCanvas/Code/Source/Components/SceneComponent.cpp index 52e7892364..e821ea9be2 100644 --- a/Gems/GraphCanvas/Code/Source/Components/SceneComponent.cpp +++ b/Gems/GraphCanvas/Code/Source/Components/SceneComponent.cpp @@ -669,6 +669,7 @@ namespace GraphCanvas { GeometryNotificationBus::Handler::BusDisconnect(); SceneNotificationBus::Handler::BusDisconnect(); + AZ::SystemTickBus::Handler::BusDisconnect(); } void GestureSceneHelper::TrackElement(const AZ::EntityId& elementId) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index e8ee2ed97c..0acbf640b0 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -99,7 +99,11 @@ namespace ScriptCanvasEditor } const auto& asString = fileStringOutcome.GetValue(); - DataPtr scriptCanvasData = Graph::Create(); + DataPtr scriptCanvasData = AZStd::make_shared(); + if (!scriptCanvasData) + { + return AZ::Failure(AZStd::string("failed to allocate ScriptCanvas::ScriptCanvasData after loading source file")); + } AZ::SerializeContext* serializeContext = nullptr; AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index c70e4b74f3..851a920019 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -490,7 +490,7 @@ namespace ScriptCanvasEditor EditorGraphRequestBus::Handler::BusDisconnect(); SceneCounterRequestBus::Handler::BusDisconnect(); NodeCreationNotificationBus::Handler::BusDisconnect(); - + AZ::SystemTickBus::Handler::BusDisconnect(); GraphCanvas::SceneNotificationBus::Handler::BusDisconnect(); GraphCanvas::GraphModelRequestBus::Handler::BusDisconnect(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index ce8c280b35..11fefe59bf 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -115,6 +115,7 @@ namespace ScriptCanvasEditor CanvasWidget* canvasWidget = new CanvasWidget(assetId, this); canvasWidget->SetDefaultBorderColor(ScriptCanvasAssetDescription().GetDisplayColorImpl()); metaData.m_canvasWidget = canvasWidget; + metaData.m_assetId = assetId; AZStd::string tabName; AzFramework::StringFunc::Path::GetFileName(assetId.Path().c_str(), tabName); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 38e5f0172b..432c51374c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1280,16 +1280,9 @@ namespace ScriptCanvasEditor AddRecentFile(assetPath.c_str()); } - if (!m_isRestoringWorkspace) - { - SetActiveAsset(fileAssetId); - } - GraphCanvas::GraphId graphCanvasGraphId = GetGraphCanvasGraphId(scriptCanvasAsset.Get()->GetScriptCanvasId()); GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphLoaded, graphCanvasGraphId); - GeneralAssetNotificationBus::Event(fileAssetId, &GeneralAssetNotifications::OnAssetVisualized); - return AZ::Success(outTabIndex); } @@ -1506,14 +1499,14 @@ namespace ScriptCanvasEditor } m_errorFilePath.clear(); - m_activeGraph = ScriptCanvasEditor::SourceHandle(outcome.TakeValue(), assetInfo.m_assetId.m_guid, fullPath); + auto activeGraph = ScriptCanvasEditor::SourceHandle(outcome.TakeValue(), assetInfo.m_assetId.m_guid, fullPath); - auto openOutcome = OpenScriptCanvasAsset(m_activeGraph); + auto openOutcome = OpenScriptCanvasAsset(activeGraph); if (openOutcome) { RunGraphValidation(false); - SetRecentAssetId(m_activeGraph); - SetActiveAsset(m_activeGraph); + SetActiveAsset(activeGraph); + SetRecentAssetId(activeGraph); } else { From d40b9fc809c11381afbcecaff476ea49e92bd1b2 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 4 Nov 2021 15:58:19 -0700 Subject: [PATCH 030/399] add file state for graphs Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Assets/ScriptCanvasFileHandling.cpp | 3 + .../Code/Editor/Components/EditorGraph.cpp | 30 ++++---- .../ScriptCanvas/Components/EditorGraph.h | 5 +- .../Code/Editor/SystemComponent.cpp | 4 +- .../Code/Editor/View/Widgets/GraphTabBar.cpp | 75 ++++++++++++++----- .../Code/Editor/View/Widgets/GraphTabBar.h | 10 ++- .../VariablePanel/GraphVariablesTableView.cpp | 5 +- .../Code/Editor/View/Windows/MainWindow.cpp | 33 ++------ .../Code/Editor/View/Windows/MainWindow.h | 2 +- .../Code/Include/ScriptCanvas/Core/Core.h | 1 + .../Code/Include/ScriptCanvas/Core/Graph.cpp | 5 -- .../Code/Include/ScriptCanvas/Core/Graph.h | 4 +- .../Code/Include/ScriptCanvas/Core/GraphBus.h | 3 - .../ScriptCanvas/Variable/GraphVariable.cpp | 8 -- .../ScriptCanvas/Variable/GraphVariable.h | 4 +- 15 files changed, 99 insertions(+), 93 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index 0acbf640b0..42dcf81a8d 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -132,6 +132,9 @@ namespace ScriptCanvasEditor { entity->Init(); entity->Activate(); + + auto graph = entity->FindComponent(); + graph->MarkOwnership(*scriptCanvasData); } return AZ::Success(ScriptCanvasEditor::SourceHandle(scriptCanvasData, {}, path)); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 851a920019..2a15371e93 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -1030,14 +1030,16 @@ namespace ScriptCanvasEditor { AZStd::any* connectionUserData = nullptr; GraphCanvas::ConnectionRequestBus::EventResult(connectionUserData, connectionId, &GraphCanvas::ConnectionRequests::GetUserData); - auto scConnectionId = connectionUserData && connectionUserData->is() ? *AZStd::any_cast(connectionUserData) : AZ::EntityId(); + auto scConnectionId = connectionUserData && connectionUserData->is() + ? *AZStd::any_cast(connectionUserData) + : AZ::EntityId(); - ScriptCanvas::Connection* connection = AZ::EntityUtils::FindFirstDerivedComponent(scConnectionId); - - if (connection) + if (ScriptCanvas::Connection* connection = AZ::EntityUtils::FindFirstDerivedComponent(scConnectionId)) { - ScriptCanvas::GraphNotificationBus::Event(GetScriptCanvasId(), &ScriptCanvas::GraphNotifications::OnDisonnectionComplete, connectionId); - + ScriptCanvas::GraphNotificationBus::Event + ( GetScriptCanvasId() + , &ScriptCanvas::GraphNotifications::OnDisonnectionComplete + , connectionId); DisconnectById(scConnectionId); } } @@ -1047,12 +1049,12 @@ namespace ScriptCanvasEditor if (AZ::Entity* entity = aznew AZ::Entity("Script Canvas Graph")) { auto graph = entity->CreateComponent(); - graph->SetAssetType(azrtti_typeid()); entity->CreateComponent(graph->GetScriptCanvasId()); if (ScriptCanvas::DataPtr data = AZStd::make_shared()) { data->m_scriptCanvasEntity.reset(entity); + graph->MarkOwnership(*data); return data; } } @@ -1060,6 +1062,11 @@ namespace ScriptCanvasEditor return nullptr; } + void Graph::MarkOwnership(ScriptCanvas::ScriptCanvasData& owner) + { + m_owner = &owner; + } + bool Graph::CreateConnection(const GraphCanvas::ConnectionId& connectionId, const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) { if (!sourcePoint.IsValid() || !targetPoint.IsValid()) @@ -1342,8 +1349,8 @@ namespace ScriptCanvasEditor void Graph::SignalDirty() { - // #sc_editor_asset - // GeneralRequestBus::Broadcast(&GeneralRequests::SignalSceneDirty, GetAssetId()); + SourceHandle handle(ScriptCanvas::DataPtr(m_owner), {}, {}); + GeneralRequestBus::Broadcast(&GeneralRequests::SignalSceneDirty, handle); } void Graph::HighlightNodesByType(const ScriptCanvas::NodeTypeIdentifier& nodeTypeIdentifier) @@ -3374,11 +3381,6 @@ namespace ScriptCanvasEditor } } - void Graph::SetAssetType(AZ::Data::AssetType assetType) - { - m_assetType = assetType; - } - void Graph::ReportError(const ScriptCanvas::Node& node, const AZStd::string& errorSource, const AZStd::string& errorMessage) { AzQtComponents::ToastConfiguration toastConfiguration(AzQtComponents::ToastType::Error, errorSource.c_str(), errorMessage.c_str()); diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index c0c8584cbd..526c929664 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -304,12 +304,12 @@ namespace ScriptCanvasEditor void OnUndoRedoEnd() override; //// - void SetAssetType(AZ::Data::AssetType); - void ReportError(const ScriptCanvas::Node& node, const AZStd::string& errorSource, const AZStd::string& errorMessage) override; const GraphStatisticsHelper& GetNodeUsageStatistics() const; + void MarkOwnership(ScriptCanvas::ScriptCanvasData& owner); + // Finds and returns all nodes within the graph that are of the specified type template AZStd::vector GetNodesOfType() const @@ -393,5 +393,6 @@ namespace ScriptCanvasEditor bool m_saveFormatConverted = true; ScriptCanvasEditor::SourceHandle m_assetId; + ScriptCanvas::ScriptCanvasData* m_owner; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 0246071172..ab8cd0e61b 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -173,13 +173,11 @@ namespace ScriptCanvasEditor outCreatableTypes.insert(m_creatableTypes.begin(), m_creatableTypes.end()); } - void SystemComponent::CreateEditorComponentsOnEntity(AZ::Entity* entity, const AZ::Data::AssetType& assetType) + void SystemComponent::CreateEditorComponentsOnEntity(AZ::Entity* entity, [[maybe_unused]] const AZ::Data::AssetType& assetType) { if (entity) { auto graph = entity->CreateComponent(); - graph->SetAssetType(assetType); - entity->CreateComponent(graph->GetScriptCanvasId()); } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index 11fefe59bf..029d713277 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -105,6 +105,44 @@ namespace ScriptCanvasEditor return nullptr; } + AZStd::optional GraphTabBar::GetTabData(int tabIndex) const + { + if (tabIndex < count()) + { + if (QVariant tabDataVariant = tabData(tabIndex); tabDataVariant.isValid()) + { + return tabDataVariant.value(); + } + } + + return AZStd::nullopt; + } + + AZStd::optional GraphTabBar::GetTabData(ScriptCanvasEditor::SourceHandle assetId) const + { + return GetTabData(FindTab(assetId)); + } + + void GraphTabBar::SetTabData(const GraphTabMetadata& metadata, int tabIndex) + { + if (tabIndex < count()) + { + setTabData(tabIndex, QVariant::fromValue(metadata)); + } + } + + void GraphTabBar::SetTabData(const GraphTabMetadata& metadata, ScriptCanvasEditor::SourceHandle assetId) + { + auto index = FindTab(assetId); + auto replacement = GetTabData(assetId); + + if (index >= 0 && replacement) + { + replacement->m_assetId = assetId; + SetTabData(metadata, index); + } + } + int GraphTabBar::InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId) { if (!SelectTab(assetId)) @@ -119,6 +157,7 @@ namespace ScriptCanvasEditor AZStd::string tabName; AzFramework::StringFunc::Path::GetFileName(assetId.Path().c_str(), tabName); + metaData.m_name = tabName.c_str(); // #sc_editor_asset filestate Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; @@ -381,6 +420,23 @@ namespace ScriptCanvasEditor Q_EMIT TabRemoved(index); } + void GraphTabBar::UpdateFileState(const ScriptCanvasEditor::SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState) + { + auto tabData = GetTabData(assetId); + if (tabData && tabData->m_fileState != fileState) + { + int index = FindTab(assetId); + tabData->m_fileState = fileState; + SetTabData(*tabData, assetId); + SetTabText(index, tabData->m_name, fileState); + + if (index == currentIndex()) + { + Q_EMIT OnActiveFileStateChanged(); + } + } + } + void GraphTabBar::currentChangedTab(int index) { if (index < 0) @@ -406,25 +462,6 @@ namespace ScriptCanvasEditor } } - void GraphTabBar::SetFileState(ScriptCanvasEditor::SourceHandle, Tracker::ScriptCanvasFileState ) - { - // #sc_editor_asset - // int index = FindTab(assetId); - -// if (index >= 0 && index < count()) -// { -// QVariant tabdata = tabData(index); -// if (tabdata.isValid()) -// { -// auto tabAssetId = tabdata.value(); -// -// AZStd::string tabName; -// AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, tabAssetId); -// SetTabText(index, tabName.c_str(), fileState); -// } -// } - } - #include } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h index 12e73b4ae5..48f327b244 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h @@ -35,6 +35,7 @@ namespace ScriptCanvasEditor QWidget* m_hostWidget = nullptr; CanvasWidget* m_canvasWidget = nullptr; Tracker::ScriptCanvasFileState m_fileState = Tracker::ScriptCanvasFileState::INVALID; + QString m_name; }; class GraphTabBar @@ -48,6 +49,11 @@ namespace ScriptCanvasEditor GraphTabBar(QWidget* parent = nullptr); ~GraphTabBar() override = default; + AZStd::optional GetTabData(int index) const; + AZStd::optional GetTabData(ScriptCanvasEditor::SourceHandle assetId) const; + void SetTabData(const GraphTabMetadata& data, int index); + void SetTabData(const GraphTabMetadata& data, ScriptCanvasEditor::SourceHandle assetId); + void AddGraphTab(ScriptCanvasEditor::SourceHandle assetId); void CloseTab(int index); void CloseAllTabs(); @@ -78,6 +84,8 @@ namespace ScriptCanvasEditor // The host widget field of the tabMetadata is not used and will not overwrite the tab data void SetTabText(int tabIndex, const QString& path, Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID); + void UpdateFileState(const ScriptCanvasEditor::SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState); + Q_SIGNALS: void TabInserted(int index); void TabRemoved(int index); @@ -101,8 +109,6 @@ namespace ScriptCanvasEditor // Called when the selected tab changes void currentChangedTab(int index); - void SetFileState(ScriptCanvasEditor::SourceHandle, Tracker::ScriptCanvasFileState fileState); - int m_signalSaveOnChangeTo = -1; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp index 5b78c62bac..1af554dd32 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp @@ -716,10 +716,7 @@ namespace ScriptCanvasEditor void GraphVariablesModel::SetActiveScene(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) { ScriptCanvas::GraphVariableManagerNotificationBus::Handler::BusDisconnect(); - - m_assetType = AZ::Data::AssetType::CreateNull(); - ScriptCanvas::GraphRequestBus::EventResult(m_assetType, scriptCanvasId, &ScriptCanvas::GraphRequests::GetAssetType); - + m_assetType = azrtti_typeid(); m_scriptCanvasId = scriptCanvasId; if (m_scriptCanvasId.IsValid()) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 432c51374c..b4269d8917 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1104,7 +1104,7 @@ namespace ScriptCanvasEditor { ScopedUndoBatch scopedUndoBatch("Modify Graph Canvas Scene"); UndoRequestBus::Event(scriptCanvasId, &UndoRequests::AddGraphItemChangeUndo, "Graph Change"); - MarkAssetModified(m_activeGraph); + UpdateFileState(m_activeGraph, Tracker::ScriptCanvasFileState::MODIFIED); } const bool forceTimer = true; @@ -1113,7 +1113,7 @@ namespace ScriptCanvasEditor void MainWindow::SignalSceneDirty(ScriptCanvasEditor::SourceHandle assetId) { - MarkAssetModified(assetId); + UpdateFileState(assetId, Tracker::ScriptCanvasFileState::MODIFIED); } void MainWindow::PushPreventUndoStateUpdate() @@ -1134,25 +1134,9 @@ namespace ScriptCanvasEditor m_preventUndoStateUpdateCount = 0; } - void MainWindow::MarkAssetModified(const ScriptCanvasEditor::SourceHandle& /*assetId*/) + void MainWindow::UpdateFileState(const ScriptCanvasEditor::SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState) { -// #sc_editor_asset if (!assetId.IsValid()) -// { -// return; -// } -// -// ScriptCanvasMemoryAsset::pointer memoryAsset; -// AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); -// -// if (memoryAsset) -// { -// const auto& memoryAssetId = memoryAsset->GetId(); -// const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(memoryAssetId); -// if (fileState != Tracker::ScriptCanvasFileState::NEW) -// { -// AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::UpdateFileState, memoryAssetId, Tracker::ScriptCanvasFileState::MODIFIED); -// } -// } + m_tabBar->UpdateFileState(assetId, fileState); } void MainWindow::RefreshScriptCanvasAsset(const AZ::Data::Asset& /*asset*/) @@ -4394,13 +4378,10 @@ namespace ScriptCanvasEditor } } - ScriptCanvasEditor::Tracker::ScriptCanvasFileState MainWindow::GetAssetFileState(ScriptCanvasEditor::SourceHandle /*assetId*/) const + ScriptCanvasEditor::Tracker::ScriptCanvasFileState MainWindow::GetAssetFileState(ScriptCanvasEditor::SourceHandle assetId) const { - // #sc_editor_asset - return Tracker::ScriptCanvasFileState::INVALID; - // Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; - // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, assetId); - // return fileState; + auto dataOptional = m_tabBar->GetTabData(assetId); + return dataOptional ? dataOptional->m_fileState : Tracker::ScriptCanvasFileState::INVALID; } void MainWindow::AssignGraphToEntityImpl(const AZ::EntityId& entityId) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index ee93308035..0a687e0011 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -548,7 +548,7 @@ namespace ScriptCanvasEditor //! \param asset asset to save void GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& assetId, AZStd::string& filePath, AZStd::string& fileFilter); - void MarkAssetModified(const ScriptCanvasEditor::SourceHandle& assetId); + void UpdateFileState(const ScriptCanvasEditor::SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState); // QMainWindow void closeEvent(QCloseEvent *event) override; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 1a81345054..ece7008b06 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -360,6 +360,7 @@ namespace ScriptCanvasEditor namespace ScriptCanvas { class ScriptCanvasData + : public AZStd::enable_shared_from_this { public: diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index 9d848ff998..ee500514dc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -1190,11 +1190,6 @@ namespace ScriptCanvas m_isObserved = isObserved; } - AZ::Data::AssetType Graph::GetAssetType() const - { - return m_assetType; - } - void Graph::VersioningRemoveSlot(ScriptCanvas::Node& scriptCanvasNode, const SlotId& slotId) { bool deletedSlot = true; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h index 786e693a04..76fc3a6c7b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h @@ -187,8 +187,6 @@ namespace ScriptCanvas bool IsGraphObserved() const override; void SetIsGraphObserved(bool isObserved) override; - - AZ::Data::AssetType GetAssetType() const override; //// const AZStd::unordered_map& GetNodeMapping() const { return m_nodeMapping; } @@ -198,7 +196,7 @@ namespace ScriptCanvas GraphData m_graphData; AZ::Data::AssetType m_assetType; - + private: ScriptCanvasId m_scriptCanvasId; ExecutionMode m_executionMode = ExecutionMode::Interpreted; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/GraphBus.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/GraphBus.h index 6b7133d47e..53d1a95964 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/GraphBus.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/GraphBus.h @@ -147,9 +147,6 @@ namespace ScriptCanvas //! returns a pair of with the supplied id //! The variable datum pointer is non-null if the variable has been found virtual GraphVariable* FindVariableById(const VariableId& variableId) = 0; - - virtual AZ::Data::AssetType GetAssetType() const = 0; - }; using GraphRequestBus = AZ::EBus; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp index 3d76883adc..8b8dfdc3fc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp @@ -493,14 +493,6 @@ namespace ScriptCanvas return m_sortPriority; } - bool GraphVariable::IsInFunction() const - { - AZ::Data::AssetType assetType = AZ::Data::AssetType::CreateNull(); - ScriptCanvas::GraphRequestBus::EventResult(assetType, m_scriptCanvasId, &ScriptCanvas::GraphRequests::GetAssetType); - - return assetType == azrtti_typeid(); - } - AZ::u32 GraphVariable::OnInitialValueSourceChanged() { VariableNotificationBus::Event(GetGraphScopedId(), &VariableNotifications::OnVariableInitialValueSourceChanged); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h index dbc0a814c6..e7829ca6c1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h @@ -194,9 +194,7 @@ namespace ScriptCanvas choices.emplace_back(AZStd::make_pair(static_cast(VariableFlags::Scope::Function), s_ScopeNames[1])); return choices; } - - bool IsInFunction() const; - + void OnScopeTypedChanged(); AZ::u32 OnInitialValueSourceChanged(); void OnSortPriorityChanged(); From 1ea245e46cde2f350d0a0e3b057b4304c8d088b6 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 8 Nov 2021 10:00:45 -0800 Subject: [PATCH 031/399] source save asset-free WIP Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Assets/ScriptCanvasAssetHandler.cpp | 1 + .../Assets/ScriptCanvasFileHandling.cpp | 60 +++++ .../Code/Editor/Components/EditorGraph.cpp | 5 + .../Assets/ScriptCanvasFileHandling.h | 6 +- .../ScriptCanvas/Components/EditorGraph.h | 2 + .../Code/Editor/View/Windows/MainWindow.cpp | 230 ++++++++---------- .../Code/Editor/View/Windows/MainWindow.h | 27 +- .../Windows/Tools/UpgradeTool/FileSaver.cpp | 86 ++++++- .../Windows/Tools/UpgradeTool/FileSaver.h | 2 + 9 files changed, 269 insertions(+), 150 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp index bac1f770cb..896d285054 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp @@ -186,6 +186,7 @@ namespace ScriptCanvasEditor , AZ::IO::GenericStream* stream , [[maybe_unused]] AZ::DataStream::StreamType streamType) { + // #sc_editor_asset delete usage of this, and route to ScriptCanvasEditor::SaveToStream namespace JSRU = AZ::JsonSerializationUtils; using namespace ScriptCanvas; diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index 42dcf81a8d..9e385443f2 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -139,4 +139,64 @@ namespace ScriptCanvasEditor return AZ::Success(ScriptCanvasEditor::SourceHandle(scriptCanvasData, {}, path)); } + + AZ::Outcome SaveToStream(const SourceHandle& source, AZ::IO::GenericStream& stream) + { + namespace JSRU = AZ::JsonSerializationUtils; + + if (!source) + { + return AZ::Failure(AZStd::string("no source graph to save")); + } + + if (source.Path().empty()) + { + return AZ::Failure(AZStd::string("no destination path specified")); + } + + AZ::SerializeContext* serializeContext = nullptr; + AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); + if (!serializeContext) + { + return AZ::Failure(AZStd::string("no serialize context available to properly save source file")); + } + + auto graphData = source.Get()->GetOwnership(); + if (!graphData) + { + return AZ::Failure(AZStd::string("source is missing save container")); + } + + if (graphData->GetEditorGraph() != source.Get()) + { + return AZ::Failure(AZStd::string("source save container refers to incorrect graph")); + } + + auto saveTarget = graphData->ModGraph(); + if (saveTarget || !saveTarget->GetGraphData()) + { + return AZ::Failure(AZStd::string("source save container failed to return graph data")); + } + + AZ::JsonSerializerSettings settings; + settings.m_metadata.Create(); + auto listeners = settings.m_metadata.Find(); + AZ_Assert(listeners, "Failed to create SerializationListeners"); + ScriptCanvasFileHandlingCpp::CollectNodes(saveTarget->GetGraphData()->m_nodes, *listeners); + settings.m_keepDefaults = false; + settings.m_serializeContext = serializeContext; + + for (auto listener : *listeners) + { + listener->OnSerialize(); + } + + auto saveOutcome = JSRU::SaveObjectToStream(graphData.get(), stream, nullptr, &settings); + if (!saveOutcome.IsSuccess()) + { + return AZ::Failure(AZStd::string("JSON serialization failed to save source: %s", saveOutcome.GetError().c_str())); + } + + return AZ::Success(); + } } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 2a15371e93..add1b3a9e5 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -1067,6 +1067,11 @@ namespace ScriptCanvasEditor m_owner = &owner; } + ScriptCanvas::DataPtr Graph::GetOwnership() const + { + return ScriptCanvas::DataPtr(const_cast(this)->m_owner); + } + bool Graph::CreateConnection(const GraphCanvas::ConnectionId& connectionId, const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) { if (!sourcePoint.IsValid() || !targetPoint.IsValid()) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h index 154ff5f2b0..c88a7df28b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h @@ -26,10 +26,12 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { - AZ::Outcome LoadFromFile(AZStd::string_view path); + AZ::Outcome LoadFromFile(AZStd::string_view path); AZ::Outcome LoadDataFromJson ( ScriptCanvas::ScriptCanvasData& dataTarget , AZStd::string_view source , AZ::SerializeContext& serializeContext); - } + + AZ::Outcome SaveToStream(const SourceHandle& source, AZ::IO::GenericStream& stream); +} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index 526c929664..05619caa30 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -309,6 +309,7 @@ namespace ScriptCanvasEditor const GraphStatisticsHelper& GetNodeUsageStatistics() const; void MarkOwnership(ScriptCanvas::ScriptCanvasData& owner); + ScriptCanvas::DataPtr GetOwnership() const; // Finds and returns all nodes within the graph that are of the specified type template @@ -393,6 +394,7 @@ namespace ScriptCanvasEditor bool m_saveFormatConverted = true; ScriptCanvasEditor::SourceHandle m_assetId; + // #sc_editor_asset temporary step in cleaning up the graph / asset class structure. This reference is deliberately weak. ScriptCanvas::ScriptCanvasData* m_owner; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index b4269d8917..8807219e53 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1723,17 +1723,18 @@ namespace ScriptCanvasEditor // return AZ::Success(outTabIndex); } - bool MainWindow::OnFileSave(const Callbacks::OnSave& saveCB) + bool MainWindow::OnFileSave() { - return SaveAssetAsImpl(m_activeGraph, saveCB); + return SaveAssetImpl(m_activeGraph, Save::InPlace); } - bool MainWindow::OnFileSaveAs(const Callbacks::OnSave& saveCB) + bool MainWindow::OnFileSaveAs() { - return SaveAssetAsImpl(m_activeGraph, saveCB); + return SaveAssetImpl(m_activeGraph, Save::As); } - bool MainWindow::SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB) + /* + bool MainWindow::SaveAssetImpl_OLD(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB) { if (!assetId.IsValid()) { @@ -1748,7 +1749,7 @@ namespace ScriptCanvasEditor if (fileState == Tracker::ScriptCanvasFileState::NEW) { - saveSuccessful = SaveAssetAsImpl(assetId, saveCB); + saveSuccessful = SaveAssetImpl(assetId, saveCB); } else if (fileState == Tracker::ScriptCanvasFileState::MODIFIED || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED) @@ -1759,8 +1760,16 @@ namespace ScriptCanvasEditor return saveSuccessful; } + */ - bool MainWindow::SaveAssetAsImpl(const ScriptCanvasEditor::SourceHandle& inMemoryAssetId, const Callbacks::OnSave& saveCB) + + // 1. SaveAssetImpl + // 2. SaveAs + // // 3. OnSaveCallback + // SaveAsEnd + // SaveAssetImpl end + + bool MainWindow::SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& inMemoryAssetId, Save /*save*/) { if (!inMemoryAssetId.IsValid()) { @@ -1803,11 +1812,12 @@ namespace ScriptCanvasEditor AZ::IO::FileIOBase::GetInstance()->ResolvePath("@engroot@", assetRootChar.data(), assetRootChar.size()); assetRoot = assetRootChar.data(); - /* if (!AZ::StringFunc::StartsWith(filePath, assetRoot)) - { - QMessageBox::information(this, "Unable to Save", AZStd::string::format("You must select a path within the current project\n\n%s", assetRoot.c_str()).c_str()); - } - else*/ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) +// if (!AZ::StringFunc::StartsWith(filePath, assetRoot)) +// { +// QMessageBox::information(this, "Unable to Save", AZStd::string::format("You must select a path within the current project\n\n%s", assetRoot.c_str()).c_str()); +// } +// else +if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) { isValidFileName = !(fileName.empty()); } @@ -1833,7 +1843,7 @@ namespace ScriptCanvasEditor return false; } - SaveAs(internalStringFile, inMemoryAssetId, saveCB); + SaveAs(internalStringFile, inMemoryAssetId); m_newlySavedFile = internalStringFile; @@ -1842,103 +1852,95 @@ namespace ScriptCanvasEditor return true; } - return false; } + - void MainWindow::OnSaveCallback(bool /*saveSuccess*/, AZ::Data::AssetPtr /*fileAsset*/, ScriptCanvasEditor::SourceHandle /*previousFileAssetId*/) + void MainWindow::OnSaveCallback(bool saveSuccess, ScriptCanvasEditor::SourceHandle memoryAsset) { - // #sc_editor_asset yikes...just save the thing...move to ::SaveAsset maybe - - /* - ScriptCanvasMemoryAsset::pointer memoryAsset; - AZStd::string tabName = m_tabBar->tabText(m_tabBar->currentIndex()).toUtf8().data(); - - int saveTabIndex = m_tabBar->currentIndex(); + int saveTabIndex = m_tabBar->FindTab(memoryAsset); + AZStd::string tabName = saveTabIndex >= 0 ? m_tabBar->tabText(saveTabIndex).toUtf8().data() : ""; if (saveSuccess) { - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, fileAsset->GetId()); - AZ_Assert(memoryAsset, "At this point we must have a MemoryAsset"); - + // #sc_editor_asset find a tab with the same path name and close non focused old ones with the same name // Update the editor with the new information about this asset. - const ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset->GetFileAssetId(); - - saveTabIndex = m_tabBar->FindTab(fileAssetId); - + const ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset; // We've saved as over a new graph, so we need to close the old one. if (saveTabIndex != m_tabBar->currentIndex()) { // Invalidate the file asset id so we don't delete trigger the asset flow. - m_tabBar->setTabData(saveTabIndex, QVariant::fromValue(GraphTabMetaData)); - + m_tabBar->setTabData(saveTabIndex, QVariant::fromValue(Widget::GraphTabMetadata())); m_tabBar->CloseTab(saveTabIndex); saveTabIndex = -1; } + // #sc_editor_asset clean up these actions as well, save and close, save as and close, just save, etc if (saveTabIndex < 0) { // This asset had not been saved yet, we will need to use the in memory asset Id to get the index. - saveTabIndex = m_tabBar->FindTab(memoryAsset->GetId()); + // saveTabIndex = m_tabBar->FindTab(memoryAsset->GetId()); if (saveTabIndex < 0) { // Finally, we may have Saved-As and we need the previous file asset Id to find the tab - saveTabIndex = m_tabBar->FindTab(previousFileAssetId); + //saveTabIndex = m_tabBar->FindTab(previousFileAssetId); } } - AzFramework::StringFunc::Path::GetFileName(memoryAsset->GetAbsolutePath().c_str(), tabName); + AzFramework::StringFunc::Path::GetFileName(memoryAsset.Path().c_str(), tabName); // Update the tab's assetId to the file asset Id (necessary when saving a new asset) - // used to be configure tab...sets the name and file state - m_tabBar->ConfigureTab(saveTabIndex, fileAssetId, tabName); - - GeneralAssetNotificationBus::Event(memoryAsset->GetId(), &GeneralAssetNotifications::OnAssetVisualized); - - auto requestorIter = m_assetCreationRequests.find(fileAsset->GetId()); - - if (requestorIter != m_assetCreationRequests.end()) - { - auto editorComponents = AZ::EntityUtils::FindDerivedComponents(requestorIter->second.first); - - if (editorComponents.empty()) - { - auto firstRequestBus = EditorScriptCanvasComponentRequestBus::FindFirstHandler(requestorIter->second.first); + // #sc_editor_asset used to be configure tab...sets the name and file state + // m_tabBar->ConfigureTab(saveTabIndex, fileAssetId, tabName); - if (firstRequestBus) - { - firstRequestBus->SetAssetId(fileAsset->GetId()); - } - } - else - { - for (auto editorComponent : editorComponents) - { - if (editorComponent->GetId() == requestorIter->second.second) - { - editorComponent->SetAssetId(fileAsset->GetId()); - break; - } - } - } - - m_assetCreationRequests.erase(requestorIter); - } +// GeneralAssetNotificationBus::Event(memoryAsset, &GeneralAssetNotifications::OnAssetVisualized); +// +// auto requestorIter = m_assetCreationRequests.find(fileAsset->GetId()); +// +// if (requestorIter != m_assetCreationRequests.end()) +// { +// auto editorComponents = AZ::EntityUtils::FindDerivedComponents(requestorIter->second.first); +// +// if (editorComponents.empty()) +// { +// auto firstRequestBus = EditorScriptCanvasComponentRequestBus::FindFirstHandler(requestorIter->second.first); +// +// if (firstRequestBus) +// { +// firstRequestBus->SetAssetId(fileAsset->GetId()); +// } +// } +// else +// { +// for (auto editorComponent : editorComponents) +// { +// if (editorComponent->GetId() == requestorIter->second.second) +// { +// editorComponent->SetAssetId(fileAsset->GetId()); +// break; +// } +// } +// } +// +// m_assetCreationRequests.erase(requestorIter); +// } // Soft switch the asset id here. We'll do a double scene switch down below to actually switch the active assetid m_activeGraph = fileAssetId; } else { + // #sc_editor_asset this seems to remove the unsaved indicator even on failure + // Use the previous memory asset to find what we had setup as our display - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); + // AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); // Drop off our file modifier status for our display name when we fail to save. - if (tabName.at(tabName.size() -1) == '*') - { - tabName = tabName.substr(0, tabName.size() - 2); - } +// if (tabName.at(tabName.size() -1) == '*') +// { +// tabName = tabName.substr(0, tabName.size() - 2); +// } } if (m_tabBar->currentIndex() != saveTabIndex) @@ -1961,7 +1963,7 @@ namespace ScriptCanvasEditor const bool displayAsNotification = true; RunGraphValidation(displayAsNotification); - // This is called during saving, so the is scaving flag is always true Need to update the state after this callback is complete. So schedule for next system tick. + // This is called during saving, so the is saving flag is always true Need to update the state after this callback is complete. So schedule for next system tick. AddSystemTickAction(SystemTickActionFlag::UpdateSaveMenuState); if (m_closeCurrentGraphAfterSave) @@ -1974,69 +1976,27 @@ namespace ScriptCanvasEditor EnableAssetView(memoryAsset); UnblockCloseRequests(); - */ } - bool MainWindow::ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId, const Callbacks::OnSave& saveCB) + bool MainWindow::ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId) { SetActiveAsset(unsavedAssetId); - return OnFileSave(saveCB); + return OnFileSave(); } - void MainWindow::SaveAs(AZStd::string_view /*path*/, ScriptCanvasEditor::SourceHandle /*inMemoryAssetId*/, const Callbacks::OnSave& /*onSave*/) + void MainWindow::SaveAs(AZStd::string_view path, ScriptCanvasEditor::SourceHandle inMemoryAssetId) { - /* - PrepareAssetForSave(inMemoryAssetId); - - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, inMemoryAssetId); - - // Disable the current view if we are saving. - if (memoryAsset) - { - DisableAssetView(memoryAsset); - } - - auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle previousAssetId) - { - OnSaveCallback(saveSuccess, asset, previousAssetId); - if (onSave) - { - AZStd::invoke(onSave, saveSuccess, asset, previousAssetId); - } - }; - - AZ::Data::AssetStreamInfo streamInfo; - streamInfo.m_streamFlags = AZ::IO::OpenMode::ModeWrite; - streamInfo.m_streamName = m_saveAsPath; - - if (!streamInfo.IsValid()) - { - return; - } + AZ_TracePrintf("ScriptCanvas", "Saving %s to %.*s", inMemoryAssetId.Path().c_str(), path.data()); + // #sc_editor_asset maybe delete this + + DisableAssetView(inMemoryAssetId); - bool sourceControlActive = false; - AzToolsFramework::SourceControlConnectionRequestBus::BroadcastResult(sourceControlActive, &AzToolsFramework::SourceControlConnectionRequests::IsActive); - // If Source Control is active then use it to check out the file before saving otherwise query the file info and save only if the file is not read-only - if (sourceControlActive) - { - AzToolsFramework::SourceControlCommandBus::Broadcast(&AzToolsFramework::SourceControlCommandBus::Events::RequestEdit, - streamInfo.m_streamName.c_str(), - true, - [this, streamInfo, onSaveCallback](bool success, AzToolsFramework::SourceControlFileInfo info) { FinalizeAssetSave(success, info, streamInfo, onSaveCallback); } - ); - } - else - { - AzToolsFramework::SourceControlCommandBus::Broadcast(&AzToolsFramework::SourceControlCommandBus::Events::GetFileInfo, - streamInfo.m_streamName.c_str(), - [this, streamInfo, onSaveCallback](bool success, AzToolsFramework::SourceControlFileInfo info) { FinalizeAssetSave(success, info, streamInfo, onSaveCallback); } - ); - } + // use the file saver, make new version that works on source handle and not asset + // then...connect the failed and succeed versions + // to OnSaveCallBack - UpdateSaveState(); - BlockCloseRequests(); - */ + UpdateSaveState(); + BlockCloseRequests(); } void MainWindow::OnFileOpen() @@ -2802,7 +2762,7 @@ namespace ScriptCanvasEditor // // if (fileState == Tracker::ScriptCanvasFileState::NEW) // { -// SaveAssetAsImpl(fileAssetId, saveCB); +// SaveAssetImpl(fileAssetId, saveCB); // } // else // { @@ -2822,7 +2782,7 @@ namespace ScriptCanvasEditor if (tabdata.isValid()) { auto assetId = tabdata.value(); - SaveAssetAsImpl(assetId.m_assetId, nullptr); + SaveAssetImpl(assetId.m_assetId, Save::InPlace); } } @@ -4761,11 +4721,11 @@ namespace ScriptCanvasEditor //connect(m_unitTestDockWidget, &QDockWidget::visibilityChanged, this, &MainWindow::OnViewVisibilityChanged); } - void MainWindow::DisableAssetView(ScriptCanvasMemoryAsset::pointer memoryAsset) + void MainWindow::DisableAssetView(const ScriptCanvasEditor::SourceHandle& memoryAssetId) { - if (memoryAsset->GetView()) + if (auto view = m_tabBar->ModTabView(m_tabBar->FindTab(memoryAssetId))) { - memoryAsset->GetView()->DisableView(); + view->DisableView(); } m_tabBar->setEnabled(false); @@ -4785,11 +4745,11 @@ namespace ScriptCanvasEditor m_autoSaveTimer.stop(); } - void MainWindow::EnableAssetView(ScriptCanvasMemoryAsset::pointer memoryAsset) + void MainWindow::EnableAssetView(const ScriptCanvasEditor::SourceHandle& memoryAssetId) { - if (memoryAsset->GetView()) + if (auto view = m_tabBar->ModTabView(m_tabBar->FindTab(memoryAssetId))) { - memoryAsset->GetView()->EnableView(); + view->EnableView(); } m_tabBar->setEnabled(true); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 0a687e0011..0f126456c0 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -325,12 +325,17 @@ namespace ScriptCanvasEditor // File menu void OnFileNew(); - bool OnFileSave(const Callbacks::OnSave& saveCB); - bool OnFileSaveAs(const Callbacks::OnSave& saveCB); - bool OnFileSaveCaller(){return OnFileSave(nullptr);}; - bool OnFileSaveAsCaller(){return OnFileSaveAs(nullptr);}; - bool SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB); - bool SaveAssetAsImpl(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB); + bool OnFileSave(); + bool OnFileSaveAs(); + bool OnFileSaveCaller(){return OnFileSave();}; + bool OnFileSaveAsCaller(){return OnFileSaveAs();}; + bool SaveAssetImpl_OLD(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB); + enum class Save + { + InPlace, + As + }; + bool SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& assetId, Save save); void OnFileOpen(); // Edit menu @@ -554,9 +559,9 @@ namespace ScriptCanvasEditor void closeEvent(QCloseEvent *event) override; UnsavedChangesOptions ShowSaveDialog(const QString& filename); - bool ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId, const Callbacks::OnSave& onSave); + bool ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId); - void SaveAs(AZStd::string_view path, ScriptCanvasEditor::SourceHandle assetId, const Callbacks::OnSave& onSave); + void SaveAs(AZStd::string_view path, ScriptCanvasEditor::SourceHandle assetId); void OpenFile(const char* fullPath); void CreateMenus(); @@ -667,8 +672,8 @@ namespace ScriptCanvasEditor } } - void DisableAssetView(ScriptCanvasMemoryAsset::pointer memoryAsset); - void EnableAssetView(ScriptCanvasMemoryAsset::pointer memoryAsset); + void DisableAssetView(const ScriptCanvasEditor::SourceHandle& memoryAssetId); + void EnableAssetView(const ScriptCanvasEditor::SourceHandle& memoryAssetId); QWidget* m_host = nullptr; @@ -783,6 +788,6 @@ namespace ScriptCanvasEditor //! this object manages the Save/Restore operations Workspace* m_workspace; - void OnSaveCallback(bool saveSuccess, AZ::Data::AssetPtr, ScriptCanvasEditor::SourceHandle previousFileAssetId); + void OnSaveCallback(bool saveSuccess, ScriptCanvasEditor::SourceHandle previousFileAssetId); }; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp index f067feeca4..82a046b0fc 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp @@ -186,12 +186,73 @@ namespace ScriptCanvasEditor }); } + void FileSaver::OnSourceFileReleased(const SourceHandle& source) + { + AZStd::string tmpFileName; + // here we are saving the graph to a temp file instead of the original file and then copying the temp file to the original file. + // This ensures that AP will not a get a file change notification on an incomplete graph file causing it to fail processing. Temp files are ignored by AP. + if (!AZ::IO::CreateTempFileName(source.Path().c_str(), tmpFileName)) + { + FileSaveResult result; + result.fileSaveError = "Failure to create temporary file name"; + m_onComplete(result); + return; + } + + bool tempSavedSucceeded = false; + AZ::IO::FileIOStream fileStream(tmpFileName.c_str(), AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeText); + if (fileStream.IsOpen()) + { + if (asset.GetType() == azrtti_typeid()) + { + ScriptCanvasEditor::ScriptCanvasAssetHandler handler; + tempSavedSucceeded = handler.SaveAssetData(asset, &fileStream); + } + + fileStream.Close(); + } + + if (!tempSavedSucceeded) + { + FileSaveResult result; + result.fileSaveError = "Save asset data to temporary file failed"; + m_onComplete(result); + return; + } + + AzToolsFramework::SourceControlCommandBus::Broadcast + ( &AzToolsFramework::SourceControlCommandBus::Events::RequestEdit + , fullPath.c_str() + , true + , [this, fullPath, tmpFileName]([[maybe_unused]] bool success, const AzToolsFramework::SourceControlFileInfo& info) + { + constexpr const size_t k_maxAttemps = 10; + + if (!info.IsReadOnly()) + { + PerformMove(tmpFileName, fullPath, k_maxAttemps); + } + else if (m_onReadOnlyFile && m_onReadOnlyFile()) + { + AZ::IO::SystemFile::SetWritable(info.m_filePath.c_str(), true); + PerformMove(tmpFileName, fullPath, k_maxAttemps); + } + else + { + FileSaveResult result; + result.fileSaveError = "Source file was and remained read-only"; + result.tempFileRemovalError = RemoveTempFile(tmpFileName); + m_onComplete(result); + } + }); + } + AZStd::string FileSaver::RemoveTempFile(AZStd::string_view tempFile) { AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance(); if (!fileIO) { - return "GraphUpgradeComplete: No FileIO instance"; + return "No FileIO instance"; } if (fileIO->Exists(tempFile.data()) && !fileIO->Remove(tempFile.data())) @@ -202,13 +263,34 @@ namespace ScriptCanvasEditor return ""; } + void FileSaver::Save(const SourceHandle& source) + { + if (source.Path().empty()) + { + FileSaveResult result; + result.fileSaveError = "No save location specified"; + m_onComplete(result); + } + else + { + auto streamer = AZ::Interface::Get(); + AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(source.Path()); + streamer->SetRequestCompleteCallback(flushRequest, [this, source]([[maybe_unused]] AZ::IO::FileRequestHandle request) + { + this->OnSourceFileReleased(source); + }); + streamer->QueueRequest(flushRequest); + } + } + void FileSaver::Save(AZ::Data::Asset asset) { + // #sc_editor_asset fix this path from the version explorer AZStd::string relativePath, fullPath; AZ::Data::AssetCatalogRequestBus::BroadcastResult(relativePath, &AZ::Data::AssetCatalogRequests::GetAssetPathById, asset.GetId()); bool fullPathFound = false; AzToolsFramework::AssetSystemRequestBus::BroadcastResult - (fullPathFound + ( fullPathFound , &AzToolsFramework::AssetSystemRequestBus::Events::GetFullSourcePathFromRelativeProductPath , relativePath, fullPath); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h index dd333927ed..6ec0daa2b7 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h @@ -30,11 +30,13 @@ namespace ScriptCanvasEditor , AZStd::function onComplete); void Save(AZ::Data::Asset asset); + void Save(const SourceHandle& source); private: AZStd::function m_onComplete; AZStd::function m_onReadOnlyFile; + void OnSourceFileReleased(const SourceHandle& source); void OnSourceFileReleased(AZ::Data::Asset asset); void PerformMove From 5cd8eb648ccb1257e7690ae546aee0e26c2b9d20 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 8 Nov 2021 13:58:48 -0800 Subject: [PATCH 032/399] source save in place first pass Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Assets/ScriptCanvasFileHandling.cpp | 4 +- .../Code/Editor/Components/EditorGraph.cpp | 4 +- .../ScriptCanvas/Components/EditorGraph.h | 2 +- .../Code/Editor/View/Windows/MainWindow.cpp | 135 +++++++++--------- .../Code/Editor/View/Windows/MainWindow.h | 5 +- .../Windows/Tools/UpgradeTool/FileSaver.cpp | 31 ++-- .../Windows/Tools/UpgradeTool/FileSaver.h | 2 + .../Windows/Tools/UpgradeTool/Modifier.cpp | 2 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 1 - 9 files changed, 99 insertions(+), 87 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index 9e385443f2..4af7ff247e 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -173,7 +173,7 @@ namespace ScriptCanvasEditor } auto saveTarget = graphData->ModGraph(); - if (saveTarget || !saveTarget->GetGraphData()) + if (!saveTarget || !saveTarget->GetGraphData()) { return AZ::Failure(AZStd::string("source save container failed to return graph data")); } @@ -191,7 +191,7 @@ namespace ScriptCanvasEditor listener->OnSerialize(); } - auto saveOutcome = JSRU::SaveObjectToStream(graphData.get(), stream, nullptr, &settings); + auto saveOutcome = JSRU::SaveObjectToStream(graphData, stream, nullptr, &settings); if (!saveOutcome.IsSuccess()) { return AZ::Failure(AZStd::string("JSON serialization failed to save source: %s", saveOutcome.GetError().c_str())); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index add1b3a9e5..a34dc949f5 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -1067,9 +1067,9 @@ namespace ScriptCanvasEditor m_owner = &owner; } - ScriptCanvas::DataPtr Graph::GetOwnership() const + ScriptCanvas::ScriptCanvasData* Graph::GetOwnership() const { - return ScriptCanvas::DataPtr(const_cast(this)->m_owner); + return const_cast(this)->m_owner; } bool Graph::CreateConnection(const GraphCanvas::ConnectionId& connectionId, const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index 05619caa30..b5269cc45d 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -309,7 +309,7 @@ namespace ScriptCanvasEditor const GraphStatisticsHelper& GetNodeUsageStatistics() const; void MarkOwnership(ScriptCanvas::ScriptCanvasData& owner); - ScriptCanvas::DataPtr GetOwnership() const; + ScriptCanvas::ScriptCanvasData* GetOwnership() const; // Finds and returns all nodes within the graph that are of the specified type template diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 8807219e53..c298517c4b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1405,48 +1405,28 @@ namespace ScriptCanvasEditor void MainWindow::GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZStd::string& /*filePath*/, AZStd::string& /*fileFilter*/) { // #sc_editor_asset - /* - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - - AZStd::string assetPath; - if (memoryAsset) - { - assetPath = memoryAsset->GetAbsolutePath(); - - AZ::Data::AssetType assetType = memoryAsset->GetAsset().GetType(); - - ScriptCanvasAssetHandler* assetHandler; - AssetTrackerRequestBus::BroadcastResult(assetHandler, &AssetTrackerRequests::GetAssetHandlerForType, assetType); - AZ_Assert(assetHandler, "Asset type must have a valid asset handler"); - - AZ::EBusAggregateResults results; - AssetRegistryRequestBus::BroadcastResult(results, &AssetRegistryRequests::GetAssetDescription, assetType); - - ScriptCanvas::AssetDescription* description = nullptr; - for (auto item : results.values) - { - if (item->GetAssetType() == assetType) - { - description = item; - break; - } - } - - AZ_Assert(description, "Asset type must have a valid description"); - - fileFilter = description->GetFileFilterImpl(); - - AZStd::string tabName; - AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, assetId); - - assetPath = AZStd::string::format("%s/%s%s", description->GetSuggestedSavePathImpl(), tabName.c_str(), description->GetExtensionImpl()); - } - - AZStd::array resolvedPath; - AZ::IO::FileIOBase::GetInstance()->ResolvePath(assetPath.data(), resolvedPath.data(), resolvedPath.size()); - filePath = resolvedPath.data(); - */ +// +// ScriptCanvasMemoryAsset::pointer memoryAsset; +// AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); +// +// AZStd::string assetPath; +// if (memoryAsset) +// { +// assetPath = memoryAsset->GetAbsolutePath(); +// fileFilter = ScriptCanvasAssetDescription().GetFileFilterImpl(); +// +// AZStd::string tabName; +// AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, assetId); +// +// assetPath = AZStd::string::format("%s/%s%s" +// , ScriptCanvasAssetDescription().GetSuggestedSavePathImpl() +// , tabName.c_str() +// , ScriptCanvasAssetDescription().GetExtensionImpl()); +// } +// +// AZStd::array resolvedPath; +// AZ::IO::FileIOBase::GetInstance()->ResolvePath(assetPath.data(), resolvedPath.data(), resolvedPath.size()); +// filePath = resolvedPath.data(); } void MainWindow::OpenFile(const char* fullPath) @@ -1769,7 +1749,7 @@ namespace ScriptCanvasEditor // SaveAsEnd // SaveAssetImpl end - bool MainWindow::SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& inMemoryAssetId, Save /*save*/) + bool MainWindow::SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& inMemoryAssetId, Save save) { if (!inMemoryAssetId.IsValid()) { @@ -1785,14 +1765,22 @@ namespace ScriptCanvasEditor AZStd::string suggestedFilename; AZStd::string suggestedFileFilter; - GetSuggestedFullFilenameToSaveAs(inMemoryAssetId, suggestedFilename, suggestedFileFilter); + bool isValidFileName = false; + if (save == Save::InPlace) + { + isValidFileName = true; + suggestedFileFilter = ScriptCanvasAssetDescription().GetExtensionImpl(); + suggestedFilename = inMemoryAssetId.Path(); + } + else + { + GetSuggestedFullFilenameToSaveAs(inMemoryAssetId, suggestedFilename, suggestedFileFilter); + } + EnsureSaveDestinationDirectory(suggestedFilename); - QString filter = suggestedFileFilter.c_str(); - QString selectedFile; - - bool isValidFileName = false; + QString selectedFile = suggestedFilename.c_str(); while (!isValidFileName) { @@ -1817,7 +1805,7 @@ namespace ScriptCanvasEditor // QMessageBox::information(this, "Unable to Save", AZStd::string::format("You must select a path within the current project\n\n%s", assetRoot.c_str()).c_str()); // } // else -if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) + if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) { isValidFileName = !(fileName.empty()); } @@ -1825,7 +1813,6 @@ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) { QMessageBox::information(this, "Unable to Save", "File name cannot be empty"); } - } else { @@ -1844,20 +1831,20 @@ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) } SaveAs(internalStringFile, inMemoryAssetId); - m_newlySavedFile = internalStringFile; - // Forcing the file add here, since we are creating a new file AddRecentFile(m_newlySavedFile.c_str()); - return true; } + return false; } - void MainWindow::OnSaveCallback(bool saveSuccess, ScriptCanvasEditor::SourceHandle memoryAsset) + void MainWindow::OnSaveCallBack(const VersionExplorer::FileSaveResult& result) { + const bool saveSuccess = result.fileSaveError.empty(); + auto memoryAsset = m_fileSaver->GetSource(); int saveTabIndex = m_tabBar->FindTab(memoryAsset); AZStd::string tabName = saveTabIndex >= 0 ? m_tabBar->tabText(saveTabIndex).toUtf8().data() : ""; @@ -1866,8 +1853,9 @@ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) // #sc_editor_asset find a tab with the same path name and close non focused old ones with the same name // Update the editor with the new information about this asset. const ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset; + int currentTabIndex = m_tabBar->currentIndex(); // We've saved as over a new graph, so we need to close the old one. - if (saveTabIndex != m_tabBar->currentIndex()) + if (saveTabIndex != currentTabIndex) { // Invalidate the file asset id so we don't delete trigger the asset flow. m_tabBar->setTabData(saveTabIndex, QVariant::fromValue(Widget::GraphTabMetadata())); @@ -1928,6 +1916,14 @@ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) // Soft switch the asset id here. We'll do a double scene switch down below to actually switch the active assetid m_activeGraph = fileAssetId; + + if (tabName.at(tabName.size() - 1) == '*') + { + tabName = tabName.substr(0, tabName.size() - 2); + } + + m_tabBar->UpdateFileState(fileAssetId, Tracker::ScriptCanvasFileState::UNMODIFIED); + m_tabBar->SetTabText(saveTabIndex, tabName.c_str()); } else { @@ -1949,11 +1945,11 @@ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) } else { - // Something weird happens with our saving. Where we are relying on these scene changes being called. - ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; - - OnChangeActiveGraphTab(ScriptCanvasEditor::SourceHandle()); - OnChangeActiveGraphTab(previousAssetId); +// // Something weird happens with our saving. Where we are relying on these scene changes being called. +// ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; +// +// OnChangeActiveGraphTab(ScriptCanvasEditor::SourceHandle()); +// OnChangeActiveGraphTab(previousAssetId); } UpdateAssignToSelectionState(); @@ -1966,7 +1962,7 @@ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) // This is called during saving, so the is saving flag is always true Need to update the state after this callback is complete. So schedule for next system tick. AddSystemTickAction(SystemTickActionFlag::UpdateSaveMenuState); - if (m_closeCurrentGraphAfterSave) + if (saveSuccess && m_closeCurrentGraphAfterSave) { AddSystemTickAction(SystemTickActionFlag::CloseCurrentGraph); } @@ -1976,6 +1972,7 @@ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) EnableAssetView(memoryAsset); UnblockCloseRequests(); + m_fileSaver.reset(); } bool MainWindow::ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId) @@ -1986,17 +1983,17 @@ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) void MainWindow::SaveAs(AZStd::string_view path, ScriptCanvasEditor::SourceHandle inMemoryAssetId) { - AZ_TracePrintf("ScriptCanvas", "Saving %s to %.*s", inMemoryAssetId.Path().c_str(), path.data()); - // #sc_editor_asset maybe delete this - DisableAssetView(inMemoryAssetId); - // use the file saver, make new version that works on source handle and not asset - // then...connect the failed and succeed versions - // to OnSaveCallBack + m_fileSaver = AZStd::make_unique + ( nullptr + , [this](const VersionExplorer::FileSaveResult& fileSaveResult) { OnSaveCallBack(fileSaveResult); }); + + ScriptCanvasEditor::SourceHandle newLocation(inMemoryAssetId, {}, path); + m_fileSaver->Save(newLocation); - UpdateSaveState(); - BlockCloseRequests(); + UpdateSaveState(); + BlockCloseRequests(); } void MainWindow::OnFileOpen() diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 0f126456c0..6704c10fda 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -53,6 +53,7 @@ #include #include +#include #if SCRIPTCANVAS_EDITOR #include @@ -788,6 +789,8 @@ namespace ScriptCanvasEditor //! this object manages the Save/Restore operations Workspace* m_workspace; - void OnSaveCallback(bool saveSuccess, ScriptCanvasEditor::SourceHandle previousFileAssetId); + AZStd::unique_ptr m_fileSaver; + VersionExplorer::FileSaveResult m_fileSaveResult; + void OnSaveCallBack(const VersionExplorer::FileSaveResult& result); }; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp index 82a046b0fc..f36f72234b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp @@ -15,6 +15,7 @@ #include #include #include +#include namespace FileSaverCpp { @@ -58,6 +59,11 @@ namespace ScriptCanvasEditor , m_onComplete(onComplete) {} + const SourceHandle& FileSaver::GetSource() const + { + return m_source; + } + void FileSaver::PerformMove ( AZStd::string tmpFileName , AZStd::string target @@ -179,7 +185,7 @@ namespace ScriptCanvasEditor else { FileSaveResult result; - result.fileSaveError = "Source file was and remained read-only"; + result.fileSaveError = "Source file is read-only"; result.tempFileRemovalError = RemoveTempFile(tmpFileName); m_onComplete(result); } @@ -188,10 +194,12 @@ namespace ScriptCanvasEditor void FileSaver::OnSourceFileReleased(const SourceHandle& source) { + AZStd::string fullPath = source.Path(); AZStd::string tmpFileName; // here we are saving the graph to a temp file instead of the original file and then copying the temp file to the original file. - // This ensures that AP will not a get a file change notification on an incomplete graph file causing it to fail processing. Temp files are ignored by AP. - if (!AZ::IO::CreateTempFileName(source.Path().c_str(), tmpFileName)) + // This ensures that AP will not a get a file change notification on an incomplete graph file causing it to fail processing. + // Temp files are ignored by AP. + if (!AZ::IO::CreateTempFileName(fullPath.c_str(), tmpFileName)) { FileSaveResult result; result.fileSaveError = "Failure to create temporary file name"; @@ -199,23 +207,24 @@ namespace ScriptCanvasEditor return; } - bool tempSavedSucceeded = false; + AZStd::string saveError; + AZ::IO::FileIOStream fileStream(tmpFileName.c_str(), AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeText); if (fileStream.IsOpen()) { - if (asset.GetType() == azrtti_typeid()) + auto saveOutcome = ScriptCanvasEditor::SaveToStream(source, fileStream); + if (!saveOutcome.IsSuccess()) { - ScriptCanvasEditor::ScriptCanvasAssetHandler handler; - tempSavedSucceeded = handler.SaveAssetData(asset, &fileStream); + saveError = saveOutcome.TakeError(); } fileStream.Close(); } - if (!tempSavedSucceeded) + if (!saveError.empty()) { FileSaveResult result; - result.fileSaveError = "Save asset data to temporary file failed"; + result.fileSaveError = AZStd::string::format("Save asset data to temporary file failed: %s", saveError.c_str()); m_onComplete(result); return; } @@ -265,6 +274,8 @@ namespace ScriptCanvasEditor void FileSaver::Save(const SourceHandle& source) { + m_source = source; + if (source.Path().empty()) { FileSaveResult result; @@ -285,7 +296,7 @@ namespace ScriptCanvasEditor void FileSaver::Save(AZ::Data::Asset asset) { - // #sc_editor_asset fix this path from the version explorer + // #sc_editor_asset fix/remove this path that is used by the version explorer AZStd::string relativePath, fullPath; AZ::Data::AssetCatalogRequestBus::BroadcastResult(relativePath, &AZ::Data::AssetCatalogRequests::GetAssetPathById, asset.GetId()); bool fullPathFound = false; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h index 6ec0daa2b7..439db2d260 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h @@ -29,10 +29,12 @@ namespace ScriptCanvasEditor ( AZStd::function onReadOnlyFile , AZStd::function onComplete); + const SourceHandle& GetSource() const; void Save(AZ::Data::Asset asset); void Save(const SourceHandle& source); private: + SourceHandle m_source; AZStd::function m_onComplete; AZStd::function m_onReadOnlyFile; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index f3da1ba309..0e4190b18d 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -259,7 +259,7 @@ namespace ScriptCanvasEditor m_modifyState = ModifyState::Saving; m_fileSaver = AZStd::make_unique ( m_config.onReadOnlyFile - , [this](const FileSaveResult& result) { OnFileSaveComplete(result); }); + , [this](const FileSaveResult& fileSaveResult) { OnFileSaveComplete(fileSaveResult); }); m_fileSaver->Save(result.asset); } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 15e2192ee8..064029eb03 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -13,7 +13,6 @@ #include #include #include -// #include #include "Core.h" #include "Attributes.h" From 65814e65ccb925b601c30848152ae17f90a19240 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 8 Nov 2021 14:39:20 -0800 Subject: [PATCH 033/399] source file save-as Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/View/Windows/MainWindow.cpp | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index c298517c4b..98f992bbbf 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1766,7 +1766,7 @@ namespace ScriptCanvasEditor AZStd::string suggestedFilename; AZStd::string suggestedFileFilter; bool isValidFileName = false; - + if (save == Save::InPlace) { isValidFileName = true; @@ -1775,7 +1775,17 @@ namespace ScriptCanvasEditor } else { - GetSuggestedFullFilenameToSaveAs(inMemoryAssetId, suggestedFilename, suggestedFileFilter); + // replaces GetSuggestedFullFilenameToSaveAs + suggestedFileFilter = ScriptCanvasAssetDescription().GetExtensionImpl(); + + if (inMemoryAssetId.Path().empty()) + { + suggestedFilename = ScriptCanvasAssetDescription().GetSuggestedSavePathImpl(); + } + else + { + suggestedFilename = inMemoryAssetId.Path(); + } } EnsureSaveDestinationDirectory(suggestedFilename); @@ -1790,7 +1800,14 @@ namespace ScriptCanvasEditor // So we want to break out. if (!selectedFile.isEmpty()) { + ScriptCanvasAssetDescription assetDescription; AZStd::string filePath = selectedFile.toUtf8().data(); + + if (!AZ::StringFunc::EndsWith(filePath, assetDescription.GetExtensionImpl(), false)) + { + filePath += assetDescription.GetExtensionImpl(); + } + AZStd::string fileName; // Verify that the path is within the project From 6c1d1dc2e2c4e4e452aba4edd3c3e2b0b414c67e Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 10 Nov 2021 15:39:17 -0800 Subject: [PATCH 034/399] new source file button works Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../ScriptCanvasAssetTrackerDefinitions.h | 1 + .../Code/Editor/Components/EditorGraph.cpp | 4 +- .../Code/Editor/View/Windows/MainWindow.cpp | 229 +++++++----------- .../Code/Editor/View/Windows/MainWindow.h | 29 +-- .../Code/Include/ScriptCanvas/Core/Core.cpp | 9 + .../Code/Include/ScriptCanvas/Core/Core.h | 2 + 6 files changed, 109 insertions(+), 165 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h index 2aebf29b24..29f88b33c8 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h @@ -31,6 +31,7 @@ namespace ScriptCanvasEditor NEW, MODIFIED, UNMODIFIED, + // #sc_editor_asset restore this SOURCE_REMOVED, INVALID = -1 }; diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index a34dc949f5..7658c7d8be 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -1055,6 +1055,8 @@ namespace ScriptCanvasEditor { data->m_scriptCanvasEntity.reset(entity); graph->MarkOwnership(*data); + entity->Init(); + entity->Activate(); return data; } } @@ -1354,7 +1356,7 @@ namespace ScriptCanvasEditor void Graph::SignalDirty() { - SourceHandle handle(ScriptCanvas::DataPtr(m_owner), {}, {}); + SourceHandle handle(m_owner->shared_from_this(), {}, {}); GeneralRequestBus::Broadcast(&GeneralRequests::SignalSceneDirty, handle); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 98f992bbbf..ff3dc2da27 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1148,28 +1148,7 @@ namespace ScriptCanvasEditor if (memoryAsset && asset.IsReady()) { - AZ::EntityId scGraphId = memoryAsset->GetScriptCanvasId(); - GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(scGraphId); - AZ::EntityId graphCanvasId = GetGraphCanvasGraphId(scGraphId); - - GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphRefreshed, graphCanvasId, graphCanvasId); - - int tabIndex = -1; - if (IsTabOpen(asset.GetId(), tabIndex)) - { - const AZStd::string& assetPath = memoryAsset->GetAbsolutePath(); - m_tabBar->setTabToolTip(tabIndex, assetPath.c_str()); - m_tabBar->SetTabText(tabIndex, memoryAsset->GetTabName().c_str(), memoryAsset->GetFileState()); - } - - if (graphCanvasId.IsValid()) - { - GraphCanvas::SceneNotificationBus::MultiHandler::BusConnect(graphCanvasId); - GraphCanvas::SceneMimeDelegateRequestBus::Event(graphCanvasId, &GraphCanvas::SceneMimeDelegateRequests::AddDelegate, m_entityMimeDelegateId); - - GraphCanvas::SceneRequestBus::Event(graphCanvasId, &GraphCanvas::SceneRequests::SetMimeType, Widget::NodePaletteDockWidget::GetMimeType()); - GraphCanvas::SceneMemberNotificationBus::Event(graphCanvasId, &GraphCanvas::SceneMemberNotifications::OnSceneReady); - } + } */ } @@ -1287,31 +1266,6 @@ namespace ScriptCanvasEditor return m_tabBar->InsertGraphTab(tabIndex, assetId); } - AZ::Outcome MainWindow::UpdateScriptCanvasAsset(const AZ::Data::Asset& /*scriptCanvasAsset*/) - { - // #sc_editor_asset - return AZ::Failure(AZStd::string("rewrite MainWindow::UpdateScriptCanvasAsset")); - - /* - int outTabIndex = -1; - - PushPreventUndoStateUpdate(); - RefreshScriptCanvasAsset(scriptCanvasAsset); - if (IsTabOpen(scriptCanvasAsset.GetId(), outTabIndex)) - { - RefreshActiveAsset(); - } - PopPreventUndoStateUpdate(); - - if (outTabIndex == -1) - { - return AZ::Failure(AZStd::string::format("Script Canvas Asset %s is not open in a tab", scriptCanvasAsset.ToString().c_str())); - } - - return AZ::Success(outTabIndex); - */ - } - void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { // #sc_editor_asset move what is necessary to the widget @@ -1640,7 +1594,30 @@ namespace ScriptCanvasEditor void MainWindow::OnFileNew() { - MakeNewFile(); + static int scriptCanvasEditorDefaultNewNameCount = 0; + + ScriptCanvasAssetDescription description; + + AZStd::string newAssetName = AZStd::string::format(description.GetAssetNamePatternImpl(), ++scriptCanvasEditorDefaultNewNameCount); + + AZStd::array assetRootArray; + if (!AZ::IO::FileIOBase::GetInstance()->ResolvePath(description.GetSuggestedSavePathImpl() + , assetRootArray.data(), assetRootArray.size())) + { + AZ_ErrorOnce("Script Canvas", false, "Unable to resolve @projectroot@ path"); + } + + AZStd::string assetPath; + AzFramework::StringFunc::Path::Join(assetRootArray.data(), (newAssetName + description.GetExtensionImpl()).data(), assetPath); + + auto createOutcome = CreateScriptCanvasAsset(assetPath); + if (createOutcome) + { + } + else + { + AZ_Warning("Script Canvas", createOutcome, "%s", createOutcome.GetError().data()); + } } int MainWindow::InsertTabForAsset(AZStd::string_view assetPath, ScriptCanvasEditor::SourceHandle assetId, int tabIndex) @@ -1675,32 +1652,64 @@ namespace ScriptCanvasEditor } } - AZ::Outcome MainWindow::CreateScriptCanvasAsset(AZStd::string_view /*assetPath*/, AZ::Data::AssetType /*assetType*/, int /*tabIndex*/) + AZ::Outcome MainWindow::CreateScriptCanvasAsset(AZStd::string_view assetPath, int tabIndex) { - return AZ::Failure(AZStd::string("MainWindow::CreateScriptCanvasAsset just make a new thing with the project root + untitled...")); -// int outTabIndex = -1; -// -// ScriptCanvasEditor::SourceHandle newAssetId; -// auto onAssetCreated = [this, assetPath, tabIndex, &outTabIndex](ScriptCanvasMemoryAsset& asset) -// { -// const ScriptCanvasEditor::SourceHandle& assetId = asset.GetId(); -// -// outTabIndex = InsertTabForAsset(assetPath, assetId, tabIndex); -// -// SetActiveAsset(assetId); -// -// UpdateScriptCanvasAsset(asset.GetAsset()); -// -// AZ::EntityId scriptCanvasEntityId; -// AssetTrackerRequestBus::BroadcastResult(scriptCanvasEntityId, &AssetTrackerRequests::GetScriptCanvasId, assetId); -// -// GraphCanvas::GraphId graphCanvasGraphId = GetGraphCanvasGraphId(scriptCanvasEntityId); -// GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphLoaded, graphCanvasGraphId); -// -// }; -// AssetTrackerRequestBus::BroadcastResult(newAssetId, &AssetTrackerRequests::Create, assetPath, assetType, onAssetCreated); + int outTabIndex = -1; + + ScriptCanvas::DataPtr graph = Graph::Create(); + AZ::Uuid assetId = AZ::Uuid::CreateRandom(); + ScriptCanvasEditor::SourceHandle handle = ScriptCanvasEditor::SourceHandle(graph, assetId, assetPath); + + outTabIndex = InsertTabForAsset(assetPath, handle, tabIndex); + m_tabBar->UpdateFileState(handle, Tracker::ScriptCanvasFileState::NEW); + + if (outTabIndex == -1) + { + return AZ::Failure(AZStd::string::format("Script Canvas Asset %.*s is not open in a tab", assetPath.data())); + } + + SetActiveAsset(handle); + + // #sc_editor_asset delete candidate - // return AZ::Success(outTabIndex); + PushPreventUndoStateUpdate(); + + AZ::EntityId scriptCanvasEntityId = graph->GetGraph()->GetScriptCanvasId(); + GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(scriptCanvasEntityId); + AZ::EntityId graphCanvasGraphId = GetGraphCanvasGraphId(scriptCanvasEntityId); + + GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId + , &GraphCanvas::AssetEditorNotifications::OnGraphRefreshed, graphCanvasGraphId, graphCanvasGraphId); + + if (IsTabOpen(handle, tabIndex)) + { + AZStd::string tabName; + AzFramework::StringFunc::Path::GetFileName(assetPath.data(), tabName); + m_tabBar->setTabToolTip(tabIndex, assetPath.data()); + m_tabBar->SetTabText(tabIndex, tabName.c_str(), Tracker::ScriptCanvasFileState::NEW); + } + + if (graphCanvasGraphId.IsValid()) + { + GraphCanvas::SceneNotificationBus::MultiHandler::BusConnect(graphCanvasGraphId); + GraphCanvas::SceneMimeDelegateRequestBus::Event(graphCanvasGraphId, &GraphCanvas::SceneMimeDelegateRequests::AddDelegate, m_entityMimeDelegateId); + + GraphCanvas::SceneRequestBus::Event(graphCanvasGraphId, &GraphCanvas::SceneRequests::SetMimeType, Widget::NodePaletteDockWidget::GetMimeType()); + GraphCanvas::SceneMemberNotificationBus::Event(graphCanvasGraphId, &GraphCanvas::SceneMemberNotifications::OnSceneReady); + } + + if (IsTabOpen(handle, outTabIndex)) + { + RefreshActiveAsset(); + } + + PopPreventUndoStateUpdate(); + + + GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId + , &GraphCanvas::AssetEditorNotifications::OnGraphLoaded, graphCanvasGraphId); + + return AZ::Success(outTabIndex); } bool MainWindow::OnFileSave() @@ -1944,16 +1953,8 @@ namespace ScriptCanvasEditor } else { - // #sc_editor_asset this seems to remove the unsaved indicator even on failure - - // Use the previous memory asset to find what we had setup as our display - // AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); - - // Drop off our file modifier status for our display name when we fail to save. -// if (tabName.at(tabName.size() -1) == '*') -// { -// tabName = tabName.substr(0, tabName.size() - 2); -// } + const auto failureMessage = AZStd::string::format("Failed to save %s: %s", tabName.c_str(), result.fileSaveError.c_str()); + QMessageBox::critical(this, QString(), QObject::tr(failureMessage.data())); } if (m_tabBar->currentIndex() != saveTabIndex) @@ -2719,69 +2720,25 @@ namespace ScriptCanvasEditor void MainWindow::OnTabCloseButtonPressed(int index) { - QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto fileAssetId = tabdata.value(); - - Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::NEW; - bool isSaving = false; - - // #sc_editor_asset Get from widgets - /* - AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); - AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, fileAssetId); - */ - if (isSaving) - { - m_closeCurrentGraphAfterSave = true; - return; - } - + Widget::GraphTabMetadata tabMetadata = tabdata.value(); + Tracker::ScriptCanvasFileState fileState = tabMetadata.m_fileState; UnsavedChangesOptions saveDialogResults = UnsavedChangesOptions::CONTINUE_WITHOUT_SAVING; - if (!isSaving && (fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::MODIFIED || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED)) - { - SetActiveAsset(fileAssetId.m_assetId); - - // #sc_editor_asset - AZStd::string tabName = "Get from widget"; - // AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, fileAssetId); - saveDialogResults = ShowSaveDialog(tabName.c_str()); + if (fileState == Tracker::ScriptCanvasFileState::NEW + || fileState == Tracker::ScriptCanvasFileState::MODIFIED + || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED) + { + SetActiveAsset(tabMetadata.m_assetId); + saveDialogResults = ShowSaveDialog(m_tabBar->tabText(index).toUtf8().constData()); } if (saveDialogResults == UnsavedChangesOptions::SAVE) { - // #sc_editor_asset -// auto saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle) -// { -// if (isSuccessful) -// { -// ScriptCanvasMemoryAsset::pointer memoryAsset; -// AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, asset->GetId()); -// AZ_Assert(memoryAsset, "At this point we must have a MemoryAsset"); -// -// int tabIndex = -1; -// if (IsTabOpen(memoryAsset->GetFileAssetId(), tabIndex)) -// { -// OnTabCloseRequest(tabIndex); -// } -// } -// else -// { -// QMessageBox::critical(this, QString(), QObject::tr("Failed to save.")); -// } -// }; -// -// if (fileState == Tracker::ScriptCanvasFileState::NEW) -// { -// SaveAssetImpl(fileAssetId, saveCB); -// } -// else -// { -// SaveAsset(fileAssetId, saveCB); -// } + m_closeCurrentGraphAfterSave = true; + SaveAssetImpl(tabMetadata.m_assetId, fileState == Tracker::ScriptCanvasFileState::NEW ? Save::As : Save::InPlace); } else if (saveDialogResults == UnsavedChangesOptions::CONTINUE_WITHOUT_SAVING) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 6704c10fda..7c527a5449 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -437,9 +437,7 @@ namespace ScriptCanvasEditor const NodePaletteModelInformation* FindNodePaletteModelInformation(const ScriptCanvas::NodeTypeIdentifier& nodeType) const override; //// - AZ::Outcome CreateScriptCanvasAsset(AZStd::string_view assetPath, AZ::Data::AssetType assetType, int tabIndex = -1); - AZ::Outcome UpdateScriptCanvasAsset(const AZ::Data::Asset& scriptCanvasAsset); - + AZ::Outcome CreateScriptCanvasAsset(AZStd::string_view assetPath, int tabIndex = -1); void RefreshScriptCanvasAsset(const AZ::Data::Asset& scriptCanvasAsset); //! Removes the assetId -> ScriptCanvasAsset mapping and disconnects from the asset tracker @@ -647,31 +645,6 @@ namespace ScriptCanvasEditor void OpenNextFile(); - template - void MakeNewFile() - { - static int scriptCanvasEditorDefaultNewNameCount = 0; - - AZStd::string newAssetName = AZStd::string::format(ScriptCanvas::AssetDescription::GetAssetNamePattern(), ++scriptCanvasEditorDefaultNewNameCount); - - AZStd::array assetRootArray; - if (!AZ::IO::FileIOBase::GetInstance()->ResolvePath(ScriptCanvas::AssetDescription::GetSuggestedSavePath(), assetRootArray.data(), assetRootArray.size())) - { - AZ_ErrorOnce("Script Canvas", false, "Unable to resolve @projectroot@ path"); - } - - AZStd::string assetPath; - AzFramework::StringFunc::Path::Join(assetRootArray.data(), (newAssetName + ScriptCanvas::AssetDescription::GetExtension()).data(), assetPath); - - auto createOutcome = CreateScriptCanvasAsset(assetPath, azrtti_typeid()); - if (createOutcome) - { - } - else - { - AZ_Warning("Script Canvas", createOutcome, "%s", createOutcome.GetError().data()); - } - } void DisableAssetView(const ScriptCanvasEditor::SourceHandle& memoryAssetId); void EnableAssetView(const ScriptCanvasEditor::SourceHandle& memoryAssetId); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 064029eb03..761f30f88b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -203,6 +203,15 @@ namespace ScriptCanvasEditor , m_path(path) {} + SourceHandle::~SourceHandle() + { + AZ_TracePrintf("ScriptCanvas", "Destroy Handle: %p, count %d", m_data.get(), m_data.use_count()); + if (m_data.use_count() <= 1) + { + AZ_TracePrintf("ScriptCanvas", "BOOM Handle: %p, count %d", m_data.get(), m_data.use_count()); + } + } + bool SourceHandle::AnyEquals(const SourceHandle& other) const { return m_data == other.m_data diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index ece7008b06..53a0ecdeb3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -330,6 +330,8 @@ namespace ScriptCanvasEditor SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path); + ~SourceHandle(); + bool AnyEquals(const SourceHandle& other) const; void Clear(); From 5558be2aeb2269f0d524a0d5b3d8ed3583031ee6 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 10 Nov 2021 16:40:33 -0800 Subject: [PATCH 035/399] new source file close button works, but not on multiple tabs Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/View/Windows/MainWindow.cpp | 54 +++++++++---------- .../Code/Include/ScriptCanvas/Core/Core.cpp | 9 ---- .../Code/Include/ScriptCanvas/Core/Core.h | 2 +- 3 files changed, 25 insertions(+), 40 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index ff3dc2da27..46e57ceaf1 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1266,38 +1266,27 @@ namespace ScriptCanvasEditor return m_tabBar->InsertGraphTab(tabIndex, assetId); } - void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& /*assetId*/) + void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) { - // #sc_editor_asset move what is necessary to the widget - /* - AssetHelpers::PrintInfo("RemoveScriptCanvasAsset : %s", AssetHelpers::AssetIdToString(assetId).c_str()); - + AssetHelpers::PrintInfo("RemoveScriptCanvasAsset : %s", assetId.ToString().c_str()); m_assetCreationRequests.erase(assetId); - GeneralAssetNotificationBus::Event(assetId, &GeneralAssetNotifications::OnAssetUnloaded); - AssetTrackerNotificationBus::MultiHandler::BusDisconnect(assetId); - - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - - if (memoryAsset) + if (assetId) { // Disconnect scene and asset editor buses - GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(memoryAsset->GetScriptCanvasId()); - GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphUnloaded, memoryAsset->GetGraphId()); + GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(assetId.Get()->GetScriptCanvasId()); + GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId + , &GraphCanvas::AssetEditorNotifications::OnGraphUnloaded, assetId.Get()->GetGraphCanvasGraphId()); } - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Close, assetId); - int tabIndex = m_tabBar->FindTab(assetId); QVariant tabdata = m_tabBar->tabData(tabIndex); if (tabdata.isValid()) { auto tabAssetId = tabdata.value(); - SetActiveAsset(tabAssetId); + SetActiveAsset(tabAssetId.m_assetId); } - */ } int MainWindow::CloseScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) @@ -1771,6 +1760,7 @@ namespace ScriptCanvasEditor } PrepareAssetForSave(inMemoryAssetId); + ScriptCanvasAssetDescription assetDescription; AZStd::string suggestedFilename; AZStd::string suggestedFileFilter; @@ -1809,7 +1799,6 @@ namespace ScriptCanvasEditor // So we want to break out. if (!selectedFile.isEmpty()) { - ScriptCanvasAssetDescription assetDescription; AZStd::string filePath = selectedFile.toUtf8().data(); if (!AZ::StringFunc::EndsWith(filePath, assetDescription.GetExtensionImpl(), false)) @@ -1850,6 +1839,12 @@ namespace ScriptCanvasEditor { AZStd::string internalStringFile = selectedFile.toUtf8().data(); + + if (!AZ::StringFunc::EndsWith(internalStringFile, assetDescription.GetExtensionImpl(), false)) + { + internalStringFile += assetDescription.GetExtensionImpl(); + } + if (!AssetHelpers::IsValidSourceFile(internalStringFile, GetActiveScriptCanvasId())) { QMessageBox::warning(this, "Unable to Save", QString("File\n'%1'\n\nDoes not match the asset type of the current Graph.").arg(selectedFile)); @@ -2845,32 +2840,32 @@ namespace ScriptCanvasEditor } } - void MainWindow::OnTabCloseRequest(int /*index*/) + void MainWindow::OnTabCloseRequest(int index) { - /* QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { auto tabAssetId = tabdata.value(); - if (tabAssetId == m_activeGraph) + + if (tabAssetId.m_canvasWidget) { - SetActiveAsset({}); + tabAssetId.m_canvasWidget->hide(); } - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, tabAssetId); + bool activeSet = false; - if (memoryAsset && memoryAsset->GetView()) + if (tabAssetId.m_assetId == m_activeGraph) { - memoryAsset->GetView()->hide(); + SetActiveAsset({}); + activeSet = true; } m_tabBar->CloseTab(index); m_tabBar->update(); - RemoveScriptCanvasAsset(tabAssetId); + RemoveScriptCanvasAsset(tabAssetId.m_assetId); - if (m_tabBar->count() == 0) + if (!activeSet && m_tabBar->count() == 0) { // The last tab has been removed. SetActiveAsset({}); @@ -2881,7 +2876,6 @@ namespace ScriptCanvasEditor // information AddSystemTickAction(SystemTickActionFlag::CloseNextTabAction); } - */ } void MainWindow::OnNodeAdded(const AZ::EntityId& nodeId, bool isPaste) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 761f30f88b..064029eb03 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -203,15 +203,6 @@ namespace ScriptCanvasEditor , m_path(path) {} - SourceHandle::~SourceHandle() - { - AZ_TracePrintf("ScriptCanvas", "Destroy Handle: %p, count %d", m_data.get(), m_data.use_count()); - if (m_data.use_count() <= 1) - { - AZ_TracePrintf("ScriptCanvas", "BOOM Handle: %p, count %d", m_data.get(), m_data.use_count()); - } - } - bool SourceHandle::AnyEquals(const SourceHandle& other) const { return m_data == other.m_data diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 53a0ecdeb3..415c181033 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -330,7 +330,7 @@ namespace ScriptCanvasEditor SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path); - ~SourceHandle(); + ~SourceHandle() = default; bool AnyEquals(const SourceHandle& other) const; From d8e8cdba60d699ec4c4b06934f4d42987870beb4 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 10 Nov 2021 17:15:42 -0800 Subject: [PATCH 036/399] multi tab close fixed Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Assets/ScriptCanvasFileHandling.cpp | 2 +- .../Code/Editor/View/Widgets/GraphTabBar.cpp | 5 +-- .../Code/Editor/View/Windows/MainWindow.cpp | 32 +++++++++---------- .../Code/Include/ScriptCanvas/Core/Core.cpp | 17 +++++++--- .../Code/Include/ScriptCanvas/Core/Core.h | 6 ++-- 5 files changed, 35 insertions(+), 27 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index 4af7ff247e..cd8d21543f 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -144,7 +144,7 @@ namespace ScriptCanvasEditor { namespace JSRU = AZ::JsonSerializationUtils; - if (!source) + if (!source.IsValid()) { return AZ::Failure(AZStd::string("no source graph to save")); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index 029d713277..1dfb27ce63 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -194,7 +194,7 @@ namespace ScriptCanvasEditor if (tabDataVariant.isValid()) { auto tabAssetId = tabDataVariant.value(); - if (tabAssetId.m_assetId == assetId) + if (tabAssetId.m_assetId.AnyEquals(assetId)) { return tabIndex; } @@ -243,7 +243,8 @@ namespace ScriptCanvasEditor if (tabdata.isValid()) { auto tabAssetId = tabdata.value(); - if (tabAssetId.m_assetId && tabAssetId.m_assetId.Get()->GetGraphCanvasGraphId() == graphCanvasGraphId) + if (tabAssetId.m_assetId.IsValid() + && tabAssetId.m_assetId.Get()->GetGraphCanvasGraphId() == graphCanvasGraphId) { return tabAssetId.m_assetId.Get()->GetScriptCanvasId(); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 46e57ceaf1..2f62bbcdf5 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -260,7 +260,7 @@ namespace ScriptCanvasEditor activeAssets.push_back(assetSaveData); } } - else if (assetId == focusedAssetId) + else if (assetId.AnyEquals(focusedAssetId)) { focusedAssetId.Clear(); } @@ -822,7 +822,7 @@ namespace ScriptCanvasEditor void MainWindow::SignalActiveSceneChanged(ScriptCanvasEditor::SourceHandle assetId) { AZ::EntityId graphId; - if (assetId) + if (assetId.IsValid()) { EditorGraphRequestBus::EventResult(graphId, assetId.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); } @@ -1251,7 +1251,7 @@ namespace ScriptCanvasEditor AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, int tabIndex) { - if (scriptCanvasAssetId) + if (scriptCanvasAssetId.IsValid()) { return OpenScriptCanvasAssetImplementation(scriptCanvasAssetId, tabIndex); } @@ -1272,7 +1272,7 @@ namespace ScriptCanvasEditor m_assetCreationRequests.erase(assetId); GeneralAssetNotificationBus::Event(assetId, &GeneralAssetNotifications::OnAssetUnloaded); - if (assetId) + if (assetId.IsValid()) { // Disconnect scene and asset editor buses GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(assetId.Get()->GetScriptCanvasId()); @@ -1314,7 +1314,7 @@ namespace ScriptCanvasEditor OnFileNew(); - bool createdNewAsset = m_activeGraph != previousAssetId; + bool createdNewAsset = !(m_activeGraph.AnyEquals(previousAssetId)); if (createdNewAsset) { @@ -1754,7 +1754,7 @@ namespace ScriptCanvasEditor return false; } - if (m_activeGraph != inMemoryAssetId) + if (!m_activeGraph.AnyEquals(inMemoryAssetId)) { OnChangeActiveGraphTab(inMemoryAssetId); } @@ -2489,7 +2489,7 @@ namespace ScriptCanvasEditor { AZ::EntityId graphId{}; - if (m_activeGraph) + if (m_activeGraph.IsValid()) { EditorGraphRequestBus::EventResult ( graphId, m_activeGraph.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); @@ -2514,7 +2514,7 @@ namespace ScriptCanvasEditor { AZ::EntityId graphId{}; - if (assetId) + if (assetId.IsValid()) { EditorGraphRequestBus::EventResult ( graphId, assetId.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); @@ -2525,7 +2525,7 @@ namespace ScriptCanvasEditor ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const { - return assetId ? assetId.Get()->GetScriptCanvasId() : ScriptCanvas::ScriptCanvasId{}; + return assetId.IsValid() ? assetId.Get()->GetScriptCanvasId() : ScriptCanvas::ScriptCanvasId{}; } ScriptCanvas::ScriptCanvasId MainWindow::GetScriptCanvasId(const GraphCanvas::GraphId& graphCanvasGraphId) const @@ -2568,7 +2568,7 @@ namespace ScriptCanvasEditor if (tabdata.isValid()) { auto tabAssetId = tabdata.value(); - if (tabAssetId.m_assetId == assetId) + if (tabAssetId.m_assetId.AnyEquals(assetId)) { return tabdata; } @@ -2594,14 +2594,14 @@ namespace ScriptCanvasEditor // Disconnect previous asset AZ::EntityId previousScriptCanvasSceneId; - if (previousAsset) + if (previousAsset.IsValid()) { previousScriptCanvasSceneId = previousAsset.Get()->GetScriptCanvasId(); GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(previousScriptCanvasSceneId); } AZ::EntityId nextAssetGraphCanvasId; - if (nextAsset) + if (nextAsset.IsValid()) { // Connect the next asset EditorGraphRequestBus::EventResult(nextAssetGraphCanvasId, nextAsset.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); @@ -2622,9 +2622,7 @@ namespace ScriptCanvasEditor void MainWindow::SetActiveAsset(const ScriptCanvasEditor::SourceHandle& fileAssetId) { - // #sc_editor_asset - - if (m_activeGraph == fileAssetId) + if (m_activeGraph.AnyEquals(fileAssetId)) { return; } @@ -2827,7 +2825,7 @@ namespace ScriptCanvasEditor { auto assetId = tabdata.value(); - if (assetId.m_assetId != m_skipTabOnClose) + if (!assetId.m_assetId.AnyEquals(m_skipTabOnClose)) { break; } @@ -2855,7 +2853,7 @@ namespace ScriptCanvasEditor bool activeSet = false; - if (tabAssetId.m_assetId == m_activeGraph) + if (tabAssetId.m_assetId.AnyEquals(m_activeGraph)) { SetActiveAsset({}); activeSet = true; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 064029eb03..829a25f3d1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -229,7 +229,7 @@ namespace ScriptCanvasEditor bool SourceHandle::IsValid() const { - return *this; + return m_data != nullptr; } GraphPtr SourceHandle::Mod() const @@ -237,14 +237,16 @@ namespace ScriptCanvasEditor return m_data ? m_data->ModEditorGraph() : nullptr; } - SourceHandle::operator bool() const + bool SourceHandle::operator==(const SourceHandle& other) const { - return m_data != nullptr; + return m_data.get() == other.m_data.get() + && m_id == other.m_id + && m_path == other.m_path; } - bool SourceHandle::operator!() const + bool SourceHandle::operator!=(const SourceHandle& other) const { - return m_data == nullptr; + return !(*this == other); } const AZStd::string& SourceHandle::Path() const @@ -252,6 +254,11 @@ namespace ScriptCanvasEditor return m_path; } + bool SourceHandle::PathEquals(const SourceHandle& other) const + { + return m_path == other.m_path; + } + AZStd::string SourceHandle::ToString() const { return AZStd::string::format diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 415c181033..8d7dc40866 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -344,12 +344,14 @@ namespace ScriptCanvasEditor GraphPtr Mod() const; - operator bool() const; + bool operator==(const SourceHandle& other) const; - bool operator!() const; + bool operator!=(const SourceHandle& other) const; const AZStd::string& Path() const; + bool PathEquals(const SourceHandle& other) const; + AZStd::string ToString() const; private: From 921f675df298ebb9718653968bc5ca8f988b9085 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 11 Nov 2021 10:36:55 -0800 Subject: [PATCH 037/399] restore source file deleted behavior Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/View/Windows/MainWindow.cpp | 17 ++++++++++++----- .../Code/Editor/View/Windows/MainWindow.h | 4 +++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 2f62bbcdf5..cf77653eaf 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -664,7 +664,7 @@ namespace ScriptCanvasEditor ScriptCanvas::BatchOperationNotificationBus::Handler::BusConnect(); AssetGraphSceneBus::Handler::BusConnect(); AzToolsFramework::ToolsApplicationNotificationBus::Handler::BusConnect(); - + AzToolsFramework::AssetSystemBus::Handler::BusConnect(); ScriptCanvas::ScriptCanvasSettingsRequestBus::Handler::BusConnect(); UINotificationBus::Broadcast(&UINotifications::MainWindowCreationEvent, this); @@ -708,6 +708,7 @@ namespace ScriptCanvasEditor ScriptCanvasEditor::GeneralRequestBus::Handler::BusDisconnect(); GraphCanvas::AssetEditorAutomationRequestBus::Handler::BusDisconnect(); ScriptCanvas::ScriptCanvasSettingsRequestBus::Handler::BusDisconnect(); + AzToolsFramework::AssetSystemBus::Handler::BusDisconnect(); Clear(); @@ -1111,6 +1112,15 @@ namespace ScriptCanvasEditor RestartAutoTimerSave(forceTimer); } + void MainWindow::SourceFileRemoved + ( AZStd::string relativePath + , [[maybe_unused]] AZStd::string scanFolder + , [[maybe_unused]] AZ::Uuid fileAssetId) + { + ScriptCanvasEditor::SourceHandle handle(nullptr, fileAssetId, relativePath); + UpdateFileState(handle, Tracker::ScriptCanvasFileState::SOURCE_REMOVED); + } + void MainWindow::SignalSceneDirty(ScriptCanvasEditor::SourceHandle assetId) { UpdateFileState(assetId, Tracker::ScriptCanvasFileState::MODIFIED); @@ -2535,7 +2545,6 @@ namespace ScriptCanvasEditor bool MainWindow::IsInUndoRedo(const AZ::EntityId& graphCanvasGraphId) const { - // #sc_editor_asset bool isActive = false; UndoRequestBus::EventResult(isActive, GetScriptCanvasId(graphCanvasGraphId), &UndoRequests::IsActive); return isActive; @@ -2590,12 +2599,10 @@ namespace ScriptCanvasEditor void MainWindow::ReconnectSceneBuses(ScriptCanvasEditor::SourceHandle previousAsset, ScriptCanvasEditor::SourceHandle nextAsset) { - // #sc_editor_asset - // Disconnect previous asset AZ::EntityId previousScriptCanvasSceneId; if (previousAsset.IsValid()) - { + { previousScriptCanvasSceneId = previousAsset.Get()->GetScriptCanvasId(); GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(previousScriptCanvasSceneId); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 7c527a5449..dfe5d9fa13 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -231,7 +231,6 @@ namespace ScriptCanvasEditor , private VariablePaletteRequestBus::Handler , private ScriptCanvas::BatchOperationNotificationBus::Handler , private AssetGraphSceneBus::Handler - //, private AssetTrackerNotificationBus::MultiHandler #if SCRIPTCANVAS_EDITOR //, public IEditorNotifyListener #endif @@ -240,6 +239,7 @@ namespace ScriptCanvasEditor , private GraphCanvas::ViewNotificationBus::Handler , public AZ::SystemTickBus::Handler , private AzToolsFramework::ToolsApplicationNotificationBus::Handler + , private AzToolsFramework::AssetSystemBus::Handler , private ScriptCanvas::ScriptCanvasSettingsRequestBus::Handler { Q_OBJECT @@ -525,6 +525,8 @@ namespace ScriptCanvasEditor AZ::EntityId FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId editorNodeId) const override; private: + void SourceFileRemoved(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; + void DeleteNodes(const AZ::EntityId& sceneId, const AZStd::vector& nodes) override; void DeleteConnections(const AZ::EntityId& sceneId, const AZStd::vector& connections) override; void DisconnectEndpoints(const AZ::EntityId& sceneId, const AZStd::vector& endpoints) override; From b7d8c1a6449470f1241b06a26cf50ef204588c46 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 11 Nov 2021 12:18:50 -0800 Subject: [PATCH 038/399] make default names NOT the default name of a previously existing file Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/View/Windows/MainWindow.cpp | 124 ++++++++++-------- 1 file changed, 72 insertions(+), 52 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index cf77653eaf..12d1a2fa3d 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1593,27 +1593,33 @@ namespace ScriptCanvasEditor void MainWindow::OnFileNew() { - static int scriptCanvasEditorDefaultNewNameCount = 0; + int scriptCanvasEditorDefaultNewNameCount = 0; - ScriptCanvasAssetDescription description; - - AZStd::string newAssetName = AZStd::string::format(description.GetAssetNamePatternImpl(), ++scriptCanvasEditorDefaultNewNameCount); + AZStd::string assetPath; - AZStd::array assetRootArray; - if (!AZ::IO::FileIOBase::GetInstance()->ResolvePath(description.GetSuggestedSavePathImpl() - , assetRootArray.data(), assetRootArray.size())) + for (;;) { - AZ_ErrorOnce("Script Canvas", false, "Unable to resolve @projectroot@ path"); - } + ScriptCanvasAssetDescription description; + AZStd::string newAssetName = AZStd::string::format(description.GetAssetNamePatternImpl(), ++scriptCanvasEditorDefaultNewNameCount); + + AZStd::array assetRootArray; + if (!AZ::IO::FileIOBase::GetInstance()->ResolvePath(description.GetSuggestedSavePathImpl() + , assetRootArray.data(), assetRootArray.size())) + { + AZ_ErrorOnce("Script Canvas", false, "Unable to resolve @projectroot@ path"); + } - AZStd::string assetPath; - AzFramework::StringFunc::Path::Join(assetRootArray.data(), (newAssetName + description.GetExtensionImpl()).data(), assetPath); + AzFramework::StringFunc::Path::Join(assetRootArray.data(), (newAssetName + description.GetExtensionImpl()).data(), assetPath); + AZ::Data::AssetInfo assetInfo; - auto createOutcome = CreateScriptCanvasAsset(assetPath); - if (createOutcome) - { + if (!AssetHelpers::GetAssetInfo(assetPath, assetInfo)) + { + break; + } } - else + + auto createOutcome = CreateScriptCanvasAsset(assetPath); + if (!createOutcome.IsSuccess()) { AZ_Warning("Script Canvas", createOutcome, "%s", createOutcome.GetError().data()); } @@ -1871,7 +1877,6 @@ namespace ScriptCanvasEditor return false; } - void MainWindow::OnSaveCallBack(const VersionExplorer::FileSaveResult& result) { const bool saveSuccess = result.fileSaveError.empty(); @@ -1883,8 +1888,28 @@ namespace ScriptCanvasEditor { // #sc_editor_asset find a tab with the same path name and close non focused old ones with the same name // Update the editor with the new information about this asset. - const ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset; + ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset; int currentTabIndex = m_tabBar->currentIndex(); + + AZ::Data::AssetId oldId = fileAssetId.Id(); + AZ::Data::AssetInfo assetInfo; + assetInfo.m_assetId = fileAssetId.Id(); + AZ_VerifyWarning("ScriptCanvas", AssetHelpers::GetAssetInfo(fileAssetId.Path(), assetInfo) + , "Failed to find asset info for source file just saved: %s", fileAssetId.Path().c_str()); + + const bool assetIdHasChanged = assetInfo.m_assetId.m_guid != fileAssetId.Id(); + fileAssetId = SourceHandle(fileAssetId, assetInfo.m_assetId.m_guid, fileAssetId.Path()); + + // #sc_editor_asset + // check for saving a graph over another graph with an open tab + { + // find the saved tab by graph* + // find all tabs that match old path, and close them + // update the save tab index + // and the current index + } + + // this path is questionable, this is a save request that is not the current graph // We've saved as over a new graph, so we need to close the old one. if (saveTabIndex != currentTabIndex) { @@ -1908,52 +1933,47 @@ namespace ScriptCanvasEditor } AzFramework::StringFunc::Path::GetFileName(memoryAsset.Path().c_str(), tabName); - // Update the tab's assetId to the file asset Id (necessary when saving a new asset) // #sc_editor_asset used to be configure tab...sets the name and file state - // m_tabBar->ConfigureTab(saveTabIndex, fileAssetId, tabName); -// GeneralAssetNotificationBus::Event(memoryAsset, &GeneralAssetNotifications::OnAssetVisualized); -// -// auto requestorIter = m_assetCreationRequests.find(fileAsset->GetId()); -// -// if (requestorIter != m_assetCreationRequests.end()) -// { -// auto editorComponents = AZ::EntityUtils::FindDerivedComponents(requestorIter->second.first); -// -// if (editorComponents.empty()) -// { -// auto firstRequestBus = EditorScriptCanvasComponentRequestBus::FindFirstHandler(requestorIter->second.first); -// -// if (firstRequestBus) -// { -// firstRequestBus->SetAssetId(fileAsset->GetId()); -// } -// } -// else -// { -// for (auto editorComponent : editorComponents) -// { -// if (editorComponent->GetId() == requestorIter->second.second) -// { -// editorComponent->SetAssetId(fileAsset->GetId()); -// break; -// } -// } -// } -// -// m_assetCreationRequests.erase(requestorIter); -// } + if (assetIdHasChanged) + { + auto entity = memoryAsset.Get()->GetEntity(); + + auto editorComponents = AZ::EntityUtils::FindDerivedComponents(entity); + + if (editorComponents.empty()) + { + if (auto firstRequestBus = EditorScriptCanvasComponentRequestBus::FindFirstHandler(entity->GetId())) + { + firstRequestBus->SetAssetId(memoryAsset.Id()); + } + } + else + { + for (auto editorComponent : editorComponents) + { + if (editorComponent->GetAssetId() == oldId) + { + editorComponent->SetAssetId(memoryAsset.Id()); + break; + } + } + } + } // Soft switch the asset id here. We'll do a double scene switch down below to actually switch the active assetid m_activeGraph = fileAssetId; - if (tabName.at(tabName.size() - 1) == '*') + if (tabName.at(tabName.size() - 1) == '*' || tabName.at(tabName.size() - 1) == '^') { tabName = tabName.substr(0, tabName.size() - 2); } - m_tabBar->UpdateFileState(fileAssetId, Tracker::ScriptCanvasFileState::UNMODIFIED); + auto tabData = m_tabBar->GetTabData(saveTabIndex); + tabData->m_fileState = Tracker::ScriptCanvasFileState::UNMODIFIED; + tabData->m_assetId = fileAssetId; + m_tabBar->SetTabData(*tabData, saveTabIndex); m_tabBar->SetTabText(saveTabIndex, tabName.c_str()); } else From e34c6e55dfd03ca4d8e1affcf7c6fd4004eeda43 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Fri, 12 Nov 2021 09:33:39 -0800 Subject: [PATCH 039/399] fix scoped compile error Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp index 7913069243..8e273fd2fc 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp @@ -393,7 +393,7 @@ namespace ScriptCanvasEditor::Nodes if (methodNode->HasBusID() && busId == slot.GetId() && slot.GetDescriptor() == ScriptCanvas::SlotDescriptors::DataIn()) { - key = Translation::GlobalKeys::EBusSenderIDKey; + key = ::Translation::GlobalKeys::EBusSenderIDKey; GraphCanvas::TranslationRequestBus::BroadcastResult(details, &GraphCanvas::TranslationRequests::GetDetails, key + ".details", details); } else @@ -508,7 +508,7 @@ namespace ScriptCanvasEditor::Nodes if (busNode->IsIDRequired() && slot->GetDescriptor() == ScriptCanvas::SlotDescriptors::DataIn()) { GraphCanvas::TranslationKey key; - key << Translation::GlobalKeys::EBusHandlerIDKey << "details"; + key << ::Translation::GlobalKeys::EBusHandlerIDKey << "details"; GraphCanvas::TranslationRequests::Details details; details.m_name = slot->GetName(); details.m_tooltip = slot->GetToolTip(); @@ -726,7 +726,7 @@ namespace ScriptCanvasEditor::Nodes if (busNode->IsIDRequired() && slot->GetDescriptor() == ScriptCanvas::SlotDescriptors::DataIn()) { GraphCanvas::TranslationKey key; - key << Translation::GlobalKeys::EBusHandlerIDKey << "details"; + key << ::Translation::GlobalKeys::EBusHandlerIDKey << "details"; GraphCanvas::TranslationRequests::Details details; GraphCanvas::TranslationRequestBus::BroadcastResult(details, &GraphCanvas::TranslationRequests::GetDetails, key, details); GraphCanvas::SlotRequestBus::Event(gcSlotId, &GraphCanvas::SlotRequests::SetDetails, details.m_name, details.m_tooltip); From 015185f9d61c7dc4121d141ff59d952fbeb9c799 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 15 Nov 2021 17:15:05 -0800 Subject: [PATCH 040/399] fix upgrade scanner Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/Components/EditorGraph.cpp | 2 +- .../Code/Editor/Components/GraphUpgrade.cpp | 5 +- .../ScriptCanvas/Bus/EditorScriptCanvasBus.h | 4 +- .../ScriptCanvas/Components/EditorGraph.h | 2 +- .../Components/EditorScriptCanvasComponent.h | 2 + .../ScriptCanvas/Components/GraphUpgrade.h | 4 +- .../Code/Editor/View/Windows/MainWindow.cpp | 10 +- .../Windows/Tools/UpgradeTool/Controller.cpp | 144 ++++++------------ .../Windows/Tools/UpgradeTool/Controller.h | 30 ++-- .../Windows/Tools/UpgradeTool/FileSaver.cpp | 98 +----------- .../Windows/Tools/UpgradeTool/FileSaver.h | 4 +- .../View/Windows/Tools/UpgradeTool/Model.cpp | 6 +- .../Windows/Tools/UpgradeTool/ModelTraits.h | 52 +++---- .../Windows/Tools/UpgradeTool/Modifier.cpp | 57 +++---- .../View/Windows/Tools/UpgradeTool/Modifier.h | 8 +- .../Windows/Tools/UpgradeTool/Scanner.cpp | 105 ++++++++----- .../View/Windows/Tools/UpgradeTool/Scanner.h | 6 +- .../Tools/UpgradeTool/UpgradeHelper.cpp | 22 ++- .../Windows/Tools/UpgradeTool/UpgradeHelper.h | 4 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 12 +- .../Code/Include/ScriptCanvas/Core/Core.h | 22 +-- 21 files changed, 241 insertions(+), 358 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 7658c7d8be..7135d983fd 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -3492,7 +3492,7 @@ namespace ScriptCanvasEditor m_focusHelper.SetActiveGraph(GetGraphCanvasGraphId()); } - bool Graph::UpgradeGraph(const AZ::Data::Asset& asset, UpgradeRequest request, bool isVerbose) + bool Graph::UpgradeGraph(SourceHandle& asset, UpgradeRequest request, bool isVerbose) { m_upgradeSM.SetAsset(asset); m_upgradeSM.SetVerbose(isVerbose); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp b/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp index 0e5f11fa40..e64a47a753 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp @@ -675,19 +675,18 @@ namespace ScriptCanvasEditor RegisterState(ParseGraph); } - void EditorGraphUpgradeMachine::SetAsset(const AZ::Data::Asset& asset) + void EditorGraphUpgradeMachine::SetAsset(SourceHandle& asset) { if (m_asset != asset) { m_asset = asset; - SetDebugPrefix(asset.GetHint()); + SetDebugPrefix(asset.Path().c_str()); } } void EditorGraphUpgradeMachine::OnComplete(IState::ExitStatus exitStatus) { UpgradeNotificationsBus::Broadcast(&UpgradeNotifications::OnGraphUpgradeComplete, m_asset, exitStatus == IState::ExitStatus::Skipped); - m_asset = {}; } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h index 7c57d661f0..b55e425d43 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h @@ -26,6 +26,8 @@ #include #include +#include + namespace GraphCanvas { class GraphCanvasTreeItem; @@ -223,7 +225,7 @@ namespace ScriptCanvasEditor virtual void OnUpgradeStart() {} virtual void OnUpgradeCancelled() {} - virtual void OnGraphUpgradeComplete(AZ::Data::Asset&, bool skipped = false) { (void)skipped; } + virtual void OnGraphUpgradeComplete(SourceHandle&, bool skipped = false) { (void)skipped; } }; using UpgradeNotificationsBus = AZ::EBus; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index b5269cc45d..8a98601d54 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -237,7 +237,7 @@ namespace ScriptCanvasEditor IfOutOfDate, Forced }; - bool UpgradeGraph(const AZ::Data::Asset& asset, UpgradeRequest request, bool isVerbose = true); + bool UpgradeGraph(SourceHandle& asset, UpgradeRequest request, bool isVerbose = true); void ConnectGraphCanvasBuses(); void DisconnectGraphCanvasBuses(); /////// diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 87ffff8b19..1bdb4ccb85 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -37,6 +37,7 @@ namespace ScriptCanvasEditor , private EditorScriptCanvasComponentLoggingBus::Handler , private EditorScriptCanvasComponentRequestBus::Handler , private AssetTrackerNotificationBus::Handler + , private AzToolsFramework::AssetSystemBus::Handler , private AzToolsFramework::EditorEntityContextNotificationBus::Handler { @@ -44,6 +45,7 @@ namespace ScriptCanvasEditor AZ_COMPONENT(EditorScriptCanvasComponent, "{C28E2D29-0746-451D-A639-7F113ECF5D72}", AzToolsFramework::Components::EditorComponentBase); EditorScriptCanvasComponent(); + // EditorScriptCanvasComponent(AZ::Data::Asset asset); EditorScriptCanvasComponent(AZ::Data::Asset asset); ~EditorScriptCanvasComponent() override; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h index 817b883695..0e6e69c4bf 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h @@ -184,9 +184,9 @@ namespace ScriptCanvasEditor bool m_graphNeedsDirtying = false; Graph* m_graph = nullptr; - AZ::Data::Asset m_asset; + SourceHandle m_asset; - void SetAsset(const AZ::Data::Asset& asset); + void SetAsset(SourceHandle& assetasset); void OnComplete(IState::ExitStatus exitStatus) override; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 12d1a2fa3d..6203423e29 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1209,7 +1209,7 @@ namespace ScriptCanvasEditor { if (!m_isRestoringWorkspace) { - AZStd::string errorPath = scriptCanvasAsset.Path(); + AZStd::string errorPath = scriptCanvasAsset.Path().c_str(); if (errorPath.empty()) { @@ -1247,7 +1247,7 @@ namespace ScriptCanvasEditor , fileAssetId.ToString().c_str())); } - AZStd::string assetPath = scriptCanvasAsset.Path(); + AZStd::string assetPath = scriptCanvasAsset.Path().c_str(); if (!assetPath.empty() && !m_loadingNewlySavedFile) { AddRecentFile(assetPath.c_str()); @@ -1786,7 +1786,7 @@ namespace ScriptCanvasEditor { isValidFileName = true; suggestedFileFilter = ScriptCanvasAssetDescription().GetExtensionImpl(); - suggestedFilename = inMemoryAssetId.Path(); + suggestedFilename = inMemoryAssetId.Path().c_str(); } else { @@ -1799,7 +1799,7 @@ namespace ScriptCanvasEditor } else { - suggestedFilename = inMemoryAssetId.Path(); + suggestedFilename = inMemoryAssetId.Path().c_str(); } } @@ -1894,7 +1894,7 @@ namespace ScriptCanvasEditor AZ::Data::AssetId oldId = fileAssetId.Id(); AZ::Data::AssetInfo assetInfo; assetInfo.m_assetId = fileAssetId.Id(); - AZ_VerifyWarning("ScriptCanvas", AssetHelpers::GetAssetInfo(fileAssetId.Path(), assetInfo) + AZ_VerifyWarning("ScriptCanvas", AssetHelpers::GetAssetInfo(fileAssetId.Path().c_str(), assetInfo) , "Failed to find asset info for source file just saved: %s", fileAssetId.Path().c_str()); const bool assetIdHasChanged = assetInfo.m_assetId.m_guid != fileAssetId.Id(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp index dbcd176ee5..5189895a56 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp @@ -104,9 +104,9 @@ namespace ScriptCanvasEditor } } - QList Controller::FindTableItems(const AZ::Data::AssetInfo& info) + QList Controller::FindTableItems(const SourceHandle& info) { - return m_view->tableWidget->findItems(info.m_relativePath.c_str(), Qt::MatchFlag::MatchExactly); + return m_view->tableWidget->findItems(info.Path().c_str(), Qt::MatchFlag::MatchExactly); } void Controller::OnButtonPressClose() @@ -117,30 +117,20 @@ namespace ScriptCanvasEditor void Controller::OnButtonPressScan() { // \todo move to another file - auto isUpToDate = [this](AZ::Data::Asset asset) + auto isUpToDate = [this](const SourceHandle& asset) { - AZ::Entity* scriptCanvasEntity = nullptr; + auto graphComponent = asset.Get(); - if (asset.GetType() == azrtti_typeid()) - { - ScriptCanvasAsset* scriptCanvasAsset = asset.GetAs(); - if (!scriptCanvasAsset) - { - AZ_Warning - (ScriptCanvas::k_VersionExplorerWindow.data() - , false - , "InspectAsset: %s, AsestData failed to return ScriptCanvasAsset" - , asset.GetHint().c_str()); - return true; - } - - scriptCanvasEntity = scriptCanvasAsset->GetScriptCanvasEntity(); - AZ_Assert(scriptCanvasEntity, "The Script Canvas asset must have a valid entity"); - } - - auto graphComponent = scriptCanvasEntity->FindComponent(); - AZ_Assert(graphComponent, "The Script Canvas entity must have a Graph component"); - return !m_view->forceUpgrade->isChecked() && graphComponent->GetVersion().IsLatest(); + AZ_Warning + ( ScriptCanvas::k_VersionExplorerWindow.data() + , asset.Get() != nullptr + , "InspectAsset: %s, failed to load valid graph" + , asset.Path().c_str()); + + return graphComponent + && (!graphComponent->GetVersion().IsLatest() || m_view->forceUpgrade->isChecked()) + ? ScanConfiguration::Filter::Include + : ScanConfiguration::Filter::Exclude; }; ScanConfiguration config; @@ -156,59 +146,19 @@ namespace ScriptCanvasEditor OnButtonPressUpgradeImplementation({}); } - void Controller::OnButtonPressUpgradeImplementation(const AZ::Data::AssetInfo& assetInfo) + void Controller::OnButtonPressUpgradeImplementation(const SourceHandle& assetInfo) { - auto simpleUpdate = [this](AZ::Data::Asset asset) + auto simpleUpdate = [this](SourceHandle& asset) { - if (asset.GetType() == azrtti_typeid()) - { - ScriptCanvasAsset* scriptCanvasAsset = asset.GetAs(); - AZ_Assert(scriptCanvasAsset, "Unable to get the asset of ScriptCanvasAsset, but received type: %s" - , azrtti_typeid().template ToString().c_str()); - if (!scriptCanvasAsset) - { - return; - } + AZ_Warning(ScriptCanvas::k_VersionExplorerWindow.data(), asset.Get() != nullptr + , "The Script Canvas asset must have a Graph component"); - AZ::Entity* scriptCanvasEntity = scriptCanvasAsset->GetScriptCanvasEntity(); - AZ_Assert(scriptCanvasEntity, "View::UpgradeGraph The Script Canvas asset must have a valid entity"); - if (!scriptCanvasEntity) - { - return; - } - - AZ::Entity* queryEntity = nullptr; - AZ::ComponentApplicationBus::BroadcastResult(queryEntity, &AZ::ComponentApplicationRequests::FindEntity, scriptCanvasEntity->GetId()); - if (queryEntity) - { - if (queryEntity->GetState() == AZ::Entity::State::Active) - { - queryEntity->Deactivate(); - } - - scriptCanvasEntity = queryEntity; - } - - if (scriptCanvasEntity->GetState() == AZ::Entity::State::Constructed) - { - scriptCanvasEntity->Init(); - } - - if (scriptCanvasEntity->GetState() == AZ::Entity::State::Init) - { - scriptCanvasEntity->Activate(); - } - - AZ_Assert(scriptCanvasEntity->GetState() == AZ::Entity::State::Active, "Graph entity is not active"); - auto graphComponent = scriptCanvasEntity->FindComponent(); - AZ_Assert(graphComponent, "The Script Canvas entity must have a Graph component"); - if (graphComponent) - { - graphComponent->UpgradeGraph - (asset - , m_view->forceUpgrade->isChecked() ? Graph::UpgradeRequest::Forced : Graph::UpgradeRequest::IfOutOfDate - , m_view->verbose->isChecked()); - } + if (asset.Get()) + { + asset.Mod()->UpgradeGraph + ( asset + , m_view->forceUpgrade->isChecked() ? Graph::UpgradeRequest::Forced : Graph::UpgradeRequest::IfOutOfDate + , m_view->verbose->isChecked()); } }; @@ -235,12 +185,12 @@ namespace ScriptCanvasEditor ModelRequestsBus::Broadcast(&ModelRequestsTraits::Modify, config); } - void Controller::OnButtonPressUpgradeSingle(const AZ::Data::AssetInfo& assetInfo) + void Controller::OnButtonPressUpgradeSingle(const SourceHandle& info) { - OnButtonPressUpgradeImplementation(assetInfo); + OnButtonPressUpgradeImplementation(info); } - void Controller::OnUpgradeModificationBegin([[maybe_unused]] const ModifyConfiguration& config, const AZ::Data::AssetInfo& info) + void Controller::OnUpgradeModificationBegin([[maybe_unused]] const ModifyConfiguration& config, const SourceHandle& info) { for (auto* item : FindTableItems(info)) { @@ -252,16 +202,16 @@ namespace ScriptCanvasEditor void Controller::OnUpgradeModificationEnd ( [[maybe_unused]] const ModifyConfiguration& config - , const AZ::Data::AssetInfo& info + , const SourceHandle& info , ModificationResult result) { if (result.errorMessage.empty()) { - VE_LOG("Successfully modified %s", result.assetInfo.m_relativePath.c_str()); + VE_LOG("Successfully modified %s", result.asset.Path().c_str()); } else { - VE_LOG("Failed to modify %s: %s", result.assetInfo.m_relativePath.c_str(), result.errorMessage.data()); + VE_LOG("Failed to modify %s: %s", result.asset.Path().c_str(), result.errorMessage.data()); } for (auto* item : FindTableItems(info)) @@ -289,12 +239,10 @@ namespace ScriptCanvasEditor AddLogEntries(); } - void Controller::OnGraphUpgradeComplete(AZ::Data::Asset& asset, bool skipped) + void Controller::OnGraphUpgradeComplete(ScriptCanvasEditor::SourceHandle& asset, bool skipped) { ModificationResult result; result.asset = asset; - AZ::Data::AssetCatalogRequestBus::BroadcastResult - ( result.assetInfo, &AZ::Data::AssetCatalogRequests::GetAssetInfoById, asset.GetId()); if (skipped) { @@ -342,19 +290,19 @@ namespace ScriptCanvasEditor } } - void Controller::OnScanFilteredGraph(const AZ::Data::AssetInfo& info) + void Controller::OnScanFilteredGraph(const SourceHandle& info) { OnScannedGraph(info, Filtered::Yes); } - void Controller::OnScannedGraph(const AZ::Data::AssetInfo& assetInfo, [[maybe_unused]] Filtered filtered) + void Controller::OnScannedGraph(const SourceHandle& assetInfo, [[maybe_unused]] Filtered filtered) { const int rowIndex = m_view->tableWidget->rowCount(); if (filtered == Filtered::No || !m_view->onlyShowOutdated->isChecked()) { m_view->tableWidget->insertRow(rowIndex); - QTableWidgetItem* rowName = new QTableWidgetItem(tr(assetInfo.m_relativePath.c_str())); + QTableWidgetItem* rowName = new QTableWidgetItem(tr(assetInfo.Path().c_str())); m_view->tableWidget->setItem(rowIndex, static_cast(ColumnAsset), rowName); SetRowSucceeded(rowIndex); @@ -378,7 +326,7 @@ namespace ScriptCanvasEditor } char resolvedBuffer[AZ_MAX_PATH_LEN] = { 0 }; - AZStd::string path = AZStd::string::format("@devroot@/%s", assetInfo.m_relativePath.c_str()); + AZStd::string path = AZStd::string::format("@devroot@/%s", assetInfo.Path().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); @@ -386,7 +334,7 @@ namespace ScriptCanvasEditor bool result = false; AZ::Data::AssetInfo info; AZStd::string watchFolder; - QByteArray assetNameUtf8 = assetInfo.m_relativePath.c_str(); + QByteArray assetNameUtf8 = assetInfo.Path().c_str(); AzToolsFramework::AssetSystemRequestBus::BroadcastResult ( result , &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath @@ -413,41 +361,41 @@ namespace ScriptCanvasEditor OnScannedGraphResult(assetInfo); } - void Controller::OnScannedGraphResult([[maybe_unused]] const AZ::Data::AssetInfo& info) + void Controller::OnScannedGraphResult([[maybe_unused]] const SourceHandle& info) { m_view->progressBar->setValue(aznumeric_cast(m_handledAssetCount)); ++m_handledAssetCount; AddLogEntries(); } - void Controller::OnScanLoadFailure(const AZ::Data::AssetInfo& info) + void Controller::OnScanLoadFailure(const SourceHandle& info) { const int rowIndex = m_view->tableWidget->rowCount(); m_view->tableWidget->insertRow(rowIndex); QTableWidgetItem* rowName = new QTableWidgetItem - ( tr(AZStd::string::format("Load Error: %s", info.m_relativePath.c_str()).c_str())); + ( tr(AZStd::string::format("Load Error: %s", info.Path().c_str()).c_str())); m_view->tableWidget->setItem(rowIndex, static_cast(ColumnAsset), rowName); SetRowFailed(rowIndex, "Load failed"); OnScannedGraphResult(info); } - void Controller::OnScanUnFilteredGraph(const AZ::Data::AssetInfo& info) + void Controller::OnScanUnFilteredGraph(const SourceHandle& info) { OnScannedGraph(info, Filtered::No); } void Controller::OnUpgradeBegin ( const ModifyConfiguration& config - , [[maybe_unused]] const WorkingAssets& assets) + , [[maybe_unused]] const AZStd::vector& assets) { QString spinnerText = QStringLiteral("Upgrade in progress - "); - if (config.modifySingleAsset.m_assetId.IsValid()) + if (!config.modifySingleAsset.Path().empty()) { spinnerText.append(" single graph"); if (assets.size() == 1) { - for (auto* item : FindTableItems(assets.front().info)) + for (auto* item : FindTableItems(assets.front())) { int row = item->row(); SetRowBusy(row); @@ -498,7 +446,7 @@ namespace ScriptCanvasEditor m_view->scanButton->setEnabled(true); } - void Controller::OnUpgradeDependenciesGathered(const AZ::Data::AssetInfo& info, Result result) + void Controller::OnUpgradeDependenciesGathered(const SourceHandle& info, Result result) { for (auto* item : FindTableItems(info)) { @@ -527,7 +475,7 @@ namespace ScriptCanvasEditor void Controller::OnUpgradeDependencySortBegin ( [[maybe_unused]] const ModifyConfiguration& config - , const WorkingAssets& assets) + , const AZStd::vector& assets) { m_handledAssetCount = 0; m_view->progressBar->setVisible(true); @@ -553,7 +501,7 @@ namespace ScriptCanvasEditor void Controller::OnUpgradeDependencySortEnd ( [[maybe_unused]] const ModifyConfiguration& config - , const WorkingAssets& assets + , const AZStd::vector& assets , [[maybe_unused]] const AZStd::vector& sortedOrder) { m_handledAssetCount = 0; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.h index 9842ea3da4..2d7b78060e 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.h @@ -65,36 +65,36 @@ namespace ScriptCanvasEditor void AddLogEntries(); void EnableAllUpgradeButtons(); - QList FindTableItems(const AZ::Data::AssetInfo& assetInfo); + QList FindTableItems(const SourceHandle& assetInfo); void OnButtonPressClose(); void OnButtonPressScan(); void OnButtonPressUpgrade(); - void OnButtonPressUpgradeImplementation(const AZ::Data::AssetInfo& assetInfo); - void OnButtonPressUpgradeSingle(const AZ::Data::AssetInfo& assetInfo); + void OnButtonPressUpgradeImplementation(const SourceHandle& assetInfo); + void OnButtonPressUpgradeSingle(const SourceHandle& assetInfo); - void OnGraphUpgradeComplete(AZ::Data::Asset&, bool skipped) override; + void OnGraphUpgradeComplete(SourceHandle&, bool skipped) override; void OnScanBegin(size_t assetCount) override; void OnScanComplete(const ScanResult& result) override; - void OnScanFilteredGraph(const AZ::Data::AssetInfo& info) override; - void OnScanLoadFailure(const AZ::Data::AssetInfo& info) override; - void OnScanUnFilteredGraph(const AZ::Data::AssetInfo& info) override; + void OnScanFilteredGraph(const SourceHandle& info) override; + void OnScanLoadFailure(const SourceHandle& info) override; + void OnScanUnFilteredGraph(const SourceHandle& info) override; enum class Filtered { No, Yes }; - void OnScannedGraph(const AZ::Data::AssetInfo& info, Filtered filtered); - void OnScannedGraphResult(const AZ::Data::AssetInfo& info); + void OnScannedGraph(const SourceHandle& info, Filtered filtered); + void OnScannedGraphResult(const SourceHandle& info); // for single operation UI updates, just check the assets size, or note it on the request - void OnUpgradeBegin(const ModifyConfiguration& config, const WorkingAssets& assets) override; + void OnUpgradeBegin(const ModifyConfiguration& config, const AZStd::vector& assets) override; void OnUpgradeComplete(const ModificationResults& results) override; - void OnUpgradeDependenciesGathered(const AZ::Data::AssetInfo& info, Result result) override; - void OnUpgradeDependencySortBegin(const ModifyConfiguration& config, const WorkingAssets& assets) override; + void OnUpgradeDependenciesGathered(const SourceHandle& info, Result result) override; + void OnUpgradeDependencySortBegin(const ModifyConfiguration& config, const AZStd::vector& assets) override; void OnUpgradeDependencySortEnd ( const ModifyConfiguration& config - , const WorkingAssets& assets + , const AZStd::vector& assets , const AZStd::vector& sortedOrder) override; - void OnUpgradeModificationBegin(const ModifyConfiguration& config, const AZ::Data::AssetInfo& info) override; - void OnUpgradeModificationEnd(const ModifyConfiguration& config, const AZ::Data::AssetInfo& info, ModificationResult result) override; + void OnUpgradeModificationBegin(const ModifyConfiguration& config, const SourceHandle& info) override; + void OnUpgradeModificationEnd(const ModifyConfiguration& config, const SourceHandle& info, ModificationResult result) override; void SetLoggingPreferences(); void SetSpinnerIsBusy(bool isBusy); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp index f36f72234b..a88c6c2c7e 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp @@ -127,74 +127,9 @@ namespace ScriptCanvasEditor } } - void FileSaver::OnSourceFileReleased(AZ::Data::Asset asset) - { - AZStd::string relativePath, fullPath; - AZ::Data::AssetCatalogRequestBus::BroadcastResult(relativePath, &AZ::Data::AssetCatalogRequests::GetAssetPathById, asset.GetId()); - bool fullPathFound = false; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult(fullPathFound, &AzToolsFramework::AssetSystemRequestBus::Events::GetFullSourcePathFromRelativeProductPath, relativePath, fullPath); - AZStd::string tmpFileName; - // here we are saving the graph to a temp file instead of the original file and then copying the temp file to the original file. - // This ensures that AP will not a get a file change notification on an incomplete graph file causing it to fail processing. Temp files are ignored by AP. - if (!AZ::IO::CreateTempFileName(fullPath.c_str(), tmpFileName)) - { - FileSaveResult result; - result.fileSaveError = "Failure to create temporary file name"; - m_onComplete(result); - return; - } - - bool tempSavedSucceeded = false; - AZ::IO::FileIOStream fileStream(tmpFileName.c_str(), AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeText); - if (fileStream.IsOpen()) - { - if (asset.GetType() == azrtti_typeid()) - { - ScriptCanvasEditor::ScriptCanvasAssetHandler handler; - tempSavedSucceeded = handler.SaveAssetData(asset, &fileStream); - } - - fileStream.Close(); - } - - if (!tempSavedSucceeded) - { - FileSaveResult result; - result.fileSaveError = "Save asset data to temporary file failed"; - m_onComplete(result); - return; - } - - AzToolsFramework::SourceControlCommandBus::Broadcast - ( &AzToolsFramework::SourceControlCommandBus::Events::RequestEdit - , fullPath.c_str() - , true - , [this, fullPath, tmpFileName]([[maybe_unused]] bool success, const AzToolsFramework::SourceControlFileInfo& info) - { - constexpr const size_t k_maxAttemps = 10; - - if (!info.IsReadOnly()) - { - PerformMove(tmpFileName, fullPath, k_maxAttemps); - } - else if (m_onReadOnlyFile && m_onReadOnlyFile()) - { - AZ::IO::SystemFile::SetWritable(info.m_filePath.c_str(), true); - PerformMove(tmpFileName, fullPath, k_maxAttemps); - } - else - { - FileSaveResult result; - result.fileSaveError = "Source file is read-only"; - result.tempFileRemovalError = RemoveTempFile(tmpFileName); - m_onComplete(result); - } - }); - } - void FileSaver::OnSourceFileReleased(const SourceHandle& source) { - AZStd::string fullPath = source.Path(); + AZStd::string fullPath = source.Path().c_str(); AZStd::string tmpFileName; // here we are saving the graph to a temp file instead of the original file and then copying the temp file to the original file. // This ensures that AP will not a get a file change notification on an incomplete graph file causing it to fail processing. @@ -285,7 +220,7 @@ namespace ScriptCanvasEditor else { auto streamer = AZ::Interface::Get(); - AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(source.Path()); + AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(source.Path().c_str()); streamer->SetRequestCompleteCallback(flushRequest, [this, source]([[maybe_unused]] AZ::IO::FileRequestHandle request) { this->OnSourceFileReleased(source); @@ -293,34 +228,5 @@ namespace ScriptCanvasEditor streamer->QueueRequest(flushRequest); } } - - void FileSaver::Save(AZ::Data::Asset asset) - { - // #sc_editor_asset fix/remove this path that is used by the version explorer - AZStd::string relativePath, fullPath; - AZ::Data::AssetCatalogRequestBus::BroadcastResult(relativePath, &AZ::Data::AssetCatalogRequests::GetAssetPathById, asset.GetId()); - bool fullPathFound = false; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult - ( fullPathFound - , &AzToolsFramework::AssetSystemRequestBus::Events::GetFullSourcePathFromRelativeProductPath - , relativePath, fullPath); - - if (!fullPathFound) - { - FileSaveResult result; - result.fileSaveError = "Full source path not found"; - m_onComplete(result); - } - else - { - auto streamer = AZ::Interface::Get(); - AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(fullPath); - streamer->SetRequestCompleteCallback(flushRequest, [this, asset]([[maybe_unused]] AZ::IO::FileRequestHandle request) - { - this->OnSourceFileReleased(asset); - }); - streamer->QueueRequest(flushRequest); - } - } } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h index 439db2d260..d04b543b0c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h @@ -30,7 +30,6 @@ namespace ScriptCanvasEditor , AZStd::function onComplete); const SourceHandle& GetSource() const; - void Save(AZ::Data::Asset asset); void Save(const SourceHandle& source); private: @@ -39,8 +38,7 @@ namespace ScriptCanvasEditor AZStd::function m_onReadOnlyFile; void OnSourceFileReleased(const SourceHandle& source); - void OnSourceFileReleased(AZ::Data::Asset asset); - + void PerformMove ( AZStd::string source , AZStd::string target diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp index d8d242adbb..86a1c1f42e 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp @@ -101,7 +101,7 @@ namespace ScriptCanvasEditor return; } - if (modification.modifySingleAsset.m_assetId.IsValid()) + if (!modification.modifySingleAsset.Path().empty()) { const auto& results = m_scanner->GetResult(); auto iter = AZStd::find_if @@ -109,7 +109,7 @@ namespace ScriptCanvasEditor , results.m_unfiltered.end() , [&modification](const auto& candidate) { - return candidate.info.m_assetId == modification.modifySingleAsset.m_assetId; + return candidate.AnyEquals(modification.modifySingleAsset); }); if (iter == results.m_unfiltered.end()) @@ -120,7 +120,7 @@ namespace ScriptCanvasEditor m_state = State::ModifySingle; - m_modifier = AZStd::make_unique(modification, WorkingAssets{ *iter }, [this]() { OnModificationComplete(); }); + m_modifier = AZStd::make_unique(modification, AZStd::vector{ *iter }, [this]() { OnModificationComplete(); }); } else { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/ModelTraits.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/ModelTraits.h index 01eb200542..4ab9015a6c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/ModelTraits.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/ModelTraits.h @@ -9,53 +9,51 @@ #include #include +#include namespace ScriptCanvasEditor { namespace VersionExplorer { - struct WorkingAsset - { - AZ::Data::Asset asset; - AZ::Data::AssetInfo info; - }; - - using WorkingAssets = AZStd::vector; - struct ModifyConfiguration { - AZStd::function)> modification; + AZStd::function modification; AZStd::function onReadOnlyFile; - AZ::Data::AssetInfo modifySingleAsset; + SourceHandle modifySingleAsset; bool backupGraphBeforeModification = false; bool successfulDependencyUpgradeRequired = true; }; struct ModificationResult { - AZ::Data::Asset asset; - AZ::Data::AssetInfo assetInfo; + SourceHandle asset; AZStd::string errorMessage; }; struct ModificationResults { - AZStd::vector m_successes; + AZStd::vector m_successes; AZStd::vector m_failures; }; struct ScanConfiguration { - AZStd::function)> filter; + enum class Filter + { + Include, + Exclude + }; + + AZStd::function filter; bool reportFilteredGraphs = false; }; struct ScanResult { - AZStd::vector m_catalogAssets; - WorkingAssets m_unfiltered; - AZStd::vector m_filteredAssets; - AZStd::vector m_loadErrors; + AZStd::vector m_catalogAssets; + AZStd::vector m_unfiltered; + AZStd::vector m_filteredAssets; + AZStd::vector m_loadErrors; }; enum Result @@ -88,20 +86,20 @@ namespace ScriptCanvasEditor public: virtual void OnScanBegin(size_t assetCount) = 0; virtual void OnScanComplete(const ScanResult& result) = 0; - virtual void OnScanFilteredGraph(const AZ::Data::AssetInfo& info) = 0; - virtual void OnScanLoadFailure(const AZ::Data::AssetInfo& info) = 0; - virtual void OnScanUnFilteredGraph(const AZ::Data::AssetInfo& info) = 0; + virtual void OnScanFilteredGraph(const SourceHandle& info) = 0; + virtual void OnScanLoadFailure(const SourceHandle& info) = 0; + virtual void OnScanUnFilteredGraph(const SourceHandle& info) = 0; - virtual void OnUpgradeBegin(const ModifyConfiguration& config, const WorkingAssets& assets) = 0; + virtual void OnUpgradeBegin(const ModifyConfiguration& config, const AZStd::vector& assets) = 0; virtual void OnUpgradeComplete(const ModificationResults& results) = 0; - virtual void OnUpgradeDependenciesGathered(const AZ::Data::AssetInfo& info, Result result) = 0; - virtual void OnUpgradeDependencySortBegin(const ModifyConfiguration& config, const WorkingAssets& assets) = 0; + virtual void OnUpgradeDependenciesGathered(const SourceHandle& info, Result result) = 0; + virtual void OnUpgradeDependencySortBegin(const ModifyConfiguration& config, const AZStd::vector& assets) = 0; virtual void OnUpgradeDependencySortEnd ( const ModifyConfiguration& config - , const WorkingAssets& assets + , const AZStd::vector& assets , const AZStd::vector& sortedOrder) = 0; - virtual void OnUpgradeModificationBegin(const ModifyConfiguration& config, const AZ::Data::AssetInfo& info) = 0; - virtual void OnUpgradeModificationEnd(const ModifyConfiguration& config, const AZ::Data::AssetInfo& info, ModificationResult result) = 0; + virtual void OnUpgradeModificationBegin(const ModifyConfiguration& config, const SourceHandle& info) = 0; + virtual void OnUpgradeModificationEnd(const ModifyConfiguration& config, const SourceHandle& info, ModificationResult result) = 0; }; using ModelNotificationsBus = AZ::EBus; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index 0e4190b18d..56d7264859 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -6,24 +6,21 @@ * */ +#include #include #include #include #include +#include #include -namespace ModifierCpp -{ - -} - namespace ScriptCanvasEditor { namespace VersionExplorer { Modifier::Modifier ( const ModifyConfiguration& modification - , WorkingAssets&& assets + , AZStd::vector&& assets , AZStd::function onComplete) : m_state(State::GatheringDependencies) , m_config(modification) @@ -35,11 +32,11 @@ namespace ScriptCanvasEditor AZ::SystemTickBus::Handler::BusConnect(); } - const AZ::Data::AssetInfo& Modifier::GetCurrentAsset() const + const SourceHandle& Modifier::GetCurrentAsset() const { return m_state == State::GatheringDependencies - ? m_assets[m_assetIndex].info - : m_assets[m_dependencyOrderedAssetIndicies[m_assetIndex]].info; + ? m_assets[m_assetIndex] + : m_assets[m_dependencyOrderedAssetIndicies[m_assetIndex]]; } AZStd::unordered_set& Modifier::GetOrCreateDependencyIndexSet() @@ -66,13 +63,9 @@ namespace ScriptCanvasEditor bool anyFailures = false; auto asset = LoadAsset(); - - if (asset - && asset.GetAs() - && asset.GetAs()->GetScriptCanvasGraph() - && asset.GetAs()->GetScriptCanvasGraph()->GetGraphData()) + if (asset.Get() && asset.Mod()->GetGraphData()) { - auto graphData = asset.GetAs()->GetScriptCanvasGraph()->GetGraphData(); + auto graphData = asset.Mod()->GetGraphData(); auto dependencyGrabber = [this] ( void* instancePointer @@ -107,15 +100,15 @@ namespace ScriptCanvasEditor , nullptr)) { anyFailures = true; - VE_LOG("Modifier: ERROR - Failed to gather dependencies from graph data: %s" - , GetCurrentAsset().m_relativePath.c_str()) + VE_LOG("Modifier: ERROR - Failed to gather dependencies from graph data: %s" + , GetCurrentAsset().Path().c_str()) } } else { anyFailures = true; VE_LOG("Modifier: ERROR - Failed to load asset %s for modification, even though it scanned properly" - , GetCurrentAsset().m_relativePath.c_str()); + , GetCurrentAsset().Path().c_str()); } ModelNotificationsBus::Broadcast @@ -127,18 +120,12 @@ namespace ScriptCanvasEditor AZ::Data::AssetManager::Instance().DispatchEvents(); } - AZ::Data::Asset Modifier::LoadAsset() + SourceHandle Modifier::LoadAsset() { - AZ::Data::Asset asset = AZ::Data::AssetManager::Instance().GetAsset - ( GetCurrentAsset().m_assetId - , azrtti_typeid() - , AZ::Data::AssetLoadBehavior::PreLoad); - - asset.BlockUntilLoadComplete(); - - if (asset.IsReady()) + auto outcome = LoadFromFile(GetCurrentAsset().Path().c_str()); + if (outcome.IsSuccess()) { - return asset; + return outcome.TakeValue(); } else { @@ -163,11 +150,11 @@ namespace ScriptCanvasEditor void Modifier::ModifyCurrentAsset() { m_result = {}; - m_result.assetInfo = GetCurrentAsset(); + m_result.asset = GetCurrentAsset(); ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, GetCurrentAsset()); - if (auto asset = LoadAsset()) + if (auto asset = LoadAsset(); asset.IsValid()) { ModificationNotificationsBus::Handler::BusConnect(); m_modifyState = ModifyState::InProgress; @@ -199,7 +186,7 @@ namespace ScriptCanvasEditor void Modifier::ReportModificationSuccess() { - m_results.m_successes.push_back(m_result.assetInfo); + m_results.m_successes.push_back(m_result.asset); ModifyNextAsset(); } @@ -227,7 +214,7 @@ namespace ScriptCanvasEditor { VE_LOG ( "Temporary file not removed for %s: %s" - , m_result.assetInfo.m_relativePath.c_str() + , m_result.asset.Path().c_str() , result.tempFileRemovalError.c_str()); } @@ -287,7 +274,7 @@ namespace ScriptCanvasEditor for (size_t index = 0; index != m_assets.size(); ++index) { - m_assetInfoIndexById.insert({ m_assets[index].info.m_assetId.m_guid, index }); + m_assetInfoIndexById.insert({ m_assets[index].Id(), index }); } } else @@ -380,10 +367,10 @@ namespace ScriptCanvasEditor if (markedTemporary.contains(index)) { AZ_Error - (ScriptCanvas::k_VersionExplorerWindow.data() + (ScriptCanvas::k_VersionExplorerWindow.data() , false , "Modifier: Dependency sort has failed during, circular dependency detected for Asset: %s" - , modifier->GetCurrentAsset().m_relativePath.c_str()); + , modifier->GetCurrentAsset().Path().c_str()); return; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h index 981a1eb746..c57af605e3 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h @@ -26,7 +26,7 @@ namespace ScriptCanvasEditor Modifier ( const ModifyConfiguration& modification - , WorkingAssets&& assets + , AZStd::vector&& assets , AZStd::function onComplete); const ModificationResults& GetResult() const; @@ -69,7 +69,7 @@ namespace ScriptCanvasEditor size_t m_assetIndex = 0; AZStd::function m_onComplete; // asset infos in scanned order - WorkingAssets m_assets; + AZStd::vector m_assets; // dependency sorted order indices into the asset vector AZStd::vector m_dependencyOrderedAssetIndicies; // dependency indices by asset info index (only exist if graphs have them) @@ -83,9 +83,9 @@ namespace ScriptCanvasEditor FileSaveResult m_fileSaveResult; void GatherDependencies(); - const AZ::Data::AssetInfo& GetCurrentAsset() const; + const SourceHandle& GetCurrentAsset() const; AZStd::unordered_set& GetOrCreateDependencyIndexSet(); - AZ::Data::Asset LoadAsset(); + SourceHandle LoadAsset(); void ModifyCurrentAsset(); void ModifyNextAsset(); void ModificationComplete(const ModificationResult& result) override; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp index bc69f6e634..d959a6b6ab 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp @@ -6,9 +6,45 @@ * */ +#include +#include +#include +#include +#include #include #include -#include +#include + +namespace ScannerCpp +{ + void TraverseTree + ( QModelIndex index + , AzToolsFramework::AssetBrowser::AssetBrowserFilterModel& model + , ScriptCanvasEditor::VersionExplorer::ScanResult& result) + { + QModelIndex sourceIndex = model.mapToSource(index); + AzToolsFramework::AssetBrowser::AssetBrowserEntry* entry = + reinterpret_cast(sourceIndex.internalPointer()); + + if (entry + && entry->GetEntryType() == AzToolsFramework::AssetBrowser::AssetBrowserEntry::AssetEntryType::Source + && azrtti_istypeof(entry) + && entry->GetFullPath().ends_with(".scriptcanvas")) + { + auto sourceEntry = azrtti_cast(entry); + result.m_catalogAssets.push_back( + ScriptCanvasEditor::SourceHandle(nullptr, sourceEntry->GetSourceUuid(), sourceEntry->GetFullPath())); + } + + const int rowCount = model.rowCount(index); + + for (int i = 0; i < rowCount; ++i) + { + TraverseTree(model.index(i, 0, index), model, result); + } + } +} + namespace ScriptCanvasEditor { @@ -18,39 +54,44 @@ namespace ScriptCanvasEditor : m_config(config) , m_onComplete(onComplete) { - AZ::Data::AssetCatalogRequestBus::Broadcast - ( &AZ::Data::AssetCatalogRequestBus::Events::EnumerateAssets - , nullptr - , [this](const AZ::Data::AssetId, const AZ::Data::AssetInfo& assetInfo) - { - if (assetInfo.m_assetType == azrtti_typeid()) - { - m_result.m_catalogAssets.push_back(assetInfo); - } - } - , nullptr); - - ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanBegin, m_result.m_catalogAssets.size()); + AzToolsFramework::AssetBrowser::AssetBrowserModel* assetBrowserModel = nullptr; + AzToolsFramework::AssetBrowser::AssetBrowserComponentRequestBus::BroadcastResult + ( assetBrowserModel, &AzToolsFramework::AssetBrowser::AssetBrowserComponentRequests::GetAssetBrowserModel); + + if (assetBrowserModel) + { + auto stringFilter = new AzToolsFramework::AssetBrowser::StringFilter(); + stringFilter->SetName("ScriptCanvas"); + stringFilter->SetFilterString(".scriptcanvas"); + stringFilter->SetFilterPropagation(AzToolsFramework::AssetBrowser::AssetBrowserEntryFilter::PropagateDirection::Down); + + AzToolsFramework::AssetBrowser::AssetBrowserFilterModel assetFilterModel; + assetFilterModel.SetFilter(AzToolsFramework::AssetBrowser::FilterConstType(stringFilter)); + assetFilterModel.setSourceModel(assetBrowserModel); + + ScannerCpp::TraverseTree(QModelIndex(), assetFilterModel, m_result); + } + AZ::SystemTickBus::Handler::BusConnect(); } - void Scanner::FilterAsset(AZ::Data::Asset asset) + void Scanner::FilterAsset(SourceHandle asset) { - if (m_config.filter && m_config.filter(asset)) + if (m_config.filter && m_config.filter(asset) == ScanConfiguration::Filter::Exclude) { - VE_LOG("Scanner: Excluded: %s ", GetCurrentAsset().m_relativePath.c_str()); - m_result.m_filteredAssets.push_back(GetCurrentAsset()); + VE_LOG("Scanner: Excluded: %s ", GetCurrentAsset().Path().c_str()); + m_result.m_filteredAssets.push_back(GetCurrentAsset().Describe()); ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanFilteredGraph, GetCurrentAsset()); } else { - VE_LOG("Scanner: Included: %s ", GetCurrentAsset().m_relativePath.c_str()); - m_result.m_unfiltered.push_back({ asset, GetCurrentAsset() }); + VE_LOG("Scanner: Included: %s ", GetCurrentAsset().Path().c_str()); + m_result.m_unfiltered.push_back(GetCurrentAsset().Describe()); ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanUnFilteredGraph, GetCurrentAsset()); } } - const AZ::Data::AssetInfo& Scanner::GetCurrentAsset() const + const SourceHandle& Scanner::GetCurrentAsset() const { return m_result.m_catalogAssets[m_catalogAssetIndex]; } @@ -60,18 +101,12 @@ namespace ScriptCanvasEditor return m_result; } - AZ::Data::Asset Scanner::LoadAsset() + SourceHandle Scanner::LoadAsset() { - AZ::Data::Asset asset = AZ::Data::AssetManager::Instance().GetAsset - ( GetCurrentAsset().m_assetId - , azrtti_typeid() - , AZ::Data::AssetLoadBehavior::PreLoad); - - asset.BlockUntilLoadComplete(); - - if (asset.IsReady()) + auto fileOutcome = LoadFromFile(GetCurrentAsset().Path().c_str()); + if (fileOutcome.IsSuccess()) { - return asset; + return fileOutcome.GetValue(); } else { @@ -93,19 +128,19 @@ namespace ScriptCanvasEditor } else { - if (auto asset = LoadAsset()) + if (auto asset = LoadAsset(); asset.IsValid()) { - VE_LOG("Scanner: Loaded: %s ", GetCurrentAsset().m_relativePath.c_str()); + VE_LOG("Scanner: Loaded: %s ", GetCurrentAsset().Path().c_str()); FilterAsset(asset); } else { - VE_LOG("Scanner: Failed to load: %s ", GetCurrentAsset().m_relativePath.c_str()); + VE_LOG("Scanner: Failed to load: %s ", GetCurrentAsset().Path().c_str()); m_result.m_loadErrors.push_back(GetCurrentAsset()); ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanLoadFailure, GetCurrentAsset()); } - VE_LOG("Scanner: scan of %s complete", GetCurrentAsset().m_relativePath.c_str()); + VE_LOG("Scanner: scan of %s complete", GetCurrentAsset().Path().c_str()); ++m_catalogAssetIndex; } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.h index fb030845c7..f276c146da 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.h @@ -33,9 +33,9 @@ namespace ScriptCanvasEditor ScanConfiguration m_config; ScanResult m_result; - void FilterAsset(AZ::Data::Asset); - const AZ::Data::AssetInfo& GetCurrentAsset() const; - AZ::Data::Asset LoadAsset(); + void FilterAsset(SourceHandle); + const SourceHandle& GetCurrentAsset() const; + SourceHandle LoadAsset(); void OnSystemTick() override; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp index e88675814b..3522f3cfa2 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp @@ -55,26 +55,25 @@ namespace ScriptCanvasEditor for (auto& failedUpdate : result->m_failures) { - auto& assetInfo = failedUpdate.assetInfo; - auto assetId = assetInfo.m_assetId; - + auto asset = failedUpdate.asset; + m_ui->tableWidget->insertRow(rows); connect(m_ui->closeButton, &QPushButton::pressed, this, &QDialog::accept); - connect(m_ui->tableWidget, &QTableWidget::itemDoubleClicked, this, [this, rows, assetId](QTableWidgetItem* item) + connect(m_ui->tableWidget, &QTableWidget::itemDoubleClicked, this, [this, rows, asset](QTableWidgetItem* item) { if (item && item->data(Qt::UserRole).toInt() == rows) { - OpenGraph(assetId); + OpenGraph(asset); } } ); - auto openGraph = [this, assetId] { - OpenGraph(assetId); + auto openGraph = [this, asset] { + OpenGraph(asset); }; - QTableWidgetItem* rowName = new QTableWidgetItem(tr(assetInfo.m_relativePath.c_str())); + QTableWidgetItem* rowName = new QTableWidgetItem(tr(asset.Path().c_str())); rowName->setData(Qt::UserRole, rows); m_ui->tableWidget->setItem(rows, 0, rowName); @@ -91,16 +90,15 @@ namespace ScriptCanvasEditor } } - void UpgradeHelper::OpenGraph(AZ::Data::AssetId assetId) + void UpgradeHelper::OpenGraph(const SourceHandle& asset) { // Open the graph in SC editor AzToolsFramework::OpenViewPane(/*LyViewPane::ScriptCanvas*/"Script Canvas"); AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - if (assetId.IsValid()) + if (!asset.Path().empty()) { - // #sc_editor_asset - // GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, assetId, -1); + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, asset, -1); } if (!openOutcome) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.h index 36949c1828..4c0c073d70 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.h @@ -35,6 +35,8 @@ namespace Ui namespace ScriptCanvasEditor { + // class SourceHandle; + //! A tool that collects and upgrades all Script Canvas graphs in the asset catalog class UpgradeHelper : public AzQtComponents::StyledDialog @@ -51,6 +53,6 @@ namespace ScriptCanvasEditor AZStd::unique_ptr m_ui; - void OpenGraph(AZ::Data::AssetId assetId); + void OpenGraph(const SourceHandle& assetId); }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 829a25f3d1..7bfa9fabd2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -189,7 +189,7 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { - SourceHandle::SourceHandle(const SourceHandle& data, const AZ::Uuid& id, AZStd::string_view path) + SourceHandle::SourceHandle(const SourceHandle& data, const AZ::Uuid& id, const AZ::IO::Path& path) : m_data(data.m_data) , m_id(id) , m_path(path) @@ -197,7 +197,7 @@ namespace ScriptCanvasEditor } - SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path) + SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, const AZ::IO::Path& path) : m_data(graph) , m_id(id) , m_path(path) @@ -217,6 +217,12 @@ namespace ScriptCanvasEditor m_path.clear(); } + // return a SourceHandle with only the Id and Path, but without a pointer to the data + SourceHandle SourceHandle::Describe() const + { + return SourceHandle(nullptr, m_id, m_path); + } + GraphPtrConst SourceHandle::Get() const { return m_data ? m_data->GetEditorGraph() : nullptr; @@ -249,7 +255,7 @@ namespace ScriptCanvasEditor return !(*this == other); } - const AZStd::string& SourceHandle::Path() const + const AZ::IO::Path& SourceHandle::Path() const { return m_path; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 8d7dc40866..9e7ffc96f8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -9,18 +9,19 @@ #pragma once #include +#include +#include +#include #include +#include #include #include -#include #include +#include #include #include #include #include -#include -#include -#include #include #include @@ -326,16 +327,17 @@ namespace ScriptCanvasEditor SourceHandle() = default; - SourceHandle(const SourceHandle& data, const AZ::Uuid& id, AZStd::string_view path); + SourceHandle(const SourceHandle& data, const AZ::Uuid& id, const AZ::IO::Path& path); - SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path); - - ~SourceHandle() = default; + SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, const AZ::IO::Path& path); bool AnyEquals(const SourceHandle& other) const; void Clear(); + // return a SourceHandle with only the Id and Path, but without a pointer to the data + SourceHandle Describe() const; + GraphPtrConst Get() const; const AZ::Uuid& Id() const; @@ -348,7 +350,7 @@ namespace ScriptCanvasEditor bool operator!=(const SourceHandle& other) const; - const AZStd::string& Path() const; + const AZ::IO::Path& Path() const; bool PathEquals(const SourceHandle& other) const; @@ -357,7 +359,7 @@ namespace ScriptCanvasEditor private: ScriptCanvas::DataPtr m_data; AZ::Uuid m_id = AZ::Uuid::CreateNull(); - AZStd::string m_path; + AZ::IO::Path m_path; }; } From 4484b69036870601ac5ff270951a08e5b0d7747c Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Tue, 16 Nov 2021 09:12:36 -0800 Subject: [PATCH 041/399] isolate the loading problem during version explorer Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp | 2 +- .../Code/Builder/ScriptCanvasBuilderComponent.cpp | 2 +- .../Code/Editor/Assets/ScriptCanvasFileHandling.cpp | 5 +++++ .../Editor/View/Windows/Tools/UpgradeTool/Controller.cpp | 1 - 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp index 1c383d04bd..2a3da9f351 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp @@ -64,7 +64,7 @@ namespace ScriptCanvasEditor void EditorAssetSystemComponent::Activate() { - m_editorAssetRegistry.Register(); + // m_editorAssetRegistry.Register(); m_editorAssetRegistry.Register(); AzToolsFramework::AssetBrowser::AssetBrowserInteractionNotificationBus::Handler::BusConnect(); diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp index a37fa47b62..a08e006a19 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp @@ -48,7 +48,7 @@ namespace ScriptCanvasBuilder SharedHandlers HandleAssetTypes() { SharedHandlers handlers; - handlers.m_editorAssetHandler = RegisterHandler("scriptcanvas", false); + // handlers.m_editorAssetHandler = RegisterHandler("scriptcanvas", false); handlers.m_subgraphInterfaceHandler = RegisterHandler("scriptcanvas_fn_compiled", true); handlers.m_runtimeAssetHandler = RegisterHandler("scriptcanvas_compiled", true); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index cd8d21543f..ec225017fe 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -194,6 +194,11 @@ namespace ScriptCanvasEditor auto saveOutcome = JSRU::SaveObjectToStream(graphData, stream, nullptr, &settings); if (!saveOutcome.IsSuccess()) { + + Here is the allocation failure. + + AZStd::string result = saveOutcome.TakeError(); + return AZ::Failure(AZStd::string("JSON serialization failed to save source: %s", saveOutcome.GetError().c_str())); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp index 5189895a56..035152a521 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp @@ -53,7 +53,6 @@ namespace ScriptCanvasEditor m_view->textEdit->setVerticalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAlwaysOn); connect(m_view->scanButton, &QPushButton::pressed, this, &Controller::OnButtonPressScan); connect(m_view->closeButton, &QPushButton::pressed, this, &Controller::OnButtonPressClose); - m_view->upgradeAllButton->setVisible(false); connect(m_view->upgradeAllButton, &QPushButton::pressed, this, &Controller::OnButtonPressUpgrade); m_view->progressBar->setValue(0); m_view->progressBar->setVisible(false); From f8fdf4b30646486c8332a727547c896ab9e17785 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 17 Nov 2021 12:17:45 -0800 Subject: [PATCH 042/399] fixed version explorer issue Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/Assets/ScriptCanvasFileHandling.cpp | 10 +++------- .../Code/Editor/View/Windows/MainWindow.cpp | 2 +- .../View/Windows/Tools/UpgradeTool/Controller.cpp | 2 +- .../View/Windows/Tools/UpgradeTool/FileSaver.cpp | 10 ++++++++-- .../Editor/View/Windows/Tools/UpgradeTool/FileSaver.h | 3 +++ .../Code/Include/ScriptCanvas/Core/Core.cpp | 6 +++--- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index ec225017fe..68648a71f3 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -175,7 +175,7 @@ namespace ScriptCanvasEditor auto saveTarget = graphData->ModGraph(); if (!saveTarget || !saveTarget->GetGraphData()) { - return AZ::Failure(AZStd::string("source save container failed to return graph data")); + return AZ::Failure(AZStd::string("source save container failed to return serializable graph data")); } AZ::JsonSerializerSettings settings; @@ -194,12 +194,8 @@ namespace ScriptCanvasEditor auto saveOutcome = JSRU::SaveObjectToStream(graphData, stream, nullptr, &settings); if (!saveOutcome.IsSuccess()) { - - Here is the allocation failure. - - AZStd::string result = saveOutcome.TakeError(); - - return AZ::Failure(AZStd::string("JSON serialization failed to save source: %s", saveOutcome.GetError().c_str())); + AZStd::string result = saveOutcome.TakeError(); + return AZ::Failure(AZStd::string("JSON serialization failed to save source: %s", result.c_str())); } return AZ::Success(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 6203423e29..a53100eea8 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1409,7 +1409,7 @@ namespace ScriptCanvasEditor AZ::Outcome outcome = LoadFromFile(fullPath); if (!outcome.IsSuccess()) { - QMessageBox::warning(this, "Invalid Source File", QString("'%1' is not a valid file path.").arg(fullPath), QMessageBox::Ok); + QMessageBox::warning(this, "Invalid Source File", QString("'%1' failed to load properly.").arg(fullPath), QMessageBox::Ok); m_errorFilePath = fullPath; AZ_Warning("ScriptCanvas", false, "Unable to open file as a ScriptCanvas graph: %s", fullPath); return; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp index 035152a521..888f183151 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp @@ -165,7 +165,7 @@ namespace ScriptCanvasEditor { int result = QMessageBox::No; QMessageBox mb - (QMessageBox::Warning + ( QMessageBox::Warning , QObject::tr("Failed to Save Upgraded File") , QObject::tr("The upgraded file could not be saved because the file is read only.\n" "Do you want to make it writeable and overwrite it?") diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp index a88c6c2c7e..c23a3d915b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp @@ -221,10 +221,16 @@ namespace ScriptCanvasEditor { auto streamer = AZ::Interface::Get(); AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(source.Path().c_str()); - streamer->SetRequestCompleteCallback(flushRequest, [this, source]([[maybe_unused]] AZ::IO::FileRequestHandle request) + streamer->SetRequestCompleteCallback(flushRequest, [this]([[maybe_unused]] AZ::IO::FileRequestHandle request) { - this->OnSourceFileReleased(source); + AZStd::lock_guard lock(m_mutex); + if (!m_sourceFileReleased) + { + m_sourceFileReleased = true; + AZ::SystemTickBus::QueueFunction([this]() { this->OnSourceFileReleased(m_source); }); + } }); + streamer->QueueRequest(flushRequest); } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h index d04b543b0c..e87ee060f7 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h @@ -33,6 +33,9 @@ namespace ScriptCanvasEditor void Save(const SourceHandle& source); private: + AZStd::mutex m_mutex; + + bool m_sourceFileReleased = false; SourceHandle m_source; AZStd::function m_onComplete; AZStd::function m_onReadOnlyFile; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 7bfa9fabd2..de96c9953b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -205,9 +205,9 @@ namespace ScriptCanvasEditor bool SourceHandle::AnyEquals(const SourceHandle& other) const { - return m_data == other.m_data - || m_id == other.m_id - || m_path == other.m_path; + return m_data && m_data == other.m_data + || !m_id.IsNull() && m_id == other.m_id + || !m_path.empty() && m_path == other.m_path; } void SourceHandle::Clear() From 4342501804ef705108dd267ec73c4c616183c7f5 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 17 Nov 2021 13:47:51 -0800 Subject: [PATCH 043/399] fixed unit test running system Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Asset/EditorAssetConversionBus.h | 7 ++----- .../Code/Asset/EditorAssetSystemComponent.cpp | 21 +++---------------- .../Code/Asset/EditorAssetSystemComponent.h | 5 ++--- .../Builder/ScriptCanvasBuilderWorker.cpp | 1 + .../Code/Builder/ScriptCanvasBuilderWorker.h | 5 +++-- .../ScriptCanvasBuilderWorkerUtility.cpp | 13 ++++++------ .../Framework/ScriptCanvasGraphUtilities.h | 1 + .../Framework/ScriptCanvasGraphUtilities.inl | 18 +++++++--------- .../Framework/ScriptCanvasTraceUtilities.h | 4 ++-- 9 files changed, 28 insertions(+), 47 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetConversionBus.h b/Gems/ScriptCanvas/Code/Asset/EditorAssetConversionBus.h index 12313021f7..3b120af5da 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetConversionBus.h +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetConversionBus.h @@ -26,17 +26,14 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { - class ScriptCanvasAsset; - class EditorAssetConversionBusTraits : public AZ::EBusTraits { public: static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - virtual AZ::Data::Asset LoadAsset(AZStd::string_view graphPath) = 0; - virtual AZ::Outcome CreateLuaAsset(const AZ::Data::Asset& editAsset, AZStd::string_view graphPathForRawLuaFile) = 0; - virtual AZ::Outcome, AZStd::string> CreateRuntimeAsset(const AZ::Data::Asset& editAsset) = 0; + virtual AZ::Outcome CreateLuaAsset(const SourceHandle& editAsset, AZStd::string_view graphPathForRawLuaFile) = 0; + virtual AZ::Outcome, AZStd::string> CreateRuntimeAsset(const SourceHandle& editAsset) = 0; }; using EditorAssetConversionBus = AZ::EBus; diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp index 2a3da9f351..3515eaf34f 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp @@ -64,7 +64,6 @@ namespace ScriptCanvasEditor void EditorAssetSystemComponent::Activate() { - // m_editorAssetRegistry.Register(); m_editorAssetRegistry.Register(); AzToolsFramework::AssetBrowser::AssetBrowserInteractionNotificationBus::Handler::BusConnect(); @@ -98,28 +97,14 @@ namespace ScriptCanvasEditor return false; } - AZ::Data::Asset EditorAssetSystemComponent::LoadAsset(AZStd::string_view graphPath) - { - auto outcome = ScriptCanvasBuilder::LoadEditorAsset(graphPath, AZ::Data::AssetId(AZ::Uuid::CreateRandom())); - - if (outcome.IsSuccess()) - { - return outcome.GetValue(); - } - else - { - return {}; - } - } - - AZ::Outcome, AZStd::string> EditorAssetSystemComponent::CreateRuntimeAsset(const AZ::Data::Asset& editAsset) + AZ::Outcome, AZStd::string> EditorAssetSystemComponent::CreateRuntimeAsset(const SourceHandle& editAsset) { return ScriptCanvasBuilder::CreateRuntimeAsset(editAsset); } - AZ::Outcome EditorAssetSystemComponent::CreateLuaAsset(const AZ::Data::Asset& editAsset, AZStd::string_view graphPathForRawLuaFile) + AZ::Outcome EditorAssetSystemComponent::CreateLuaAsset(const SourceHandle& editAsset, AZStd::string_view graphPathForRawLuaFile) { - return ScriptCanvasBuilder::CreateLuaAsset(editAsset->GetScriptCanvasEntity(), editAsset->GetId(), graphPathForRawLuaFile); + return ScriptCanvasBuilder::CreateLuaAsset(editAsset, graphPathForRawLuaFile); } void EditorAssetSystemComponent::AddSourceFileOpeners([[maybe_unused]] const char* fullSourceFileName, [[maybe_unused]] const AZ::Uuid& sourceUuid, [[maybe_unused]] AzToolsFramework::AssetBrowser::SourceFileOpenerList& openers) diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h index 96e1280cbc..7937950a05 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h @@ -49,9 +49,8 @@ namespace ScriptCanvasEditor ////////////////////////////////////////////////////////////////////////// // EditorAssetConversionBus::Handler... - AZ::Data::Asset LoadAsset(AZStd::string_view graphPath) override; - AZ::Outcome, AZStd::string> CreateRuntimeAsset(const AZ::Data::Asset& editAsset) override; - AZ::Outcome CreateLuaAsset(const AZ::Data::Asset& editAsset, AZStd::string_view graphPathForRawLuaFile) override; + AZ::Outcome, AZStd::string> CreateRuntimeAsset(const SourceHandle& editAsset) override; + AZ::Outcome CreateLuaAsset(const SourceHandle& editAsset, AZStd::string_view graphPathForRawLuaFile) override; ////////////////////////////////////////////////////////////////////////// ScriptCanvas::AssetRegistry& GetAssetRegistry(); diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index 7a7dbfff0b..f38654f565 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -29,6 +29,7 @@ #include #include #include +#include namespace ScriptCanvasBuilder { diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index 84c9285362..816206ce33 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -37,6 +37,7 @@ namespace ScriptCanvasEditor { class Graph; class ScriptCanvasAsset; + class SourceHandle; } namespace ScriptCanvasBuilder @@ -125,13 +126,13 @@ namespace ScriptCanvasBuilder } }; - AZ::Outcome, AZStd::string> CreateRuntimeAsset(const AZ::Data::Asset& asset); + AZ::Outcome, AZStd::string> CreateRuntimeAsset(const ScriptCanvasEditor::SourceHandle& asset); AZ::Outcome CompileGraphData(AZ::Entity* scriptCanvasEntity); AZ::Outcome CompileVariableData(AZ::Entity* scriptCanvasEntity); - AZ::Outcome CreateLuaAsset(AZ::Entity* buildEntity, AZ::Data::AssetId scriptAssetId, AZStd::string_view rawLuaFilePath); + AZ::Outcome CreateLuaAsset(const ScriptCanvasEditor::SourceHandle& editAsset, AZStd::string_view rawLuaFilePath); int GetBuilderVersion(); diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp index 7d4cfec909..f337580cf3 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp @@ -29,6 +29,7 @@ #include #include #include +#include namespace ScriptCanvasBuilder { @@ -77,17 +78,17 @@ namespace ScriptCanvasBuilder return ScriptCanvas::Translation::ParseGraph(request); } - AZ::Outcome CreateLuaAsset(AZ::Entity* buildEntity, AZ::Data::AssetId scriptAssetId, AZStd::string_view rawLuaFilePath) + AZ::Outcome CreateLuaAsset(const ScriptCanvasEditor::SourceHandle& editAsset, AZStd::string_view rawLuaFilePath) { AZStd::string fullPath(rawLuaFilePath); AZStd::string fileNameOnly; AzFramework::StringFunc::Path::GetFullFileName(rawLuaFilePath.data(), fileNameOnly); AzFramework::StringFunc::Path::Normalize(fullPath); - auto sourceGraph = PrepareSourceGraph(buildEntity); + auto sourceGraph = PrepareSourceGraph(editAsset.Mod()->GetEntity()); ScriptCanvas::Grammar::Request request; - request.scriptAssetId = scriptAssetId; + request.scriptAssetId = editAsset.Id(); request.graph = sourceGraph; request.name = fileNameOnly; request.rawSaveDebugOutput = ScriptCanvas::Grammar::g_saveRawTranslationOuputToFile; @@ -117,7 +118,7 @@ namespace ScriptCanvasBuilder auto& translation = translationResult.m_translations.find(ScriptCanvas::Translation::TargetFlags::Lua)->second; AZ::Data::Asset asset; - scriptAssetId.m_subId = AZ::ScriptAsset::CompiledAssetSubId; + AZ::Data::AssetId scriptAssetId(editAsset.Id(), AZ::ScriptAsset::CompiledAssetSubId); asset.Create(scriptAssetId); auto writeStream = asset.Get()->CreateWriteStream(); @@ -144,12 +145,12 @@ namespace ScriptCanvasBuilder return AZ::Success(result); } - AZ::Outcome, AZStd::string> CreateRuntimeAsset(const AZ::Data::Asset& editAsset) + AZ::Outcome, AZStd::string> CreateRuntimeAsset(const ScriptCanvasEditor::SourceHandle& editAsset) { // Flush asset manager events to ensure no asset references are held by closures queued on Ebuses. AZ::Data::AssetManager::Instance().DispatchEvents(); - auto runtimeAssetId = editAsset.GetId(); + AZ::Data::AssetId runtimeAssetId = editAsset.Id(); runtimeAssetId.m_subId = AZ_CRC("RuntimeData", 0x163310ae); AZ::Data::Asset runtimeAsset; runtimeAsset.Create(runtimeAssetId); diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.h b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.h index 4d1be42d35..8593429b92 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.h +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.h @@ -11,6 +11,7 @@ #include #include #include +#include namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl index 05541196f7..b1bc7321e6 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl @@ -75,7 +75,7 @@ namespace ScriptCanvasEditor AZ_Assert(loadResult.m_runtimeAsset, "failed to load dependent asset"); AZ::Outcome luaAssetOutcome = AZ::Failure(AZStd::string("lua asset creation for function failed")); - ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(luaAssetOutcome, &ScriptCanvasEditor::EditorAssetConversionBusTraits::CreateLuaAsset, loadResult.m_editorAsset, loadResult.m_graphPath); + ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(luaAssetOutcome, &ScriptCanvasEditor::EditorAssetConversionBusTraits::CreateLuaAsset, loadResult.m_editorAsset, loadResult.m_editorAsset.Path().c_str()); AZ_Assert(luaAssetOutcome.IsSuccess(), "failed to create Lua asset"); AZStd::string modulePath = namespacePath[0].data(); @@ -112,18 +112,14 @@ namespace ScriptCanvasEditor AZ_INLINE LoadTestGraphResult LoadTestGraph(AZStd::string_view graphPath) { - AZ::Data::Asset editorAsset; - ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(editorAsset, &ScriptCanvasEditor::EditorAssetConversionBusTraits::LoadAsset, graphPath); - - if (editorAsset.GetData()) + if (auto loadFileOutcome = LoadFromFile(graphPath); loadFileOutcome.IsSuccess()) { AZ::Outcome< AZ::Data::Asset, AZStd::string> assetOutcome = AZ::Failure(AZStd::string("asset creation failed")); - ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(assetOutcome, &ScriptCanvasEditor::EditorAssetConversionBusTraits::CreateRuntimeAsset, editorAsset); + ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(assetOutcome, &ScriptCanvasEditor::EditorAssetConversionBusTraits::CreateRuntimeAsset, loadFileOutcome.GetValue()); if (assetOutcome.IsSuccess()) { LoadTestGraphResult result; - result.m_graphPath = graphPath; - result.m_editorAsset = editorAsset; + result.m_editorAsset = loadFileOutcome.TakeValue(); result.m_runtimeAsset = assetOutcome.GetValue(); result.m_entity = AZStd::make_unique("Loaded Graph"); return result; @@ -164,8 +160,7 @@ namespace ScriptCanvasEditor reporter.SetExecutionMode(mode); LoadTestGraphResult loadResult; - loadResult.m_graphPath = asset.GetHint().c_str(); - loadResult.m_editorAsset = asset; + loadResult.m_editorAsset = SourceHandle(nullptr, assetId.m_guid, asset.GetHint()); AZ::EntityId scriptCanvasId; loadResult.m_entity = AZStd::make_unique("Loaded test graph"); loadResult.m_runtimeAsset = runtimeAsset; @@ -206,7 +201,8 @@ namespace ScriptCanvasEditor { ScopedOutputSuppression outputSuppressor; AZ::Outcome luaAssetOutcome = AZ::Failure(AZStd::string("lua asset creation failed")); - ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(luaAssetOutcome, &ScriptCanvasEditor::EditorAssetConversionBusTraits::CreateLuaAsset, loadResult.m_editorAsset, loadResult.m_graphPath); + ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(luaAssetOutcome + , &ScriptCanvasEditor::EditorAssetConversionBusTraits::CreateLuaAsset, loadResult.m_editorAsset, loadResult.m_editorAsset.Path().c_str()); reporter.MarkParseAttemptMade(); if (luaAssetOutcome.IsSuccess()) diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h index a87f4450c2..033eed3efd 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h @@ -27,6 +27,7 @@ #include #include #include +#include namespace AZ { @@ -45,11 +46,10 @@ namespace ScriptCanvasEditor struct LoadTestGraphResult { - AZStd::string_view m_graphPath; AZStd::unique_ptr m_entity; ScriptCanvas::RuntimeComponent* m_runtimeComponent = nullptr; bool m_nativeFunctionFound = false; - AZ::Data::Asset m_editorAsset; + SourceHandle m_editorAsset; AZ::Data::Asset m_runtimeAsset; AZ::Data::Asset m_scriptAsset; }; From 727d1b38155eca95a13ec6afb9cf40efbe6530e3 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 18 Nov 2021 10:41:46 -0800 Subject: [PATCH 044/399] more aggressively release graph memory in version explorer Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Builder/ScriptCanvasBuilderComponent.cpp | 1 - .../Builder/ScriptCanvasBuilderWorker.cpp | 44 ++------------- .../Code/Builder/ScriptCanvasBuilderWorker.h | 4 +- .../ScriptCanvasBuilderWorkerUtility.cpp | 4 +- .../Windows/Tools/UpgradeTool/Modifier.cpp | 55 +++++++++++-------- .../View/Windows/Tools/UpgradeTool/Modifier.h | 3 +- .../Windows/Tools/UpgradeTool/Scanner.cpp | 40 ++++++++------ .../View/Windows/Tools/UpgradeTool/Scanner.h | 2 +- .../Code/Include/ScriptCanvas/Core/Core.h | 2 +- .../Code/Include/ScriptCanvas/Core/Graph.cpp | 16 +++++- 10 files changed, 80 insertions(+), 91 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp index a08e006a19..019dd4f5e3 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp @@ -48,7 +48,6 @@ namespace ScriptCanvasBuilder SharedHandlers HandleAssetTypes() { SharedHandlers handlers; - // handlers.m_editorAssetHandler = RegisterHandler("scriptcanvas", false); handlers.m_subgraphInterfaceHandler = RegisterHandler("scriptcanvas_fn_compiled", true); handlers.m_runtimeAssetHandler = RegisterHandler("scriptcanvas_compiled", true); diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index f38654f565..faad1871ac 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -35,7 +35,6 @@ namespace ScriptCanvasBuilder { void Worker::Activate(const AssetHandlers& handlers) { - m_editorAssetHandler = handlers.m_editorAssetHandler; m_runtimeAssetHandler = handlers.m_runtimeAssetHandler; m_subgraphInterfaceHandler = handlers.m_subgraphInterfaceHandler; } @@ -255,49 +254,14 @@ namespace ScriptCanvasBuilder return; } - if (!m_editorAssetHandler) - { - AZ_Error(s_scriptCanvasBuilder, false, R"(Exporting of .scriptcanvas for "%s" file failed as no editor asset handler was registered for script canvas. The ScriptCanvas Gem might not be enabled.)", fullPath.data()); - return; - } - if (!m_runtimeAssetHandler) { AZ_Error(s_scriptCanvasBuilder, false, R"(Exporting of .scriptcanvas for "%s" file failed as no runtime asset handler was registered for script canvas.)", fullPath.data()); return; } - AZStd::shared_ptr assetDataStream = AZStd::make_shared(); - - AZ::IO::FileIOStream stream(fullPath.c_str(), AZ::IO::OpenMode::ModeRead); - if (!AZ::IO::RetryOpenStream(stream)) - { - AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the source file could not be opened.", fullPath.data()); - return; - } - - // Read the asset into a memory buffer, then hand ownership of the buffer to assetDataStream - { - AZ::IO::FileIOStream ioStream; - if (!ioStream.Open(fullPath.data(), AZ::IO::OpenMode::ModeRead)) - { - AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the source file could not be opened.", fullPath.data()); - return; - } - AZStd::vector fileBuffer(ioStream.GetLength()); - size_t bytesRead = ioStream.Read(fileBuffer.size(), fileBuffer.data()); - if (bytesRead != ioStream.GetLength()) - { - AZ_Warning(s_scriptCanvasBuilder, false, AZStd::string::format("File failed to read completely: %s", fullPath.data()).c_str()); - return; - } - - assetDataStream->Open(AZStd::move(fileBuffer)); - } - - AZ::Data::Asset asset; - asset.Create(request.m_sourceFileUUID); - if (m_editorAssetHandler->LoadAssetDataFromStream(asset, assetDataStream, nullptr) != AZ::Data::AssetHandler::LoadResult::LoadComplete) + auto loadOutcome = ScriptCanvasEditor::LoadFromFile(request.m_fullPath); + if (!loadOutcome.IsSuccess()) { AZ_Error(s_scriptCanvasBuilder, false, R"(Loading of ScriptCanvas asset for source file "%s" has failed)", fullPath.data()); return; @@ -310,9 +274,11 @@ namespace ScriptCanvasBuilder AzFramework::StringFunc::Path::Join(request.m_tempDirPath.c_str(), fileNameOnly.c_str(), runtimeScriptCanvasOutputPath, true, true); AzFramework::StringFunc::Path::ReplaceExtension(runtimeScriptCanvasOutputPath, ScriptCanvas::RuntimeAsset::GetFileExtension()); + auto sourceHandle = loadOutcome.TakeValue(); + if (request.m_jobDescription.m_jobKey == s_scriptCanvasProcessJobKey) { - AZ::Entity* buildEntity = asset.Get()->GetScriptCanvasEntity(); + AZ::Entity* buildEntity = sourceHandle.Get()->GetEntity(); ProcessTranslationJobInput input; input.assetID = AZ::Data::AssetId(request.m_sourceFileUUID, AZ_CRC("RuntimeData", 0x163310ae)); input.request = &request; diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index 816206ce33..e1bf80aa2e 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -62,6 +62,7 @@ namespace ScriptCanvasBuilder ForceBuildForDevTest0, ForceBuildForDevTest1, + ForceBuildForDevTest2, // add new entries above Current, @@ -73,7 +74,6 @@ namespace ScriptCanvasBuilder struct AssetHandlers { - AZ::Data::AssetHandler* m_editorAssetHandler = nullptr; AZ::Data::AssetHandler* m_editorFunctionAssetHandler = nullptr; AZ::Data::AssetHandler* m_runtimeAssetHandler = nullptr; AZ::Data::AssetHandler* m_subgraphInterfaceHandler = nullptr; @@ -84,7 +84,6 @@ namespace ScriptCanvasBuilder struct SharedHandlers { - HandlerOwnership m_editorAssetHandler{}; HandlerOwnership m_editorFunctionAssetHandler{}; HandlerOwnership m_runtimeAssetHandler{}; HandlerOwnership m_subgraphInterfaceHandler{}; @@ -173,7 +172,6 @@ namespace ScriptCanvasBuilder void ShutDown() override {}; private: - AZ::Data::AssetHandler* m_editorAssetHandler = nullptr; AZ::Data::AssetHandler* m_runtimeAssetHandler = nullptr; AZ::Data::AssetHandler* m_subgraphInterfaceHandler = nullptr; diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp index f337580cf3..a68aeae5e9 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp @@ -34,15 +34,13 @@ namespace ScriptCanvasBuilder { AssetHandlers::AssetHandlers(SharedHandlers& source) - : m_editorAssetHandler(source.m_editorAssetHandler.first) - , m_editorFunctionAssetHandler(source.m_editorFunctionAssetHandler.first) + : m_editorFunctionAssetHandler(source.m_editorFunctionAssetHandler.first) , m_runtimeAssetHandler(source.m_runtimeAssetHandler.first) , m_subgraphInterfaceHandler(source.m_subgraphInterfaceHandler.first) {} void SharedHandlers::DeleteOwnedHandlers() { - DeleteIfOwned(m_editorAssetHandler); DeleteIfOwned(m_editorFunctionAssetHandler); DeleteIfOwned(m_runtimeAssetHandler); DeleteIfOwned(m_subgraphInterfaceHandler); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index 56d7264859..830d09c7dd 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -32,13 +32,6 @@ namespace ScriptCanvasEditor AZ::SystemTickBus::Handler::BusConnect(); } - const SourceHandle& Modifier::GetCurrentAsset() const - { - return m_state == State::GatheringDependencies - ? m_assets[m_assetIndex] - : m_assets[m_dependencyOrderedAssetIndicies[m_assetIndex]]; - } - AZStd::unordered_set& Modifier::GetOrCreateDependencyIndexSet() { auto iter = m_dependencies.find(m_assetIndex); @@ -101,36 +94,40 @@ namespace ScriptCanvasEditor { anyFailures = true; VE_LOG("Modifier: ERROR - Failed to gather dependencies from graph data: %s" - , GetCurrentAsset().Path().c_str()) + , ModCurrentAsset().Path().c_str()) } } else { anyFailures = true; VE_LOG("Modifier: ERROR - Failed to load asset %s for modification, even though it scanned properly" - , GetCurrentAsset().Path().c_str()); + , ModCurrentAsset().Path().c_str()); } ModelNotificationsBus::Broadcast ( &ModelNotificationsTraits::OnUpgradeDependenciesGathered - , GetCurrentAsset() + , ModCurrentAsset() , anyFailures ? Result::Failure : Result::Success); + ReleaseCurrentAsset(); + // Flush asset database events to ensure no asset references are held by closures queued on Ebuses. AZ::Data::AssetManager::Instance().DispatchEvents(); } SourceHandle Modifier::LoadAsset() { - auto outcome = LoadFromFile(GetCurrentAsset().Path().c_str()); - if (outcome.IsSuccess()) + auto& handle = ModCurrentAsset(); + if (!handle.IsValid()) { - return outcome.TakeValue(); - } - else - { - return {}; + auto outcome = LoadFromFile(handle.Path().c_str()); + if (outcome.IsSuccess()) + { + handle = outcome.TakeValue(); + } } + + return handle; } void Modifier::ModificationComplete(const ModificationResult& result) @@ -147,12 +144,19 @@ namespace ScriptCanvasEditor } } + SourceHandle& Modifier::ModCurrentAsset() + { + return m_state == State::GatheringDependencies + ? m_assets[m_assetIndex] + : m_assets[m_dependencyOrderedAssetIndicies[m_assetIndex]]; + } + void Modifier::ModifyCurrentAsset() { m_result = {}; - m_result.asset = GetCurrentAsset(); + m_result.asset = ModCurrentAsset(); - ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, GetCurrentAsset()); + ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, ModCurrentAsset()); if (auto asset = LoadAsset(); asset.IsValid()) { @@ -169,13 +173,19 @@ namespace ScriptCanvasEditor void Modifier::ModifyNextAsset() { ModelNotificationsBus::Broadcast - ( &ModelNotificationsTraits::OnUpgradeModificationEnd, m_config, GetCurrentAsset(), m_result); + ( &ModelNotificationsTraits::OnUpgradeModificationEnd, m_config, ModCurrentAsset(), m_result); ModificationNotificationsBus::Handler::BusDisconnect(); m_modifyState = ModifyState::Idle; + ReleaseCurrentAsset(); ++m_assetIndex; m_result = {}; } + void Modifier::ReleaseCurrentAsset() + { + ModCurrentAsset() = ModCurrentAsset().Describe(); + } + void Modifier::ReportModificationError(AZStd::string_view report) { m_result.asset = {}; @@ -286,7 +296,7 @@ namespace ScriptCanvasEditor m_dependencyOrderedAssetIndicies.push_back(index); } - // go straight into ModifyinGraphs + // go straight into ModifyingGraphs m_assetIndex = m_assets.size(); } } @@ -309,6 +319,7 @@ namespace ScriptCanvasEditor else { GatherDependencies(); + ReleaseCurrentAsset(); ++m_assetIndex; } } @@ -370,7 +381,7 @@ namespace ScriptCanvasEditor (ScriptCanvas::k_VersionExplorerWindow.data() , false , "Modifier: Dependency sort has failed during, circular dependency detected for Asset: %s" - , modifier->GetCurrentAsset().Path().c_str()); + , modifier->ModCurrentAsset().Path().c_str()); return; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h index c57af605e3..78c9b3a877 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h @@ -83,12 +83,13 @@ namespace ScriptCanvasEditor FileSaveResult m_fileSaveResult; void GatherDependencies(); - const SourceHandle& GetCurrentAsset() const; AZStd::unordered_set& GetOrCreateDependencyIndexSet(); SourceHandle LoadAsset(); + SourceHandle& ModCurrentAsset(); void ModifyCurrentAsset(); void ModifyNextAsset(); void ModificationComplete(const ModificationResult& result) override; + void ReleaseCurrentAsset(); void ReportModificationError(AZStd::string_view report); void ReportModificationSuccess(); void ReportSaveResult(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp index d959a6b6ab..f9fc6e497d 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp @@ -32,8 +32,12 @@ namespace ScannerCpp && entry->GetFullPath().ends_with(".scriptcanvas")) { auto sourceEntry = azrtti_cast(entry); + + AZStd::string fullPath = sourceEntry->GetFullPath(); + AzFramework::StringFunc::Path::Normalize(fullPath); + result.m_catalogAssets.push_back( - ScriptCanvasEditor::SourceHandle(nullptr, sourceEntry->GetSourceUuid(), sourceEntry->GetFullPath())); + ScriptCanvasEditor::SourceHandle(nullptr, sourceEntry->GetSourceUuid(), fullPath)); } const int rowCount = model.rowCount(index); @@ -79,23 +83,18 @@ namespace ScriptCanvasEditor { if (m_config.filter && m_config.filter(asset) == ScanConfiguration::Filter::Exclude) { - VE_LOG("Scanner: Excluded: %s ", GetCurrentAsset().Path().c_str()); - m_result.m_filteredAssets.push_back(GetCurrentAsset().Describe()); - ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanFilteredGraph, GetCurrentAsset()); + VE_LOG("Scanner: Excluded: %s ", ModCurrentAsset().Path().c_str()); + m_result.m_filteredAssets.push_back(ModCurrentAsset().Describe()); + ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanFilteredGraph, ModCurrentAsset()); } else { - VE_LOG("Scanner: Included: %s ", GetCurrentAsset().Path().c_str()); - m_result.m_unfiltered.push_back(GetCurrentAsset().Describe()); - ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanUnFilteredGraph, GetCurrentAsset()); + VE_LOG("Scanner: Included: %s ", ModCurrentAsset().Path().c_str()); + m_result.m_unfiltered.push_back(ModCurrentAsset().Describe()); + ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanUnFilteredGraph, ModCurrentAsset()); } } - const SourceHandle& Scanner::GetCurrentAsset() const - { - return m_result.m_catalogAssets[m_catalogAssetIndex]; - } - const ScanResult& Scanner::GetResult() const { return m_result; @@ -103,7 +102,7 @@ namespace ScriptCanvasEditor SourceHandle Scanner::LoadAsset() { - auto fileOutcome = LoadFromFile(GetCurrentAsset().Path().c_str()); + auto fileOutcome = LoadFromFile(ModCurrentAsset().Path().c_str()); if (fileOutcome.IsSuccess()) { return fileOutcome.GetValue(); @@ -114,6 +113,11 @@ namespace ScriptCanvasEditor } } + SourceHandle& Scanner::ModCurrentAsset() + { + return m_result.m_catalogAssets[m_catalogAssetIndex]; + } + void Scanner::OnSystemTick() { if (m_catalogAssetIndex == m_result.m_catalogAssets.size()) @@ -130,17 +134,17 @@ namespace ScriptCanvasEditor { if (auto asset = LoadAsset(); asset.IsValid()) { - VE_LOG("Scanner: Loaded: %s ", GetCurrentAsset().Path().c_str()); + VE_LOG("Scanner: Loaded: %s ", ModCurrentAsset().Path().c_str()); FilterAsset(asset); } else { - VE_LOG("Scanner: Failed to load: %s ", GetCurrentAsset().Path().c_str()); - m_result.m_loadErrors.push_back(GetCurrentAsset()); - ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanLoadFailure, GetCurrentAsset()); + VE_LOG("Scanner: Failed to load: %s ", ModCurrentAsset().Path().c_str()); + m_result.m_loadErrors.push_back(ModCurrentAsset().Describe()); + ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanLoadFailure, ModCurrentAsset()); } - VE_LOG("Scanner: scan of %s complete", GetCurrentAsset().Path().c_str()); + VE_LOG("Scanner: scan of %s complete", ModCurrentAsset().Path().c_str()); ++m_catalogAssetIndex; } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.h index f276c146da..8e086a10b0 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.h @@ -34,8 +34,8 @@ namespace ScriptCanvasEditor ScanResult m_result; void FilterAsset(SourceHandle); - const SourceHandle& GetCurrentAsset() const; SourceHandle LoadAsset(); + SourceHandle& ModCurrentAsset(); void OnSystemTick() override; }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 9e7ffc96f8..a57d2dc3a1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -27,7 +27,7 @@ #define OBJECT_STREAM_EDITOR_ASSET_LOADING_SUPPORT_ENABLED -#define EDITOR_ASSET_SUPPORT_ENABLED +// #define EDITOR_ASSET_SUPPORT_ENABLED namespace AZ { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index ee500514dc..3d802e4fbc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -52,6 +52,7 @@ namespace GraphCpp VariablePanelSymantics, AddVersionData, RemoveFunctionGraphMarker, + FixupVersionDataTypeId, // label your version above Current }; @@ -71,13 +72,24 @@ namespace ScriptCanvas componentElementNode.AddElementWithData(context, "m_assetType", azrtti_typeid()); } - if (componentElementNode.GetVersion() < GraphCpp::GraphVersion::RemoveFunctionGraphMarker) + if (componentElementNode.GetVersion() <= GraphCpp::GraphVersion::RemoveFunctionGraphMarker) { componentElementNode.RemoveElementByName(AZ_CRC_CE("isFunctionGraph")); } + if (componentElementNode.GetVersion() < GraphCpp::GraphVersion::FixupVersionDataTypeId) + { + if (auto subElement = componentElementNode.FindSubElement(AZ_CRC_CE("versionData"))) + { + if (subElement->GetId() == azrtti_typeid()) + { + componentElementNode.RemoveElementByName(AZ_CRC_CE("versionData")); + } + } + } + return true; - } + }s Graph::Graph(const ScriptCanvasId& scriptCanvasId) : m_scriptCanvasId(scriptCanvasId) From b772db5e73487ed9ea691d9bc2259d811015c517 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 18 Nov 2021 13:31:00 -0800 Subject: [PATCH 045/399] remove typo Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index 3d802e4fbc..aff212fa4c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -89,7 +89,7 @@ namespace ScriptCanvas } return true; - }s + } Graph::Graph(const ScriptCanvasId& scriptCanvasId) : m_scriptCanvasId(scriptCanvasId) From ad8cfa5f99eb3673caf92d173fcc3af2b1c1b10d Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Fri, 19 Nov 2021 10:03:16 -0800 Subject: [PATCH 046/399] editor sc component switched over to source handle, not yet connected to file notifications Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../EditorScriptCanvasComponent.cpp | 249 +++++++----------- .../Code/Editor/Components/EditorUtils.cpp | 39 +++ .../ScriptCanvas/Bus/EditorScriptCanvasBus.h | 29 +- .../Components/EditorScriptCanvasComponent.h | 38 +-- .../ScriptCanvas/Components/EditorUtils.h | 2 + .../Code/Editor/ReflectComponent.cpp | 1 + .../Code/Editor/View/Windows/MainWindow.cpp | 14 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 33 ++- .../Code/Include/ScriptCanvas/Core/Core.h | 8 +- .../$tmp29198_Test_LY_79396.scriptcanvas | 69 +++++ 10 files changed, 271 insertions(+), 211 deletions(-) create mode 100644 Gems/ScriptCanvasTesting/Assets/ScriptCanvas/Tests/$tmp29198_Test_LY_79396.scriptcanvas diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index d73273103c..3b495f6822 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -26,18 +26,20 @@ #include #include #include +#include #include #include #include #include - +#include +#include namespace EditorScriptCanvasComponentCpp { enum Version { PrefabIntegration = 10, - + AddSourceHandle, // add description above Current }; @@ -142,6 +144,25 @@ namespace ScriptCanvasEditor } } + if (rootElement.GetVersion() < EditorScriptCanvasComponentCpp::Version::AddSourceHandle) + { + ScriptCanvasAssetHolder assetHolder; + if (!rootElement.FindSubElementAndGetData(AZ_CRC_CE("m_assetHolder"), assetHolder)) + { + AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: could not retrieve old 'm_assetHolder'"); + return false; + } + + auto assetId = assetHolder.GetAssetId(); + auto path = assetHolder.GetAssetHint(); + + if (!rootElement.AddElementWithData(serializeContext, "runtimeDataOverrides", SourceHandle(nullptr, assetId.m_guid, path))) + { + AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: failed to add 'sourceHandle'"); + return false; + } + } + return true; } @@ -153,9 +174,9 @@ namespace ScriptCanvasEditor serializeContext->Class() ->Version(EditorScriptCanvasComponentCpp::Version::Current, &EditorScriptCanvasComponentVersionConverter) ->Field("m_name", &EditorScriptCanvasComponent::m_name) - ->Field("m_assetHolder", &EditorScriptCanvasComponent::m_scriptCanvasAssetHolder) ->Field("runtimeDataIsValid", &EditorScriptCanvasComponent::m_runtimeDataIsValid) ->Field("runtimeDataOverrides", &EditorScriptCanvasComponent::m_variableOverrides) + ->Field("sourceHandle", &EditorScriptCanvasComponent::m_sourceHandle) ; if (AZ::EditContext* editContext = serializeContext->GetEditContext()) @@ -171,7 +192,7 @@ namespace ScriptCanvasEditor ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("UI", 0x27ff46b0)) ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Level", 0x9aeacc13)) ->Attribute(AZ::Edit::Attributes::HelpPageURL, "https://o3de.org/docs/user-guide/components/reference/scripting/script-canvas/") - ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_scriptCanvasAssetHolder, "Script Canvas Asset", "Script Canvas asset associated with this component") + ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_sourceHandle, "Script Canvas Source File", "Script Canvas source file associated with this component") ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_variableOverrides, "Properties", "Script Canvas Graph Properties") ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) @@ -181,19 +202,13 @@ namespace ScriptCanvasEditor } EditorScriptCanvasComponent::EditorScriptCanvasComponent() - : EditorScriptCanvasComponent(AZ::Data::Asset()) + : EditorScriptCanvasComponent(SourceHandle()) { } - EditorScriptCanvasComponent::EditorScriptCanvasComponent(AZ::Data::Asset asset) - : m_scriptCanvasAssetHolder() + EditorScriptCanvasComponent::EditorScriptCanvasComponent(const SourceHandle& sourceHandle) + : m_sourceHandle(sourceHandle) { - if (asset.GetId().IsValid()) - { - m_scriptCanvasAssetHolder.SetAsset(asset.GetId()); - } - - m_scriptCanvasAssetHolder.SetScriptChangedCB([this](AZ::Data::AssetId assetId) { OnScriptCanvasAssetChanged(assetId); }); } EditorScriptCanvasComponent::~EditorScriptCanvasComponent() @@ -209,42 +224,35 @@ namespace ScriptCanvasEditor void EditorScriptCanvasComponent::UpdateName() { - AZ::Data::AssetId assetId = m_scriptCanvasAssetHolder.GetAssetId(); - if (assetId.IsValid()) - { - // Pathname from the asset doesn't seem to return a value unless the asset has been loaded up once(which isn't done until we try to show it). - // Using the Job system to determine the asset name instead. - AZ::Outcome jobOutcome = AZ::Failure(); - AzToolsFramework::AssetSystemJobRequestBus::BroadcastResult(jobOutcome, &AzToolsFramework::AssetSystemJobRequestBus::Events::GetAssetJobsInfoByAssetID, assetId, false, false); - - AZStd::string assetPath; - AZStd::string assetName; - - if (jobOutcome.IsSuccess()) - { - AzToolsFramework::AssetSystem::JobInfoContainer& jobs = jobOutcome.GetValue(); - - // Get the asset relative path - if (!jobs.empty()) - { - assetPath = jobs[0].m_sourceFile; - } - - // Get the asset file name - assetName = assetPath; - - if (!assetPath.empty()) - { - AzFramework::StringFunc::Path::GetFileName(assetPath.c_str(), assetName); - SetName(assetName); - } - } - } + SetName(m_sourceHandle.Path().Filename().Native()); } void EditorScriptCanvasComponent::OpenEditor() { - m_scriptCanvasAssetHolder.OpenEditor(); + AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); + + AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); + + if (m_sourceHandle.IsValid()) + { + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_sourceHandle, -1); + + if (!openOutcome) + { + AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); + } + } + else if (GetEntityId().IsValid()) + { + AzToolsFramework::EntityIdList selectedEntityIds; + AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); + + // Going to bypass the multiple selected entities flow for right now. + if (selectedEntityIds.size() == 1) + { + GeneralRequestBus::Broadcast(&GeneralRequests::CreateScriptCanvasAssetFor, AZStd::make_pair(GetEntityId(), GetId())); + } + } } void EditorScriptCanvasComponent::Init() @@ -260,6 +268,8 @@ namespace ScriptCanvasEditor { EditorComponentBase::Activate(); + AzToolsFramework::AssetSystemBus::Handler::BusConnect(); + AZ::EntityId entityId = GetEntityId(); EditorContextMenuRequestBus::Handler::BusConnect(entityId); @@ -268,19 +278,13 @@ namespace ScriptCanvasEditor EditorScriptCanvasComponentLoggingBus::Handler::BusConnect(entityId); EditorLoggingComponentNotificationBus::Broadcast(&EditorLoggingComponentNotifications::OnEditorScriptCanvasComponentActivated, GetNamedEntityId(), GetGraphIdentifier()); - AZ::Data::AssetId fileAssetId = m_scriptCanvasAssetHolder.GetAssetId(); - - if (fileAssetId.IsValid()) - { - AssetTrackerNotificationBus::Handler::BusConnect(fileAssetId); - AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); - } + AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); } //========================================================================= void EditorScriptCanvasComponent::Deactivate() { - AssetTrackerNotificationBus::Handler::BusDisconnect(); + AzToolsFramework::AssetSystemBus::Handler::BusDisconnect(); EditorScriptCanvasComponentLoggingBus::Handler::BusDisconnect(); EditorLoggingComponentNotificationBus::Broadcast(&EditorLoggingComponentNotifications::OnEditorScriptCanvasComponentDeactivated, GetNamedEntityId(), GetGraphIdentifier()); @@ -297,7 +301,7 @@ namespace ScriptCanvasEditor m_runtimeDataIsValid = false; - auto assetTreeOutcome = LoadEditorAssetTree(m_scriptCanvasAssetHolder.GetAssetId(), m_scriptCanvasAssetHolder.GetAssetHint()); + auto assetTreeOutcome = LoadEditorAssetTree(m_sourceHandle.Id(), m_sourceHandle.Path().c_str()); if (!assetTreeOutcome.IsSuccess()) { AZ_Warning("ScriptCanvas", false, "EditorScriptCanvasComponent::BuildGameEntityData failed: %s", assetTreeOutcome.GetError().c_str()); @@ -335,7 +339,8 @@ namespace ScriptCanvasEditor if (!m_runtimeDataIsValid) { - AZ_Error("ScriptCanvasBuilder", false, "Runtime information did not build for ScriptCanvas Component using asset: %s", m_scriptCanvasAssetHolder.GetAssetId().ToString().c_str()); + AZ_Error("ScriptCanvasBuilder", false, "Runtime information did not build for ScriptCanvas Component using asset: %s" + , m_sourceHandle.ToString().c_str()); return; } @@ -343,123 +348,53 @@ namespace ScriptCanvasEditor runtimeComponent->TakeRuntimeDataOverrides(ConvertToRuntime(m_variableOverrides)); } - void EditorScriptCanvasComponent::OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) - { - if (m_removedCatalogId == assetId) - { - if (!m_scriptCanvasAssetHolder.GetAssetId().IsValid()) - { - SetPrimaryAsset(assetId); - m_removedCatalogId.SetInvalid(); - } - } - } - void EditorScriptCanvasComponent::OnCatalogAssetRemoved(const AZ::Data::AssetId& removedAssetId, const AZ::Data::AssetInfo& /*assetInfo*/) - { - AZ::Data::AssetId assetId = m_scriptCanvasAssetHolder.GetAssetId(); - if (assetId == removedAssetId) - { - m_removedCatalogId = assetId; - SetPrimaryAsset({}); - } - } - void EditorScriptCanvasComponent::SetPrimaryAsset(const AZ::Data::AssetId& assetId) { - m_scriptCanvasAssetHolder.ClearAsset(); + m_sourceHandle = SourceHandle(nullptr, assetId.m_guid, {}); - if (assetId.IsValid()) + auto completeAsset = CompleteDescription(m_sourceHandle); + if (completeAsset) { - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - - if (memoryAsset) - { - m_scriptCanvasAssetHolder.SetAsset(memoryAsset->GetFileAssetId()); - OnScriptCanvasAssetChanged(memoryAsset->GetFileAssetId()); - SetName(memoryAsset->GetTabName()); - } - else - { - auto scriptCanvasAsset = AZ::Data::AssetManager::Instance().FindAsset(assetId, AZ::Data::AssetLoadBehavior::Default); - if (scriptCanvasAsset) - { - m_scriptCanvasAssetHolder.SetAsset(assetId); - } - } + m_sourceHandle = *completeAsset; } + OnScriptCanvasAssetChanged(m_sourceHandle); + SetName(m_sourceHandle.Path().Filename().Native()); AzToolsFramework::ToolsApplicationEvents::Bus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_AttributesAndValues); } AZ::Data::AssetId EditorScriptCanvasComponent::GetAssetId() const { - return m_scriptCanvasAssetHolder.GetAssetId(); + return m_sourceHandle.Id(); } - AZ::EntityId EditorScriptCanvasComponent::GetGraphEntityId() const + void EditorScriptCanvasComponent::OnScriptCanvasAssetChanged(const SourceHandle& assetId) { - AZ::EntityId scriptCanvasEntityId; - AZ::Data::AssetId assetId = m_scriptCanvasAssetHolder.GetAssetId(); - - if (assetId.IsValid()) - { - AssetTrackerRequestBus::BroadcastResult(scriptCanvasEntityId, &AssetTrackerRequests::GetScriptCanvasId, assetId); - } - - return scriptCanvasEntityId; - } - - void EditorScriptCanvasComponent::OnAssetReady(const ScriptCanvasMemoryAsset::pointer asset) - { - OnScriptCanvasAssetReady(asset); - } - - void EditorScriptCanvasComponent::OnAssetSaved(const ScriptCanvasMemoryAsset::pointer asset, bool isSuccessful) - { - if (isSuccessful) - { - OnScriptCanvasAssetReady(asset); - } - } - - void EditorScriptCanvasComponent::OnAssetReloaded(const ScriptCanvasMemoryAsset::pointer asset) - { - OnScriptCanvasAssetReady(asset); - } - - void EditorScriptCanvasComponent::OnScriptCanvasAssetChanged(AZ::Data::AssetId assetId) - { - AssetTrackerNotificationBus::Handler::BusDisconnect(); ScriptCanvas::GraphIdentifier newIdentifier = GetGraphIdentifier(); - newIdentifier.m_assetId = assetId; + newIdentifier.m_assetId = assetId.Id(); ScriptCanvas::GraphIdentifier oldIdentifier = GetGraphIdentifier(); - oldIdentifier.m_assetId = m_previousAssetId; + oldIdentifier.m_assetId = m_previousHandle.Id(); EditorLoggingComponentNotificationBus::Broadcast(&EditorLoggingComponentNotifications::OnAssetSwitched, GetNamedEntityId(), newIdentifier, oldIdentifier); - m_previousAssetId = m_scriptCanvasAssetHolder.GetAssetId(); + m_previousHandle = m_sourceHandle.Describe(); // Only clear our variables when we are given a new asset id // or when the asset was explicitly set to empty. // // i.e. do not clear variables when we lose the catalog asset. - if ((assetId.IsValid() && assetId != m_removedCatalogId) - || (!assetId.IsValid() && !m_removedCatalogId.IsValid())) + if ((assetId.IsValidDescription() && assetId.Describe() != m_removedHandle.Describe()) + || (!assetId.IsValidDescription() && !m_removedHandle.IsValidDescription())) { ClearVariables(); } - if (assetId.IsValid()) + if (assetId.IsValidDescription()) { - AssetTrackerNotificationBus::Handler::BusConnect(assetId); - - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - if (memoryAsset && memoryAsset->GetAsset().GetStatus() == AZ::Data::AssetData::AssetStatus::Ready) + if (auto loaded = LoadFromFile(assetId.Path().c_str()); loaded.IsSuccess()) { - OnScriptCanvasAssetReady(memoryAsset); + OnScriptCanvasAssetReady(loaded.GetValue()); } } @@ -476,39 +411,49 @@ namespace ScriptCanvasEditor AZ::ScriptSystemRequestBus::Broadcast(&AZ::ScriptSystemRequests::GarbageCollect); } - void EditorScriptCanvasComponent::SetAssetId(const AZ::Data::AssetId& assetId) + void EditorScriptCanvasComponent::SetAssetId(const SourceHandle& assetId) { - if (m_scriptCanvasAssetHolder.GetAssetId() != assetId) + if (m_sourceHandle.Describe() != assetId.Describe()) { // Invalidate the previously removed catalog id if we are setting a new asset id - m_removedCatalogId.SetInvalid(); - SetPrimaryAsset(assetId); + m_removedHandle = {}; + SetPrimaryAsset(assetId.Id()); } } + void EditorScriptCanvasComponent::SourceFileChanged(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid /*fileAssetId*/) + {} + + void EditorScriptCanvasComponent::SourceFileRemoved(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid /*fileAssetId*/) + {} + + void EditorScriptCanvasComponent::SourceFileFailed(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid /*fileAssetId*/) + {} + bool EditorScriptCanvasComponent::HasAssetId() const { - return m_scriptCanvasAssetHolder.GetAssetId().IsValid(); + return !m_sourceHandle.Id().IsNull(); } ScriptCanvas::GraphIdentifier EditorScriptCanvasComponent::GetGraphIdentifier() const { // For now we don't want to deal with disambiguating duplicates of the same script running on one entity. // Should that change we need to add the component id back into this. - return ScriptCanvas::GraphIdentifier(m_scriptCanvasAssetHolder.GetAssetId(), 0); + return ScriptCanvas::GraphIdentifier(m_sourceHandle.Id(), 0); } - void EditorScriptCanvasComponent::OnScriptCanvasAssetReady(const ScriptCanvasMemoryAsset::pointer memoryAsset) + void EditorScriptCanvasComponent::OnScriptCanvasAssetReady(const SourceHandle& sourceHandle) { - if (memoryAsset->GetFileAssetId() == m_scriptCanvasAssetHolder.GetAssetId()) + if (sourceHandle.IsValid()) { - auto assetData = memoryAsset->GetAsset(); - [[maybe_unused]] AZ::Entity* scriptCanvasEntity = assetData->GetScriptCanvasEntity(); - AZ_Assert(scriptCanvasEntity, "This graph must have a valid entity"); BuildGameEntityData(); UpdateName(); AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); } + else + { + // #sc_editor_asset clear or disable something + } } void EditorScriptCanvasComponent::ClearVariables() diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp index 650be01387..9b83acefa5 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp @@ -17,6 +17,7 @@ AZ_POP_DISABLE_WARNING #include #include #include +#include #include #include @@ -30,6 +31,44 @@ AZ_POP_DISABLE_WARNING namespace ScriptCanvasEditor { + AZStd::optional CompleteDescription(const SourceHandle& source) + { + if (source.IsValidDescription()) + { + return source.Describe(); + } + + AZStd::string watchFolder; + AZ::Data::AssetInfo assetInfo; + bool sourceInfoFound{}; + + if (!source.Id().IsNull()) + { + AzToolsFramework::AssetSystemRequestBus::BroadcastResult + ( sourceInfoFound + , &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourceUUID, source.Id(), assetInfo, watchFolder); + + if (sourceInfoFound && !assetInfo.m_relativePath.empty()) + { + return SourceHandle(nullptr, assetInfo.m_assetId.m_guid, assetInfo.m_relativePath); + } + } + + if (!source.Path().empty()) + { + AzToolsFramework::AssetSystemRequestBus::BroadcastResult + ( sourceInfoFound + , &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, source.Path().c_str(), assetInfo, watchFolder); + + if (sourceInfoFound && assetInfo.m_assetId.IsValid()) + { + return SourceHandle(nullptr, assetInfo.m_assetId.m_guid, assetInfo.m_relativePath); + } + } + + return AZStd::nullopt; + } + ////////////////////////// // NodeIdentifierFactory ////////////////////////// diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h index b55e425d43..b1fd291a1b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h @@ -72,7 +72,7 @@ namespace ScriptCanvasEditor static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; using BusIdType = AZ::EntityId; - virtual void SetAssetId(const AZ::Data::AssetId& assetId) = 0; + virtual void SetAssetId(const SourceHandle& assetId) = 0; virtual bool HasAssetId() const = 0; }; @@ -91,32 +91,7 @@ namespace ScriptCanvasEditor }; using EditorContextMenuRequestBus = AZ::EBus; - - class EditorScriptCanvasAssetNotifications : public AZ::EBusTraits - { - public: - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - using BusIdType = AZ::Data::AssetId; - - //! Notification which fires after an EditorGraph has received it's on AssetReady callback - //! \param scriptCanvasAsset Script Canvas asset which is now ready for use in the Editor - virtual void OnScriptCanvasAssetReady(const AZ::Data::Asset& /*scriptCanvasAsset*/) {}; - - //! Notification which fires after an EditorGraph has received it's on AssetReloaded callback - //! \param scriptCanvasAsset Script Canvas asset which is now ready for use in the Editor - virtual void OnScriptCanvasAssetReloaded(const AZ::Data::Asset& /*scriptCanvaAsset */) {}; - - //! Notification which fires after an EditorGraph has received it's on AssetReady callback - //! \param AssetId AssetId of unloaded ScriptCanvas - virtual void OnScriptCanvasAssetUnloaded(const AZ::Data::AssetId& /*assetId*/) {}; - - //! Notification which fires after an EditorGraph has received an onAssetSaved callback - //! \param scriptCanvasAsset Script Canvas asset which was attempted to be saved - //! \param isSuccessful specified where the Script Canvas asset was successfully saved - virtual void OnScriptCanvasAssetSaved(const AZ::Data::AssetId) {}; - }; - using EditorScriptCanvasAssetNotificationBus = AZ::EBus; - + class EditorGraphRequests : public AZ::EBusTraits { public: diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 1bdb4ccb85..38a84bc75e 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -17,6 +17,7 @@ #include #include #include +#include namespace ScriptCanvasEditor { @@ -34,10 +35,9 @@ namespace ScriptCanvasEditor : public AzToolsFramework::Components::EditorComponentBase , private EditorContextMenuRequestBus::Handler , private AzFramework::AssetCatalogEventBus::Handler + , private AzToolsFramework::AssetSystemBus::Handler , private EditorScriptCanvasComponentLoggingBus::Handler , private EditorScriptCanvasComponentRequestBus::Handler - , private AssetTrackerNotificationBus::Handler - , private AzToolsFramework::AssetSystemBus::Handler , private AzToolsFramework::EditorEntityContextNotificationBus::Handler { @@ -46,7 +46,7 @@ namespace ScriptCanvasEditor EditorScriptCanvasComponent(); // EditorScriptCanvasComponent(AZ::Data::Asset asset); - EditorScriptCanvasComponent(AZ::Data::Asset asset); + EditorScriptCanvasComponent(const SourceHandle& sourceHandle); ~EditorScriptCanvasComponent() override; //===================================================================== @@ -70,14 +70,14 @@ namespace ScriptCanvasEditor void OpenEditor(); - void SetName(const AZStd::string& name) { m_name = name; } + void SetName(AZStd::string_view name) { m_name = name; } const AZStd::string& GetName() const; AZ::EntityId GetEditorEntityId() const { return GetEntity() ? GetEntityId() : AZ::EntityId(); } AZ::NamedEntityId GetNamedEditorEntityId() const { return GetEntity() ? GetNamedEntityId() : AZ::NamedEntityId(); } //===================================================================== // EditorScriptCanvasComponentRequestBus - void SetAssetId(const AZ::Data::AssetId& assetId) override; + void SetAssetId(const SourceHandle& assetId) override; bool HasAssetId() const override; //===================================================================== @@ -85,13 +85,12 @@ namespace ScriptCanvasEditor // EditorContextMenuRequestBus AZ::Data::AssetId GetAssetId() const override; //===================================================================== - AZ::EntityId GetGraphEntityId() const; - + //===================================================================== // AssetTrackerNotificationBus - void OnAssetReady(const ScriptCanvasMemoryAsset::pointer asset) override; - void OnAssetSaved(const ScriptCanvasMemoryAsset::pointer asset, bool isSuccessful) override; - void OnAssetReloaded(const ScriptCanvasMemoryAsset::pointer asset) override; + void OnAssetReady(const ScriptCanvasMemoryAsset::pointer asset) ; + void OnAssetSaved(const ScriptCanvasMemoryAsset::pointer asset, bool isSuccessful) ; + void OnAssetReloaded(const ScriptCanvasMemoryAsset::pointer asset) ; //===================================================================== @@ -119,25 +118,30 @@ namespace ScriptCanvasEditor (void)incompatible; } - void OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) override; - void OnCatalogAssetRemoved(const AZ::Data::AssetId& assetId, const AZ::Data::AssetInfo& assetInfo) override; - void OnScriptCanvasAssetChanged(AZ::Data::AssetId assetId); + // complete the id, load call OnScriptCanvasAssetChanged + void SourceFileChanged(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; + + // update the display icon for failure, save the values in the graph + void SourceFileRemoved(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; + void SourceFileFailed(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; + + void OnScriptCanvasAssetChanged(const SourceHandle& sourceHandle); void UpdateName(); //===================================================================== - void OnScriptCanvasAssetReady(const ScriptCanvasMemoryAsset::pointer asset); + void OnScriptCanvasAssetReady(const SourceHandle& sourceHandle); //===================================================================== void BuildGameEntityData(); void ClearVariables(); private: - AZ::Data::AssetId m_removedCatalogId; - AZ::Data::AssetId m_previousAssetId; AZStd::string m_name; - ScriptCanvasAssetHolder m_scriptCanvasAssetHolder; bool m_runtimeDataIsValid = false; ScriptCanvasBuilder::BuildVariableOverrides m_variableOverrides; + SourceHandle m_sourceHandle; + SourceHandle m_previousHandle; + SourceHandle m_removedHandle; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h index 15100cbf4e..7685133ca4 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h @@ -21,6 +21,8 @@ namespace GraphCanvas namespace ScriptCanvasEditor { + AZStd::optional CompleteDescription(const SourceHandle& source); + class Graph; class NodePaletteModel; diff --git a/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp b/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp index a75671d0f8..7f2a170a4d 100644 --- a/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp @@ -31,6 +31,7 @@ namespace ScriptCanvasEditor { void ReflectComponent::Reflect(AZ::ReflectContext* context) { + SourceHandle::Reflect(context); ScriptCanvas::ScriptCanvasData::Reflect(context); ScriptCanvasAssetHolder::Reflect(context); EditorSettings::EditorWorkspace::Reflect(context); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index a53100eea8..ce4ee7638f 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1946,7 +1946,7 @@ namespace ScriptCanvasEditor { if (auto firstRequestBus = EditorScriptCanvasComponentRequestBus::FindFirstHandler(entity->GetId())) { - firstRequestBus->SetAssetId(memoryAsset.Id()); + firstRequestBus->SetAssetId(memoryAsset.Describe()); } } else @@ -1955,7 +1955,7 @@ namespace ScriptCanvasEditor { if (editorComponent->GetAssetId() == oldId) { - editorComponent->SetAssetId(memoryAsset.Id()); + editorComponent->SetAssetId(memoryAsset.Describe()); break; } } @@ -4379,15 +4379,7 @@ namespace ScriptCanvasEditor if (usableRequestBus) { - ScriptCanvasMemoryAsset::pointer memoryAsset; - // #sc_editor_asset - // AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); - - if (memoryAsset) - { - // We need to assign the AssetId for the file asset, not the in-memory asset - usableRequestBus->SetAssetId(memoryAsset->GetFileAssetId()); - } + usableRequestBus->SetAssetId(m_activeGraph.Describe()); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index de96c9953b..ae85dbc6a9 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -6,6 +6,7 @@ * */ + #include #include #include @@ -14,9 +15,8 @@ #include #include -#include "Core.h" #include "Attributes.h" - +#include "Core.h" #include namespace ScriptCanvas @@ -238,6 +238,11 @@ namespace ScriptCanvasEditor return m_data != nullptr; } + bool SourceHandle::IsValidDescription() const + { + return !m_id.IsNull() && !m_path.empty(); + } + GraphPtr SourceHandle::Mod() const { return m_data ? m_data->ModEditorGraph() : nullptr; @@ -265,6 +270,30 @@ namespace ScriptCanvasEditor return m_path == other.m_path; } + void SourceHandle::Reflect(AZ::ReflectContext* context) + { + if (auto serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0) + ->Field("id", &SourceHandle::m_id) + ->Field("path", &SourceHandle::m_path) + ; + + if (AZ::EditContext* editContext = serializeContext->GetEditContext()) + { + editContext->Class("Script Canvas Source Handle", "References a source editor file") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::Category, "Scripting") + ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/ScriptCanvas.svg") + ->Attribute(AZ::Edit::Attributes::ViewportIcon, "Icons/ScriptCanvas/Viewport/ScriptCanvas.svg") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->DataElement(AZ::Edit::UIHandlers::Default, &SourceHandle::m_path); + ; + } + } + } + AZStd::string SourceHandle::ToString() const { return AZStd::string::format diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index a57d2dc3a1..d514683b55 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -325,6 +325,8 @@ namespace ScriptCanvasEditor AZ_TYPE_INFO(SourceHandle, "{65855A98-AE2F-427F-BFC8-69D45265E312}"); AZ_CLASS_ALLOCATOR(SourceHandle, AZ::SystemAllocator, 0); + static void Reflect(AZ::ReflectContext* context); + SourceHandle() = default; SourceHandle(const SourceHandle& data, const AZ::Uuid& id, const AZ::IO::Path& path); @@ -344,6 +346,8 @@ namespace ScriptCanvasEditor bool IsValid() const; + bool IsValidDescription() const; + GraphPtr Mod() const; bool operator==(const SourceHandle& other) const; @@ -372,8 +376,8 @@ namespace ScriptCanvas AZ_RTTI(ScriptCanvasData, "{1072E894-0C67-4091-8B64-F7DB324AD13C}"); AZ_CLASS_ALLOCATOR(ScriptCanvasData, AZ::SystemAllocator, 0); - ScriptCanvasData() {} - virtual ~ScriptCanvasData() {} + ScriptCanvasData() = default; + virtual ~ScriptCanvasData() = default; ScriptCanvasData(ScriptCanvasData&& other); ScriptCanvasData& operator=(ScriptCanvasData&& other); diff --git a/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/Tests/$tmp29198_Test_LY_79396.scriptcanvas b/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/Tests/$tmp29198_Test_LY_79396.scriptcanvas new file mode 100644 index 0000000000..278d74c28d --- /dev/null +++ b/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/Tests/$tmp29198_Test_LY_79396.scriptcanvas @@ -0,0 +1,69 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 32884619828465 + }, + "Name": "Script Canvas Graph", + "Components": { + "Component_[14322649685925277086]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 14322649685925277086, + "m_variableData": { + "m_nameVariableMap": [ + { + "Key": { + "m_id": "{142C0457-38E5-496E-A4F2-67E91852CBCB}" + }, + "Value": { + "Datum": { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{5CBE5640-DF5C-5A49-9195-D790881A0747}" + }, + "isNullPointer": false, + "$type": "{5CBE5640-DF5C-5A49-9195-D790881A0747} AZStd::vector", + "value": [ + [ + 0.0, + 0.0, + -498814079205376.0, + 0.0 + ], + [ + 0.0, + 0.0, + 1.1865528051967005e38, + 0.0 + ] + ], + "label": "Variable 7" + }, + "VariableId": { + "m_id": "{142C0457-38E5-496E-A4F2-67E91852CBCB}" + }, + "VariableName": "Variable 7" + } + }, + { + "Key": { + "m_id": "{21DD2B3D-ADC9-46E1-B44C-965A6E2AE543}" + }, + "Value": { + "Datum": { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{9ABF5933-C8FC-53CD-A518-B6AF433CF496}" + }, + "isNullPointer": false, + "$type": "{9ABF5933-C8FC-53CD-A518-B6AF433CF496} AZStd::unordered_map", + "value": [ + { + "Key": true, + "Value": { + "roll": \ No newline at end of file From 3f6824571f120ebadb840c4c74236ef5d48a7abe Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 09:07:31 -0600 Subject: [PATCH 047/399] Added regular expression filter for asset browser entries. Signed-off-by: Chris Galvan --- .../AssetBrowser/Search/Filter.cpp | 34 +++++++++++++++++++ .../AssetBrowser/Search/Filter.h | 22 ++++++++++++ 2 files changed, 56 insertions(+) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.cpp index 3f267dedd0..d617638632 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.cpp @@ -251,6 +251,40 @@ namespace AzToolsFramework return false; } + ////////////////////////////////////////////////////////////////////////// + // RegExpFilter + ////////////////////////////////////////////////////////////////////////// + RegExpFilter::RegExpFilter() + : m_filterPattern("") + { + } + + void RegExpFilter::SetFilterPattern(const QString& filterPattern) + { + m_filterPattern = filterPattern; + Q_EMIT updatedSignal(); + } + + QString RegExpFilter::GetNameInternal() const + { + return m_filterPattern; + } + + bool RegExpFilter::MatchInternal(const AssetBrowserEntry* entry) const + { + // no filter pattern matches any asset + if (m_filterPattern.isEmpty()) + { + return true; + } + + // entry's name matches regular expression pattern + QRegExp regExp(m_filterPattern); + regExp.setPatternSyntax(QRegExp::Wildcard); + + return regExp.exactMatch(entry->GetDisplayName()); + } + ////////////////////////////////////////////////////////////////////////// // AssetTypeFilter ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.h index 5819ae92d7..94f47e0599 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.h @@ -115,6 +115,28 @@ namespace AzToolsFramework QString m_filterString; }; + ////////////////////////////////////////////////////////////////////////// + // RegExpFilter + ////////////////////////////////////////////////////////////////////////// + //! RegExpFilter filters assets based on a regular expression pattern + class RegExpFilter + : public AssetBrowserEntryFilter + { + Q_OBJECT + public: + RegExpFilter(); + ~RegExpFilter() override = default; + + void SetFilterPattern(const QString& filterPattern); + + protected: + QString GetNameInternal() const override; + bool MatchInternal(const AssetBrowserEntry* entry) const override; + + private: + QString m_filterPattern; + }; + ////////////////////////////////////////////////////////////////////////// // AssetTypeFilter ////////////////////////////////////////////////////////////////////////// From 231aaa5bf59fddd001e085fb5674c23648b4bd95 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 14:48:12 -0600 Subject: [PATCH 048/399] Added asset selection model option for a source asset type based on regex. Signed-off-by: Chris Galvan --- .../AssetBrowser/AssetSelectionModel.cpp | 69 ++++++++++++++++--- .../AssetBrowser/AssetSelectionModel.h | 11 ++- 2 files changed, 70 insertions(+), 10 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.cpp index 3547cf57b3..2fbdcaf40b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.cpp @@ -10,18 +10,24 @@ #include #include +#if !defined(Q_MOC_RUN) +AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") +#include +AZ_POP_DISABLE_WARNING +#endif + namespace AzToolsFramework { namespace AssetBrowser { namespace { - FilterConstType ProductsNoFoldersFilter() + FilterConstType EntryTypeNoFoldersFilter(AssetBrowserEntry::AssetEntryType entryType = AssetBrowserEntry::AssetEntryType::Product) { - EntryTypeFilter* productFilter = new EntryTypeFilter(); - productFilter->SetEntryType(AssetBrowserEntry::AssetEntryType::Product); + EntryTypeFilter* entryTypeFilter = new EntryTypeFilter(); + entryTypeFilter->SetEntryType(entryType); // in case entry is a source or folder, it may still contain relevant product - productFilter->SetFilterPropagation(AssetBrowserEntryFilter::PropagateDirection::Down); + entryTypeFilter->SetFilterPropagation(AssetBrowserEntryFilter::PropagateDirection::Down); EntryTypeFilter* foldersFilter = new EntryTypeFilter(); foldersFilter->SetEntryType(AssetBrowserEntry::AssetEntryType::Folder); @@ -30,7 +36,7 @@ namespace AzToolsFramework noFoldersFilter->SetFilter(FilterConstType(foldersFilter)); CompositeFilter* compFilter = new CompositeFilter(CompositeFilter::LogicOperatorType::AND); - compFilter->AddFilter(FilterConstType(productFilter)); + compFilter->AddFilter(FilterConstType(entryTypeFilter)); compFilter->AddFilter(FilterConstType(noFoldersFilter)); return FilterConstType(compFilter); @@ -79,15 +85,39 @@ namespace AzToolsFramework void AssetSelectionModel::SetSelectedAssetIds(const AZStd::vector& selectedAssetIds) { + m_selectedFilePaths.clear(); + m_selectedAssetIds = selectedAssetIds; } void AssetSelectionModel::SetSelectedAssetId(const AZ::Data::AssetId& selectedAssetId) { + m_selectedFilePaths.clear(); + m_selectedAssetIds.clear(); m_selectedAssetIds.push_back(selectedAssetId); } + const AZStd::vector& AssetSelectionModel::GetSelectedFilePaths() const + { + return m_selectedFilePaths; + } + + void AssetSelectionModel::SetSelectedFilePaths(const AZStd::vector& selectedFilePaths) + { + m_selectedAssetIds.clear(); + + m_selectedFilePaths = selectedFilePaths; + } + + void AssetSelectionModel::SetSelectedFilePath(const AZStd::string& selectedFilePath) + { + m_selectedAssetIds.clear(); + + m_selectedFilePaths.clear(); + m_selectedFilePaths.push_back(selectedFilePath); + } + void AssetSelectionModel::SetDefaultDirectory(AZStd::string_view defaultDirectory) { m_defaultDirectory = defaultDirectory; @@ -136,7 +166,7 @@ namespace AzToolsFramework CompositeFilter* compFilter = new CompositeFilter(CompositeFilter::LogicOperatorType::AND); compFilter->AddFilter(assetTypeFilterPtr); - compFilter->AddFilter(ProductsNoFoldersFilter()); + compFilter->AddFilter(EntryTypeNoFoldersFilter()); selection.SetSelectionFilter(FilterConstType(compFilter)); selection.SetMultiselect(multiselect); @@ -169,7 +199,7 @@ namespace AzToolsFramework CompositeFilter* compFilter = new CompositeFilter(CompositeFilter::LogicOperatorType::AND); compFilter->AddFilter(anyAssetTypeFilterPtr); - compFilter->AddFilter(ProductsNoFoldersFilter()); + compFilter->AddFilter(EntryTypeNoFoldersFilter()); selection.SetSelectionFilter(FilterConstType(compFilter)); selection.SetMultiselect(multiselect); @@ -190,7 +220,28 @@ namespace AzToolsFramework CompositeFilter* compFilter = new CompositeFilter(CompositeFilter::LogicOperatorType::AND); compFilter->AddFilter(assetGroupFilterPtr); - compFilter->AddFilter(ProductsNoFoldersFilter()); + compFilter->AddFilter(EntryTypeNoFoldersFilter()); + + selection.SetSelectionFilter(FilterConstType(compFilter)); + selection.SetMultiselect(multiselect); + + return selection; + } + + AssetSelectionModel AssetSelectionModel::SourceAssetTypeSelection(const QString& pattern, bool multiselect) + { + AssetSelectionModel selection; + + RegExpFilter* patternFilter = new RegExpFilter(); + patternFilter->SetFilterPattern(pattern); + patternFilter->SetFilterPropagation(AssetBrowserEntryFilter::PropagateDirection::Down); + auto patternFilterPtr = FilterConstType(patternFilter); + + selection.SetDisplayFilter(patternFilterPtr); + + CompositeFilter* compFilter = new CompositeFilter(CompositeFilter::LogicOperatorType::AND); + compFilter->AddFilter(patternFilterPtr); + compFilter->AddFilter(EntryTypeNoFoldersFilter(AssetBrowserEntry::AssetEntryType::Source)); selection.SetSelectionFilter(FilterConstType(compFilter)); selection.SetMultiselect(multiselect); @@ -204,7 +255,7 @@ namespace AzToolsFramework CompositeFilter* compFilter = new CompositeFilter(CompositeFilter::LogicOperatorType::OR); selection.SetDisplayFilter(FilterConstType(compFilter)); - selection.SetSelectionFilter(ProductsNoFoldersFilter()); + selection.SetSelectionFilter(EntryTypeNoFoldersFilter()); selection.SetMultiselect(multiselect); return selection; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.h index 4036c166ac..241c896123 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.h @@ -44,6 +44,10 @@ namespace AzToolsFramework void SetSelectedAssetIds(const AZStd::vector& selectedAssetIds); void SetSelectedAssetId(const AZ::Data::AssetId& selectedAssetId); + const AZStd::vector& GetSelectedFilePaths() const; + void SetSelectedFilePaths(const AZStd::vector& selectedFilePaths); + void SetSelectedFilePath(const AZStd::string& selectedFilePath); + void SetDefaultDirectory(AZStd::string_view defaultDirectory); AZStd::string_view GetDefaultDirectory() const; @@ -60,6 +64,7 @@ namespace AzToolsFramework static AssetSelectionModel AssetTypeSelection(const char* assetTypeName, bool multiselect = false); static AssetSelectionModel AssetTypesSelection(const AZStd::vector& assetTypes, bool multiselect = false); static AssetSelectionModel AssetGroupSelection(const char* group, bool multiselect = false); + static AssetSelectionModel SourceAssetTypeSelection(const QString& pattern, bool multiselect = false); static AssetSelectionModel EverythingSelection(bool multiselect = false); private: @@ -68,8 +73,12 @@ namespace AzToolsFramework // some entries like folder should always be displayed, but not always selectable, thus 2 separate filters FilterConstType m_selectionFilter; FilterConstType m_displayFilter; - + + //! Selection can be based on asset ids (for products), or file paths (for sources) + //! These are mututally exclusive AZStd::vector m_selectedAssetIds; + AZStd::vector m_selectedFilePaths; + AZStd::vector m_results; AZStd::string m_defaultDirectory; From d9ee02fddfb382e04ed546dbd76fc17dc89c0fa9 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 14:48:56 -0600 Subject: [PATCH 049/399] Added method to AssetCompleterModel for specifying a filter directly. Signed-off-by: Chris Galvan --- .../UI/PropertyEditor/Model/AssetCompleterModel.cpp | 7 ++++++- .../UI/PropertyEditor/Model/AssetCompleterModel.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp index 3e5b41ebeb..81f0cb36af 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp @@ -39,7 +39,12 @@ namespace AzToolsFramework typeFilter->SetAssetType(filterType); typeFilter->SetFilterPropagation(AssetBrowserEntryFilter::PropagateDirection::Down); - m_assetBrowserFilterModel->SetFilter(FilterConstType(typeFilter)); + SetFilter(FilterConstType(typeFilter)); + } + + void AssetCompleterModel::SetFilter(FilterConstType filter) + { + m_assetBrowserFilterModel->SetFilter(filter); RefreshAssetList(); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h index 55a6db8589..03660e8fa9 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h @@ -32,6 +32,7 @@ namespace AzToolsFramework QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; void SetFilter(AZ::Data::AssetType filterType); + void SetFilter(FilterConstType filter); void RefreshAssetList(); void SearchStringHighlight(QString searchString); From 42382cd8d16811fe5c9055a5f24ab5325c898984 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 14:49:56 -0600 Subject: [PATCH 050/399] Added logic to AssetPickerDialog to pre-select by file paths. Signed-off-by: Chris Galvan --- .../AssetBrowser/AssetPicker/AssetPickerDialog.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetPicker/AssetPickerDialog.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetPicker/AssetPickerDialog.cpp index eae8ec2a1e..4e3b8ee745 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetPicker/AssetPickerDialog.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetPicker/AssetPickerDialog.cpp @@ -99,6 +99,18 @@ namespace AzToolsFramework } } + if (selection.GetSelectedAssetIds().empty()) + { + for (auto& filePath : selection.GetSelectedFilePaths()) + { + if (!filePath.empty()) + { + selectedAsset = true; + m_ui->m_assetBrowserTreeViewWidget->SelectFileAtPath(filePath); + } + } + } + if (!selectedAsset) { m_ui->m_assetBrowserTreeViewWidget->SelectFolder(selection.GetDefaultDirectory()); From b4407e504407d3ea0491252eb8a455efd888f333 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 14:51:41 -0600 Subject: [PATCH 051/399] Made PropertyAssetCtrl more extensible. Signed-off-by: Chris Galvan --- .../UI/PropertyEditor/PropertyAssetCtrl.cpp | 11 ++++++++--- .../UI/PropertyEditor/PropertyAssetCtrl.hxx | 5 +++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp index 384b384a23..16270ac8c7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp @@ -1288,7 +1288,7 @@ namespace AzToolsFramework return newCtrl; } - void AssetPropertyHandlerDefault::ConsumeAttribute(PropertyAssetCtrl* GUI, AZ::u32 attrib, PropertyAttributeReader* attrValue, const char* debugName) + void AssetPropertyHandlerDefault::ConsumeAttributeInternal(PropertyAssetCtrl* GUI, AZ::u32 attrib, PropertyAttributeReader* attrValue, const char* debugName) { (void)debugName; @@ -1487,6 +1487,11 @@ namespace AzToolsFramework } } + void AssetPropertyHandlerDefault::ConsumeAttribute(PropertyAssetCtrl* GUI, AZ::u32 attrib, PropertyAttributeReader* attrValue, const char* debugName) + { + ConsumeAttributeInternal(GUI, attrib, attrValue, debugName); + } + void AssetPropertyHandlerDefault::WriteGUIValuesIntoProperty(size_t index, PropertyAssetCtrl* GUI, property_t& instance, InstanceDataNode* node) { (void)index; @@ -1629,8 +1634,8 @@ namespace AzToolsFramework void RegisterAssetPropertyHandler() { - EBUS_EVENT(PropertyTypeRegistrationMessages::Bus, RegisterPropertyType, aznew AssetPropertyHandlerDefault()); - EBUS_EVENT(PropertyTypeRegistrationMessages::Bus, RegisterPropertyType, aznew SimpleAssetPropertyHandlerDefault()); + PropertyTypeRegistrationMessages::Bus::Broadcast(&PropertyTypeRegistrationMessages::RegisterPropertyType, aznew AssetPropertyHandlerDefault()); + PropertyTypeRegistrationMessages::Bus::Broadcast(&PropertyTypeRegistrationMessages::RegisterPropertyType, aznew SimpleAssetPropertyHandlerDefault()); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx index 58ddbb967e..403725a429 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx @@ -235,7 +235,7 @@ namespace AzToolsFramework void SetSelectedAssetID(const AZ::Data::AssetId& newID, const AZ::Data::AssetType& newType); void SetCurrentAssetHint(const AZStd::string& hint); void SetDefaultAssetID(const AZ::Data::AssetId& defaultID); - void PopupAssetPicker(); + virtual void PopupAssetPicker(); void OnClearButtonClicked(); void UpdateAssetDisplay(); void OnLineEditFocus(bool focus); @@ -270,7 +270,8 @@ namespace AzToolsFramework virtual void UpdateWidgetInternalTabbing(PropertyAssetCtrl* widget) override { widget->UpdateTabOrder(); } virtual QWidget* CreateGUI(QWidget* pParent) override; - virtual void ConsumeAttribute(PropertyAssetCtrl* GUI, AZ::u32 attrib, PropertyAttributeReader* attrValue, const char* debugName) override; + static void ConsumeAttributeInternal(PropertyAssetCtrl* GUI, AZ::u32 attrib, PropertyAttributeReader* attrValue, const char* debugName); + void ConsumeAttribute(PropertyAssetCtrl* GUI, AZ::u32 attrib, PropertyAttributeReader* attrValue, const char* debugName) override; virtual void WriteGUIValuesIntoProperty(size_t index, PropertyAssetCtrl* GUI, property_t& instance, InstanceDataNode* node) override; virtual bool ReadValuesIntoGUI(size_t index, PropertyAssetCtrl* GUI, const property_t& instance, InstanceDataNode* node) override; }; From befd84cf0bb51a6f75278f6b64e464e3092a3cf6 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 14:52:45 -0600 Subject: [PATCH 052/399] Added property handler for SourceHandle type. Signed-off-by: Chris Galvan --- .../Serialization/EditContextConstants.inl | 2 + .../Code/Editor/SystemComponent.cpp | 2 + .../Widgets/SourceHandlePropertyAssetCtrl.cpp | 138 ++++++++++++++++++ .../Widgets/SourceHandlePropertyAssetCtrl.h | 67 +++++++++ .../Code/scriptcanvasgem_editor_files.cmake | 2 + 5 files changed, 211 insertions(+) create mode 100644 Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp create mode 100644 Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h diff --git a/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl b/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl index 4f8c67f058..27f27dd6dd 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl +++ b/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl @@ -133,6 +133,8 @@ namespace AZ const static AZ::Crc32 AllowClearAsset = AZ_CRC("AllowClearAsset", 0x24827182); // Show the name of the asset that was produced from the source asset const static AZ::Crc32 ShowProductAssetFileName = AZ_CRC("ShowProductAssetFileName"); + //! Regular expression pattern filter for source files + const static AZ::Crc32 SourceAssetFilterPattern = AZ_CRC_CE("SourceAssetFilterPattern"); //! Component icon attributes const static AZ::Crc32 Icon = AZ_CRC("Icon", 0x659429db); diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index ab8cd0e61b..3566d8da4b 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -119,6 +120,7 @@ namespace ScriptCanvasEditor PopulateEditorCreatableTypes(); AzToolsFramework::RegisterGenericComboBoxHandler(); + AzToolsFramework::PropertyTypeRegistrationMessages::Bus::Broadcast(&AzToolsFramework::PropertyTypeRegistrationMessages::RegisterPropertyType, aznew SourceHandlePropertyHandler()); SystemRequestBus::Handler::BusConnect(); ScriptCanvasExecutionBus::Handler::BusConnect(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp new file mode 100644 index 0000000000..66b9b77bdf --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp @@ -0,0 +1,138 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +#include + +#include +#include +#include + +namespace ScriptCanvasEditor +{ + SourceHandlePropertyAssetCtrl::SourceHandlePropertyAssetCtrl(QWidget* parent) + : AzToolsFramework::PropertyAssetCtrl(parent) + { + } + + AzToolsFramework::AssetBrowser::AssetSelectionModel SourceHandlePropertyAssetCtrl::GetAssetSelectionModel() + { + auto selectionModel = AssetSelectionModel::SourceAssetTypeSelection(m_sourceAssetFilterPattern); + selectionModel.SetTitle(m_title); + return selectionModel; + } + + void SourceHandlePropertyAssetCtrl::PopupAssetPicker() + { + // Request the AssetBrowser Dialog and set a type filter + AssetSelectionModel selection = GetAssetSelectionModel(); + selection.SetSelectedFilePath(m_selectedSourcePath.c_str()); + + AZStd::string defaultDirectory; + if (m_defaultDirectoryCallback) + { + m_defaultDirectoryCallback->Invoke(m_editNotifyTarget, defaultDirectory); + selection.SetDefaultDirectory(defaultDirectory); + } + + AssetBrowserComponentRequestBus::Broadcast(&AssetBrowserComponentRequests::PickAssets, selection, parentWidget()); + if (selection.IsValid()) + { + const auto source = azrtti_cast(selection.GetResult()); + AZ_Assert(source, "Incorrect entry type selected. Expected source."); + if (source) + { + SetSelectedSourcePath(source->GetFullPath()); + } + } + } + + void SourceHandlePropertyAssetCtrl::ClearAssetInternal() + { + SetSelectedSourcePath(""); + + PropertyAssetCtrl::ClearAssetInternal(); + } + + void SourceHandlePropertyAssetCtrl::SetSourceAssetFilterPattern(const QString& filterPattern) + { + m_sourceAssetFilterPattern = filterPattern; + } + + AZ::IO::Path SourceHandlePropertyAssetCtrl::GetSelectedSourcePath() const + { + return m_selectedSourcePath; + } + + void SourceHandlePropertyAssetCtrl::SetSelectedSourcePath(const AZ::IO::Path& sourcePath) + { + m_selectedSourcePath = sourcePath; + + AZStd::string displayText; + if (!sourcePath.empty()) + { + AzFramework::StringFunc::Path::GetFileName(sourcePath.c_str(), displayText); + } + m_browseEdit->setText(displayText.c_str()); + + // The AssetID gets ignored, the only important bit is triggering the change for the RequestWrite + emit OnAssetIDChanged(AZ::Data::AssetId()); + } + + QWidget* SourceHandlePropertyHandler::CreateGUI(QWidget* pParent) + { + SourceHandlePropertyAssetCtrl* newCtrl = aznew SourceHandlePropertyAssetCtrl(pParent); + connect(newCtrl, &SourceHandlePropertyAssetCtrl::OnAssetIDChanged, this, [newCtrl](AZ::Data::AssetId newAssetID) + { + (void)newAssetID; + AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::RequestWrite, newCtrl); + AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::OnEditingFinished, newCtrl); + }); + return newCtrl; + } + + void SourceHandlePropertyHandler::ConsumeAttribute(SourceHandlePropertyAssetCtrl* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) + { + // Let the AssetPropertyHandlerDefault handle all of the common attributes + AzToolsFramework::AssetPropertyHandlerDefault::ConsumeAttributeInternal(GUI, attrib, attrValue, debugName); + + if (attrib == AZ::Edit::Attributes::SourceAssetFilterPattern) + { + AZStd::string filterPattern; + if (attrValue->Read(filterPattern)) + { + GUI->SetSourceAssetFilterPattern(filterPattern.c_str()); + } + } + } + + void SourceHandlePropertyHandler::WriteGUIValuesIntoProperty(size_t index, SourceHandlePropertyAssetCtrl* GUI, property_t& instance, AzToolsFramework::InstanceDataNode* node) + { + (void)index; + (void)node; + + auto sourceHandle = SourceHandle(nullptr, {}, GUI->GetSelectedSourcePath()); + instance = property_t(*CompleteDescription(sourceHandle)); + } + + bool SourceHandlePropertyHandler::ReadValuesIntoGUI(size_t index, SourceHandlePropertyAssetCtrl* GUI, const property_t& instance, AzToolsFramework::InstanceDataNode* node) + { + (void)index; + (void)node; + + GUI->blockSignals(true); + + GUI->SetSelectedSourcePath(instance.Path()); + GUI->SetEditNotifyTarget(node->GetParent()->GetInstance(0)); + + GUI->blockSignals(false); + return false; + } +} diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h new file mode 100644 index 0000000000..31a62aacfb --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#if !defined(Q_MOC_RUN) +#include + +#include +#endif + +namespace ScriptCanvasEditor +{ + class SourceHandlePropertyAssetCtrl + : public AzToolsFramework::PropertyAssetCtrl + { + Q_OBJECT + + public: + AZ_CLASS_ALLOCATOR(SourceHandlePropertyAssetCtrl, AZ::SystemAllocator, 0); + + SourceHandlePropertyAssetCtrl(QWidget* parent = nullptr); + + AzToolsFramework::AssetBrowser::AssetSelectionModel GetAssetSelectionModel() override; + void PopupAssetPicker() override; + void ClearAssetInternal() override; + + void SetSourceAssetFilterPattern(const QString& filterPattern); + + AZ::IO::Path GetSelectedSourcePath() const; + void SetSelectedSourcePath(const AZ::IO::Path& sourcePath); + + private: + //! A regular expression pattern for filtering by source assets + //! If this is set, the PropertyAssetCtrl will be dealing with source assets + //! instead of a specific asset type + QString m_sourceAssetFilterPattern; + + AZ::IO::Path m_selectedSourcePath; + }; + + class SourceHandlePropertyHandler + : QObject + , public AzToolsFramework::PropertyHandler + { + Q_OBJECT + + public: + AZ_CLASS_ALLOCATOR(SourceHandlePropertyHandler, AZ::SystemAllocator, 0); + + AZ::u32 GetHandlerName(void) const override { return AZ_CRC_CE("SourceHandle"); } + bool IsDefaultHandler() const override { return true; } + QWidget* GetFirstInTabOrder(SourceHandlePropertyAssetCtrl* widget) override { return widget->GetFirstInTabOrder(); } + QWidget* GetLastInTabOrder(SourceHandlePropertyAssetCtrl* widget) override { return widget->GetLastInTabOrder(); } + void UpdateWidgetInternalTabbing(SourceHandlePropertyAssetCtrl* widget) override { widget->UpdateTabOrder(); } + + QWidget* CreateGUI(QWidget* pParent) override; + void ConsumeAttribute(SourceHandlePropertyAssetCtrl* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) override; + void WriteGUIValuesIntoProperty(size_t index, SourceHandlePropertyAssetCtrl* GUI, property_t& instance, AzToolsFramework::InstanceDataNode* node) override; + bool ReadValuesIntoGUI(size_t index, SourceHandlePropertyAssetCtrl* GUI, const property_t& instance, AzToolsFramework::InstanceDataNode* node) override; + }; +} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index 49f89d8e48..7f269e2081 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -182,6 +182,8 @@ set(FILES Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.h Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp Editor/View/Widgets/ScriptCanvasNodePaletteToolbar.ui + Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h + Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp Editor/View/Widgets/WidgetBus.h Editor/View/Widgets/DataTypePalette/DataTypePaletteModel.cpp Editor/View/Widgets/DataTypePalette/DataTypePaletteModel.h From c36d827fc5481c9f8924eb6efaa006dbf2eb0116 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 14:58:01 -0600 Subject: [PATCH 053/399] Updated Script Canvas component to use source handle property. Signed-off-by: Chris Galvan --- .../Components/EditorScriptCanvasComponent.cpp | 9 +++++++-- .../Components/EditorScriptCanvasComponent.h | 2 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 12 ------------ 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 3b495f6822..4d870ebca3 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -193,7 +193,12 @@ namespace ScriptCanvasEditor ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Level", 0x9aeacc13)) ->Attribute(AZ::Edit::Attributes::HelpPageURL, "https://o3de.org/docs/user-guide/components/reference/scripting/script-canvas/") ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_sourceHandle, "Script Canvas Source File", "Script Canvas source file associated with this component") - ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->Attribute("BrowseIcon", ":/stylesheet/img/UI20/browse-edit-select-files.svg") + ->Attribute("EditButton", "") + ->Attribute("EditDescription", "Open in Script Canvas Editor") + ->Attribute("EditCallback", &EditorScriptCanvasComponent::OpenEditor) + ->Attribute(AZ::Edit::Attributes::AssetPickerTitle, "Script Canvas") + ->Attribute(AZ::Edit::Attributes::SourceAssetFilterPattern, "*.scriptcanvas") ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_variableOverrides, "Properties", "Script Canvas Graph Properties") ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) ; @@ -227,7 +232,7 @@ namespace ScriptCanvasEditor SetName(m_sourceHandle.Path().Filename().Native()); } - void EditorScriptCanvasComponent::OpenEditor() + void EditorScriptCanvasComponent::OpenEditor(const AZ::Data::AssetId&, const AZ::Data::AssetType&) { AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 38a84bc75e..c496c91a18 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -68,7 +68,7 @@ namespace ScriptCanvasEditor ScriptCanvas::GraphIdentifier GetGraphIdentifier() const override; //===================================================================== - void OpenEditor(); + void OpenEditor(const AZ::Data::AssetId&, const AZ::Data::AssetType&); void SetName(AZStd::string_view name) { m_name = name; } const AZStd::string& GetName() const; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index ae85dbc6a9..ef1feae71a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -279,18 +279,6 @@ namespace ScriptCanvasEditor ->Field("id", &SourceHandle::m_id) ->Field("path", &SourceHandle::m_path) ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Script Canvas Source Handle", "References a source editor file") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Category, "Scripting") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/ScriptCanvas.svg") - ->Attribute(AZ::Edit::Attributes::ViewportIcon, "Icons/ScriptCanvas/Viewport/ScriptCanvas.svg") - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->DataElement(AZ::Edit::UIHandlers::Default, &SourceHandle::m_path); - ; - } } } From 31304ee9b180895b9a20d81554e72bb28c416a6c Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 15:03:49 -0600 Subject: [PATCH 054/399] Fixed issue when clearing out source handle property. Signed-off-by: Chris Galvan --- .../View/Widgets/SourceHandlePropertyAssetCtrl.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp index 66b9b77bdf..4d5cbd91fc 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp @@ -119,7 +119,15 @@ namespace ScriptCanvasEditor (void)node; auto sourceHandle = SourceHandle(nullptr, {}, GUI->GetSelectedSourcePath()); - instance = property_t(*CompleteDescription(sourceHandle)); + auto completeSourceHandle = CompleteDescription(sourceHandle); + if (completeSourceHandle) + { + instance = property_t(*CompleteDescription(sourceHandle)); + } + else + { + instance = property_t(); + } } bool SourceHandlePropertyHandler::ReadValuesIntoGUI(size_t index, SourceHandlePropertyAssetCtrl* GUI, const property_t& instance, AzToolsFramework::InstanceDataNode* node) From 805bd8ef56ee6181a7b966e837b32289b8659a9b Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Fri, 19 Nov 2021 12:22:12 -0800 Subject: [PATCH 055/399] fix graph tab selection: Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilder.cpp | 15 +++++-- .../EditorScriptCanvasComponent.cpp | 40 +++++++++++++++---- .../Components/EditorScriptCanvasComponent.h | 3 +- .../Code/Editor/View/Widgets/GraphTabBar.cpp | 10 +---- 4 files changed, 47 insertions(+), 21 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index 0eb748b2f1..a75b68b518 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -39,10 +39,19 @@ namespace ScriptCanvasBuilder void BuildVariableOverrides::CopyPreviousOverriddenValues(const BuildVariableOverrides& source) { - auto copyPreviousIfFound = [](ScriptCanvas::GraphVariable& overriddenValue, const AZStd::vector& source) + auto isEqual = [](const ScriptCanvas::GraphVariable& overrideValue, const ScriptCanvas::GraphVariable& candidate) { - if (auto iter = AZStd::find_if(source.begin(), source.end(), [&overriddenValue](const auto& candidate) { return candidate.GetVariableId() == overriddenValue.GetVariableId(); }); - iter != source.end()) + return candidate.GetVariableId() == overrideValue.GetVariableId() + || (candidate.GetVariableName() == overrideValue.GetVariableName() + && candidate.GetDataType() == overrideValue.GetDataType()); + }; + + auto copyPreviousIfFound = [isEqual](ScriptCanvas::GraphVariable& overriddenValue, const AZStd::vector& source) + { + auto iter = AZStd::find_if(source.begin(), source.end() + , [&overriddenValue, isEqual](const auto& candidate) { return isEqual(candidate, overriddenValue); }); + + if (iter != source.end()) { overriddenValue.DeepCopy(*iter); overriddenValue.SetScriptInputControlVisibility(AZ::Edit::PropertyVisibility::Hide); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 3b495f6822..27b03874ae 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -394,7 +394,7 @@ namespace ScriptCanvasEditor { if (auto loaded = LoadFromFile(assetId.Path().c_str()); loaded.IsSuccess()) { - OnScriptCanvasAssetReady(loaded.GetValue()); + UpdatePropertyDisplay(loaded.GetValue()); } } @@ -421,14 +421,38 @@ namespace ScriptCanvasEditor } } - void EditorScriptCanvasComponent::SourceFileChanged(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid /*fileAssetId*/) - {} + void EditorScriptCanvasComponent::SourceFileChanged([[maybe_unused]] AZStd::string relativePath + , [[maybe_unused]] AZStd::string scanFolder, [[maybe_unused]] AZ::Uuid fileAssetId) + { + if (fileAssetId == m_sourceHandle.Id()) + { + if (auto handle = CompleteDescription(SourceHandle(nullptr, fileAssetId, {}))) + { + // consider queueing on tick bus + OnScriptCanvasAssetChanged(*handle); + } + } + } - void EditorScriptCanvasComponent::SourceFileRemoved(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid /*fileAssetId*/) - {} + void EditorScriptCanvasComponent::SourceFileRemoved([[maybe_unused]] AZStd::string relativePath + , [[maybe_unused]] AZStd::string scanFolder, [[maybe_unused]] AZ::Uuid fileAssetId) + { + if (fileAssetId == m_sourceHandle.Id()) + { + m_removedHandle = m_sourceHandle; + OnScriptCanvasAssetChanged(m_removedHandle); + } + } - void EditorScriptCanvasComponent::SourceFileFailed(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid /*fileAssetId*/) - {} + void EditorScriptCanvasComponent::SourceFileFailed([[maybe_unused]] AZStd::string relativePath + , [[maybe_unused]] AZStd::string scanFolder, [[maybe_unused]] AZ::Uuid fileAssetId) + { + if (fileAssetId == m_sourceHandle.Id()) + { + m_removedHandle = m_sourceHandle; + OnScriptCanvasAssetChanged(m_removedHandle); + } + } bool EditorScriptCanvasComponent::HasAssetId() const { @@ -442,7 +466,7 @@ namespace ScriptCanvasEditor return ScriptCanvas::GraphIdentifier(m_sourceHandle.Id(), 0); } - void EditorScriptCanvasComponent::OnScriptCanvasAssetReady(const SourceHandle& sourceHandle) + void EditorScriptCanvasComponent::UpdatePropertyDisplay(const SourceHandle& sourceHandle) { if (sourceHandle.IsValid()) { diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 38a84bc75e..f9ea8b08e5 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -45,7 +45,6 @@ namespace ScriptCanvasEditor AZ_COMPONENT(EditorScriptCanvasComponent, "{C28E2D29-0746-451D-A639-7F113ECF5D72}", AzToolsFramework::Components::EditorComponentBase); EditorScriptCanvasComponent(); - // EditorScriptCanvasComponent(AZ::Data::Asset asset); EditorScriptCanvasComponent(const SourceHandle& sourceHandle); ~EditorScriptCanvasComponent() override; @@ -130,7 +129,7 @@ namespace ScriptCanvasEditor void UpdateName(); //===================================================================== - void OnScriptCanvasAssetReady(const SourceHandle& sourceHandle); + void UpdatePropertyDisplay(const SourceHandle& sourceHandle); //===================================================================== void BuildGameEntityData(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index 1dfb27ce63..cc43098ad4 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -181,11 +181,6 @@ namespace ScriptCanvasEditor return false; } -// void GraphTabBar::ConfigureTab(int /*tabIndex*/, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName) -// { -// -// } - int GraphTabBar::FindTab(ScriptCanvasEditor::SourceHandle assetId) const { for (int tabIndex = 0; tabIndex < count(); ++tabIndex) @@ -451,10 +446,9 @@ namespace ScriptCanvasEditor return; } - auto assetId = tabdata.value(); + auto assetId = tabdata.value().m_assetId; - // #sc_editor_asset - // ScriptCanvasEditor::GeneralRequestBus::Broadcast(&ScriptCanvasEditor::GeneralRequests::OnChangeActiveGraphTab, assetId); + ScriptCanvasEditor::GeneralRequestBus::Broadcast(&ScriptCanvasEditor::GeneralRequests::OnChangeActiveGraphTab, assetId); if (m_signalSaveOnChangeTo >= 0 && m_signalSaveOnChangeTo == index) { From ca5424dd7b25a6f1f39aa33ad43e908d83d33612 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 16:20:54 -0600 Subject: [PATCH 056/399] Fixed asset completer model for source handle picker. Signed-off-by: Chris Galvan --- .../Model/AssetCompleterModel.cpp | 21 ++++++++++++++----- .../Model/AssetCompleterModel.h | 5 +++++ .../UI/PropertyEditor/PropertyAssetCtrl.hxx | 6 +++--- .../Widgets/SourceHandlePropertyAssetCtrl.cpp | 20 ++++++++++++++++++ .../Widgets/SourceHandlePropertyAssetCtrl.h | 4 ++++ 5 files changed, 48 insertions(+), 8 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp index 81f0cb36af..40f3b7063e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp @@ -125,9 +125,6 @@ namespace AzToolsFramework int rows = m_assetBrowserFilterModel->rowCount(index); if (rows == 0) { - if (index != QModelIndex()) { - AZ_Error("AssetCompleterModel", false, "No children detected in FetchResources()"); - } return; } @@ -136,7 +133,7 @@ namespace AzToolsFramework QModelIndex childIndex = m_assetBrowserFilterModel->index(i, 0, index); AssetBrowserEntry* childEntry = GetAssetEntry(m_assetBrowserFilterModel->mapToSource(childIndex)); - if (childEntry->GetEntryType() == AssetBrowserEntry::AssetEntryType::Product) + if (childEntry->GetEntryType() == m_entryType) { ProductAssetBrowserEntry* productEntry = static_cast(childEntry); AZStd::string assetName; @@ -172,7 +169,6 @@ namespace AzToolsFramework return m_assets[index.row()].m_displayName; } - const AZ::Data::AssetId AssetCompleterModel::GetAssetIdFromIndex(const QModelIndex& index) { if (!index.isValid()) @@ -182,4 +178,19 @@ namespace AzToolsFramework return m_assets[index.row()].m_assetId; } + + const AZStd::string_view AssetCompleterModel::GetPathFromIndex(const QModelIndex& index) + { + if (!index.isValid()) + { + return ""; + } + + return m_assets[index.row()].m_path; + } + + void AssetCompleterModel::SetFetchEntryType(AssetBrowserEntry::AssetEntryType entryType) + { + m_entryType = entryType; + } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h index 03660e8fa9..4596d70657 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h @@ -40,6 +40,9 @@ namespace AzToolsFramework const AZStd::string_view GetNameFromIndex(const QModelIndex& index); const AZ::Data::AssetId GetAssetIdFromIndex(const QModelIndex& index); + const AZStd::string_view GetPathFromIndex(const QModelIndex& index); + + void SetFetchEntryType(AssetBrowserEntry::AssetEntryType entryType); private: struct AssetItem @@ -58,6 +61,8 @@ namespace AzToolsFramework AZStd::vector m_assets; //! String that will be highlighted in the suggestions QString m_highlightString; + + AssetBrowserEntry::AssetEntryType m_entryType = AssetBrowserEntry::AssetEntryType::Product; }; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx index 403725a429..d6ff1b8de6 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx @@ -175,10 +175,11 @@ namespace AzToolsFramework virtual void SetFolderSelection(const AZStd::string& /* folderPath */) {} virtual void ClearAssetInternal(); - void ConfigureAutocompleter(); + virtual void ConfigureAutocompleter(); void RefreshAutocompleter(); void EnableAutocompleter(); void DisableAutocompleter(); + const QModelIndex GetSourceIndex(const QModelIndex& index); void HandleFieldClear(); AZStd::string AddDefaultSuffix(const AZStd::string& filename); @@ -242,13 +243,12 @@ namespace AzToolsFramework virtual void OnEditButtonClicked(); void OnThumbnailClicked(); void OnCompletionModelReset(); - void OnAutocomplete(const QModelIndex& index); + virtual void OnAutocomplete(const QModelIndex& index); void OnTextChange(const QString& text); void OnReturnPressed(); void ShowContextMenu(const QPoint& pos); private: - const QModelIndex GetSourceIndex(const QModelIndex& index); void UpdateThumbnail(); }; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp index 4d5cbd91fc..04f7d79da5 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp @@ -13,6 +13,7 @@ #include #include +#include #include namespace ScriptCanvasEditor @@ -61,6 +62,20 @@ namespace ScriptCanvasEditor PropertyAssetCtrl::ClearAssetInternal(); } + void SourceHandlePropertyAssetCtrl::ConfigureAutocompleter() + { + if (m_completerIsConfigured) + { + return; + } + + AzToolsFramework::PropertyAssetCtrl::ConfigureAutocompleter(); + + AssetSelectionModel selection = GetAssetSelectionModel(); + m_model->SetFetchEntryType(AssetBrowserEntry::AssetEntryType::Source); + m_model->SetFilter(selection.GetDisplayFilter()); + } + void SourceHandlePropertyAssetCtrl::SetSourceAssetFilterPattern(const QString& filterPattern) { m_sourceAssetFilterPattern = filterPattern; @@ -86,6 +101,11 @@ namespace ScriptCanvasEditor emit OnAssetIDChanged(AZ::Data::AssetId()); } + void SourceHandlePropertyAssetCtrl::OnAutocomplete(const QModelIndex& index) + { + SetSelectedSourcePath(m_model->GetPathFromIndex(GetSourceIndex(index))); + } + QWidget* SourceHandlePropertyHandler::CreateGUI(QWidget* pParent) { SourceHandlePropertyAssetCtrl* newCtrl = aznew SourceHandlePropertyAssetCtrl(pParent); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h index 31a62aacfb..f54279e59c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h @@ -29,12 +29,16 @@ namespace ScriptCanvasEditor AzToolsFramework::AssetBrowser::AssetSelectionModel GetAssetSelectionModel() override; void PopupAssetPicker() override; void ClearAssetInternal() override; + void ConfigureAutocompleter() override; void SetSourceAssetFilterPattern(const QString& filterPattern); AZ::IO::Path GetSelectedSourcePath() const; void SetSelectedSourcePath(const AZ::IO::Path& sourcePath); + public Q_SLOTS: + void OnAutocomplete(const QModelIndex& index) override; + private: //! A regular expression pattern for filtering by source assets //! If this is set, the PropertyAssetCtrl will be dealing with source assets From d9f849b03e1826aa8c12c262e181e1b87389591a Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 22 Nov 2021 11:03:37 -0800 Subject: [PATCH 057/399] File state change include external delete detection Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Asset/EditorAssetSystemComponent.cpp | 50 ++-- .../Builder/ScriptCanvasBuilderWorker.cpp | 51 ---- .../Assets/ScriptCanvasAssetTracker.cpp | 44 --- .../Editor/Assets/ScriptCanvasAssetTracker.h | 6 +- .../Assets/ScriptCanvasAssetTrackerBus.h | 1 + .../ScriptCanvasAssetTrackerDefinitions.h | 12 - .../Editor/Assets/ScriptCanvasMemoryAsset.h | 2 + .../EditorScriptCanvasComponent.cpp | 2 +- .../Code/Editor/Components/EditorUtils.cpp | 49 ++-- .../FunctionNodeDescriptorComponent.cpp | 3 +- .../Include/ScriptCanvas/Bus/RequestBus.h | 16 +- .../Components/EditorScriptCanvasComponent.h | 8 +- .../ScriptCanvas/Components/EditorUtils.h | 3 + .../Code/Editor/View/Widgets/GraphTabBar.cpp | 9 +- .../Code/Editor/View/Widgets/GraphTabBar.h | 6 +- .../LoggingPanel/LoggingWindowSession.cpp | 9 +- .../UnitTestPanel/UnitTestDockWidget.cpp | 5 +- .../Code/Editor/View/Windows/MainWindow.cpp | 261 +++++++----------- .../Code/Editor/View/Windows/MainWindow.h | 27 +- .../Tools/UpgradeTool/UpgradeHelper.cpp | 2 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 8 +- .../Code/Include/ScriptCanvas/Core/Core.h | 2 - 22 files changed, 216 insertions(+), 360 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp index 3515eaf34f..1f614a5a87 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp @@ -107,11 +107,15 @@ namespace ScriptCanvasEditor return ScriptCanvasBuilder::CreateLuaAsset(editAsset, graphPathForRawLuaFile); } - void EditorAssetSystemComponent::AddSourceFileOpeners([[maybe_unused]] const char* fullSourceFileName, [[maybe_unused]] const AZ::Uuid& sourceUuid, [[maybe_unused]] AzToolsFramework::AssetBrowser::SourceFileOpenerList& openers) + void EditorAssetSystemComponent::AddSourceFileOpeners + ( [[maybe_unused]] const char* fullSourceFileName + , const AZ::Uuid& sourceUuid + , AzToolsFramework::AssetBrowser::SourceFileOpenerList& openers) { using namespace AzToolsFramework; using namespace AzToolsFramework::AssetBrowser; - if (const SourceAssetBrowserEntry* source = SourceAssetBrowserEntry::GetSourceByUuid(sourceUuid)) // get the full details of the source file based on its UUID. + // get the full details of the source file based on its UUID. + if (const SourceAssetBrowserEntry* source = SourceAssetBrowserEntry::GetSourceByUuid(sourceUuid)) { if (!HandlesSource(source)) { @@ -123,23 +127,31 @@ namespace ScriptCanvasEditor // has no UUID / Not a source file. return; } - // You can push back any number of "Openers" - choose a unique identifier, and icon, and then a lambda which will be activated if the user chooses to open it with your opener: - // #sc_editor_asset - // openers.push_back({ "ScriptCanvas_Editor_Asset_Edit", "Script Canvas Editor...", QIcon(), -// [](const char*, const AZ::Uuid& scSourceUuid) -// { -// AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); -// AZ::Data::AssetId sourceAssetId(scSourceUuid, 0); -// -// auto& assetManager = AZ::Data::AssetManager::Instance(); -// AZ::Data::Asset scriptCanvasAsset = assetManager.GetAsset(sourceAssetId, azrtti_typeid(), AZ::Data::AssetLoadBehavior::Default); -// AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); -// GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, scriptCanvasAsset.GetId(), -1); -// if (!openOutcome) -// { -// AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); -// } -// } }); + // You can push back any number of "Openers" - choose a unique identifier, and icon, + // and then a lambda which will be activated if the user chooses to open it with your opener: + + openers.push_back({ "ScriptCanvas_Editor_Asset_Edit", "Script Canvas Editor..." + , QIcon(ScriptCanvasAssetDescription().GetIconPathImpl()), + [](const char*, const AZ::Uuid& scSourceUuid) + { + AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); + + if (auto sourceHandle = CompleteDescription(SourceHandle(nullptr, scSourceUuid, {}))) + { + AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset + , *sourceHandle, Tracker::ScriptCanvasFileState::UNMODIFIED, -1); + if (!openOutcome) + { + AZ_Warning("ScriptCanvas", openOutcome, "%s", openOutcome.GetError().data()); + } + } + else + { + AZ_Warning("ScriptCanvas", false + , "Unabled to find full path for Source UUid %s", scSourceUuid.ToString().c_str()); + } + }}); } } diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index faad1871ac..bf98e62b71 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -60,57 +60,6 @@ namespace ScriptCanvasBuilder graphData = sourceGraph->GetGraphDataConst(); } -#if defined(EDITOR_ASSET_SUPPORT_ENABLED) - if (graphData == nullptr) - { - if (!m_editorAssetHandler) - { - AZ_Error(s_scriptCanvasBuilder, false, R"(CreateJobs for %s failed because the ScriptCanvas Editor Asset handler is missing.)", fullPath.data()); - } - - AZStd::shared_ptr assetDataStream = AZStd::make_shared(); - - AZ::IO::FileIOStream stream(fullPath.c_str(), AZ::IO::OpenMode::ModeRead); - if (!AZ::IO::RetryOpenStream(stream)) - { - AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the source file could not be opened.", fullPath.data()); - return; - } - - // Read the asset into a memory buffer, then hand ownership of the buffer to assetDataStream - { - AZ::IO::FileIOStream ioStream; - if (!ioStream.Open(fullPath.data(), AZ::IO::OpenMode::ModeRead)) - { - AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the source file could not be opened.", fullPath.data()); - return; - } - - AZStd::vector fileBuffer(ioStream.GetLength()); - size_t bytesRead = ioStream.Read(fileBuffer.size(), fileBuffer.data()); - if (bytesRead != ioStream.GetLength()) - { - AZ_Warning(s_scriptCanvasBuilder, false, AZStd::string::format("File failed to read completely: %s", fullPath.data()).c_str()); - return; - } - - assetDataStream->Open(AZStd::move(fileBuffer)); - } - - m_processEditorAssetDependencies.clear(); - - asset.Create(AZ::Data::AssetId(AZ::Uuid::CreateRandom())); - if (m_editorAssetHandler->LoadAssetDataFromStream(asset, assetDataStream, {}) != AZ::Data::AssetHandler::LoadResult::LoadComplete) - { - AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the asset data could not be loaded from the file", fullPath.data()); - return; - } - - sourceGraph = AZ::EntityUtils::FindFirstDerivedComponent(asset.Get()->GetScriptCanvasEntity()); - graphData = sourceGraph->GetGraphDataConst(); - } -#endif - AZ_Assert(sourceGraph, "Graph component is missing from entity."); AZ_Assert(graphData, "GraphData is missing from entity"); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp index 513dc6afe5..5ec620a907 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp @@ -541,48 +541,4 @@ namespace ScriptCanvasEditor return AZ::EntityId(); } - void AssetTracker::OnAssetReady(const ScriptCanvasMemoryAsset* asset) - { - AZ::Data::AssetId assetId = CheckAssetId(asset->GetId()); - - auto assetInUseIter = m_assetsInUse.find(assetId); - if (assetInUseIter != m_assetsInUse.end()) - { - AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetReady, assetInUseIter->second); - } - } - - void AssetTracker::OnAssetReloaded(const ScriptCanvasMemoryAsset* asset) - { - AZ::Data::AssetId assetId = CheckAssetId(asset->GetId()); - - auto assetInUseIter = m_assetsInUse.find(assetId); - if (assetInUseIter != m_assetsInUse.end()) - { - AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetReloaded, assetInUseIter->second); - } - } - - void AssetTracker::OnAssetSaved(const ScriptCanvasMemoryAsset* asset, bool isSuccessful) - { - AZ::Data::AssetId assetId = CheckAssetId(asset->GetId()); - - auto assetInUseIter = m_assetsInUse.find(assetId); - if (assetInUseIter != m_assetsInUse.end()) - { - AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetSaved, assetInUseIter->second, isSuccessful); - } - } - - void AssetTracker::OnAssetError(const ScriptCanvasMemoryAsset* asset) - { - AZ::Data::AssetId assetId = CheckAssetId(asset->GetId()); - - auto assetInUseIter = m_assetsInUse.find(assetId); - if (assetInUseIter != m_assetsInUse.end()) - { - AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetError, assetInUseIter->second); - } - } - } diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h index b55e5c06c8..247aba3b94 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h @@ -16,6 +16,7 @@ #include #include +#include namespace ScriptCanvasEditor @@ -122,10 +123,5 @@ namespace ScriptCanvasEditor // Invoked when an asset is loaded from file and becomes ready Callbacks::OnAssetReadyCallback m_onAssetReadyCallback; - // Internal::MemoryAssetNotificationBus - void OnAssetReady(const ScriptCanvasMemoryAsset* asset) override; - void OnAssetReloaded(const ScriptCanvasMemoryAsset* asset) override; - void OnAssetSaved(const ScriptCanvasMemoryAsset* asset, bool isSuccessful) override; - void OnAssetError(const ScriptCanvasMemoryAsset* asset) override; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h index 3fecb0aac9..fd50b40768 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h @@ -17,6 +17,7 @@ #include #include +#include class QWidget; diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h index 29f88b33c8..73507112c2 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h @@ -24,17 +24,5 @@ namespace ScriptCanvasEditor using OnAssetCreatedCallback = OnAssetReadyCallback; } - namespace Tracker - { - enum class ScriptCanvasFileState : AZ::s32 - { - NEW, - MODIFIED, - UNMODIFIED, - // #sc_editor_asset restore this - SOURCE_REMOVED, - INVALID = -1 - }; - } } diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h index d7f6ae87b6..6eecc5e04f 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h @@ -29,6 +29,8 @@ #include #include +#include + namespace ScriptCanvasEditor { diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 27b03874ae..b4d8593a87 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -235,7 +235,7 @@ namespace ScriptCanvasEditor if (m_sourceHandle.IsValid()) { - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_sourceHandle, -1); + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_sourceHandle, Tracker::ScriptCanvasFileState::UNMODIFIED, -1); if (!openOutcome) { diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp index 9b83acefa5..adf5035dbd 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp @@ -35,37 +35,46 @@ namespace ScriptCanvasEditor { if (source.IsValidDescription()) { - return source.Describe(); + return source; } - AZStd::string watchFolder; - AZ::Data::AssetInfo assetInfo; - bool sourceInfoFound{}; - - if (!source.Id().IsNull()) + AzToolsFramework::AssetSystemRequestBus::Events* assetSystem = AzToolsFramework::AssetSystemRequestBus::FindFirstHandler(); + if (assetSystem) { - AzToolsFramework::AssetSystemRequestBus::BroadcastResult - ( sourceInfoFound - , &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourceUUID, source.Id(), assetInfo, watchFolder); + AZStd::string watchFolder; + AZ::Data::AssetInfo assetInfo; - if (sourceInfoFound && !assetInfo.m_relativePath.empty()) + if (!source.Id().IsNull()) { - return SourceHandle(nullptr, assetInfo.m_assetId.m_guid, assetInfo.m_relativePath); - } - } + if (assetSystem->GetSourceInfoBySourceUUID(source.Id(), assetInfo, watchFolder)) + { + AZ::IO::Path watchPath(watchFolder); + AZ::IO::Path assetInfoPath(assetInfo.m_relativePath); + SourceHandle fullPathHandle(nullptr, assetInfo.m_assetId.m_guid, watchPath / assetInfoPath); - if (!source.Path().empty()) - { - AzToolsFramework::AssetSystemRequestBus::BroadcastResult - ( sourceInfoFound - , &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, source.Path().c_str(), assetInfo, watchFolder); + if (assetSystem->GetSourceInfoBySourcePath(fullPathHandle.Path().c_str(), assetInfo, watchFolder) && assetInfo.m_assetId.IsValid()) + { + if (assetInfo.m_assetId.m_guid != source.Id()) + { + AZ_TracePrintf("ScriptCanvas", "This is what I don't get"); + } - if (sourceInfoFound && assetInfo.m_assetId.IsValid()) + auto path = fullPathHandle.Path(); + return SourceHandle(source, assetInfo.m_assetId.m_guid, path.MakePreferred()); + } + } + } + + if (!source.Path().empty()) { - return SourceHandle(nullptr, assetInfo.m_assetId.m_guid, assetInfo.m_relativePath); + if (assetSystem->GetSourceInfoBySourcePath(source.Path().c_str(), assetInfo, watchFolder) && assetInfo.m_assetId.IsValid()) + { + return SourceHandle(source, assetInfo.m_assetId.m_guid, source.Path()); + } } } + return AZStd::nullopt; } diff --git a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp index f649bb9f7d..f80c6dde21 100644 --- a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp @@ -97,7 +97,8 @@ namespace ScriptCanvasEditor } AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, SourceHandle( nullptr, assetInfo.m_assetId.m_guid, {} ), -1); + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset + , SourceHandle( nullptr, assetInfo.m_assetId.m_guid, {} ), Tracker::ScriptCanvasFileState::UNMODIFIED, -1); return openOutcome.IsSuccess(); } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h index 90468f5d8c..15600c2b88 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h @@ -47,6 +47,18 @@ namespace ScriptCanvasEditor struct CategoryInformation; struct NodePaletteModelInformation; + namespace Tracker + { + enum class ScriptCanvasFileState : AZ::s32 + { + NEW, + MODIFIED, + UNMODIFIED, + // #sc_editor_asset restore this + SOURCE_REMOVED, + INVALID = -1 + }; + } namespace Widget { @@ -68,8 +80,8 @@ namespace ScriptCanvasEditor //! Opens an existing graph and returns the tab index in which it was open in. //! \param File AssetId //! \return index of open tab if the asset was able to be open successfully or error message of why the open failed - virtual AZ::Outcome OpenScriptCanvasAsset(SourceHandle scriptCanvasAssetId, int tabIndex = -1) = 0; - virtual AZ::Outcome OpenScriptCanvasAssetId(const SourceHandle& scriptCanvasAsset) = 0; + virtual AZ::Outcome OpenScriptCanvasAsset(SourceHandle scriptCanvasAssetId, Tracker::ScriptCanvasFileState fileState, int tabIndex = -1) = 0; + virtual AZ::Outcome OpenScriptCanvasAssetId(const SourceHandle& scriptCanvasAsset, Tracker::ScriptCanvasFileState fileState) = 0; virtual int CloseScriptCanvasAsset(const SourceHandle&) = 0; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index f9ea8b08e5..ddd83d06ba 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -85,12 +85,7 @@ namespace ScriptCanvasEditor AZ::Data::AssetId GetAssetId() const override; //===================================================================== - //===================================================================== - // AssetTrackerNotificationBus - void OnAssetReady(const ScriptCanvasMemoryAsset::pointer asset) ; - void OnAssetSaved(const ScriptCanvasMemoryAsset::pointer asset, bool isSuccessful) ; - void OnAssetReloaded(const ScriptCanvasMemoryAsset::pointer asset) ; - //===================================================================== + //===================================================================== @@ -119,7 +114,6 @@ namespace ScriptCanvasEditor // complete the id, load call OnScriptCanvasAssetChanged void SourceFileChanged(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; - // update the display icon for failure, save the values in the graph void SourceFileRemoved(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; void SourceFileFailed(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h index 7685133ca4..0d27d255af 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h @@ -21,6 +21,9 @@ namespace GraphCanvas namespace ScriptCanvasEditor { + // If only the Path or the Id is valid, attempts to fill in the missing piece. + // If both Path and Id is valid, including after correction, returns the handle including source Data, + // otherwise, returns null AZStd::optional CompleteDescription(const SourceHandle& source); class Graph; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index cc43098ad4..2e0ace4768 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -46,9 +46,9 @@ namespace ScriptCanvasEditor connect(this, &QTabBar::customContextMenuRequested, this, &GraphTabBar::OnContextMenu); } - void GraphTabBar::AddGraphTab(ScriptCanvasEditor::SourceHandle assetId) + void GraphTabBar::AddGraphTab(ScriptCanvasEditor::SourceHandle assetId, Tracker::ScriptCanvasFileState fileState) { - InsertGraphTab(count(), assetId); + InsertGraphTab(count(), assetId, fileState); } void GraphTabBar::ClearTabView(int tabIndex) @@ -143,7 +143,7 @@ namespace ScriptCanvasEditor } } - int GraphTabBar::InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId) + int GraphTabBar::InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId, Tracker::ScriptCanvasFileState fileState) { if (!SelectTab(assetId)) { @@ -159,9 +159,6 @@ namespace ScriptCanvasEditor AzFramework::StringFunc::Path::GetFileName(assetId.Path().c_str(), tabName); metaData.m_name = tabName.c_str(); - // #sc_editor_asset filestate - Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; - // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); SetTabText(tabIndex, tabName.c_str(), fileState); setTabData(tabIndex, QVariant::fromValue(metaData)); return tabIndex; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h index 48f327b244..9d86583f76 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h @@ -18,6 +18,8 @@ #include #include +#include + #endif class QGraphicsView; @@ -54,11 +56,11 @@ namespace ScriptCanvasEditor void SetTabData(const GraphTabMetadata& data, int index); void SetTabData(const GraphTabMetadata& data, ScriptCanvasEditor::SourceHandle assetId); - void AddGraphTab(ScriptCanvasEditor::SourceHandle assetId); + void AddGraphTab(ScriptCanvasEditor::SourceHandle assetId, Tracker::ScriptCanvasFileState fileState); void CloseTab(int index); void CloseAllTabs(); - int InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId); + int InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId, Tracker::ScriptCanvasFileState fileState); bool SelectTab(ScriptCanvasEditor::SourceHandle assetId); // void ConfigureTab(int tabIndex, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowSession.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowSession.cpp index 2e712cef08..963be52edc 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowSession.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowSession.cpp @@ -256,7 +256,8 @@ namespace ScriptCanvasEditor const AZ::Data::AssetId& assetId = executionItem->GetAssetId(); - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, SourceHandle(nullptr, assetId.m_guid, {})); + GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId + , SourceHandle(nullptr, assetId.m_guid, {}), Tracker::ScriptCanvasFileState::UNMODIFIED); } } } @@ -272,10 +273,12 @@ namespace ScriptCanvasEditor bool isAssetOpen = false; GeneralRequestBus::BroadcastResult(isAssetOpen, &GeneralRequests::IsScriptCanvasAssetOpen, SourceHandle(nullptr, assetId.m_guid, {})); - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, SourceHandle(nullptr, assetId.m_guid, {})); + GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId + , SourceHandle(nullptr, assetId.m_guid, {}), Tracker::ScriptCanvasFileState::UNMODIFIED); AZ::EntityId graphCanvasGraphId; - GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, SourceHandle(nullptr, assetId.m_guid, {})); + GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId + , SourceHandle(nullptr, assetId.m_guid, {})); if (isAssetOpen) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp index a60c59ad7e..f319a166df 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp @@ -433,7 +433,10 @@ namespace ScriptCanvasEditor AZ::Data::AssetId sourceAssetId(sourceUuid, 0); AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAssetId, ScriptCanvasEditor::SourceHandle(nullptr, sourceUuid, {})); + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAssetId + , ScriptCanvasEditor::SourceHandle(nullptr, sourceUuid, {}) + , Tracker::ScriptCanvasFileState::UNMODIFIED); + if (!openOutcome) { AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index ce4ee7638f..52c5b4c5d2 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -666,6 +666,7 @@ namespace ScriptCanvasEditor AzToolsFramework::ToolsApplicationNotificationBus::Handler::BusConnect(); AzToolsFramework::AssetSystemBus::Handler::BusConnect(); ScriptCanvas::ScriptCanvasSettingsRequestBus::Handler::BusConnect(); + AZ::SystemTickBus::Handler::BusConnect(); UINotificationBus::Broadcast(&UINotifications::MainWindowCreationEvent, this); @@ -1112,13 +1113,47 @@ namespace ScriptCanvasEditor RestartAutoTimerSave(forceTimer); } + void MainWindow::SourceFileChanged + ( [[maybe_unused]] AZStd::string relativePath + , AZStd::string scanFolder + , [[maybe_unused]] AZ::Uuid fileAssetId) + { + auto handle = CompleteDescription(SourceHandle(nullptr, fileAssetId, {})); + if (handle) + { + if (!IsRecentSave(*handle)) + { + UpdateFileState(*handle, Tracker::ScriptCanvasFileState::MODIFIED); + } + else + { + AZ_TracePrintf + ( "ScriptCanvas" + , "Ignoring source file modification notification (possibly external), as a it was recently saved by the editor: %s" + , relativePath.c_str()); + } + } + } + void MainWindow::SourceFileRemoved ( AZStd::string relativePath , [[maybe_unused]] AZStd::string scanFolder - , [[maybe_unused]] AZ::Uuid fileAssetId) + , AZ::Uuid fileAssetId) { - ScriptCanvasEditor::SourceHandle handle(nullptr, fileAssetId, relativePath); - UpdateFileState(handle, Tracker::ScriptCanvasFileState::SOURCE_REMOVED); + SourceHandle handle(nullptr, fileAssetId, relativePath); + { + if (!IsRecentSave(handle)) + { + UpdateFileState(handle, Tracker::ScriptCanvasFileState::SOURCE_REMOVED); + } + else + { + AZ_TracePrintf + ( "ScriptCanvas" + , "Ignoring source file removed notification (possibly external), as a it was recently saved by the editor: %s" + , relativePath.c_str()); + } + } } void MainWindow::SignalSceneDirty(ScriptCanvasEditor::SourceHandle assetId) @@ -1149,21 +1184,7 @@ namespace ScriptCanvasEditor m_tabBar->UpdateFileState(assetId, fileState); } - void MainWindow::RefreshScriptCanvasAsset(const AZ::Data::Asset& /*asset*/) - { - // #sc_editor_asset - /* - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, asset.GetId()); - - if (memoryAsset && asset.IsReady()) - { - - } - */ - } - - AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& fileAssetId) + AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& fileAssetId, Tracker::ScriptCanvasFileState fileState) { if (fileAssetId.Id().IsNull()) { @@ -1178,7 +1199,7 @@ namespace ScriptCanvasEditor return AZ::Success(outTabIndex); } - outTabIndex = CreateAssetTab(fileAssetId); + outTabIndex = CreateAssetTab(fileAssetId, fileState); if (!m_isRestoringWorkspace) { @@ -1188,7 +1209,7 @@ namespace ScriptCanvasEditor if (outTabIndex >= 0) { AddRecentFile(fileAssetId.Path().c_str()); - OpenScriptCanvasAssetImplementation(fileAssetId); + OpenScriptCanvasAssetImplementation(fileAssetId, fileState); return AZ::Success(outTabIndex); } else @@ -1197,7 +1218,7 @@ namespace ScriptCanvasEditor } } - AZ::Outcome MainWindow::OpenScriptCanvasAssetImplementation(const SourceHandle& scriptCanvasAsset, int tabIndex) + AZ::Outcome MainWindow::OpenScriptCanvasAssetImplementation(const SourceHandle& scriptCanvasAsset, Tracker::ScriptCanvasFileState fileState, int tabIndex) { const ScriptCanvasEditor::SourceHandle& fileAssetId = scriptCanvasAsset; if (!fileAssetId.IsValid()) @@ -1239,7 +1260,7 @@ namespace ScriptCanvasEditor return AZ::Success(outTabIndex); } - outTabIndex = CreateAssetTab(fileAssetId, tabIndex); + outTabIndex = CreateAssetTab(fileAssetId, fileState, tabIndex); if (outTabIndex == -1) { @@ -1259,21 +1280,21 @@ namespace ScriptCanvasEditor return AZ::Success(outTabIndex); } - AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, int tabIndex) + AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, Tracker::ScriptCanvasFileState fileState, int tabIndex) { if (scriptCanvasAssetId.IsValid()) { - return OpenScriptCanvasAssetImplementation(scriptCanvasAssetId, tabIndex); + return OpenScriptCanvasAssetImplementation(scriptCanvasAssetId, fileState, tabIndex); } else { - return OpenScriptCanvasAssetId(scriptCanvasAssetId); + return OpenScriptCanvasAssetId(scriptCanvasAssetId, fileState); } } - int MainWindow::CreateAssetTab(const ScriptCanvasEditor::SourceHandle& assetId, int tabIndex) + int MainWindow::CreateAssetTab(const ScriptCanvasEditor::SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState, int tabIndex) { - return m_tabBar->InsertGraphTab(tabIndex, assetId); + return m_tabBar->InsertGraphTab(tabIndex, assetId, fileState); } void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) @@ -1316,7 +1337,7 @@ namespace ScriptCanvasEditor { if (createdAssetPair.second == requestingEntityId) { - return OpenScriptCanvasAssetId(createdAssetPair.first).IsSuccess(); + return OpenScriptCanvasAssetId(createdAssetPair.first, Tracker::ScriptCanvasFileState::NEW).IsSuccess(); } } @@ -1355,33 +1376,6 @@ namespace ScriptCanvasEditor return m_nodePaletteModel.FindNodePaletteInformation(nodeType); } - void MainWindow::GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZStd::string& /*filePath*/, AZStd::string& /*fileFilter*/) - { - // #sc_editor_asset -// -// ScriptCanvasMemoryAsset::pointer memoryAsset; -// AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); -// -// AZStd::string assetPath; -// if (memoryAsset) -// { -// assetPath = memoryAsset->GetAbsolutePath(); -// fileFilter = ScriptCanvasAssetDescription().GetFileFilterImpl(); -// -// AZStd::string tabName; -// AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, assetId); -// -// assetPath = AZStd::string::format("%s/%s%s" -// , ScriptCanvasAssetDescription().GetSuggestedSavePathImpl() -// , tabName.c_str() -// , ScriptCanvasAssetDescription().GetExtensionImpl()); -// } -// -// AZStd::array resolvedPath; -// AZ::IO::FileIOBase::GetInstance()->ResolvePath(assetPath.data(), resolvedPath.data(), resolvedPath.size()); -// filePath = resolvedPath.data(); - } - void MainWindow::OpenFile(const char* fullPath) { auto tabIndex = m_tabBar->FindTabByPath(fullPath); @@ -1418,7 +1412,7 @@ namespace ScriptCanvasEditor m_errorFilePath.clear(); auto activeGraph = ScriptCanvasEditor::SourceHandle(outcome.TakeValue(), assetInfo.m_assetId.m_guid, fullPath); - auto openOutcome = OpenScriptCanvasAsset(activeGraph); + auto openOutcome = OpenScriptCanvasAsset(activeGraph, Tracker::ScriptCanvasFileState::UNMODIFIED); if (openOutcome) { RunGraphValidation(false); @@ -1429,66 +1423,10 @@ namespace ScriptCanvasEditor { AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); } - -#if defined(EDITOR_ASSET_SUPPORT_ENABLED) - /* - m_errorFilePath = fullPath; - - // Let's find the source file on disk - AZStd::string watchFolder; - AZ::Data::AssetInfo assetInfo; - bool sourceInfoFound{}; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult(sourceInfoFound, &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, fullPath, assetInfo, watchFolder); - - if (sourceInfoFound) - { - const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(assetInfo.m_assetId); - if (fileState != Tracker::ScriptCanvasFileState::NEW && fileState != Tracker::ScriptCanvasFileState::INVALID) - { - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetInfo.m_assetId); - - if (m_tabBar->FindTab(assetInfo.m_assetId) < 0) - { - CreateAssetTab(assetInfo.m_assetId); - } - - SetActiveAsset(memoryAsset->GetFileAssetId()); - OpenNextFile(); - return; - } - - Callbacks::OnAssetReadyCallback onAssetReady = [this, assetInfo](ScriptCanvasMemoryAsset&) - { - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetInfo.m_assetId); - - auto openOutcome = OpenScriptCanvasAsset(*memoryAsset); - if (openOutcome) - { - RunGraphValidation(false); - SetRecentAssetId(assetInfo.m_assetId); - } - else - { - AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); - } - - OpenNextFile(); - }; - - // TODO-LS the assetInfo.m_assetType is always null for some reason, I know in this case we want default assets so it's ok to hardcode it - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Load, assetInfo.m_assetId, assetInfo.m_assetType, azrtti_typeid(), onAssetReady); - } - else - { - QMessageBox::warning(this, "Invalid Source Asset", QString("'%1' is not a valid asset path.").arg(fullPath), QMessageBox::Ok); - } - */ -#endif } - GraphCanvas::Endpoint MainWindow::HandleProposedConnection(const GraphCanvas::GraphId&, const GraphCanvas::ConnectionId&, const GraphCanvas::Endpoint& endpoint, const GraphCanvas::NodeId& nodeId, const QPoint& screenPoint) + GraphCanvas::Endpoint MainWindow::HandleProposedConnection(const GraphCanvas::GraphId&, const GraphCanvas::ConnectionId& + , const GraphCanvas::Endpoint& endpoint, const GraphCanvas::NodeId& nodeId, const QPoint& screenPoint) { GraphCanvas::Endpoint retVal; @@ -1633,7 +1571,7 @@ namespace ScriptCanvasEditor // Insert tab block AZStd::string tabName; AzFramework::StringFunc::Path::GetFileName(assetPath.data(), tabName); - m_tabBar->InsertGraphTab(tabIndex, assetId); + m_tabBar->InsertGraphTab(tabIndex, assetId, Tracker::ScriptCanvasFileState::NEW); if (!IsTabOpen(assetId, outTabIndex)) { @@ -1666,17 +1604,13 @@ namespace ScriptCanvasEditor ScriptCanvasEditor::SourceHandle handle = ScriptCanvasEditor::SourceHandle(graph, assetId, assetPath); outTabIndex = InsertTabForAsset(assetPath, handle, tabIndex); - m_tabBar->UpdateFileState(handle, Tracker::ScriptCanvasFileState::NEW); - + if (outTabIndex == -1) { return AZ::Failure(AZStd::string::format("Script Canvas Asset %.*s is not open in a tab", assetPath.data())); } SetActiveAsset(handle); - - // #sc_editor_asset delete candidate - PushPreventUndoStateUpdate(); AZ::EntityId scriptCanvasEntityId = graph->GetGraph()->GetScriptCanvasId(); @@ -1790,7 +1724,6 @@ namespace ScriptCanvasEditor } else { - // replaces GetSuggestedFullFilenameToSaveAs suggestedFileFilter = ScriptCanvasAssetDescription().GetExtensionImpl(); if (inMemoryAssetId.Path().empty()) @@ -1880,7 +1813,8 @@ namespace ScriptCanvasEditor void MainWindow::OnSaveCallBack(const VersionExplorer::FileSaveResult& result) { const bool saveSuccess = result.fileSaveError.empty(); - auto memoryAsset = m_fileSaver->GetSource(); + auto completeDescription = CompleteDescription(m_fileSaver->GetSource()); + auto memoryAsset = completeDescription ? *completeDescription : m_fileSaver->GetSource(); int saveTabIndex = m_tabBar->FindTab(memoryAsset); AZStd::string tabName = saveTabIndex >= 0 ? m_tabBar->tabText(saveTabIndex).toUtf8().data() : ""; @@ -2002,18 +1936,11 @@ namespace ScriptCanvasEditor const bool displayAsNotification = true; RunGraphValidation(displayAsNotification); - // This is called during saving, so the is saving flag is always true Need to update the state after this callback is complete. So schedule for next system tick. - AddSystemTickAction(SystemTickActionFlag::UpdateSaveMenuState); - - if (saveSuccess && m_closeCurrentGraphAfterSave) - { - AddSystemTickAction(SystemTickActionFlag::CloseCurrentGraph); - } - m_closeCurrentGraphAfterSave = false; EnableAssetView(memoryAsset); + UpdateSaveState(true); UnblockCloseRequests(); m_fileSaver.reset(); } @@ -2027,15 +1954,15 @@ namespace ScriptCanvasEditor void MainWindow::SaveAs(AZStd::string_view path, ScriptCanvasEditor::SourceHandle inMemoryAssetId) { DisableAssetView(inMemoryAssetId); - + UpdateSaveState(false); m_fileSaver = AZStd::make_unique ( nullptr , [this](const VersionExplorer::FileSaveResult& fileSaveResult) { OnSaveCallBack(fileSaveResult); }); - ScriptCanvasEditor::SourceHandle newLocation(inMemoryAssetId, {}, path); + ScriptCanvasEditor::SourceHandle newLocation(inMemoryAssetId, AZ::Uuid::CreateNull(), path); + MarkRecentSave(newLocation); m_fileSaver->Save(newLocation); - UpdateSaveState(); BlockCloseRequests(); } @@ -2827,7 +2754,6 @@ namespace ScriptCanvasEditor void MainWindow::OnActiveFileStateChanged() { - UpdateSaveState(); UpdateAssignToSelectionState(); } @@ -3457,7 +3383,6 @@ namespace ScriptCanvasEditor UpdateAssignToSelectionState(); UpdateUndoRedoState(); - UpdateSaveState(); } void MainWindow::OnWorkspaceRestoreStart() @@ -3535,25 +3460,10 @@ namespace ScriptCanvasEditor ui->action_Redo->setEnabled(isEnabled); } - void MainWindow::UpdateSaveState() + void MainWindow::UpdateSaveState(bool enabled) { - // #sc_editor_asset todo, consider making blocking -// bool enabled = m_activeGraph.IsValid(); -// bool isSaving = false; -// bool hasModifications = false; -// -// if (enabled) -// { -// Tracker::ScriptCanvasFileState fileState = GetAssetFileState(m_activeGraph); -// hasModifications = ( fileState == Tracker::ScriptCanvasFileState::MODIFIED -// || fileState == Tracker::ScriptCanvasFileState::NEW -// || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED); -// -// AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, m_activeGraph); -// } -// -// ui->action_Save->setEnabled(enabled && !isSaving && hasModifications); -// ui->action_Save_As->setEnabled(enabled && !isSaving); + ui->action_Save->setEnabled(enabled); + ui->action_Save_As->setEnabled(enabled); } void MainWindow::CreateFunctionInput() @@ -4143,12 +4053,6 @@ namespace ScriptCanvasEditor qobject_cast(parent())->close(); } - if (HasSystemTickAction(SystemTickActionFlag::UpdateSaveMenuState)) - { - RemoveSystemTickAction(SystemTickActionFlag::UpdateSaveMenuState); - UpdateSaveState(); - } - if (HasSystemTickAction(SystemTickActionFlag::CloseCurrentGraph)) { RemoveSystemTickAction(SystemTickActionFlag::CloseCurrentGraph); @@ -4165,10 +4069,7 @@ namespace ScriptCanvasEditor CloseNextTab(); } - if (m_systemTickActions == 0) - { - AZ::SystemTickBus::Handler::BusDisconnect(); - } + ClearStaleSaves(); } void MainWindow::OnCommandStarted(AZ::Crc32) @@ -4395,11 +4296,6 @@ namespace ScriptCanvasEditor void MainWindow::AddSystemTickAction(SystemTickActionFlag action) { - if (!AZ::SystemTickBus::Handler::BusIsConnected()) - { - AZ::SystemTickBus::Handler::BusConnect(); - } - m_systemTickActions |= action; } @@ -4749,5 +4645,34 @@ namespace ScriptCanvasEditor UpdateUndoRedoState(); } + + void MainWindow::ClearStaleSaves() + { + AZStd::lock_guard lock(m_mutex); + auto timeNow = AZStd::chrono::system_clock::now(); + AZStd::erase_if(m_saves, [&timeNow](const auto& item) + { + AZStd::sys_time_t delta = AZStd::chrono::seconds(timeNow - item.second).count(); + return delta > 2.0f; + }); + } + + bool MainWindow::IsRecentSave(const SourceHandle& handle) const + { + AZStd::lock_guard lock(const_cast(this)->m_mutex); + AZStd::string key = handle.Path().Native(); + AZStd::to_lower(key.begin(), key.end()); + auto iter = m_saves.find(key); + return iter != m_saves.end(); + } + + void MainWindow::MarkRecentSave(const SourceHandle& handle) + { + AZStd::lock_guard lock(m_mutex); + AZStd::string key = handle.Path().Native(); + AZStd::to_lower(key.begin(), key.end()); + m_saves[key] = AZStd::chrono::system_clock::now(); + } + #include } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index dfe5d9fa13..68488238ec 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -425,9 +425,9 @@ namespace ScriptCanvasEditor QVariant GetTabData(const SourceHandle& assetId); //! GeneralRequestBus - AZ::Outcome OpenScriptCanvasAssetId(const SourceHandle& assetId) override; - AZ::Outcome OpenScriptCanvasAsset(SourceHandle scriptCanvasAssetId, int tabIndex = -1) override; - AZ::Outcome OpenScriptCanvasAssetImplementation(const SourceHandle& sourceHandle, int tabIndex = -1); + AZ::Outcome OpenScriptCanvasAssetId(const SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState) override; + AZ::Outcome OpenScriptCanvasAsset(SourceHandle scriptCanvasAssetId, Tracker::ScriptCanvasFileState fileState, int tabIndex = -1) override; + AZ::Outcome OpenScriptCanvasAssetImplementation(const SourceHandle& sourceHandle, Tracker::ScriptCanvasFileState fileState, int tabIndex = -1); int CloseScriptCanvasAsset(const SourceHandle& assetId) override; bool CreateScriptCanvasAssetFor(const TypeDefs::EntityComponentId& requestingEntityId) override; @@ -438,8 +438,7 @@ namespace ScriptCanvasEditor //// AZ::Outcome CreateScriptCanvasAsset(AZStd::string_view assetPath, int tabIndex = -1); - void RefreshScriptCanvasAsset(const AZ::Data::Asset& scriptCanvasAsset); - + //! Removes the assetId -> ScriptCanvasAsset mapping and disconnects from the asset tracker void RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId); void OnChangeActiveGraphTab(ScriptCanvasEditor::SourceHandle) override; @@ -525,8 +524,9 @@ namespace ScriptCanvasEditor AZ::EntityId FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId editorNodeId) const override; private: + void SourceFileChanged(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; void SourceFileRemoved(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; - + void DeleteNodes(const AZ::EntityId& sceneId, const AZStd::vector& nodes) override; void DeleteConnections(const AZ::EntityId& sceneId, const AZStd::vector& connections) override; void DisconnectEndpoints(const AZ::EntityId& sceneId, const AZStd::vector& endpoints) override; @@ -549,11 +549,6 @@ namespace ScriptCanvasEditor void OnAutoSave(); - //! Helper function which serializes a file to disk - //! \param filename name of file to serialize the Entity - //! \param asset asset to save - void GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& assetId, AZStd::string& filePath, AZStd::string& fileFilter); - void UpdateFileState(const ScriptCanvasEditor::SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState); // QMainWindow @@ -599,14 +594,14 @@ namespace ScriptCanvasEditor void UpdateAssignToSelectionState(); void UpdateUndoRedoState(); - void UpdateSaveState(); + void UpdateSaveState(bool enabled); void CreateFunctionInput(); void CreateFunctionOutput(); void CreateFunctionDefinitionNode(int positionOffset); - int CreateAssetTab(const ScriptCanvasEditor::SourceHandle& assetId, int tabIndex = -1); + int CreateAssetTab(const ScriptCanvasEditor::SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState, int tabIndex = -1); //! \param asset The AssetId of the ScriptCanvas Asset. void SetActiveAsset(const ScriptCanvasEditor::SourceHandle& assetId); @@ -767,5 +762,11 @@ namespace ScriptCanvasEditor AZStd::unique_ptr m_fileSaver; VersionExplorer::FileSaveResult m_fileSaveResult; void OnSaveCallBack(const VersionExplorer::FileSaveResult& result); + + void ClearStaleSaves(); + bool IsRecentSave(const SourceHandle& handle) const; + void MarkRecentSave(const SourceHandle& handle); + AZStd::recursive_mutex m_mutex; + AZStd::unordered_map m_saves; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp index 3522f3cfa2..c557a83f0c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp @@ -98,7 +98,7 @@ namespace ScriptCanvasEditor if (!asset.Path().empty()) { - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, asset, -1); + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, asset, Tracker::ScriptCanvasFileState::UNMODIFIED, -1); } if (!openOutcome) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index ae85dbc6a9..1b24d2d12a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -194,14 +194,18 @@ namespace ScriptCanvasEditor , m_id(id) , m_path(path) { - + m_path.MakePreferred(); + m_id = id; } SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, const AZ::IO::Path& path) : m_data(graph) , m_id(id) , m_path(path) - {} + { + m_path.MakePreferred(); + m_id = id; + } bool SourceHandle::AnyEquals(const SourceHandle& other) const { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index d514683b55..8671197f7b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -27,8 +27,6 @@ #define OBJECT_STREAM_EDITOR_ASSET_LOADING_SUPPORT_ENABLED -// #define EDITOR_ASSET_SUPPORT_ENABLED - namespace AZ { class Entity; From 23267fd862288ef59abc49bd9ce00cbcf7169677 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:04:49 -0800 Subject: [PATCH 058/399] SC Editor serialization update in JSON Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Serialization/Json/BaseJsonSerializer.cpp | 16 +++++ .../Serialization/Json/BaseJsonSerializer.h | 7 +- .../Assets/ScriptCanvasFileHandling.cpp | 2 +- .../EditorScriptCanvasComponent.cpp | 33 ++++++--- .../Code/Editor/Components/EditorUtils.cpp | 2 +- .../Components/EditorScriptCanvasComponent.h | 3 + .../EditorScriptCanvasComponentSerializer.cpp | 55 +++++++++++++++ .../EditorScriptCanvasComponentSerializer.h | 31 +++++++++ .../Code/Editor/View/Widgets/GraphTabBar.cpp | 2 +- .../Code/Editor/View/Windows/MainWindow.cpp | 68 ++++++++++--------- .../Windows/Tools/UpgradeTool/Modifier.cpp | 4 +- .../Windows/Tools/UpgradeTool/Scanner.cpp | 2 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 10 +-- .../Code/Include/ScriptCanvas/Core/Core.h | 4 +- .../Code/scriptcanvasgem_editor_files.cmake | 2 + 15 files changed, 185 insertions(+), 56 deletions(-) create mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp create mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.h diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.cpp b/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.cpp index 7309955a1c..4f5657a328 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.cpp @@ -204,6 +204,22 @@ namespace AZ // BaseJsonSerializer // + JsonSerializationResult::Result BaseJsonSerializer::Load(void* outputValue, const Uuid& outputValueTypeId, const rapidjson::Value& inputValue, + JsonDeserializerContext& context) + { + JsonSerializationResult::ResultCode result(JsonSerializationResult::Tasks::ReadField); + result.Combine(ContinueLoading(outputValue, outputValueTypeId, inputValue, context, ContinuationFlags::IgnoreTypeSerializer)); + return context.Report(result, "Ignoring custom serialization during load"); + } + + JsonSerializationResult::Result BaseJsonSerializer::Store(rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue, + const Uuid& valueTypeId, JsonSerializerContext& context) + { + JsonSerializationResult::ResultCode result(JsonSerializationResult::Tasks::WriteValue); + result.Combine(ContinueStoring(outputValue, inputValue, defaultValue, valueTypeId, context, ContinuationFlags::IgnoreTypeSerializer)); + return context.Report(result, "Ignoring custom serialization during store"); + } + BaseJsonSerializer::OperationFlags BaseJsonSerializer::GetOperationsFlags() const { return OperationFlags::None; diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.h b/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.h index 7d2af01c16..4e8f545367 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.h +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.h @@ -180,13 +180,16 @@ namespace AZ //! Transforms the data from the rapidjson Value to outputValue, if the conversion is possible and supported. //! The serializer is responsible for casting to the proper type and safely writing to the outputValue memory. + //! \note The default implementation is to load the object ignoring a custom serializers for the type, which allows for custom serializers + //! to modify the object after all default loading has occurred. virtual JsonSerializationResult::Result Load(void* outputValue, const Uuid& outputValueTypeId, const rapidjson::Value& inputValue, - JsonDeserializerContext& context) = 0; + JsonDeserializerContext& context); //! Write the input value to a rapidjson value if the default value is not null and doesn't match the input value, otherwise //! an error is returned and sets the rapidjson value to a null value. + //! \note The default implementation is to store the object ignoring custom serializers. virtual JsonSerializationResult::Result Store(rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue, - const Uuid& valueTypeId, JsonSerializerContext& context) = 0; + const Uuid& valueTypeId, JsonSerializerContext& context); //! Returns the operation flags which tells the Json Serialization how this custom json serializer can be used. virtual OperationFlags GetOperationsFlags() const; diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index 68648a71f3..d806eb7e24 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -144,7 +144,7 @@ namespace ScriptCanvasEditor { namespace JSRU = AZ::JsonSerializationUtils; - if (!source.IsValid()) + if (!source.IsGraphValid()) { return AZ::Failure(AZStd::string("no source graph to save")); } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 34a79b2543..e059ff555b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -6,7 +6,6 @@ * */ - #include #include #include @@ -14,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -21,24 +21,26 @@ #include #include #include +#include #include #include #include +#include #include #include -#include #include #include +#include +#include #include #include -#include -#include namespace EditorScriptCanvasComponentCpp { enum Version { PrefabIntegration = 10, + InternalDev, AddSourceHandle, // add description above Current @@ -49,6 +51,8 @@ namespace ScriptCanvasEditor { static bool EditorScriptCanvasComponentVersionConverter(AZ::SerializeContext& serializeContext, AZ::SerializeContext::DataElementNode& rootElement) { + AZ_TracePrintf("ScriptCanvas", "EditorScriptCanvasComponentVersionConverter called!"); + if (rootElement.GetVersion() <= 4) { int assetElementIndex = rootElement.FindElement(AZ::Crc32("m_asset")); @@ -204,6 +208,11 @@ namespace ScriptCanvasEditor ; } } + + if (AZ::JsonRegistrationContext* jsonContext = azrtti_cast(context)) + { + jsonContext->Serializer()->HandlesType(); + } } EditorScriptCanvasComponent::EditorScriptCanvasComponent() @@ -238,7 +247,7 @@ namespace ScriptCanvasEditor AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - if (m_sourceHandle.IsValid()) + if (m_sourceHandle.IsDescriptionValid()) { GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_sourceHandle, Tracker::ScriptCanvasFileState::UNMODIFIED, -1); @@ -265,7 +274,11 @@ namespace ScriptCanvasEditor EditorComponentBase::Init(); AzFramework::AssetCatalogEventBus::Handler::BusConnect(); AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusConnect(); - // m_scriptCanvasAssetHolder.Init(GetEntityId(), GetId()); + } + + void EditorScriptCanvasComponent::InitializeSource(const SourceHandle& sourceHandle) + { + m_sourceHandle = sourceHandle; } //========================================================================= @@ -389,13 +402,13 @@ namespace ScriptCanvasEditor // or when the asset was explicitly set to empty. // // i.e. do not clear variables when we lose the catalog asset. - if ((assetId.IsValidDescription() && assetId.Describe() != m_removedHandle.Describe()) - || (!assetId.IsValidDescription() && !m_removedHandle.IsValidDescription())) + if ((assetId.IsDescriptionValid() && assetId.Describe() != m_removedHandle.Describe()) + || (!assetId.IsDescriptionValid() && !m_removedHandle.IsDescriptionValid())) { ClearVariables(); } - if (assetId.IsValidDescription()) + if (assetId.IsDescriptionValid()) { if (auto loaded = LoadFromFile(assetId.Path().c_str()); loaded.IsSuccess()) { @@ -473,7 +486,7 @@ namespace ScriptCanvasEditor void EditorScriptCanvasComponent::UpdatePropertyDisplay(const SourceHandle& sourceHandle) { - if (sourceHandle.IsValid()) + if (sourceHandle.IsGraphValid()) { BuildGameEntityData(); UpdateName(); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp index adf5035dbd..dccc50f732 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp @@ -33,7 +33,7 @@ namespace ScriptCanvasEditor { AZStd::optional CompleteDescription(const SourceHandle& source) { - if (source.IsValidDescription()) + if (source.IsDescriptionValid()) { return source; } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index c9cb472808..31ef111b7b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -48,6 +48,9 @@ namespace ScriptCanvasEditor EditorScriptCanvasComponent(const SourceHandle& sourceHandle); ~EditorScriptCanvasComponent() override; + // sets the soure but does not attempt to load anything; + void InitializeSource(const SourceHandle& sourceHandle); + //===================================================================== // AZ::Component void Init() override; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp new file mode 100644 index 0000000000..dfda030403 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp @@ -0,0 +1,55 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include + +namespace AZ +{ + AZ_CLASS_ALLOCATOR_IMPL(EditorScriptCanvasComponentSerializer, SystemAllocator, 0); + + JsonSerializationResult::Result EditorScriptCanvasComponentSerializer::Load + ( void* outputValue + , const Uuid& outputValueTypeId + , const rapidjson::Value& inputValue + , JsonDeserializerContext& context) + { + namespace JSR = JsonSerializationResult; + + AZ_Assert(outputValueTypeId == azrtti_typeid() + , "EditorScriptCanvasComponentSerializer Load against output typeID that was not EditorScriptCanvasComponent"); + AZ_Assert(outputValue, "EditorScriptCanvasComponentSerializer Load against null output"); + + auto outputComponent = reinterpret_cast(outputValue); + JsonSerializationResult::ResultCode result = BaseJsonSerializer::Load(outputValue, outputValueTypeId, inputValue, context); + + if (result.GetProcessing() != JSR::Processing::Halted) + { + auto assetHolderMember = inputValue.FindMember("m_assetHolder"); + if (assetHolderMember != inputValue.MemberEnd()) + { + ScriptCanvasEditor::ScriptCanvasAssetHolder assetHolder; + result.Combine + ( ContinueLoading(&assetHolder + , azrtti_typeid(), assetHolderMember->value, context)); + + if (result.GetProcessing() != JSR::Processing::Halted) + { + outputComponent->InitializeSource + ( ScriptCanvasEditor::SourceHandle(nullptr, assetHolder.GetAssetId().m_guid, assetHolder.GetAssetHint())); + } + } + } + + return context.Report(result, result.GetProcessing() != JSR::Processing::Halted + ? "EditorScriptCanvasComponentSerializer Load finished loading EditorScriptCanvasComponent" + : "EditorScriptCanvasComponentSerializer Load failed to load EditorScriptCanvasComponent"); + } +} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.h new file mode 100644 index 0000000000..68ad370997 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include + +namespace AZ +{ + class EditorScriptCanvasComponentSerializer + : public BaseJsonSerializer + { + public: + AZ_RTTI(EditorScriptCanvasComponentSerializer, "{80B497B3-ABC1-4991-A3C4-047A8CB2C26C}", BaseJsonSerializer); + AZ_CLASS_ALLOCATOR_DECL; + + private: + JsonSerializationResult::Result Load + ( void* outputValue + , const Uuid& outputValueTypeId + , const rapidjson::Value& inputValue + , JsonDeserializerContext& context) override; + }; +} diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index 2e0ace4768..6ea8f3a75d 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -235,7 +235,7 @@ namespace ScriptCanvasEditor if (tabdata.isValid()) { auto tabAssetId = tabdata.value(); - if (tabAssetId.m_assetId.IsValid() + if (tabAssetId.m_assetId.IsGraphValid() && tabAssetId.m_assetId.Get()->GetGraphCanvasGraphId() == graphCanvasGraphId) { return tabAssetId.m_assetId.Get()->GetScriptCanvasId(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 52c5b4c5d2..06c907f56d 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -251,7 +251,7 @@ namespace ScriptCanvasEditor if (fileState == Tracker::ScriptCanvasFileState::MODIFIED || fileState == Tracker::ScriptCanvasFileState::UNMODIFIED) { ScriptCanvasEditor::SourceHandle sourceId = GetSourceAssetId(assetId); - if (sourceId.IsValid()) + if (sourceId.IsGraphValid()) { EditorSettings::EditorWorkspace::WorkspaceAssetSaveData assetSaveData; assetSaveData.m_assetId = sourceId; @@ -267,13 +267,13 @@ namespace ScriptCanvasEditor } // The assetId needs to be the file AssetId to restore the workspace - if (focusedAssetId.IsValid()) + if (focusedAssetId.IsGraphValid()) { focusedAssetId = GetSourceAssetId(focusedAssetId); } // If our currently focused asset won't be restored, just show the first element. - if (!focusedAssetId.IsValid()) + if (!focusedAssetId.IsGraphValid()) { if (!activeAssets.empty()) { @@ -643,7 +643,7 @@ namespace ScriptCanvasEditor QTimer::singleShot(0, [this]() { SetDefaultLayout(); - if (m_activeGraph.IsValid()) + if (m_activeGraph.IsGraphValid()) { m_queuedFocusOverride = m_activeGraph; } @@ -824,7 +824,7 @@ namespace ScriptCanvasEditor void MainWindow::SignalActiveSceneChanged(ScriptCanvasEditor::SourceHandle assetId) { AZ::EntityId graphId; - if (assetId.IsValid()) + if (assetId.IsGraphValid()) { EditorGraphRequestBus::EventResult(graphId, assetId.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); } @@ -1199,17 +1199,23 @@ namespace ScriptCanvasEditor return AZ::Success(outTabIndex); } - outTabIndex = CreateAssetTab(fileAssetId, fileState); + auto loadedGraph = LoadFromFile(fileAssetId.Path().c_str()); + if (!loadedGraph.IsSuccess()) + { + return AZ::Failure(AZStd::string("Failed to load graph at %s", fileAssetId.Path().c_str())); + } + + outTabIndex = CreateAssetTab(loadedGraph.GetValue(), fileState); if (!m_isRestoringWorkspace) { - SetActiveAsset(fileAssetId); + SetActiveAsset(loadedGraph.GetValue()); } if (outTabIndex >= 0) { - AddRecentFile(fileAssetId.Path().c_str()); - OpenScriptCanvasAssetImplementation(fileAssetId, fileState); + AddRecentFile(loadedGraph.GetValue().Path().c_str()); + OpenScriptCanvasAssetImplementation(loadedGraph.GetValue(), fileState); return AZ::Success(outTabIndex); } else @@ -1221,12 +1227,12 @@ namespace ScriptCanvasEditor AZ::Outcome MainWindow::OpenScriptCanvasAssetImplementation(const SourceHandle& scriptCanvasAsset, Tracker::ScriptCanvasFileState fileState, int tabIndex) { const ScriptCanvasEditor::SourceHandle& fileAssetId = scriptCanvasAsset; - if (!fileAssetId.IsValid()) + if (!fileAssetId.IsDescriptionValid()) { return AZ::Failure(AZStd::string("Unable to open asset with invalid asset id")); } - if (!scriptCanvasAsset.IsValid()) + if (!scriptCanvasAsset.IsDescriptionValid()) { if (!m_isRestoringWorkspace) { @@ -1282,7 +1288,7 @@ namespace ScriptCanvasEditor AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, Tracker::ScriptCanvasFileState fileState, int tabIndex) { - if (scriptCanvasAssetId.IsValid()) + if (scriptCanvasAssetId.IsGraphValid()) { return OpenScriptCanvasAssetImplementation(scriptCanvasAssetId, fileState, tabIndex); } @@ -1303,7 +1309,7 @@ namespace ScriptCanvasEditor m_assetCreationRequests.erase(assetId); GeneralAssetNotificationBus::Event(assetId, &GeneralAssetNotifications::OnAssetUnloaded); - if (assetId.IsValid()) + if (assetId.IsGraphValid()) { // Disconnect scene and asset editor buses GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(assetId.Get()->GetScriptCanvasId()); @@ -1379,7 +1385,7 @@ namespace ScriptCanvasEditor void MainWindow::OpenFile(const char* fullPath) { auto tabIndex = m_tabBar->FindTabByPath(fullPath); - if (tabIndex.IsValid()) + if (tabIndex.IsGraphValid()) { SetActiveAsset(tabIndex); return; @@ -1699,7 +1705,7 @@ namespace ScriptCanvasEditor bool MainWindow::SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& inMemoryAssetId, Save save) { - if (!inMemoryAssetId.IsValid()) + if (!inMemoryAssetId.IsGraphValid()) { return false; } @@ -2446,7 +2452,7 @@ namespace ScriptCanvasEditor { AZ::EntityId graphId{}; - if (m_activeGraph.IsValid()) + if (m_activeGraph.IsGraphValid()) { EditorGraphRequestBus::EventResult ( graphId, m_activeGraph.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); @@ -2471,7 +2477,7 @@ namespace ScriptCanvasEditor { AZ::EntityId graphId{}; - if (assetId.IsValid()) + if (assetId.IsGraphValid()) { EditorGraphRequestBus::EventResult ( graphId, assetId.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); @@ -2482,7 +2488,7 @@ namespace ScriptCanvasEditor ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const { - return assetId.IsValid() ? assetId.Get()->GetScriptCanvasId() : ScriptCanvas::ScriptCanvasId{}; + return assetId.IsGraphValid() ? assetId.Get()->GetScriptCanvasId() : ScriptCanvas::ScriptCanvasId{}; } ScriptCanvas::ScriptCanvasId MainWindow::GetScriptCanvasId(const GraphCanvas::GraphId& graphCanvasGraphId) const @@ -2548,14 +2554,14 @@ namespace ScriptCanvasEditor { // Disconnect previous asset AZ::EntityId previousScriptCanvasSceneId; - if (previousAsset.IsValid()) + if (previousAsset.IsGraphValid()) { previousScriptCanvasSceneId = previousAsset.Get()->GetScriptCanvasId(); GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(previousScriptCanvasSceneId); } AZ::EntityId nextAssetGraphCanvasId; - if (nextAsset.IsValid()) + if (nextAsset.IsGraphValid()) { // Connect the next asset EditorGraphRequestBus::EventResult(nextAssetGraphCanvasId, nextAsset.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); @@ -2583,7 +2589,7 @@ namespace ScriptCanvasEditor AssetHelpers::PrintInfo("SetActiveAsset : from: %s to %s", m_activeGraph.ToString().c_str(), fileAssetId.ToString().c_str()); - if (fileAssetId.IsValid()) + if (fileAssetId.IsGraphValid()) { if (m_tabBar->FindTab(fileAssetId) >= 0) { @@ -2596,7 +2602,7 @@ namespace ScriptCanvasEditor } } - if (m_activeGraph.IsValid()) + if (m_activeGraph.IsGraphValid()) { // If we are saving the asset, the Id may have changed from the in-memory to the file asset Id, in that case, // there's no need to hide the view or remove the widget @@ -2609,7 +2615,7 @@ namespace ScriptCanvasEditor } } - if (fileAssetId.IsValid()) + if (fileAssetId.IsGraphValid()) { ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; m_activeGraph = fileAssetId; @@ -2631,7 +2637,7 @@ namespace ScriptCanvasEditor void MainWindow::RefreshActiveAsset() { - if (m_activeGraph.IsValid()) + if (m_activeGraph.IsGraphValid()) { AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", m_activeGraph.ToString().c_str()); if (auto view = m_tabBar->ModOrCreateTabView(m_tabBar->FindTab(m_activeGraph))) @@ -2762,7 +2768,7 @@ namespace ScriptCanvasEditor if (m_isClosingTabs) { if (m_tabBar->count() == 0 - || (m_tabBar->count() == 1 && m_skipTabOnClose.IsValid())) + || (m_tabBar->count() == 1 && m_skipTabOnClose.IsGraphValid())) { m_isClosingTabs = false; m_skipTabOnClose.Clear(); @@ -3003,7 +3009,7 @@ namespace ScriptCanvasEditor bool hasCopiableSelection = false; bool hasSelection = false; - if (m_activeGraph.IsValid()) + if (m_activeGraph.IsGraphValid()) { if (graphCanvasGraphId.IsValid()) { @@ -3396,17 +3402,17 @@ namespace ScriptCanvasEditor { m_isRestoringWorkspace = false; - if (m_queuedFocusOverride.IsValid()) + if (m_queuedFocusOverride.IsGraphValid()) { SetActiveAsset(m_queuedFocusOverride); m_queuedFocusOverride.Clear(); } - else if (lastFocusAsset.IsValid()) + else if (lastFocusAsset.IsGraphValid()) { SetActiveAsset(lastFocusAsset); } - if (!m_activeGraph.IsValid()) + if (!m_activeGraph.IsGraphValid()) { if (m_tabBar->count() > 0) { @@ -3429,7 +3435,7 @@ namespace ScriptCanvasEditor void MainWindow::UpdateAssignToSelectionState() { - bool buttonEnabled = m_activeGraph.IsValid(); + bool buttonEnabled = m_activeGraph.IsGraphValid(); if (buttonEnabled) { @@ -3789,7 +3795,7 @@ namespace ScriptCanvasEditor OnFileNew(); - if (m_activeGraph.IsValid()) + if (m_activeGraph.IsGraphValid()) { graphId = GetActiveGraphCanvasGraphId(); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index 830d09c7dd..71aeb1dbb9 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -118,7 +118,7 @@ namespace ScriptCanvasEditor SourceHandle Modifier::LoadAsset() { auto& handle = ModCurrentAsset(); - if (!handle.IsValid()) + if (!handle.IsGraphValid()) { auto outcome = LoadFromFile(handle.Path().c_str()); if (outcome.IsSuccess()) @@ -158,7 +158,7 @@ namespace ScriptCanvasEditor ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, ModCurrentAsset()); - if (auto asset = LoadAsset(); asset.IsValid()) + if (auto asset = LoadAsset(); asset.IsGraphValid()) { ModificationNotificationsBus::Handler::BusConnect(); m_modifyState = ModifyState::InProgress; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp index f9fc6e497d..816ded8a7b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp @@ -132,7 +132,7 @@ namespace ScriptCanvasEditor } else { - if (auto asset = LoadAsset(); asset.IsValid()) + if (auto asset = LoadAsset(); asset.IsGraphValid()) { VE_LOG("Scanner: Loaded: %s ", ModCurrentAsset().Path().c_str()); FilterAsset(asset); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 8e3d5c53e8..fd9d2ccd57 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -237,14 +237,14 @@ namespace ScriptCanvasEditor return m_id; } - bool SourceHandle::IsValid() const + bool SourceHandle::IsDescriptionValid() const { - return m_data != nullptr; + return !m_id.IsNull() && !m_path.empty(); } - bool SourceHandle::IsValidDescription() const + bool SourceHandle::IsGraphValid() const { - return !m_id.IsNull() && !m_path.empty(); + return m_data != nullptr; } GraphPtr SourceHandle::Mod() const @@ -290,7 +290,7 @@ namespace ScriptCanvasEditor { return AZStd::string::format ( "%s, %s, %s" - , IsValid() ? "O" : "X" + , IsGraphValid() ? "O" : "X" , m_path.empty() ? m_path.c_str() : "" , m_id.IsNull() ? "" : m_id.ToString().c_str()); } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 8671197f7b..b5cf9c22b3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -342,9 +342,9 @@ namespace ScriptCanvasEditor const AZ::Uuid& Id() const; - bool IsValid() const; + bool IsDescriptionValid() const; - bool IsValidDescription() const; + bool IsGraphValid() const; GraphPtr Mod() const; diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index 7f269e2081..449298097f 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -59,6 +59,8 @@ set(FILES Editor/Components/EditorGraphVariableManagerComponent.cpp Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h Editor/Components/EditorScriptCanvasComponent.cpp + Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.h + Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp Editor/Components/IconComponent.h Editor/Components/IconComponent.cpp Editor/Include/ScriptCanvas/GraphCanvas/DynamicSlotBus.h From 66e744785f89689fa119a6023e68c77dc59821a1 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 22 Nov 2021 20:34:11 -0800 Subject: [PATCH 059/399] EditorCOmponent build pipeline WIP Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilder.cpp | 127 ++--------------- .../Code/Builder/ScriptCanvasBuilder.h | 27 +--- .../Assets/ScriptCanvasFileHandling.cpp | 132 +++++++++++++++++- .../EditorScriptCanvasComponent.cpp | 43 ++++-- .../Code/Editor/Components/EditorUtils.cpp | 13 ++ .../Assets/ScriptCanvasFileHandling.h | 18 +++ .../Components/EditorScriptCanvasComponent.h | 2 + .../ScriptCanvas/Components/EditorUtils.h | 2 + .../Code/Editor/View/Widgets/GraphTabBar.cpp | 1 + .../Widgets/SourceHandlePropertyAssetCtrl.cpp | 2 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 20 +++ .../Code/Include/ScriptCanvas/Core/Core.h | 6 +- 12 files changed, 233 insertions(+), 160 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index a75b68b518..bb2b94bb50 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -13,23 +13,14 @@ #include #include #include - -namespace ScriptCanvasBuilderCpp -{ - void AppendTabs(AZStd::string& result, size_t depth) - { - for (size_t i = 0; i < depth; ++i) - { - result += "\t"; - } - } -} +#include +#include namespace ScriptCanvasBuilder { void BuildVariableOverrides::Clear() { - m_source.Reset(); + m_source = {}; m_variables.clear(); m_overrides.clear(); m_overridesUnused.clear(); @@ -104,6 +95,7 @@ namespace ScriptCanvasBuilder return m_variables.empty() && m_entityIds.empty() && m_dependencies.empty(); } + // #sc_editor_asset THIS MUST GET VERSIONED! void BuildVariableOverrides::Reflect(AZ::ReflectContext* reflectContext) { if (auto serializeContext = azrtti_cast(reflectContext)) @@ -203,45 +195,12 @@ namespace ScriptCanvasBuilder } } - EditorAssetTree* EditorAssetTree::ModRoot() - { - if (!m_parent) - { - return this; - } - - return m_parent->ModRoot(); - } - - void EditorAssetTree::SetParent(EditorAssetTree& parent) - { - m_parent = &parent; - } - - AZStd::string EditorAssetTree::ToString(size_t depth) const - { - AZStd::string result; - ScriptCanvasBuilderCpp::AppendTabs(result, depth); - result += m_asset.GetId().ToString(); - result += m_asset.GetHint(); - depth += m_dependencies.empty() ? 0 : 1; - - for (const auto& dependency : m_dependencies) - { - result += "\n"; - ScriptCanvasBuilderCpp::AppendTabs(result, depth); - result += dependency.ToString(depth); - } - - return result; - } - ScriptCanvas::RuntimeDataOverrides ConvertToRuntime(const BuildVariableOverrides& buildOverrides) { ScriptCanvas::RuntimeDataOverrides runtimeOverrides; runtimeOverrides.m_runtimeAsset = AZ::Data::Asset - (AZ::Data::AssetId(buildOverrides.m_source.GetId().m_guid, AZ_CRC("RuntimeData", 0x163310ae)), azrtti_typeid(), {}); + (AZ::Data::AssetId(buildOverrides.m_source.Id(), AZ_CRC("RuntimeData", 0x163310ae)), azrtti_typeid(), {}); runtimeOverrides.m_runtimeAsset.SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::PreLoad); runtimeOverrides.m_variableIndices.resize(buildOverrides.m_variables.size()); @@ -304,76 +263,9 @@ namespace ScriptCanvasBuilder return runtimeOverrides; } - AZ::Outcome LoadEditorAssetTree(AZ::Data::AssetId editorAssetId, AZStd::string_view assetHint, EditorAssetTree* parent) - { - EditorAssetTree result; - AZ::Data::AssetInfo assetInfo; - AZStd::string watchFolder; - bool resultFound = false; - - if (!AzToolsFramework::AssetSystemRequestBus::FindFirstHandler()) - { - return AZ::Failure(AZStd::string("LoadEditorAssetTree found no handler for AzToolsFramework::AssetSystemRequestBus.")); - } - - AzToolsFramework::AssetSystemRequestBus::BroadcastResult - ( resultFound - , &AzToolsFramework::AssetSystem::AssetSystemRequest::GetSourceInfoBySourceUUID - , editorAssetId.m_guid - , assetInfo - , watchFolder); - - if (!resultFound) - { - return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to get engine relative path from %s-%.*s.", editorAssetId.ToString().c_str(), aznumeric_cast(assetHint.size()), assetHint.data())); - } - - AZStd::vector dependentAssets; - - auto filterCB = [&dependentAssets](const AZ::Data::AssetFilterInfo& filterInfo)->bool - { - if (filterInfo.m_assetType == azrtti_typeid()) - { - dependentAssets.push_back(AZ::Data::AssetId(filterInfo.m_assetId.m_guid, 0)); - } - else if (filterInfo.m_assetType == azrtti_typeid()) - { - dependentAssets.push_back(filterInfo.m_assetId); - } - - return true; - }; - - auto loadAssetOutcome = ScriptCanvasBuilder::LoadEditorAsset(assetInfo.m_relativePath, editorAssetId, filterCB); - if (!loadAssetOutcome.IsSuccess()) - { - return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to load graph from %s-%s: %s", editorAssetId.ToString().c_str(), assetHint.data(), loadAssetOutcome.GetError().c_str())); - } - - for (auto& dependentAsset : dependentAssets) - { - auto loadDependentOutcome = LoadEditorAssetTree(dependentAsset, "", &result); - if (!loadDependentOutcome.IsSuccess()) - { - return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to load dependent graph from %s-%s: %s", editorAssetId.ToString().c_str(), assetHint.data(), loadDependentOutcome.GetError().c_str())); - } - - result.m_dependencies.push_back(loadDependentOutcome.TakeValue()); - } - - if (parent) - { - result.SetParent(*parent); - } - - result.m_asset = loadAssetOutcome.TakeValue(); - - return AZ::Success(result); - } - - AZ::Outcome ParseEditorAssetTree(const EditorAssetTree& editorAssetTree) + AZ::Outcome ParseEditorAssetTree(const ScriptCanvasEditor::EditorAssetTree& editorAssetTree) { - auto buildEntity = editorAssetTree.m_asset->GetScriptCanvasEntity(); + auto buildEntity = editorAssetTree.m_asset.Get()->GetEntity(); if (!buildEntity) { return AZ::Failure(AZStd::string("No entity from source asset")); @@ -409,9 +301,8 @@ namespace ScriptCanvasBuilder if (!parseDependentOutcome.IsSuccess()) { return AZ::Failure(AZStd::string::format - ( "ParseEditorAssetTree failed to parse dependent graph from %s-%s: %s" - , dependentAsset.m_asset.GetId().ToString().c_str() - , dependentAsset.m_asset.GetHint().c_str() + ( "ParseEditorAssetTree failed to parse dependent graph from %s: %s" + , dependentAsset.m_asset.ToString().c_str() , parseDependentOutcome.GetError().c_str())); } diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h index f03e78bc3e..0dedd67847 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h @@ -16,6 +16,7 @@ namespace ScriptCanvasEditor { class ScriptCanvasAsset; + class EditorAssetTree; } namespace ScriptCanvasBuilder @@ -39,8 +40,8 @@ namespace ScriptCanvasBuilder void PopulateFromParsedResults(ScriptCanvas::Grammar::AbstractCodeModelConstPtr abstractCodeModel, const ScriptCanvas::VariableData& variables); // #functions2 provide an identifier for the node/variable in the source that caused the dependency. the root will not have one. - AZ::Data::Asset m_source; - + ScriptCanvasEditor::SourceHandle m_source; + // all of the variables here are overrides AZStd::vector m_variables; // the values here may or may not be overrides @@ -48,30 +49,12 @@ namespace ScriptCanvasBuilder // these two variable lists are all that gets exposed to the edit context AZStd::vector m_overrides; AZStd::vector m_overridesUnused; - // AZStd::vector m_entityIdRuntimeInputIndices; since all of the entity ids need to go in, they may not need indices + // AZStd::vector m_entityIdRuntimeInputIndices; since all oSf the entity ids need to go in, they may not need indices AZStd::vector m_dependencies; }; - class EditorAssetTree - { - public: - AZ_CLASS_ALLOCATOR(EditorAssetTree, AZ::SystemAllocator, 0); - - EditorAssetTree* m_parent = nullptr; - AZStd::vector m_dependencies; - AZ::Data::Asset m_asset; - - EditorAssetTree* ModRoot(); - - void SetParent(EditorAssetTree& parent); - - AZStd::string ToString(size_t depth = 0) const; - }; - // copy the variables overridden during editor / prefab build time back to runtime data ScriptCanvas::RuntimeDataOverrides ConvertToRuntime(const BuildVariableOverrides& overrides); - AZ::Outcome LoadEditorAssetTree(AZ::Data::AssetId editorAssetId, AZStd::string_view assetHint, EditorAssetTree* parent = nullptr); - - AZ::Outcome ParseEditorAssetTree(const EditorAssetTree& editorAssetTree); + AZ::Outcome ParseEditorAssetTree(const ScriptCanvasEditor::EditorAssetTree& editorAssetTree); } diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index d806eb7e24..e5d9e86fbe 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -22,18 +22,26 @@ #include #include #include - +#include + namespace ScriptCanvasFileHandlingCpp { - using namespace ScriptCanvas; + void AppendTabs(AZStd::string& result, size_t depth) + { + for (size_t i = 0; i < depth; ++i) + { + result += "\t"; + } + } - void CollectNodes(const GraphData::NodeContainer& container, SerializationListeners& listeners) + void CollectNodes(const ScriptCanvas::GraphData::NodeContainer& container, ScriptCanvas::SerializationListeners& listeners) { for (auto& nodeEntity : container) { if (nodeEntity) { - if (auto listener = azrtti_cast(AZ::EntityUtils::FindFirstDerivedComponent(nodeEntity))) + if (auto listener = azrtti_cast + ( AZ::EntityUtils::FindFirstDerivedComponent(nodeEntity))) { listeners.push_back(listener); } @@ -44,6 +52,38 @@ namespace ScriptCanvasFileHandlingCpp namespace ScriptCanvasEditor { + EditorAssetTree* EditorAssetTree::ModRoot() + { + if (!m_parent) + { + return this; + } + + return m_parent->ModRoot(); + } + + void EditorAssetTree::SetParent(EditorAssetTree& parent) + { + m_parent = &parent; + } + + AZStd::string EditorAssetTree::ToString(size_t depth) const + { + AZStd::string result; + ScriptCanvasFileHandlingCpp::AppendTabs(result, depth); + result += m_asset.ToString(); + depth += m_dependencies.empty() ? 0 : 1; + + for (const auto& dependency : m_dependencies) + { + result += "\n"; + ScriptCanvasFileHandlingCpp::AppendTabs(result, depth); + result += dependency.ToString(depth); + } + + return result; + } + AZ::Outcome LoadDataFromJson ( ScriptCanvas::ScriptCanvasData& dataTarget , AZStd::string_view source @@ -87,6 +127,88 @@ namespace ScriptCanvasEditor return AZ::Success(); } + + AZ::Outcome LoadEditorAssetTree(SourceHandle handle, EditorAssetTree* parent) + { + if (!CompleteDescriptionInPlace(handle)) + { + return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to describe graph from %s", handle.ToString().c_str())); + } + + auto loadAssetOutcome = LoadFromFile(handle.Path().c_str()); + if (!loadAssetOutcome.IsSuccess()) + { + return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to load graph from %s: %s" + , handle.ToString().c_str(), loadAssetOutcome.GetError().c_str())); + } + + AZStd::vector dependentAssets; + + auto filterCB = [&dependentAssets](const AZ::Data::AssetFilterInfo& filterInfo)->bool + { + if (filterInfo.m_assetType == azrtti_typeid() + || filterInfo.m_assetType == azrtti_typeid()) + { + dependentAssets.push_back(SourceHandle(nullptr, filterInfo.m_assetId.m_guid, {})); + } + + return true; + }; + + const auto subgraphInterfaceAssetTypeID = azrtti_typeid>(); + + auto beginElementCB = [&subgraphInterfaceAssetTypeID, &dependentAssets] + ( void* instance + , const AZ::SerializeContext::ClassData* classData + , const AZ::SerializeContext::ClassElement* classElement) -> bool + { + if (classElement) + { + // if we are a pointer, then we may be pointing to a derived type. + if (classElement->m_flags & AZ::SerializeContext::ClassElement::FLG_POINTER) + { + // if ptr is a pointer-to-pointer, cast its value to a void* (or const void*) and dereference to get to the actual object pointer. + instance = *(void**)(instance); + } + + if (classData->m_typeId == subgraphInterfaceAssetTypeID) + { + auto id = reinterpret_cast*>(instance)->GetId(); + dependentAssets.push_back(SourceHandle(nullptr, id.m_guid, {})); + } + } + + return true; + }; + + AZ::SerializeContext* serializeContext = nullptr; + AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); + serializeContext->EnumerateObject( handle.Get(), beginElementCB, nullptr, AZ::SerializeContext::ENUM_ACCESS_FOR_READ); + + EditorAssetTree result; + + for (auto& dependentAsset : dependentAssets) + { + auto loadDependentOutcome = LoadEditorAssetTree(dependentAsset, &result); + if (!loadDependentOutcome.IsSuccess()) + { + return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to load graph from %s: %s" + , dependentAsset.ToString().c_str(), loadDependentOutcome.GetError().c_str())); + } + + result.m_dependencies.push_back(loadDependentOutcome.TakeValue()); + } + + if (parent) + { + result.SetParent(*parent); + } + + result.m_asset = loadAssetOutcome.TakeValue(); + + return AZ::Success(result); + } + AZ::Outcome LoadFromFile(AZStd::string_view path) { namespace JSRU = AZ::JsonSerializationUtils; @@ -137,7 +259,7 @@ namespace ScriptCanvasEditor graph->MarkOwnership(*scriptCanvasData); } - return AZ::Success(ScriptCanvasEditor::SourceHandle(scriptCanvasData, {}, path)); + return AZ::Success(ScriptCanvasEditor::SourceHandle(scriptCanvasData, path)); } AZ::Outcome SaveToStream(const SourceHandle& source, AZ::IO::GenericStream& stream) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index e059ff555b..fd2aa3e884 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -134,7 +134,7 @@ namespace ScriptCanvasEditor } ScriptCanvasBuilder::BuildVariableOverrides overrides; - overrides.m_source = AZ::Data::Asset(assetHolder.GetAssetId(), assetHolder.GetAssetType(), assetHolder.GetAssetHint());; + overrides.m_source = SourceHandle(nullptr, assetHolder.GetAssetId().m_guid, {}); for (auto& variable : editableData.GetVariables()) { @@ -197,14 +197,15 @@ namespace ScriptCanvasEditor ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Level", 0x9aeacc13)) ->Attribute(AZ::Edit::Attributes::HelpPageURL, "https://o3de.org/docs/user-guide/components/reference/scripting/script-canvas/") ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_sourceHandle, "Script Canvas Source File", "Script Canvas source file associated with this component") - ->Attribute("BrowseIcon", ":/stylesheet/img/UI20/browse-edit-select-files.svg") - ->Attribute("EditButton", "") - ->Attribute("EditDescription", "Open in Script Canvas Editor") - ->Attribute("EditCallback", &EditorScriptCanvasComponent::OpenEditor) - ->Attribute(AZ::Edit::Attributes::AssetPickerTitle, "Script Canvas") - ->Attribute(AZ::Edit::Attributes::SourceAssetFilterPattern, "*.scriptcanvas") + ->Attribute("BrowseIcon", ":/stylesheet/img/UI20/browse-edit-select-files.svg") + ->Attribute("EditButton", "") + ->Attribute("EditDescription", "Open in Script Canvas Editor") + ->Attribute("EditCallback", &EditorScriptCanvasComponent::OpenEditor) + ->Attribute(AZ::Edit::Attributes::AssetPickerTitle, "Script Canvas") + ->Attribute(AZ::Edit::Attributes::SourceAssetFilterPattern, "*.scriptcanvas") + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorScriptCanvasComponent::OnFileSelectionChanged) ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_variableOverrides, "Properties", "Script Canvas Graph Properties") - ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) ; } } @@ -319,7 +320,7 @@ namespace ScriptCanvasEditor m_runtimeDataIsValid = false; - auto assetTreeOutcome = LoadEditorAssetTree(m_sourceHandle.Id(), m_sourceHandle.Path().c_str()); + auto assetTreeOutcome = LoadEditorAssetTree(m_sourceHandle); if (!assetTreeOutcome.IsSuccess()) { AZ_Warning("ScriptCanvas", false, "EditorScriptCanvasComponent::BuildGameEntityData failed: %s", assetTreeOutcome.GetError().c_str()); @@ -386,6 +387,26 @@ namespace ScriptCanvasEditor return m_sourceHandle.Id(); } + AZ::u32 EditorScriptCanvasComponent::OnFileSelectionChanged() + { + m_sourceHandle = SourceHandle(nullptr, m_sourceHandle.Path()); + CompleteDescriptionInPlace(m_sourceHandle); + + m_previousHandle = {}; + m_removedHandle = {}; + + if (m_sourceHandle.IsDescriptionValid()) + { + OnScriptCanvasAssetChanged(m_sourceHandle); + } + else + { + ClearVariables(); + } + + return AZ::Edit::PropertyRefreshLevels::EntireTree; + } + void EditorScriptCanvasComponent::OnScriptCanvasAssetChanged(const SourceHandle& assetId) { ScriptCanvas::GraphIdentifier newIdentifier = GetGraphIdentifier(); @@ -492,10 +513,6 @@ namespace ScriptCanvasEditor UpdateName(); AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); } - else - { - // #sc_editor_asset clear or disable something - } } void EditorScriptCanvasComponent::ClearVariables() diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp index dccc50f732..d21b3d004c 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp @@ -78,6 +78,19 @@ namespace ScriptCanvasEditor return AZStd::nullopt; } + bool CompleteDescriptionInPlace(SourceHandle& source) + { + if (auto completed = CompleteDescription(source)) + { + source = *completed; + return true; + } + else + { + return false; + } + } + ////////////////////////// // NodeIdentifierFactory ////////////////////////// diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h index c88a7df28b..dd0e7aeb62 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h @@ -26,6 +26,22 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { + class EditorAssetTree + { + public: + AZ_CLASS_ALLOCATOR(EditorAssetTree, AZ::SystemAllocator, 0); + + EditorAssetTree* m_parent = nullptr; + AZStd::vector m_dependencies; + SourceHandle m_asset; + + EditorAssetTree* ModRoot(); + + void SetParent(EditorAssetTree& parent); + + AZStd::string ToString(size_t depth = 0) const; + }; + AZ::Outcome LoadFromFile(AZStd::string_view path); AZ::Outcome LoadDataFromJson @@ -33,5 +49,7 @@ namespace ScriptCanvasEditor , AZStd::string_view source , AZ::SerializeContext& serializeContext); + AZ::Outcome LoadEditorAssetTree(SourceHandle handle, EditorAssetTree* parent = nullptr); + AZ::Outcome SaveToStream(const SourceHandle& source, AZ::IO::GenericStream& stream); } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 31ef111b7b..19347e25eb 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -121,6 +121,8 @@ namespace ScriptCanvasEditor void SourceFileRemoved(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; void SourceFileFailed(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; + AZ::u32 OnFileSelectionChanged(); + void OnScriptCanvasAssetChanged(const SourceHandle& sourceHandle); void UpdateName(); diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h index 0d27d255af..a4522198b7 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h @@ -25,6 +25,8 @@ namespace ScriptCanvasEditor // If both Path and Id is valid, including after correction, returns the handle including source Data, // otherwise, returns null AZStd::optional CompleteDescription(const SourceHandle& source); + // if CompleteDescription() succeeds, sets the handle to the result, else does nothing + bool CompleteDescriptionInPlace(SourceHandle& source); class Graph; class NodePaletteModel; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index 6ea8f3a75d..17228565da 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -154,6 +154,7 @@ namespace ScriptCanvasEditor canvasWidget->SetDefaultBorderColor(ScriptCanvasAssetDescription().GetDisplayColorImpl()); metaData.m_canvasWidget = canvasWidget; metaData.m_assetId = assetId; + metaData.m_fileState = fileState; AZStd::string tabName; AzFramework::StringFunc::Path::GetFileName(assetId.Path().c_str(), tabName); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp index 04f7d79da5..3e4cb7cd49 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp @@ -138,7 +138,7 @@ namespace ScriptCanvasEditor (void)index; (void)node; - auto sourceHandle = SourceHandle(nullptr, {}, GUI->GetSelectedSourcePath()); + auto sourceHandle = SourceHandle(nullptr, GUI->GetSelectedSourcePath()); auto completeSourceHandle = CompleteDescription(sourceHandle); if (completeSourceHandle) { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index fd9d2ccd57..1ac7a33821 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -189,6 +189,10 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { + SourceHandle::SourceHandle() + : m_id(AZ::Uuid::CreateNull()) + {} + SourceHandle::SourceHandle(const SourceHandle& data, const AZ::Uuid& id, const AZ::IO::Path& path) : m_data(data.m_data) , m_id(id) @@ -207,6 +211,22 @@ namespace ScriptCanvasEditor m_id = id; } + SourceHandle::SourceHandle(const SourceHandle& data, const AZ::IO::Path& path) + : m_data(data.m_data) + , m_id(AZ::Uuid::CreateNull()) + , m_path(path) + { + m_path.MakePreferred(); + } + + SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::IO::Path& path) + : m_data(graph) + , m_id(AZ::Uuid::CreateNull()) + , m_path(path) + { + m_path.MakePreferred(); + } + bool SourceHandle::AnyEquals(const SourceHandle& other) const { return m_data && m_data == other.m_data diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index b5cf9c22b3..297ee70500 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -325,12 +325,16 @@ namespace ScriptCanvasEditor static void Reflect(AZ::ReflectContext* context); - SourceHandle() = default; + SourceHandle(); SourceHandle(const SourceHandle& data, const AZ::Uuid& id, const AZ::IO::Path& path); SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, const AZ::IO::Path& path); + SourceHandle(const SourceHandle& data, const AZ::IO::Path& path); + + SourceHandle(ScriptCanvas::DataPtr graph, const AZ::IO::Path& path); + bool AnyEquals(const SourceHandle& other) const; void Clear(); From 27cc659ab9cec7a37caf2868e46656bd7f8290c9 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Tue, 23 Nov 2021 10:31:26 -0800 Subject: [PATCH 060/399] Editor Script Component simplified and working Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilder.cpp | 18 +++++-- .../Assets/ScriptCanvasFileHandling.cpp | 49 ++++++++++--------- .../EditorScriptCanvasComponent.cpp | 46 ++++++++--------- .../Components/EditorScriptCanvasComponent.h | 10 +++- .../ScriptCanvas/Variable/GraphVariable.cpp | 5 ++ .../ScriptCanvas/Variable/GraphVariable.h | 2 + 6 files changed, 74 insertions(+), 56 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index bb2b94bb50..fe89c57009 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -30,11 +30,10 @@ namespace ScriptCanvasBuilder void BuildVariableOverrides::CopyPreviousOverriddenValues(const BuildVariableOverrides& source) { - auto isEqual = [](const ScriptCanvas::GraphVariable& overrideValue, const ScriptCanvas::GraphVariable& candidate) + auto isEqual = [](const ScriptCanvas::GraphVariable& lhs, const ScriptCanvas::GraphVariable& rhs) { - return candidate.GetVariableId() == overrideValue.GetVariableId() - || (candidate.GetVariableName() == overrideValue.GetVariableName() - && candidate.GetDataType() == overrideValue.GetDataType()); + return (lhs.GetVariableId() == rhs.GetVariableId() && lhs.GetDataType() == rhs.GetDataType()) + || (lhs.GetVariableName() == rhs.GetVariableName() && lhs.GetDataType() == rhs.GetDataType()); }; auto copyPreviousIfFound = [isEqual](ScriptCanvas::GraphVariable& overriddenValue, const AZStd::vector& source) @@ -44,7 +43,7 @@ namespace ScriptCanvasBuilder if (iter != source.end()) { - overriddenValue.DeepCopy(*iter); + overriddenValue.ModDatum().DeepCopyDatum(*iter->GetDatum()); overriddenValue.SetScriptInputControlVisibility(AZ::Edit::PropertyVisibility::Hide); overriddenValue.SetAllowSignalOnChange(false); return true; @@ -64,6 +63,15 @@ namespace ScriptCanvasBuilder } } + for (auto& overriddenValue : m_overridesUnused) + { + if (!copyPreviousIfFound(overriddenValue, source.m_overridesUnused)) + { + // the variable in question may have been previously used, and is now unused, so copy the previous value over + copyPreviousIfFound(overriddenValue, source.m_overrides); + } + } + ////////////////////////////////////////////////////////////////////////// // #functions2 provide an identifier for the node/variable in the source that caused the dependency. the root will not have one. // the above will provide the data to handle the cases where only certain dependency nodes were removed diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index e5d9e86fbe..8cecdc86d9 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -23,7 +23,8 @@ #include #include #include - +#include + namespace ScriptCanvasFileHandlingCpp { void AppendTabs(AZStd::string& result, size_t depth) @@ -135,26 +136,19 @@ namespace ScriptCanvasEditor return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to describe graph from %s", handle.ToString().c_str())); } - auto loadAssetOutcome = LoadFromFile(handle.Path().c_str()); - if (!loadAssetOutcome.IsSuccess()) - { - return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to load graph from %s: %s" - , handle.ToString().c_str(), loadAssetOutcome.GetError().c_str())); - } - - AZStd::vector dependentAssets; - - auto filterCB = [&dependentAssets](const AZ::Data::AssetFilterInfo& filterInfo)->bool + if (!handle.Get()) { - if (filterInfo.m_assetType == azrtti_typeid() - || filterInfo.m_assetType == azrtti_typeid()) + auto loadAssetOutcome = LoadFromFile(handle.Path().c_str()); + if (!loadAssetOutcome.IsSuccess()) { - dependentAssets.push_back(SourceHandle(nullptr, filterInfo.m_assetId.m_guid, {})); + return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to load graph from %s: %s" + , handle.ToString().c_str(), loadAssetOutcome.GetError().c_str())); } - return true; - }; + handle = SourceHandle(loadAssetOutcome.GetValue(), handle.Id(), handle.Path().c_str()); + } + AZStd::vector dependentAssets; const auto subgraphInterfaceAssetTypeID = azrtti_typeid>(); auto beginElementCB = [&subgraphInterfaceAssetTypeID, &dependentAssets] @@ -170,12 +164,13 @@ namespace ScriptCanvasEditor // if ptr is a pointer-to-pointer, cast its value to a void* (or const void*) and dereference to get to the actual object pointer. instance = *(void**)(instance); } + } - if (classData->m_typeId == subgraphInterfaceAssetTypeID) - { - auto id = reinterpret_cast*>(instance)->GetId(); - dependentAssets.push_back(SourceHandle(nullptr, id.m_guid, {})); - } + if (classData->m_typeId == subgraphInterfaceAssetTypeID) + { + auto asset = reinterpret_cast*>(instance); + auto id = asset->GetId(); + dependentAssets.push_back(SourceHandle(nullptr, id.m_guid, {})); } return true; @@ -183,7 +178,10 @@ namespace ScriptCanvasEditor AZ::SerializeContext* serializeContext = nullptr; AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); - serializeContext->EnumerateObject( handle.Get(), beginElementCB, nullptr, AZ::SerializeContext::ENUM_ACCESS_FOR_READ); + AZ_Assert(serializeContext, "LoadEditorAssetTree() ailed to retrieve serialize context!"); + + const ScriptCanvasEditor::Graph* graph = handle.Get(); + serializeContext->EnumerateObject(graph, beginElementCB, nullptr, AZ::SerializeContext::ENUM_ACCESS_FOR_READ); EditorAssetTree result; @@ -204,8 +202,7 @@ namespace ScriptCanvasEditor result.SetParent(*parent); } - result.m_asset = loadAssetOutcome.TakeValue(); - + result.m_asset = AZStd::move(handle); return AZ::Success(result); } @@ -252,6 +249,10 @@ namespace ScriptCanvasEditor if (auto entity = scriptCanvasData->GetScriptCanvasEntity()) { + AZ_Assert(entity->GetState() == AZ::Entity::State::Constructed, "Entity loaded in bad state"); + AZ::u64 entityId = + aznumeric_caster(ScriptCanvas::MathNodeUtilities::GetRandomIntegral(1, std::numeric_limits::max())); + entity->SetId(AZ::EntityId(entityId)); entity->Init(); entity->Activate(); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index fd2aa3e884..26fbf85a82 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -377,7 +377,7 @@ namespace ScriptCanvasEditor m_sourceHandle = *completeAsset; } - OnScriptCanvasAssetChanged(m_sourceHandle); + OnScriptCanvasAssetChanged(SourceChangeDescription::SelectionChanged); SetName(m_sourceHandle.Path().Filename().Native()); AzToolsFramework::ToolsApplicationEvents::Bus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_AttributesAndValues); } @@ -391,26 +391,16 @@ namespace ScriptCanvasEditor { m_sourceHandle = SourceHandle(nullptr, m_sourceHandle.Path()); CompleteDescriptionInPlace(m_sourceHandle); - m_previousHandle = {}; m_removedHandle = {}; - - if (m_sourceHandle.IsDescriptionValid()) - { - OnScriptCanvasAssetChanged(m_sourceHandle); - } - else - { - ClearVariables(); - } - + OnScriptCanvasAssetChanged(SourceChangeDescription::SelectionChanged); return AZ::Edit::PropertyRefreshLevels::EntireTree; } - void EditorScriptCanvasComponent::OnScriptCanvasAssetChanged(const SourceHandle& assetId) + void EditorScriptCanvasComponent::OnScriptCanvasAssetChanged(SourceChangeDescription changeDescription) { ScriptCanvas::GraphIdentifier newIdentifier = GetGraphIdentifier(); - newIdentifier.m_assetId = assetId.Id(); + newIdentifier.m_assetId = m_sourceHandle.Id(); ScriptCanvas::GraphIdentifier oldIdentifier = GetGraphIdentifier(); oldIdentifier.m_assetId = m_previousHandle.Id(); @@ -419,21 +409,24 @@ namespace ScriptCanvasEditor m_previousHandle = m_sourceHandle.Describe(); - // Only clear our variables when we are given a new asset id - // or when the asset was explicitly set to empty. - // - // i.e. do not clear variables when we lose the catalog asset. - if ((assetId.IsDescriptionValid() && assetId.Describe() != m_removedHandle.Describe()) - || (!assetId.IsDescriptionValid() && !m_removedHandle.IsDescriptionValid())) + if (changeDescription == SourceChangeDescription::SelectionChanged) { ClearVariables(); } - if (assetId.IsDescriptionValid()) + if (m_sourceHandle.IsDescriptionValid()) { - if (auto loaded = LoadFromFile(assetId.Path().c_str()); loaded.IsSuccess()) + if (!m_sourceHandle.Get()) + { + if (auto loaded = LoadFromFile(m_sourceHandle.Path().c_str()); loaded.IsSuccess()) + { + m_sourceHandle = SourceHandle(loaded.TakeValue(), m_sourceHandle.Id(), m_sourceHandle.Path().c_str()); + } + } + + if (m_sourceHandle.Get()) { - UpdatePropertyDisplay(loaded.GetValue()); + UpdatePropertyDisplay(m_sourceHandle); } } @@ -467,8 +460,9 @@ namespace ScriptCanvasEditor { if (auto handle = CompleteDescription(SourceHandle(nullptr, fileAssetId, {}))) { + m_sourceHandle = *handle; // consider queueing on tick bus - OnScriptCanvasAssetChanged(*handle); + OnScriptCanvasAssetChanged(SourceChangeDescription::Modified); } } } @@ -479,7 +473,7 @@ namespace ScriptCanvasEditor if (fileAssetId == m_sourceHandle.Id()) { m_removedHandle = m_sourceHandle; - OnScriptCanvasAssetChanged(m_removedHandle); + OnScriptCanvasAssetChanged(SourceChangeDescription::Removed); } } @@ -489,7 +483,7 @@ namespace ScriptCanvasEditor if (fileAssetId == m_sourceHandle.Id()) { m_removedHandle = m_sourceHandle; - OnScriptCanvasAssetChanged(m_removedHandle); + OnScriptCanvasAssetChanged(SourceChangeDescription::Error); } } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 19347e25eb..52cf49070b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -98,6 +98,14 @@ namespace ScriptCanvasEditor void OnStopPlayInEditor() override; protected: + enum class SourceChangeDescription : AZ::u8 + { + Error, + Modified, + Removed, + SelectionChanged, + }; + static void Reflect(AZ::ReflectContext* context); static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) @@ -123,7 +131,7 @@ namespace ScriptCanvasEditor AZ::u32 OnFileSelectionChanged(); - void OnScriptCanvasAssetChanged(const SourceHandle& sourceHandle); + void OnScriptCanvasAssetChanged(SourceChangeDescription changeDescription); void UpdateName(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp index 8b8dfdc3fc..59b924196b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp @@ -335,6 +335,11 @@ namespace ScriptCanvas return &m_datum; } + Datum& GraphVariable::ModDatum() + { + return m_datum; + } + void GraphVariable::ConfigureDatumView(ModifiableDatumView& datumView) { datumView.ConfigureView((*this)); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h index e7829ca6c1..db83076f67 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h @@ -127,6 +127,8 @@ namespace ScriptCanvas const Datum* GetDatum() const; + Datum& ModDatum(); + bool IsComponentProperty() const; void ConfigureDatumView(ModifiableDatumView& accessController); From 8357fa34e94bba8a04a7dc0b75dc41b94efb1133 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Tue, 23 Nov 2021 23:57:03 -0800 Subject: [PATCH 061/399] fixed unit testing code Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../AzCore/AzCore/Script/ScriptContext.cpp | 13 ++++ .../AzCore/Script/ScriptContextAttributes.h | 1 + .../ScriptCanvasBuilderWorkerUtility.cpp | 15 +---- .../Framework/ScriptCanvasGraphUtilities.inl | 17 ++++- .../Framework/ScriptCanvasTraceUtilities.h | 8 +-- .../Code/Editor/SystemComponent.cpp | 5 +- .../Include/ScriptCanvas/Core/Nodeable.cpp | 9 ++- .../Interpreted/ExecutionInterpretedAPI.cpp | 46 ++++++++++++++ .../Interpreted/ExecutionStateInterpreted.cpp | 2 + ...ExecutionStateInterpretedPerActivation.cpp | 62 +++++++++++++++++++ 10 files changed, 155 insertions(+), 23 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp index 45f7876993..841387f14d 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp @@ -5073,13 +5073,26 @@ LUA_API const Node* lua_getDummyNode() // Check all constructors if they have use ScriptDataContext and if so choose this one if (!customConstructorMethod) { + int overrideIndex = -1; + AZ::AttributeReader(nullptr, FindAttribute + ( Script::Attributes::DefaultConstructorOverrideIndex, behaviorClass->m_attributes)).Read(overrideIndex); + + int methodIndex = 0; for (BehaviorMethod* method : behaviorClass->m_constructors) { + if (methodIndex == overrideIndex) + { + customConstructorMethod = method; + break; + } + if (method->GetNumArguments() && method->GetArgument(method->GetNumArguments() - 1)->m_typeId == AZ::AzTypeInfo::Uuid()) { customConstructorMethod = method; break; } + + ++methodIndex; } } diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h b/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h index 9807f0af39..e238289ef5 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h @@ -21,6 +21,7 @@ namespace AZ static constexpr AZ::Crc32 ClassNameOverride = AZ_CRC_CE("ScriptClassNameOverride"); ///< Provide a custom name for script reflection, that doesn't match the behavior Context name static constexpr AZ::Crc32 MethodOverride = AZ_CRC_CE("ScriptFunctionOverride"); ///< Use a custom function in the attribute instead of the function static constexpr AZ::Crc32 ConstructorOverride = AZ_CRC_CE("ConstructorOverride"); ///< You can provide a custom constructor to be called when created from Lua script + static constexpr AZ::Crc32 DefaultConstructorOverrideIndex = AZ_CRC_CE("DefaultConstructorOverrideIndex"); ///< Use a different class constructor as the default constructor in Lua static constexpr AZ::Crc32 EventHandlerCreationFunction = AZ_CRC_CE("EventHandlerCreationFunction"); ///< helps create a handler for any script target so that script functions can be used for AZ::Event signals static constexpr AZ::Crc32 GenericConstructorOverride = AZ_CRC_CE("GenericConstructorOverride"); ///< You can provide a custom constructor to be called when creating a script static constexpr AZ::Crc32 ReaderWriterOverride = AZ_CRC_CE("ReaderWriterOverride"); ///< paired with \ref ScriptContext::CustomReaderWriter allows you to customize read/write to Lua VM diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp index a68aeae5e9..fb7b5e7a4a 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp @@ -30,6 +30,8 @@ #include #include #include +#include + namespace ScriptCanvasBuilder { @@ -93,19 +95,6 @@ namespace ScriptCanvasBuilder request.printModelToConsole = ScriptCanvas::Grammar::g_printAbstractCodeModel; request.path = fullPath; - bool pathFound = false; - AZStd::string relativePath; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult - ( pathFound - , &AzToolsFramework::AssetSystem::AssetSystemRequest::GetRelativeProductPathFromFullSourceOrProductPath - , fullPath.c_str(), relativePath); - - if (!pathFound) - { - AZ::Failure(AZStd::string::format("Failed to get engine relative path from %s", fullPath.c_str())); - } - - request.namespacePath = relativePath; const ScriptCanvas::Translation::Result translationResult = TranslateToLua(request); auto isSuccessOutcome = translationResult.IsSuccess(ScriptCanvas::Translation::TargetFlags::Lua); diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl index b1bc7321e6..74d0f76dce 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl @@ -114,12 +114,17 @@ namespace ScriptCanvasEditor { if (auto loadFileOutcome = LoadFromFile(graphPath); loadFileOutcome.IsSuccess()) { - AZ::Outcome< AZ::Data::Asset, AZStd::string> assetOutcome = AZ::Failure(AZStd::string("asset creation failed")); - ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(assetOutcome, &ScriptCanvasEditor::EditorAssetConversionBusTraits::CreateRuntimeAsset, loadFileOutcome.GetValue()); + auto& source = loadFileOutcome.GetValue(); + auto testableSource = SourceHandle(source, AZ::Uuid::CreateRandom(), source.Path().c_str()); + + AZ::Outcome, AZStd::string> assetOutcome(AZ::Failure(AZStd::string("asset create failed"))); + ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(assetOutcome + , &ScriptCanvasEditor::EditorAssetConversionBusTraits::CreateRuntimeAsset, testableSource); + if (assetOutcome.IsSuccess()) { LoadTestGraphResult result; - result.m_editorAsset = loadFileOutcome.TakeValue(); + result.m_editorAsset = AZStd::move(testableSource); result.m_runtimeAsset = assetOutcome.GetValue(); result.m_entity = AZStd::make_unique("Loaded Graph"); return result; @@ -216,6 +221,8 @@ namespace ScriptCanvasEditor { RuntimeDataOverrides runtimeDataOverrides; runtimeDataOverrides.m_runtimeAsset = loadResult.m_runtimeAsset; + runtimeDataOverrides.m_runtimeAsset.SetHint("original"); + runtimeDataOverrides.m_runtimeAsset.Get()->m_runtimeData.m_script.SetHint("original"); #if defined(LINUX) ////////////////////////////////////////////////////////////////////////// // Temporarily disable testing on the Linux build until the file name casing discrepancy @@ -261,6 +268,10 @@ namespace ScriptCanvasEditor RuntimeDataOverrides dependencyRuntimeDataOverrides; dependencyRuntimeDataOverrides.m_runtimeAsset = dependency.runtimeAsset; + AZStd::string dependencyHint = AZStd::string::format("dependency_%d", index); + dependencyRuntimeDataOverrides.m_runtimeAsset.SetHint(dependencyHint); + dependencyRuntimeDataOverrides.m_runtimeAsset.Get()->m_runtimeData.m_script.SetHint(dependencyHint); + runtimeDataOverrides.m_dependencies.push_back(dependencyRuntimeDataOverrides); RuntimeData& dependencyData = dependencyDataBuffer[index]; diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h index 033eed3efd..dfcb0d2643 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h @@ -161,15 +161,15 @@ namespace ScriptCanvasEditor struct ScopedOutputSuppression { - ScopedOutputSuppression(bool suppressState = true) + ScopedOutputSuppression([[maybe_unused]] bool suppressState = true) { - AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", ""); - TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState); + // AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", ""); + // TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState); } ~ScopedOutputSuppression() { - TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, m_oldSuppression); + // TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, m_oldSuppression); } private: bool m_oldSuppression = false; diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 3566d8da4b..88ef93a4c4 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -120,7 +120,10 @@ namespace ScriptCanvasEditor PopulateEditorCreatableTypes(); AzToolsFramework::RegisterGenericComboBoxHandler(); - AzToolsFramework::PropertyTypeRegistrationMessages::Bus::Broadcast(&AzToolsFramework::PropertyTypeRegistrationMessages::RegisterPropertyType, aznew SourceHandlePropertyHandler()); + if (AzToolsFramework::PropertyTypeRegistrationMessages::Bus::FindFirstHandler()) + { + AzToolsFramework::PropertyTypeRegistrationMessages::Bus::Broadcast(&AzToolsFramework::PropertyTypeRegistrationMessages::RegisterPropertyType, aznew SourceHandlePropertyHandler()); + } SystemRequestBus::Handler::BusConnect(); ScriptCanvasExecutionBus::Handler::BusConnect(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp index 093f87e1f7..023d46097d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp @@ -22,12 +22,16 @@ namespace ScriptCanvas Nodeable::Nodeable() : m_noOpFunctor(&NodeableOutCpp::NoOp) - {} + { + AZ_TracePrintf("SCDB", "How many times does this get called? Because it should....NOT GET CALLED!"); + } Nodeable::Nodeable(ExecutionStateWeakPtr executionState) : m_noOpFunctor(&NodeableOutCpp::NoOp) , m_executionState(executionState) - {} + { + AZ_TracePrintf("SCDB", "How many times does this get called 2?"); + } #if !defined(RELEASE) void Nodeable::CallOut(size_t index, AZ::BehaviorValueParameter* resultBVP, AZ::BehaviorValueParameter* argsBVPs, int numArguments) const @@ -80,6 +84,7 @@ namespace ScriptCanvas ->Attribute(AZ::ScriptCanvasAttributes::VariableCreationForbidden, AZ::AttributeIsValid::IfPresent) ->Attribute(AZ::Script::Attributes::UseClassIndexAllowNil, AZ::AttributeIsValid::IfPresent) ->Constructor() + ->Attribute(AZ::Script::Attributes::DefaultConstructorOverrideIndex, 0) ->Method("Deactivate", &Nodeable::Deactivate) ->Method("InitializeExecutionState", &Nodeable::InitializeExecutionState) ->Method("InitializeExecutionOuts", &Nodeable::InitializeExecutionOuts) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp index bbd16dfb96..a706d70629 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp @@ -68,6 +68,8 @@ namespace ExecutionInterpretedAPICpp { if (lua_isstring(lua, -1)) { + AZStd::string errorResult = lua_tostring(lua, -1); + AZ_TracePrintf("ScriptCanvas", errorResult.c_str()); AZ::ScriptContext::FromNativeContext(lua)->Error(AZ::ScriptContext::ErrorType::Error, true, "%s", lua_tostring(lua, -1)); } else @@ -402,6 +404,50 @@ namespace ScriptCanvas AZ_Assert(lua_isuserdata(lua, -2) && !lua_islightuserdata(lua, -2), "Error in compiled lua file, 1st argument to OverrideNodeableMetatable is not userdata (Nodeable)"); AZ_Assert(lua_istable(lua, -1), "Error in compiled lua file, 2nd argument to OverrideNodeableMetatable is not a Lua table"); + /* table is in the stack at index 't' */ + if (lua_istable(lua, -1)) + { + lua_getfield(lua, -1, "__index"); + + if (lua_istable(lua, -1)) + { + int t = -2; + AZStd::string tableGuts; + lua_pushnil(lua); + /* first key */ + while (lua_next(lua, t) != 0) + { + /* uses 'key' (at index -2) and 'value' (at index -1) */ + if (lua_type(lua, -2) == LUA_TSTRING) + { + size_t len; + tableGuts += AZStd::string::format("%s - %s\n", + lua_tolstring(lua, -2, &len), + lua_typename(lua, lua_type(lua, -1))); + } + else if (lua_type(lua, -2) == LUA_TNUMBER) + { + tableGuts += AZStd::string::format("%f - %s\n", + lua_tonumber(lua, -2), + lua_typename(lua, lua_type(lua, -1))); + } + else + { + tableGuts += AZStd::string::format("%s - %s\n", + lua_typename(lua, lua_type(lua, -2)), + lua_typename(lua, lua_type(lua, -1))); + } + + /* removes 'value'; keeps 'key' for next iteration */ + lua_pop(lua, 1); + } + + AZ_TracePrintf("SCDB", tableGuts.c_str()); + } + + lua_pop(lua, 1); + } + [[maybe_unused]] auto userData = reinterpret_cast(lua_touserdata(lua, -2)); AZ_Assert(userData && userData->magicData == AZ_CRC_CE("AZLuaUserData"), "this isn't user data"); // Lua: LuaUserData::nodeable, class_mt diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp index 0f090574b5..3ae52846cd 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp @@ -143,6 +143,8 @@ namespace ScriptCanvas AZ_Assert(m_luaRegistryIndex == LUA_NOREF, "ExecutionStateInterpreted already in the Lua registry and risks double deletion"); // Lua: instance m_luaRegistryIndex = luaL_ref(m_luaState, LUA_REGISTRYINDEX); + AZ_Assert(m_luaRegistryIndex != LUA_REFNIL, "ExecutionStateInterpreted was nil when trying to gain a reference"); + AZ_Assert(m_luaRegistryIndex != LUA_NOREF, "ExecutionStateInterpreted failed to gain a reference"); } void ExecutionStateInterpreted::Reflect(AZ::ReflectContext* reflectContext) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp index 44b1364682..7ef1e22fbf 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp @@ -111,10 +111,72 @@ namespace ScriptCanvas auto& lua = m_luaState; // Lua: lua_rawgeti(lua, LUA_REGISTRYINDEX, registryIndex); + if (!lua_isuserdata(lua, -1)) + { + AZ_TracePrintf("SCDB", "No light userdata"); + } + // Lua: instance + + lua_getmetatable(lua, -1); + if (!lua_istable(lua, -1)) + { + AZ_TracePrintf("SCDB", "no metatable"); + } + + + /* table is in the stack at index 't' */ + if (lua_istable(lua, -1)) + { + int t = -2; + AZStd::string tableGuts; + lua_pushnil(lua); + /* first key */ + while (lua_next(lua, t) != 0) + { + /* uses 'key' (at index -2) and 'value' (at index -1) */ + if (lua_type(lua, -2) == LUA_TSTRING) + { + size_t len; + tableGuts += AZStd::string::format("%s - %s\n", + lua_tolstring(lua, -2, &len), + lua_typename(lua, lua_type(lua, -1))); + } + else if (lua_type(lua, -2) == LUA_TNUMBER) + { + tableGuts += AZStd::string::format("%f - %s\n", + lua_tonumber(lua, -2), + lua_typename(lua, lua_type(lua, -1))); + } + else + { + tableGuts += AZStd::string::format("%s - %s\n", + lua_typename(lua, lua_type(lua, -2)), + lua_typename(lua, lua_type(lua, -1))); + } + + /* removes 'value'; keeps 'key' for next iteration */ + lua_pop(lua, 1); + } + + AZ_TracePrintf("SCDB", tableGuts.c_str()); + } + + // Lua: instance, instance_mt + lua_pop (lua, 1); + + // Lua: instance lua_getfield(lua, -1, Grammar::k_OnGraphStartFunctionName); // Lua: instance, graph_VM.k_OnGraphStartFunctionName + if (!lua_isfunction(lua, -1)) + { + AZ_TracePrintf("SCDB", "No function"); + } lua_pushvalue(lua, -2); + if (!lua_isuserdata(lua, -1)) + { + AZ_TracePrintf("SCDB", "No light userdata"); + } // Lua: instance, graph_VM.k_OnGraphStartFunctionName, instance const int result = Execution::InterpretedSafeCall(lua, 1, 0); // Lua: instance ? From c4ea3075cc5aad803493658932945a9990efd71d Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 24 Nov 2021 18:55:11 -0800 Subject: [PATCH 062/399] fixed unit tests bugs, removed commented out code, removed loading spam Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilder.cpp | 34 ++++- .../Code/Builder/ScriptCanvasBuilder.h | 1 - .../Code/Builder/ScriptCanvasBuilderWorker.h | 5 +- .../Editor/Assets/ScriptCanvasAssetHolder.cpp | 25 ---- .../Assets/ScriptCanvasAssetTracker.cpp | 103 --------------- .../Editor/Assets/ScriptCanvasAssetTracker.h | 3 - .../Assets/ScriptCanvasAssetTrackerBus.h | 12 -- .../Editor/Assets/ScriptCanvasMemoryAsset.cpp | 86 +------------ .../EditorScriptCanvasComponent.cpp | 2 - .../Code/Editor/Components/EditorUtils.cpp | 6 +- .../Framework/ScriptCanvasTraceUtilities.h | 6 +- .../Include/ScriptCanvas/Bus/RequestBus.h | 1 - .../ScriptCanvas/Components/EditorGraph.h | 7 - .../Code/Editor/View/Widgets/GraphTabBar.cpp | 30 ----- .../Code/Editor/View/Widgets/GraphTabBar.h | 7 - .../LoggingPanel/LoggingWindowTreeItems.cpp | 15 --- .../Code/Editor/View/Windows/MainWindow.cpp | 86 +------------ .../Windows/Tools/UpgradeTool/Controller.cpp | 8 +- .../Code/Include/ScriptCanvas/Core/Graph.cpp | 13 +- .../Include/ScriptCanvas/Core/Nodeable.cpp | 8 +- .../Interpreted/ExecutionInterpretedAPI.cpp | 50 +------- ...ExecutionStateInterpretedPerActivation.cpp | 64 +--------- .../Code/Tests/ScriptCanvas_VM.cpp | 120 ------------------ 23 files changed, 52 insertions(+), 640 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index fe89c57009..31b63e8fad 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -16,6 +16,38 @@ #include #include +namespace BuildVariableOverridesCpp +{ + enum Version + { + EditorAssetRedux, + + // add description above + Current + }; + + bool VersionConverter + ( [[maybe_unused]] AZ::SerializeContext& serializeContext + , [[maybe_unused]] AZ::SerializeContext::DataElementNode& rootElement) + { + // #sc_editor_asset +// ScriptCanvasBuilder::BuildVariableOverrides overrides; +// overrides.m_source = SourceHandle(nullptr, assetHolder.GetAssetId().m_guid, {}); +// +// for (auto& variable : editableData.GetVariables()) +// { +// overrides.m_overrides.push_back(variable.m_graphVariable); +// } +// +// if (!rootElement.AddElementWithData(serializeContext, "runtimeDataOverrides", overrides)) +// { +// AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: failed to add 'runtimeDataOverrides'"); +// return false; +// } + return true; + } +} + namespace ScriptCanvasBuilder { void BuildVariableOverrides::Clear() @@ -109,7 +141,7 @@ namespace ScriptCanvasBuilder if (auto serializeContext = azrtti_cast(reflectContext)) { serializeContext->Class() - ->Version(1) + ->Version(BuildVariableOverridesCpp::Version::Current, &BuildVariableOverridesCpp::VersionConverter) ->Field("source", &BuildVariableOverrides::m_source) ->Field("variables", &BuildVariableOverrides::m_variables) ->Field("entityId", &BuildVariableOverrides::m_entityIds) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h index 0dedd67847..5cffa823dc 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h @@ -49,7 +49,6 @@ namespace ScriptCanvasBuilder // these two variable lists are all that gets exposed to the edit context AZStd::vector m_overrides; AZStd::vector m_overridesUnused; - // AZStd::vector m_entityIdRuntimeInputIndices; since all oSf the entity ids need to go in, they may not need indices AZStd::vector m_dependencies; }; diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index e1bf80aa2e..77b90df3e0 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -59,10 +59,7 @@ namespace ScriptCanvasBuilder PrefabIntegration, CorrectGraphVariableVersion, ReflectEntityIdNodes, - - ForceBuildForDevTest0, - ForceBuildForDevTest1, - ForceBuildForDevTest2, + FixExecutionStateNodeableConstrution, // add new entries above Current, diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp index c5c08d5bbe..f8c89ae7e5 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp @@ -82,31 +82,6 @@ namespace ScriptCanvasEditor void ScriptCanvasAssetHolder::OpenEditor() const { - // #sc_editor_asset -// AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); -// -// AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); -// -// if (m_scriptCanvasAsset.IsReady()) -// { -// GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_scriptCanvasAsset.GetId(), -1); -// -// if (!openOutcome) -// { -// AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); -// } -// } -// else if (m_ownerId.first.IsValid()) -// { -// AzToolsFramework::EntityIdList selectedEntityIds; -// AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); -// -// // Going to bypass the multiple selected entities flow for right now. -// if (selectedEntityIds.size() == 1) -// { -// GeneralRequestBus::Broadcast(&GeneralRequests::CreateScriptCanvasAssetFor, m_ownerId); -// } -// } } ScriptCanvas::ScriptCanvasId ScriptCanvasAssetHolder::GetScriptCanvasId() const diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp index 5ec620a907..09b967281d 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp @@ -60,109 +60,6 @@ namespace ScriptCanvasEditor void AssetTracker::SaveAs(AZ::Data::AssetId /*assetId*/, const AZStd::string& /*path*/, Callbacks::OnSave /*onSaveCallback*/) { -// auto assetIter = m_assetsInUse.find(assetId); -// -// if (assetIter != m_assetsInUse.end()) -// { -// auto onSave = [this, assetId, onSaveCallback](bool saveSuccess, AZ::Data::AssetPtr asset, AZ::Data::AssetId previousFileAssetId) -// { -// AZ::Data::AssetId signalId = assetId; -// AZ::Data::AssetId fileAssetId = asset->GetId(); -// -// // If there is a previous file Id is valid, it means this is a save-as operation and we need to remap the tracking. -// if (previousFileAssetId.IsValid()) -// { -// if (saveSuccess) -// { -// fileAssetId = m_assetsInUse[assetId]->GetFileAssetId(); -// m_remappedAsset[asset->GetId()] = fileAssetId; -// -// // Erase the asset first so the smart pointer can deal with it's things. -// m_assetsInUse.erase(fileAssetId); -// -// // Then perform the insert once we know nothing will attempt to delete this while we are operating on it. -// m_assetsInUse[fileAssetId] = m_assetsInUse[assetId]; -// m_assetsInUse.erase(assetId); -// } -// -// m_savingAssets.erase(assetId); -// m_savingAssets.insert(fileAssetId); -// -// signalId = fileAssetId; -// -// if (m_queuedCloses.erase(assetId)) -// { -// m_queuedCloses.insert(fileAssetId); -// } -// -// auto assetIter = m_assetsInUse.find(fileAssetId); -// -// if (assetIter != m_assetsInUse.end()) -// { -// AZStd::invoke(onSaveCallback, saveSuccess, m_assetsInUse[fileAssetId]->GetAsset().Get(), previousFileAssetId); -// } -// else -// { -// AZ_Error("ScriptCanvas", !saveSuccess, "Unable to find Memory Asset for Asset(%s)", fileAssetId.ToString().c_str()); -// AZStd::invoke(onSaveCallback, saveSuccess, asset, previousFileAssetId); -// } -// } -// else -// { -// if (saveSuccess) -// { -// // This should be the case when we get a save as from a newly created file. -// // -// // If we find the 'memory' asset id in the assets in use. This means this was a new file that was saved. -// // To maintain all of the look-up stuff, we need to treat this like a remapping stage. -// auto assetInUseIter = m_assetsInUse.find(assetId); -// if (assetInUseIter != m_assetsInUse.end()) -// { -// fileAssetId = assetInUseIter->second->GetFileAssetId(); -// -// if (assetId != fileAssetId) -// { -// m_remappedAsset[assetId] = fileAssetId; -// -// m_assetsInUse.erase(fileAssetId); -// m_assetsInUse[fileAssetId] = AZStd::move(assetInUseIter->second); -// m_assetsInUse.erase(assetId); -// -// m_savingAssets.erase(assetId); -// m_savingAssets.insert(fileAssetId); -// -// if (m_queuedCloses.erase(assetId)) -// { -// m_queuedCloses.insert(fileAssetId); -// } -// } -// } -// else -// { -// fileAssetId = CheckAssetId(fileAssetId); -// } -// -// signalId = fileAssetId; -// } -// -// if (onSaveCallback) -// { -// AZStd::invoke(onSaveCallback, saveSuccess, m_assetsInUse[signalId]->GetAsset().Get(), previousFileAssetId); -// } -// -// AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetSaved, m_assetsInUse[signalId], saveSuccess); -// } -// -// SignalSaveComplete(signalId); -// }; -// -// m_savingAssets.insert(assetId); -// assetIter->second->SaveAs(path, onSave); -// } -// else -// { -// AZ_Assert(false, "Cannot SaveAs into an existing AssetId"); -// } } bool AssetTracker::Load(AZ::Data::AssetId fileAssetId, AZ::Data::AssetType assetType, Callbacks::OnAssetReadyCallback onAssetReadyCallback) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h index 247aba3b94..aa06029c98 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h @@ -23,9 +23,6 @@ namespace ScriptCanvasEditor { class ScriptCanvasMemoryAsset; - - // MOVE THIS MOSTLY TO TAB BAR, MAIN WINDOW AND THE CANVAS WIDGET - // This class tracks all things related to the assets that the Script Canvas editor // has in play. It also provides helper functionality to quickly getting asset information // from GraphCanvas diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h index fd50b40768..7125cb7d9b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h @@ -155,17 +155,5 @@ namespace ScriptCanvasEditor using MemoryAssetSystemNotificationBus = AZ::EBus; } - class MemoryAssetNotifications - : public AZ::EBusTraits - { - public: - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - using BusIdType = AZ::Data::AssetId; - - virtual void OnFileStateChanged(Tracker::ScriptCanvasFileState) {} - }; - - using MemoryAssetNotificationBus = AZ::EBus; ////////////////////////////////////////////////////////////////////////////////////////////////////////// } diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp index 7af1aa3d9f..01595e0702 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp @@ -285,8 +285,6 @@ namespace ScriptCanvasEditor ScriptCanvasEditor::Widget::CanvasWidget* ScriptCanvasMemoryAsset::CreateView(QWidget* /*parent*/) { - //m_canvasWidget = new Widget::CanvasWidget(m_fileAssetId, parent); - //return m_canvasWidget; return nullptr; } @@ -433,66 +431,11 @@ namespace ScriptCanvasEditor void ScriptCanvasMemoryAsset::SourceFileFailed(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid) { -// AZStd::string fullPath; -// AzFramework::StringFunc::Path::Join(scanFolder.data(), relativePath.data(), fullPath); -// AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, fullPath); -// -// auto assetPathIdIt = AZStd::find(m_pendingSave.begin(), m_pendingSave.end(), fullPath); -// -// if (assetPathIdIt != m_pendingSave.end()) -// { -// if (m_onSaveCallback) -// { -// m_onSaveCallback(false, m_inMemoryAsset.Get(), AZ::Data::AssetId()); -// m_onSaveCallback = nullptr; -// } -// -// m_pendingSave.erase(assetPathIdIt); -// } + } void ScriptCanvasMemoryAsset::SavingComplete(const AZStd::string& /*streamName*/, AZ::Uuid /*sourceAssetId*/) { -// AZStd::string normPath = streamName; -// AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, normPath); -// -// auto assetPathIdIt = AZStd::find(m_pendingSave.begin(), m_pendingSave.end(), normPath); -// if (assetPathIdIt != m_pendingSave.end()) -// { -// AZ::Data::AssetId previousFileAssetId; -// -// if (sourceAssetId != m_fileAssetId.m_guid) -// { -// previousFileAssetId = m_fileAssetId; -// -// // The source file has changed, store the AssetId to the canonical asset on file -// SetFileAssetId(sourceAssetId); -// -// } -// else if (!m_fileAssetId.IsValid()) -// { -// SetFileAssetId(sourceAssetId); -// } -// -// m_formerGraphIdPair = AZStd::make_pair(m_scriptCanvasId, m_graphId); -// -// m_fileState = Tracker::ScriptCanvasFileState::UNMODIFIED; -// -// m_pendingSave.erase(assetPathIdIt); -// -// m_absolutePath = m_saveAsPath; -// m_saveAsPath.clear(); -// -// // Connect to the source asset's bus to monitor for situations we may need to handle -// AZ::Data::AssetBus::MultiHandler::BusConnect(m_inMemoryAsset.GetId()); -// AZ::Data::AssetBus::MultiHandler::BusConnect(m_fileAssetId); -// -// if (m_onSaveCallback) -// { -// m_onSaveCallback(true, m_inMemoryAsset.Get(), previousFileAssetId); -// m_onSaveCallback = nullptr; -// } -// } } void ScriptCanvasMemoryAsset::FinalizeAssetSave(bool, const AzToolsFramework::SourceControlFileInfo& fileInfo, const AZ::Data::AssetStreamInfo& saveInfo, Callbacks::OnSave onSaveCallback) @@ -528,17 +471,11 @@ namespace ScriptCanvasEditor void ScriptCanvasMemoryAsset::SetFileAssetId(const AZ::Data::AssetId& /*fileAssetId*/) { -// m_fileAssetId = fileAssetId; -// -// if (m_canvasWidget) -// { -// m_canvasWidget->SetAssetId(fileAssetId); -// } + } void ScriptCanvasMemoryAsset::SignalFileStateChanged() { - MemoryAssetNotificationBus::Event(m_fileAssetId, &MemoryAssetNotifications::OnFileStateChanged, GetFileState()); } AZStd::string ScriptCanvasMemoryAsset::MakeTemporaryFilePathForSave(AZStd::string_view targetFilename) @@ -607,25 +544,6 @@ namespace ScriptCanvasEditor bool AssetSaveFinalizer::ValidateStatus(const AzToolsFramework::SourceControlFileInfo& /*fileInfo*/) { -// auto fileIO = AZ::IO::FileIOBase::GetInstance(); -// if (fileInfo.IsLockedByOther()) -// { -// AZ_Error("Script Canvas", !fileInfo.IsLockedByOther(), "The file is already exclusively opened by another user: %s", fileInfo.m_filePath.data()); -// AZStd::invoke(m_onSave, false, m_inMemoryAsset, m_fileAssetId); -// return false; -// } -// else if (fileInfo.IsReadOnly() && fileIO->Exists(fileInfo.m_filePath.c_str())) -// { -// AZ_Error("Script Canvas", !fileInfo.IsReadOnly(), "File %s is read-only. It cannot be saved." -// " If this file is in Perforce it may not have been checked out by the Source Control API.", fileInfo.m_filePath.data()); -// AZStd::invoke(m_onSave, false, m_inMemoryAsset, m_fileAssetId); -// return false; -// } -// else if (m_saving) -// { -// AZ_Warning("Script Canvas", false, "Trying to save the same file twice. Will result in one save callback being ignored."); -// return false; -// } return true; } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 26fbf85a82..9209196873 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -51,8 +51,6 @@ namespace ScriptCanvasEditor { static bool EditorScriptCanvasComponentVersionConverter(AZ::SerializeContext& serializeContext, AZ::SerializeContext::DataElementNode& rootElement) { - AZ_TracePrintf("ScriptCanvas", "EditorScriptCanvasComponentVersionConverter called!"); - if (rootElement.GetVersion() <= 4) { int assetElementIndex = rootElement.FindElement(AZ::Crc32("m_asset")); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp index d21b3d004c..2cd2dda89e 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp @@ -54,11 +54,7 @@ namespace ScriptCanvasEditor if (assetSystem->GetSourceInfoBySourcePath(fullPathHandle.Path().c_str(), assetInfo, watchFolder) && assetInfo.m_assetId.IsValid()) { - if (assetInfo.m_assetId.m_guid != source.Id()) - { - AZ_TracePrintf("ScriptCanvas", "This is what I don't get"); - } - + AZ_Warning("ScriptCanvas", assetInfo.m_assetId.m_guid == source.Id(), "SourceHandle completion produced conflicting AssetId."); auto path = fullPathHandle.Path(); return SourceHandle(source, assetInfo.m_assetId.m_guid, path.MakePreferred()); } diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h index dfcb0d2643..458852132d 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h @@ -163,13 +163,13 @@ namespace ScriptCanvasEditor { ScopedOutputSuppression([[maybe_unused]] bool suppressState = true) { - // AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", ""); - // TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState); + AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", ""); + TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState); } ~ScopedOutputSuppression() { - // TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, m_oldSuppression); + TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, m_oldSuppression); } private: bool m_oldSuppression = false; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h index 15600c2b88..5ec0ee1636 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h @@ -54,7 +54,6 @@ namespace ScriptCanvasEditor NEW, MODIFIED, UNMODIFIED, - // #sc_editor_asset restore this SOURCE_REMOVED, INVALID = -1 }; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index 8a98601d54..319a835ba5 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -140,10 +140,6 @@ namespace ScriptCanvasEditor void ReleaseVariableCounter(AZ::u32 variableCounter) override; //// - // RuntimeBus - //AZ::Data::AssetId GetAssetId() const override { return m_assetId; } - //// - // GraphCanvas::GraphModelRequestBus void RequestUndoPoint() override; @@ -223,9 +219,6 @@ namespace ScriptCanvasEditor void OnGraphCanvasNodeCreated(const AZ::EntityId& nodeId) override; /////////////////////////// - // EditorGraphRequestBus - // void SetAssetId(const AZ::Data::AssetId& assetId) override { m_assetId = assetId; } - void CreateGraphCanvasScene() override; void ClearGraphCanvasScene() override; void DisplayGraphCanvasScene() override; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index 17228565da..b00e2ea3de 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -251,16 +251,6 @@ namespace ScriptCanvasEditor { if (index >= 0 && index < count()) { - QVariant tabdata = tabData(index); - if (tabdata.isValid()) - { - // #sc_editor_asset fix tabData - auto tabAssetId = tabdata.value(); - - //MemoryAssetNotificationBus::MultiHandler::BusDisconnect(tabAssetId); - //AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::ClearView, tabAssetId); - } - qobject_cast(parent())->removeTab(index); } } @@ -271,8 +261,6 @@ namespace ScriptCanvasEditor { Q_EMIT TabCloseNoButton(i); } - - MemoryAssetNotificationBus::MultiHandler::BusDisconnect(); } void GraphTabBar::OnContextMenu(const QPoint& point) @@ -289,8 +277,6 @@ namespace ScriptCanvasEditor auto tabAssetId = tabdata.value(); Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; - //AssetTrackerRequestBus::BroadcastResult(fileState , &AssetTrackerRequests::GetFileState, tabAssetId); - isModified = fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::MODIFIED; } @@ -362,22 +348,6 @@ namespace ScriptCanvasEditor AzQtComponents::TabBar::mouseReleaseEvent(event); } - void GraphTabBar::OnFileStateChanged(Tracker::ScriptCanvasFileState ) - { - // #sc_editor_asset - // const AZ::Data::AssetId* fileAssetId = MemoryAssetNotificationBus::GetCurrentBusId(); - -// if (fileAssetId) -// { -// SetFileState((*fileAssetId), fileState); -// -// if (FindTab((*fileAssetId)) == currentIndex()) -// { -// Q_EMIT OnActiveFileStateChanged(); -// } -// } - } - void GraphTabBar::SetTabText(int tabIndex, const QString& path, Tracker::ScriptCanvasFileState fileState) { if (tabIndex >= 0 && tabIndex < count()) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h index 9d86583f76..40b785f016 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h @@ -42,7 +42,6 @@ namespace ScriptCanvasEditor class GraphTabBar : public AzQtComponents::TabBar - , public MemoryAssetNotificationBus::MultiHandler { Q_OBJECT @@ -63,8 +62,6 @@ namespace ScriptCanvasEditor int InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId, Tracker::ScriptCanvasFileState fileState); bool SelectTab(ScriptCanvasEditor::SourceHandle assetId); - // void ConfigureTab(int tabIndex, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName); - int FindTab(ScriptCanvasEditor::SourceHandle assetId) const; ScriptCanvasEditor::SourceHandle FindTabByPath(AZStd::string_view path) const; ScriptCanvasEditor::SourceHandle FindAssetId(int tabIndex); @@ -78,10 +75,6 @@ namespace ScriptCanvasEditor void mouseReleaseEvent(QMouseEvent* event) override; - // MemoryAssetNotifications - void OnFileStateChanged(Tracker::ScriptCanvasFileState fileState) override; - //// - // Updates the tab at the supplied index with the GraphTabMetadata // The host widget field of the tabMetadata is not used and will not overwrite the tab data void SetTabText(int tabIndex, const QString& path, Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp index a9ffe30fb1..636ee832d4 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp @@ -137,17 +137,6 @@ namespace ScriptCanvasEditor m_additionTimer.start(); } } - - if (m_updatePolicy == UpdatePolicy::SingleTime) - { - // #sc_editor_asset - // treeItem = CreateChildNodeWithoutAddSignal(loggingDataId, nodeType, graphInfo, nodeId); - } - else - { - // #sc_editor_asset - // treeItem = CreateChildNode(loggingDataId, nodeType, graphInfo, nodeId); - } return treeItem; } @@ -207,9 +196,6 @@ namespace ScriptCanvasEditor AZ::NamedEntityId entityName; - // #sc_editor_asset restore this - //LoggingDataRequestBus::EventResult(entityName, m_loggingDataId, &LoggingDataRequests::FindNamedEntityId, m_graphInfo.m_runtimeEntity); - m_sourceEntityName = entityName.ToString().c_str(); m_displayName = nodeId.m_name.c_str(); @@ -514,7 +500,6 @@ namespace ScriptCanvasEditor const ScriptCanvas::GraphIdentifier& ExecutionLogTreeItem::GetGraphIdentifier() const { - // #sc_editor_asset return m_graphIdentifier; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 06c907f56d..f9653031b4 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1667,42 +1667,6 @@ namespace ScriptCanvasEditor return SaveAssetImpl(m_activeGraph, Save::As); } - /* - bool MainWindow::SaveAssetImpl_OLD(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB) - { - if (!assetId.IsValid()) - { - return false; - } - - // TODO: Set graph read-only to prevent edits during save - - bool saveSuccessful = false; - - Tracker::ScriptCanvasFileState fileState = GetAssetFileState(assetId); - - if (fileState == Tracker::ScriptCanvasFileState::NEW) - { - saveSuccessful = SaveAssetImpl(assetId, saveCB); - } - else if (fileState == Tracker::ScriptCanvasFileState::MODIFIED - || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED) - { - SaveAs(assetId.Path(), assetId, saveCB); - saveSuccessful = true; - } - - return saveSuccessful; - } - */ - - - // 1. SaveAssetImpl - // 2. SaveAs - // // 3. OnSaveCallback - // SaveAsEnd - // SaveAssetImpl end - bool MainWindow::SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& inMemoryAssetId, Save save) { if (!inMemoryAssetId.IsGraphValid()) @@ -1770,11 +1734,6 @@ namespace ScriptCanvasEditor AZ::IO::FileIOBase::GetInstance()->ResolvePath("@engroot@", assetRootChar.data(), assetRootChar.size()); assetRoot = assetRootChar.data(); -// if (!AZ::StringFunc::StartsWith(filePath, assetRoot)) -// { -// QMessageBox::information(this, "Unable to Save", AZStd::string::format("You must select a path within the current project\n\n%s", assetRoot.c_str()).c_str()); -// } -// else if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) { isValidFileName = !(fileName.empty()); @@ -1926,14 +1885,6 @@ namespace ScriptCanvasEditor { m_tabBar->setCurrentIndex(saveTabIndex); } - else - { -// // Something weird happens with our saving. Where we are relying on these scene changes being called. -// ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; -// -// OnChangeActiveGraphTab(ScriptCanvasEditor::SourceHandle()); -// OnChangeActiveGraphTab(previousAssetId); - } UpdateAssignToSelectionState(); @@ -2367,6 +2318,7 @@ namespace ScriptCanvasEditor GraphCanvas::ViewRequestBus::Event(viewId, &GraphCanvas::ViewRequests::CenterOnEndOfChain); } + // #sc_editor_asset void MainWindow::UpdateWorkspaceStatus(const ScriptCanvasMemoryAsset& /*memoryAsset*/) { // only occurs on file open, do it there, if necessary @@ -2658,16 +2610,6 @@ namespace ScriptCanvasEditor void MainWindow::Clear() { m_tabBar->CloseAllTabs(); - // #sc_editor_asset -// -// AssetTrackerRequests::AssetList assets; -// AssetTrackerRequestBus::BroadcastResult(assets, &AssetTrackerRequests::GetAssets); -// -// for (auto asset : assets) -// { -// RemoveScriptCanvasAsset(asset->GetAsset().GetId()); -// } - SetActiveAsset({}); } @@ -4095,32 +4037,6 @@ namespace ScriptCanvasEditor void MainWindow::PrepareAssetForSave(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { - /* - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - - if (memoryAsset) - { - AZ::EntityId graphId = memoryAsset->GetGraphId(); - AZ::EntityId scriptCanvasId = memoryAsset->GetScriptCanvasId(); - - AZ::Entity* entity = nullptr; - GraphRequestBus::EventResult(entity, scriptCanvasId, &GraphRequests::GetGraphEntity); - - if (entity) - { - GraphCanvas::GraphModelRequestBus::Event(graphId, &GraphCanvas::GraphModelRequests::OnSaveDataDirtied, entity->GetId()); - } - - GraphCanvas::GraphModelRequestBus::Event(graphId, &GraphCanvas::GraphModelRequests::OnSaveDataDirtied, graphId); - - ScriptCanvasEditor::Graph* graph = AZ::EntityUtils::FindFirstDerivedComponent(entity); - if (graph) - { - graph->MarkVersion(); - } - } - */ } void MainWindow::RestartAutoTimerSave(bool forceTimer) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp index 888f183151..b8ae59d43b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp @@ -323,13 +323,7 @@ namespace ScriptCanvasEditor m_view->tableWidget->setCellWidget(rowIndex, static_cast(ColumnAction), upgradeButton); } - - char resolvedBuffer[AZ_MAX_PATH_LEN] = { 0 }; - AZStd::string path = AZStd::string::format("@devroot@/%s", assetInfo.Path().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); - + bool result = false; AZ::Data::AssetInfo info; AZStd::string watchFolder; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index aff212fa4c..9c2c854055 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -72,19 +72,16 @@ namespace ScriptCanvas componentElementNode.AddElementWithData(context, "m_assetType", azrtti_typeid()); } - if (componentElementNode.GetVersion() <= GraphCpp::GraphVersion::RemoveFunctionGraphMarker) + if (auto subElement = componentElementNode.FindElement(AZ_CRC_CE("isFunctionGraph")); subElement > 0) { - componentElementNode.RemoveElementByName(AZ_CRC_CE("isFunctionGraph")); + componentElementNode.RemoveElement(subElement); } - if (componentElementNode.GetVersion() < GraphCpp::GraphVersion::FixupVersionDataTypeId) + if (auto subElement = componentElementNode.FindSubElement(AZ_CRC_CE("versionData"))) { - if (auto subElement = componentElementNode.FindSubElement(AZ_CRC_CE("versionData"))) + if (subElement->GetId() == azrtti_typeid()) { - if (subElement->GetId() == azrtti_typeid()) - { - componentElementNode.RemoveElementByName(AZ_CRC_CE("versionData")); - } + componentElementNode.RemoveElementByName(AZ_CRC_CE("versionData")); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp index 023d46097d..7bb37a87dc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp @@ -22,16 +22,12 @@ namespace ScriptCanvas Nodeable::Nodeable() : m_noOpFunctor(&NodeableOutCpp::NoOp) - { - AZ_TracePrintf("SCDB", "How many times does this get called? Because it should....NOT GET CALLED!"); - } + {} Nodeable::Nodeable(ExecutionStateWeakPtr executionState) : m_noOpFunctor(&NodeableOutCpp::NoOp) , m_executionState(executionState) - { - AZ_TracePrintf("SCDB", "How many times does this get called 2?"); - } + {} #if !defined(RELEASE) void Nodeable::CallOut(size_t index, AZ::BehaviorValueParameter* resultBVP, AZ::BehaviorValueParameter* argsBVPs, int numArguments) const diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp index a706d70629..1855b348f2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp @@ -68,9 +68,7 @@ namespace ExecutionInterpretedAPICpp { if (lua_isstring(lua, -1)) { - AZStd::string errorResult = lua_tostring(lua, -1); - AZ_TracePrintf("ScriptCanvas", errorResult.c_str()); - AZ::ScriptContext::FromNativeContext(lua)->Error(AZ::ScriptContext::ErrorType::Error, true, "%s", lua_tostring(lua, -1)); + AZ::ScriptContext::FromNativeContext(lua)->Error(AZ::ScriptContext::ErrorType::Error, true, lua_tostring(lua, -1)); } else { @@ -403,51 +401,7 @@ namespace ScriptCanvas // \note: the the object is being constructed, and is assumed to never leave or re-enter Lua again AZ_Assert(lua_isuserdata(lua, -2) && !lua_islightuserdata(lua, -2), "Error in compiled lua file, 1st argument to OverrideNodeableMetatable is not userdata (Nodeable)"); AZ_Assert(lua_istable(lua, -1), "Error in compiled lua file, 2nd argument to OverrideNodeableMetatable is not a Lua table"); - - /* table is in the stack at index 't' */ - if (lua_istable(lua, -1)) - { - lua_getfield(lua, -1, "__index"); - - if (lua_istable(lua, -1)) - { - int t = -2; - AZStd::string tableGuts; - lua_pushnil(lua); - /* first key */ - while (lua_next(lua, t) != 0) - { - /* uses 'key' (at index -2) and 'value' (at index -1) */ - if (lua_type(lua, -2) == LUA_TSTRING) - { - size_t len; - tableGuts += AZStd::string::format("%s - %s\n", - lua_tolstring(lua, -2, &len), - lua_typename(lua, lua_type(lua, -1))); - } - else if (lua_type(lua, -2) == LUA_TNUMBER) - { - tableGuts += AZStd::string::format("%f - %s\n", - lua_tonumber(lua, -2), - lua_typename(lua, lua_type(lua, -1))); - } - else - { - tableGuts += AZStd::string::format("%s - %s\n", - lua_typename(lua, lua_type(lua, -2)), - lua_typename(lua, lua_type(lua, -1))); - } - - /* removes 'value'; keeps 'key' for next iteration */ - lua_pop(lua, 1); - } - - AZ_TracePrintf("SCDB", tableGuts.c_str()); - } - - lua_pop(lua, 1); - } - + [[maybe_unused]] auto userData = reinterpret_cast(lua_touserdata(lua, -2)); AZ_Assert(userData && userData->magicData == AZ_CRC_CE("AZLuaUserData"), "this isn't user data"); // Lua: LuaUserData::nodeable, class_mt diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp index 7ef1e22fbf..425af171c5 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp @@ -111,75 +111,13 @@ namespace ScriptCanvas auto& lua = m_luaState; // Lua: lua_rawgeti(lua, LUA_REGISTRYINDEX, registryIndex); - if (!lua_isuserdata(lua, -1)) - { - AZ_TracePrintf("SCDB", "No light userdata"); - } - // Lua: instance - - lua_getmetatable(lua, -1); - if (!lua_istable(lua, -1)) - { - AZ_TracePrintf("SCDB", "no metatable"); - } - - - /* table is in the stack at index 't' */ - if (lua_istable(lua, -1)) - { - int t = -2; - AZStd::string tableGuts; - lua_pushnil(lua); - /* first key */ - while (lua_next(lua, t) != 0) - { - /* uses 'key' (at index -2) and 'value' (at index -1) */ - if (lua_type(lua, -2) == LUA_TSTRING) - { - size_t len; - tableGuts += AZStd::string::format("%s - %s\n", - lua_tolstring(lua, -2, &len), - lua_typename(lua, lua_type(lua, -1))); - } - else if (lua_type(lua, -2) == LUA_TNUMBER) - { - tableGuts += AZStd::string::format("%f - %s\n", - lua_tonumber(lua, -2), - lua_typename(lua, lua_type(lua, -1))); - } - else - { - tableGuts += AZStd::string::format("%s - %s\n", - lua_typename(lua, lua_type(lua, -2)), - lua_typename(lua, lua_type(lua, -1))); - } - - /* removes 'value'; keeps 'key' for next iteration */ - lua_pop(lua, 1); - } - - AZ_TracePrintf("SCDB", tableGuts.c_str()); - } - - // Lua: instance, instance_mt - lua_pop (lua, 1); - - // Lua: instance lua_getfield(lua, -1, Grammar::k_OnGraphStartFunctionName); // Lua: instance, graph_VM.k_OnGraphStartFunctionName - if (!lua_isfunction(lua, -1)) - { - AZ_TracePrintf("SCDB", "No function"); - } lua_pushvalue(lua, -2); - if (!lua_isuserdata(lua, -1)) - { - AZ_TracePrintf("SCDB", "No light userdata"); - } // Lua: instance, graph_VM.k_OnGraphStartFunctionName, instance const int result = Execution::InterpretedSafeCall(lua, 1, 0); - // Lua: instance ? + // Lua: instance, ? if (result == LUA_OK) { // Lua: instance diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp index 2a20ca84df..2c455d80f5 100644 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp +++ b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp @@ -25,126 +25,6 @@ using namespace ScriptCanvasTests; using namespace TestNodes; using namespace ScriptCanvas::Execution; -// TODO: This fails to compile on Linux only -//ScriptCanvas::Grammar::SubgraphInterface* CreateExecutionMap(AZ::BehaviorContext& behaviorContext) -//{ -// using namespace ScriptCanvas; -// using namespace ScriptCanvas::Grammar; -// -// auto ins = CreateInsFromBehaviorContextMethods("TestNodeableObject", behaviorContext, { "Branch" } ); -// auto branchOutVoidTrue = CreateOut("BranchTrue", { "condition", "message" }); -// auto branchOutVoidFalse = CreateOut("BranchFalse", { "condition", "message", "vector" }); -// -// auto branchOut = FindInByName("Branch", ins); -// -// EXPECT_NE(branchOut, nullptr); -// if (branchOut) -// { -// branchOut->outs.emplace_back(AZStd::move(branchOutVoidTrue)); -// branchOut->outs.emplace_back(AZStd::move(branchOutVoidFalse)); -// } -// -// return aznew SubgraphInterface(AZStd::move(ins)); -//} - - -TEST_F(ScriptCanvasTestFixture, TestLuaObjectOrientation) -{ - using namespace ScriptCanvas; - using namespace ScriptCanvas::Grammar; - - AZ::ScriptContext sc; - sc.BindTo(m_behaviorContext); - RegisterAPI(sc.NativeContext()); - EXPECT_TRUE(sc.Execute( - R"LUA( - -assert(Nodeable ~= nil, 'Nodeable was nill') -assert(Nodeable.__call ~= nil, 'Nodeable.__call was nil') -assert(type(Nodeable.__call) == 'function', 'Nodeable.__call was not a function') - -local nodeable = Nodeable() -assert(nodeable ~= nil, 'nodeable was nil') -assert(type(nodeable) == "userdata", 'nodeable not userdata') - -local SubGraph = {} -SubGraph.s_name = "SubGraphery" -SubGraph.s_createdCount = 0 -function SubGraph:IncrementCreated() - SubGraph.s_createdCount = 1 + SubGraph.s_createdCount -end - -setmetatable(SubGraph, { __index = Nodeable }) -- exposed through BehaviorContext -local SubGraphInstanceMetatable = { __index = SubGraph } - -assert(getmetatable(SubGraph).__index == Nodeable, 'getmetatable(SubGraph).__index = Nodeable') -assert(type(getmetatable(SubGraph).__index) == 'table', "type(getmetatable(SubGraph).__index) ~= 'table'") - -function SubGraph.new() -- Add executionState input here and to Nodeable() - -- now individual instance values can be initialized - local instance = OverrideNodeableMetatable(Nodeable(), SubGraphInstanceMetatable) - assert(type(instance.s_createdCount) == 'number', 'subgraph.s_createdCount was not a number') - instance:IncrementCreated() - instance.name = 'SubGraph '..tostring(instance.s_createdCount) - return instance -end - -function SubGraph.newTable() -- Add executionState input here and to Nodeable() - -- now individual instance values can be initialized - local instance = setmetatable({}, SubGraphInstanceMetatable) - -- assert(getmetatable(instance) == SubGraphInstanceMetatable, "subgraphT") - assert(type(instance.s_createdCount) == 'number', 'subgraphT.s_createdCount was not a number') - instance:IncrementCreated() - instance.name = 'SubGraph '..tostring(instance.s_createdCount) - return instance -end - -function SubGraph:Foo() - return "I, " .. tostring(self.name) .. ", am a user function" -end - -local subgraphT = SubGraph.newTable() -assert(subgraphT ~= nil, "subgraphT was nil") -assert(type(subgraphT) == 'table', 'subgraphT was not a table') -assert(type(subgraphT.IsActive)== 'function', "subgraphT IsActive was not a function") -assert(type(subgraphT.Foo) == 'function', 'subgraphT was not a function') -local subgraphTResult = subgraphT:Foo() -assert(subgraphTResult == "I, SubGraph 1, am a user function", 'subgraphT did not return the right results:' .. tostring(subgraphTResult)) -assert(subgraphT.s_createdCount == 1, "subgraphT created count was not one: ".. tostring(subgraphT.s_createdCount)) -subgraphT = SubGraph.newTable() -assert(subgraphT.s_createdCount == 2, "subgraphT created count was not two: ".. tostring(subgraphT.s_createdCount)) - -local subgraph = SubGraph.new() -assert(subgraph ~= nil, "subgraph was nil") -assert(type(subgraph) == 'userdata', 'was not userdata') -assert(type(subgraph.IsActive)== 'function', "IsActive was not a function") -assert(not subgraph.IsActive(subgraph), "did not inherit properly") -assert(not subgraph:IsActive(), "did not inherit properly") -assert(type(subgraph.Foo) == 'function', 'was not a function') -local subgraphResult = subgraph:Foo() -assert(subgraphResult == "I, SubGraph 3, am a user function", 'subgraph:Foo() did not return the right results: ' .. tostring(subgraphResult)) -assert(subgraph.s_createdCount == 3, "created count was not three: "..tostring(subgraph.s_createdCount)) - -local subgraph2 = SubGraph.new() -assert(subgraph2 ~= nil, "subgraph2 was nil") -assert(type(subgraph2) == 'userdata', 'subgraph2 was not userdata') -assert(type(subgraph2.IsActive)== 'function', "subgraph2 IsActive was not a function") -assert(not subgraph2.IsActive(subgraph2), "subgraph2 did not inherit properly") -assert(not subgraph2:IsActive(), "subgraph2 did not inherit properly") -assert(type(subgraph2.Foo) == 'function', 'subgraph2 was not a function') -local subgraph2Result = subgraph2:Foo() -assert(subgraph2Result == "I, SubGraph 4, am a user function", 'subgraph2:Foo() did not return the right results: ' .. tostring(subgraph2Result)) -assert(subgraph2.s_createdCount == 4, "created count was not three: "..tostring(subgraph2.s_createdCount)) - -return SubGraph - -)LUA" -)); - -} - - -// // TEST_F(ScriptCanvasTestFixture, NativeNodeableStack) // { // TestNodeableObject nodeable; From 55fa33cff4bb4a0e5f7aff8d00e925c53afd8786 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 29 Nov 2021 13:43:39 -0800 Subject: [PATCH 063/399] Clean up modifier asset handling. Fix file handling string error. Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Assets/ScriptCanvasFileHandling.cpp | 3 +- .../Windows/Tools/UpgradeTool/Modifier.cpp | 49 +++++++++---------- .../View/Windows/Tools/UpgradeTool/Modifier.h | 5 +- 3 files changed, 28 insertions(+), 29 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index 8cecdc86d9..706c46fa75 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -317,8 +317,7 @@ namespace ScriptCanvasEditor auto saveOutcome = JSRU::SaveObjectToStream(graphData, stream, nullptr, &settings); if (!saveOutcome.IsSuccess()) { - AZStd::string result = saveOutcome.TakeError(); - return AZ::Failure(AZStd::string("JSON serialization failed to save source: %s", result.c_str())); + return AZ::Failure(AZStd::string::format("JSON serialization failed to save source: %s", saveOutcome.GetError().c_str())); } return AZ::Success(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index 71aeb1dbb9..242aea355e 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -32,6 +32,14 @@ namespace ScriptCanvasEditor AZ::SystemTickBus::Handler::BusConnect(); } + size_t Modifier::GetCurrentIndex() const + { + return m_state == State::GatheringDependencies + ? m_assetIndex + : m_dependencyOrderedAssetIndicies[m_assetIndex]; + + } + AZStd::unordered_set& Modifier::GetOrCreateDependencyIndexSet() { auto iter = m_dependencies.find(m_assetIndex); @@ -55,10 +63,10 @@ namespace ScriptCanvasEditor AZ_Assert(serializeContext, "SerializeContext is required to enumerate dependent assets in the ScriptCanvas file"); bool anyFailures = false; - auto asset = LoadAsset(); - if (asset.Get() && asset.Mod()->GetGraphData()) + + if (m_result.asset.Get() && m_result.asset.Mod()->GetGraphData()) { - auto graphData = asset.Mod()->GetGraphData(); + auto graphData = m_result.asset.Mod()->GetGraphData(); auto dependencyGrabber = [this] ( void* instancePointer @@ -94,19 +102,19 @@ namespace ScriptCanvasEditor { anyFailures = true; VE_LOG("Modifier: ERROR - Failed to gather dependencies from graph data: %s" - , ModCurrentAsset().Path().c_str()) + , m_result.asset.Path().c_str()) } } else { anyFailures = true; VE_LOG("Modifier: ERROR - Failed to load asset %s for modification, even though it scanned properly" - , ModCurrentAsset().Path().c_str()); + , m_result.asset.Path().c_str()); } ModelNotificationsBus::Broadcast ( &ModelNotificationsTraits::OnUpgradeDependenciesGathered - , ModCurrentAsset() + , m_result.asset , anyFailures ? Result::Failure : Result::Success); ReleaseCurrentAsset(); @@ -115,9 +123,9 @@ namespace ScriptCanvasEditor AZ::Data::AssetManager::Instance().DispatchEvents(); } - SourceHandle Modifier::LoadAsset() + void Modifier::LoadAsset() { - auto& handle = ModCurrentAsset(); + auto& handle = m_result.asset; if (!handle.IsGraphValid()) { auto outcome = LoadFromFile(handle.Path().c_str()); @@ -126,8 +134,6 @@ namespace ScriptCanvasEditor handle = outcome.TakeValue(); } } - - return handle; } void Modifier::ModificationComplete(const ModificationResult& result) @@ -144,25 +150,18 @@ namespace ScriptCanvasEditor } } - SourceHandle& Modifier::ModCurrentAsset() - { - return m_state == State::GatheringDependencies - ? m_assets[m_assetIndex] - : m_assets[m_dependencyOrderedAssetIndicies[m_assetIndex]]; - } - void Modifier::ModifyCurrentAsset() { m_result = {}; - m_result.asset = ModCurrentAsset(); - - ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, ModCurrentAsset()); + m_result.asset = m_assets[GetCurrentIndex()]; + ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, m_result.asset); + LoadAsset(); - if (auto asset = LoadAsset(); asset.IsGraphValid()) + if (m_result.asset.IsGraphValid()) { ModificationNotificationsBus::Handler::BusConnect(); m_modifyState = ModifyState::InProgress; - m_config.modification(asset); + m_config.modification(m_result.asset); } else { @@ -173,7 +172,7 @@ namespace ScriptCanvasEditor void Modifier::ModifyNextAsset() { ModelNotificationsBus::Broadcast - ( &ModelNotificationsTraits::OnUpgradeModificationEnd, m_config, ModCurrentAsset(), m_result); + ( &ModelNotificationsTraits::OnUpgradeModificationEnd, m_config, m_result.asset, m_result); ModificationNotificationsBus::Handler::BusDisconnect(); m_modifyState = ModifyState::Idle; ReleaseCurrentAsset(); @@ -183,7 +182,7 @@ namespace ScriptCanvasEditor void Modifier::ReleaseCurrentAsset() { - ModCurrentAsset() = ModCurrentAsset().Describe(); + m_result.asset = m_result.asset.Describe(); } void Modifier::ReportModificationError(AZStd::string_view report) @@ -381,7 +380,7 @@ namespace ScriptCanvasEditor (ScriptCanvas::k_VersionExplorerWindow.data() , false , "Modifier: Dependency sort has failed during, circular dependency detected for Asset: %s" - , modifier->ModCurrentAsset().Path().c_str()); + , modifier->m_result.asset.Path().c_str()); return; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h index 78c9b3a877..32b9253bb5 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h @@ -67,6 +67,7 @@ namespace ScriptCanvasEditor State m_state = State::GatheringDependencies; ModifyState m_modifyState = ModifyState::Idle; size_t m_assetIndex = 0; + AZStd::function m_onComplete; // asset infos in scanned order AZStd::vector m_assets; @@ -82,10 +83,10 @@ namespace ScriptCanvasEditor AZStd::unique_ptr m_fileSaver; FileSaveResult m_fileSaveResult; + size_t GetCurrentIndex() const; void GatherDependencies(); AZStd::unordered_set& GetOrCreateDependencyIndexSet(); - SourceHandle LoadAsset(); - SourceHandle& ModCurrentAsset(); + void LoadAsset(); void ModifyCurrentAsset(); void ModifyNextAsset(); void ModificationComplete(const ModificationResult& result) override; From 499cdaae5e69c3eb9b4f6444f1639ab3203634df Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 1 Dec 2021 22:18:32 -0800 Subject: [PATCH 064/399] version upgrader in a presumed working story Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Editor/Assets/ScriptCanvasFileHandling.cpp | 5 ++--- .../Code/Editor/Components/EditorGraph.cpp | 4 ++-- .../Code/Editor/Components/GraphUpgrade.cpp | 6 ++++-- .../ScriptCanvas/Components/EditorGraph.h | 2 +- .../Windows/Tools/UpgradeTool/FileSaver.cpp | 13 ++++++++++++- .../Windows/Tools/UpgradeTool/Modifier.cpp | 18 ++++++++++-------- .../Code/Include/ScriptCanvas/Core/Core.h | 6 +++--- .../ScriptCanvas/Grammar/ParsingMetaData.cpp | 8 ++++---- 8 files changed, 38 insertions(+), 24 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index 706c46fa75..be909e5043 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -209,7 +209,6 @@ namespace ScriptCanvasEditor AZ::Outcome LoadFromFile(AZStd::string_view path) { namespace JSRU = AZ::JsonSerializationUtils; - using namespace ScriptCanvas; auto fileStringOutcome = AZ::Utils::ReadFile(path); if (!fileStringOutcome) @@ -218,7 +217,7 @@ namespace ScriptCanvasEditor } const auto& asString = fileStringOutcome.GetValue(); - DataPtr scriptCanvasData = AZStd::make_shared(); + ScriptCanvas::DataPtr scriptCanvasData = aznew ScriptCanvas::ScriptCanvasData(); if (!scriptCanvasData) { return AZ::Failure(AZStd::string("failed to allocate ScriptCanvas::ScriptCanvasData after loading source file")); @@ -314,7 +313,7 @@ namespace ScriptCanvasEditor listener->OnSerialize(); } - auto saveOutcome = JSRU::SaveObjectToStream(graphData, stream, nullptr, &settings); + auto saveOutcome = JSRU::SaveObjectToStream(graphData.get(), stream, nullptr, &settings); if (!saveOutcome.IsSuccess()) { return AZ::Failure(AZStd::string::format("JSON serialization failed to save source: %s", saveOutcome.GetError().c_str())); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 7135d983fd..22f9359a09 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -1069,7 +1069,7 @@ namespace ScriptCanvasEditor m_owner = &owner; } - ScriptCanvas::ScriptCanvasData* Graph::GetOwnership() const + ScriptCanvas::DataPtr Graph::GetOwnership() const { return const_cast(this)->m_owner; } @@ -1356,7 +1356,7 @@ namespace ScriptCanvasEditor void Graph::SignalDirty() { - SourceHandle handle(m_owner->shared_from_this(), {}, {}); + SourceHandle handle(m_owner, {}, {}); GeneralRequestBus::Broadcast(&GeneralRequests::SignalSceneDirty, handle); } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp b/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp index e64a47a753..fec813b0c1 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp @@ -438,10 +438,11 @@ namespace ScriptCanvasEditor if (nodeConfig.IsValid()) { ScriptCanvas::NodeUpdateSlotReport nodeUpdateSlotReport; + auto nodeEntity = node->GetEntityId(); auto nodeOutcome = graph->ReplaceNodeByConfig(node, nodeConfig, nodeUpdateSlotReport); if (nodeOutcome.IsSuccess()) { - ScriptCanvas::MergeUpdateSlotReport(node->GetEntityId(), sm->m_updateReport, nodeUpdateSlotReport); + ScriptCanvas::MergeUpdateSlotReport(nodeEntity, sm->m_updateReport, nodeUpdateSlotReport); sm->m_allNodes.erase(node); sm->m_outOfDateNodes.erase(node); @@ -687,7 +688,8 @@ namespace ScriptCanvasEditor void EditorGraphUpgradeMachine::OnComplete(IState::ExitStatus exitStatus) { UpgradeNotificationsBus::Broadcast(&UpgradeNotifications::OnGraphUpgradeComplete, m_asset, exitStatus == IState::ExitStatus::Skipped); - m_asset = {}; + // releasing the asset at this stage of the system tick causes a memory crash + // m_asset = {}; } ////////////////////////////////////////////////////////////////////// diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index 319a835ba5..be8f274cd6 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -302,7 +302,7 @@ namespace ScriptCanvasEditor const GraphStatisticsHelper& GetNodeUsageStatistics() const; void MarkOwnership(ScriptCanvas::ScriptCanvasData& owner); - ScriptCanvas::ScriptCanvasData* GetOwnership() const; + ScriptCanvas::DataPtr GetOwnership() const; // Finds and returns all nodes within the graph that are of the specified type template diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp index c23a3d915b..47e43b19d3 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp @@ -76,7 +76,7 @@ namespace ScriptCanvasEditor AZ::SystemTickBus::QueueFunction([this, tmpFileName]() { FileSaveResult result; - result.fileSaveError = "Failed to move updated file from temporary location to tmpFileName destination"; + result.fileSaveError = "Failed to move updated file from temporary location to original destination."; result.tempFileRemovalError = RemoveTempFile(tmpFileName); m_onComplete(result); }); @@ -97,7 +97,16 @@ namespace ScriptCanvasEditor } else { + // #sc_editor_asset - skip save, narrow down the memory corruption + AZ::SystemTickBus::QueueFunction([this, tmpFileName]() + { + FileSaveResult result; + result.tempFileRemovalError = RemoveTempFile(tmpFileName); + m_onComplete(result); + }); + // the actual move attempt + /* auto moveResult = AZ::IO::SmartMove(tmpFileName.c_str(), target.c_str()); if (moveResult.GetResultCode() == AZ::IO::ResultCode::Success) { @@ -105,6 +114,7 @@ namespace ScriptCanvasEditor AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(target.c_str()); // Bump the slice asset up in the asset processor's queue. AzFramework::AssetSystemRequestBus::Broadcast(&AzFramework::AssetSystem::AssetSystemRequests::EscalateAssetBySearchTerm, target.c_str()); + AZ::SystemTickBus::QueueFunction([this, tmpFileName]() { FileSaveResult result; @@ -124,6 +134,7 @@ namespace ScriptCanvasEditor }); streamer->QueueRequest(flushRequest); } + **/ } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index 242aea355e..3c8605e915 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -138,15 +138,17 @@ namespace ScriptCanvasEditor void Modifier::ModificationComplete(const ModificationResult& result) { - m_result = result; - - if (result.errorMessage.empty()) + if (!result.errorMessage.empty()) { - SaveModifiedGraph(result); + ReportModificationError(result.errorMessage); + } + else if (m_result.asset.Describe() != result.asset.Describe()) + { + ReportModificationError("Received modifiction complete notification for different result"); } else { - ReportModificationError(result.errorMessage); + SaveModifiedGraph(result); } } @@ -187,15 +189,15 @@ namespace ScriptCanvasEditor void Modifier::ReportModificationError(AZStd::string_view report) { - m_result.asset = {}; m_result.errorMessage = report; - m_results.m_failures.push_back(m_result); + m_results.m_failures.push_back({ m_result.asset.Describe(), report }); ModifyNextAsset(); } void Modifier::ReportModificationSuccess() { - m_results.m_successes.push_back(m_result.asset); + m_result.asset = m_result.asset.Describe(); + m_results.m_successes.push_back({ m_result.asset.Describe(), {} }); ModifyNextAsset(); } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 297ee70500..215041e1fd 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -306,8 +306,8 @@ namespace ScriptCanvas { class ScriptCanvasData; - using DataPtr = AZStd::shared_ptr; - using DataPtrConst = AZStd::shared_ptr; + using DataPtr = AZStd::intrusive_ptr; + using DataPtrConst = AZStd::intrusive_ptr; } namespace ScriptCanvasEditor @@ -372,7 +372,7 @@ namespace ScriptCanvasEditor namespace ScriptCanvas { class ScriptCanvasData - : public AZStd::enable_shared_from_this + : public AZStd::intrusive_refcount { public: diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingMetaData.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingMetaData.cpp index 476b21d0d6..681bd3b0e4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingMetaData.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingMetaData.cpp @@ -152,19 +152,19 @@ namespace ScriptCanvas { if (azrtti_istypeof(execution->GetId().m_node)) { - return MetaDataPtr(aznew FormatStringMetaData()); + return AZStd::make_shared(); } else if (azrtti_istypeof(execution->GetId().m_node)) { - return MetaDataPtr(aznew PrintMetaData()); + return AZStd::make_shared(); } else if (azrtti_istypeof(execution->GetId().m_node)) { - return MetaDataPtr(aznew MathExpressionMetaData()); + return AZStd::make_shared(); } else if (execution->GetSymbol() == Symbol::FunctionCall) { - return MetaDataPtr(aznew FunctionCallDefaultMetaData()); + return AZStd::make_shared(); } } From d8add36212c0dd64daa2f4e44c82f24d2f808091 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 1 Dec 2021 23:04:07 -0800 Subject: [PATCH 065/399] restore file save Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/Components/EditorGraph.cpp | 2 +- .../Windows/Tools/UpgradeTool/FileSaver.cpp | 22 +++++++------------ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 22f9359a09..79621bbddb 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -1051,7 +1051,7 @@ namespace ScriptCanvasEditor auto graph = entity->CreateComponent(); entity->CreateComponent(graph->GetScriptCanvasId()); - if (ScriptCanvas::DataPtr data = AZStd::make_shared()) + if (ScriptCanvas::DataPtr data = aznew ScriptCanvas::ScriptCanvasData()) { data->m_scriptCanvasEntity.reset(entity); graph->MarkOwnership(*data); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp index 47e43b19d3..57c0822b05 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp @@ -97,23 +97,15 @@ namespace ScriptCanvasEditor } else { - // #sc_editor_asset - skip save, narrow down the memory corruption - AZ::SystemTickBus::QueueFunction([this, tmpFileName]() - { - FileSaveResult result; - result.tempFileRemovalError = RemoveTempFile(tmpFileName); - m_onComplete(result); - }); - // the actual move attempt - /* auto moveResult = AZ::IO::SmartMove(tmpFileName.c_str(), target.c_str()); if (moveResult.GetResultCode() == AZ::IO::ResultCode::Success) { auto streamer = AZ::Interface::Get(); AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(target.c_str()); // Bump the slice asset up in the asset processor's queue. - AzFramework::AssetSystemRequestBus::Broadcast(&AzFramework::AssetSystem::AssetSystemRequests::EscalateAssetBySearchTerm, target.c_str()); + AzFramework::AssetSystemRequestBus::Broadcast + (&AzFramework::AssetSystem::AssetSystemRequests::EscalateAssetBySearchTerm, target.c_str()); AZ::SystemTickBus::QueueFunction([this, tmpFileName]() { @@ -124,17 +116,19 @@ namespace ScriptCanvasEditor } else { - AZ_Warning(ScriptCanvas::k_VersionExplorerWindow.data(), false, "moving converted file to tmpFileName destination failed: %s, trying again", target.c_str()); + AZ_Warning(ScriptCanvas::k_VersionExplorerWindow.data(), false + , "moving converted file to tmpFileName destination failed: %s, trying again", target.c_str()); auto streamer = AZ::Interface::Get(); AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(target.c_str()); - streamer->SetRequestCompleteCallback(flushRequest, [this, tmpFileName, target, remainingAttempts]([[maybe_unused]] AZ::IO::FileRequestHandle request) + streamer->SetRequestCompleteCallback(flushRequest + , [this, tmpFileName, target, remainingAttempts]([[maybe_unused]] AZ::IO::FileRequestHandle request) { // Continue saving. - AZ::SystemTickBus::QueueFunction([this, tmpFileName, target, remainingAttempts]() { PerformMove(tmpFileName, target, remainingAttempts - 1); }); + AZ::SystemTickBus::QueueFunction( + [this, tmpFileName, target, remainingAttempts]() { PerformMove(tmpFileName, target, remainingAttempts - 1); }); }); streamer->QueueRequest(flushRequest); } - **/ } } From 2c107c364fd760e43ebd3507a92671da733918d2 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 1 Dec 2021 23:55:11 -0800 Subject: [PATCH 066/399] fix mismatched file name on modification Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/View/Widgets/GraphTabBar.cpp | 13 +++++++++---- .../Code/Editor/View/Widgets/GraphTabBar.h | 1 - 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index b00e2ea3de..53b2cecabc 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -158,8 +158,7 @@ namespace ScriptCanvasEditor AZStd::string tabName; AzFramework::StringFunc::Path::GetFileName(assetId.Path().c_str(), tabName); - metaData.m_name = tabName.c_str(); - + SetTabText(tabIndex, tabName.c_str(), fileState); setTabData(tabIndex, QVariant::fromValue(metaData)); return tabIndex; @@ -350,6 +349,12 @@ namespace ScriptCanvasEditor void GraphTabBar::SetTabText(int tabIndex, const QString& path, Tracker::ScriptCanvasFileState fileState) { + QString safePath = path; + if (path.endsWith("^") || path.endsWith("*")) + { + safePath.chop(1); + } + if (tabIndex >= 0 && tabIndex < count()) { const char* fileStateTag = ""; @@ -366,7 +371,7 @@ namespace ScriptCanvasEditor break; } - setTabText(tabIndex, QString("%1%2").arg(path).arg(fileStateTag)); + setTabText(tabIndex, QString("%1%2").arg(safePath).arg(fileStateTag)); } } @@ -392,7 +397,7 @@ namespace ScriptCanvasEditor int index = FindTab(assetId); tabData->m_fileState = fileState; SetTabData(*tabData, assetId); - SetTabText(index, tabData->m_name, fileState); + SetTabText(index, tabText(index), fileState); if (index == currentIndex()) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h index 40b785f016..e19ceaa4ec 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h @@ -37,7 +37,6 @@ namespace ScriptCanvasEditor QWidget* m_hostWidget = nullptr; CanvasWidget* m_canvasWidget = nullptr; Tracker::ScriptCanvasFileState m_fileState = Tracker::ScriptCanvasFileState::INVALID; - QString m_name; }; class GraphTabBar From 6421463df254908258ed58dd82908cf415d5a8fb Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 00:25:50 -0800 Subject: [PATCH 067/399] clean up WIP Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilder.cpp | 33 +++--- Gems/ScriptCanvas/Code/Editor/Settings.cpp | 17 ++- .../Code/Editor/SystemComponent.cpp | 93 +++++++-------- .../LoggingPanel/LoggingWindowTreeItems.cpp | 106 +++++++++--------- .../PivotTree/PivotTreeWidget.cpp | 23 ++-- .../FunctionNodePaletteTreeItemTypes.cpp | 14 ++- .../ScriptCanvasStatisticsDialog.cpp | 6 +- .../Code/Editor/View/Windows/MainWindow.cpp | 13 +-- 8 files changed, 154 insertions(+), 151 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index 31b63e8fad..60a3687d0d 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -27,23 +27,24 @@ namespace BuildVariableOverridesCpp }; bool VersionConverter - ( [[maybe_unused]] AZ::SerializeContext& serializeContext - , [[maybe_unused]] AZ::SerializeContext::DataElementNode& rootElement) + ( AZ::SerializeContext& serializeContext + , AZ::SerializeContext::DataElementNode& rootElement) { - // #sc_editor_asset -// ScriptCanvasBuilder::BuildVariableOverrides overrides; -// overrides.m_source = SourceHandle(nullptr, assetHolder.GetAssetId().m_guid, {}); -// -// for (auto& variable : editableData.GetVariables()) -// { -// overrides.m_overrides.push_back(variable.m_graphVariable); -// } -// -// if (!rootElement.AddElementWithData(serializeContext, "runtimeDataOverrides", overrides)) -// { -// AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: failed to add 'runtimeDataOverrides'"); -// return false; -// } + // #sc_editor_asset + ScriptCanvasBuilder::BuildVariableOverrides overrides; + overrides.m_source = SourceHandle(nullptr, assetHolder.GetAssetId().m_guid, {}); + + for (auto& variable : editableData.GetVariables()) + { + overrides.m_overrides.push_back(variable.m_graphVariable); + } + + if (!rootElement.AddElementWithData(serializeContext, "runtimeDataOverrides", overrides)) + { + AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: failed to add 'runtimeDataOverrides'"); + return false; + } + return true; } } diff --git a/Gems/ScriptCanvas/Code/Editor/Settings.cpp b/Gems/ScriptCanvas/Code/Editor/Settings.cpp index 997ef4eadf..84744f77e3 100644 --- a/Gems/ScriptCanvas/Code/Editor/Settings.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Settings.cpp @@ -110,15 +110,14 @@ namespace ScriptCanvasEditor if (subElement) { -// #sc_editor_asset -// if (subElement->GetData(assetIds)) -// { -// assetSaveData.reserve(assetIds.size()); -// for (const AZ::Data::AssetId& assetId : assetIds) -// { -// assetSaveData.emplace_back(assetId); -// } -// } + if (subElement->GetData(assetIds)) + { + assetSaveData.reserve(assetIds.size()); + for (const AZ::Data::AssetId& assetId : assetIds) + { + assetSaveData.emplace_back(SourceHandle( nullptr, assetId.m_guid, "" )); + } + } } rootDataElementNode.RemoveElementByName(AZ_CRC_CE("ActiveAssetIds")); diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 88ef93a4c4..0be2d564ee 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -212,7 +212,7 @@ namespace ScriptCanvasEditor if (!entitiesWithScriptCanvas.empty()) { QMenu* scriptCanvasMenu = nullptr; - // QAction* action = nullptr; + QAction* action = nullptr; // For entities with script canvas component, create a context menu to open any existing script canvases within each selected entity. for (const AZ::EntityId& entityId : entitiesWithScriptCanvas) @@ -245,32 +245,33 @@ namespace ScriptCanvasEditor AZStd::unordered_set< AZ::Data::AssetId > usedIds; - //#sc_editor_asset -// for (const auto& assetId : assetIds.values) -// { -// if (!assetId.IsValid() || usedIds.count(assetId) != 0) -// { -// continue; -// } -// -// entityMenu->setEnabled(true); -// -// usedIds.insert(assetId); -// -// AZStd::string rootPath; -// AZ::Data::AssetInfo assetInfo = AssetHelpers::GetAssetInfo(assetId, rootPath); -// -// AZStd::string displayName; -// AZ::StringFunc::Path::GetFileName(assetInfo.m_relativePath.c_str(), displayName); -// -// action = entityMenu->addAction(QString("%1").arg(QString(displayName.c_str()))); -// -// QObject::connect(action, &QAction::triggered, [assetId] -// { -// AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); -// GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, assetId, -1); -// }); -// } + for (const auto& assetId : assetIds.values) + { + if (!assetId.IsValid() || usedIds.count(assetId) != 0) + { + continue; + } + + entityMenu->setEnabled(true); + + usedIds.insert(assetId); + + AZStd::string rootPath; + AZ::Data::AssetInfo assetInfo = AssetHelpers::GetAssetInfo(assetId, rootPath); + + AZStd::string displayName; + AZ::StringFunc::Path::GetFileName(assetInfo.m_relativePath.c_str(), displayName); + + action = entityMenu->addAction(QString("%1").arg(QString(displayName.c_str()))); + + QObject::connect(action, &QAction::triggered, [assetId] + { + AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); + GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset + , SourceHandle(nullptr, assetId.m_guid, "") + , Tracker::ScriptCanvasFileState::UNMODIFIED, -1); + }); + } } } } @@ -319,24 +320,26 @@ namespace ScriptCanvasEditor { isScriptCanvasAsset = true; } - // #sc_editor_asset -// if (isScriptCanvasAsset) -// { -// auto scriptCanvasEditorCallback = []([[maybe_unused]] const char* fullSourceFileNameInCall, const AZ::Uuid& sourceUUIDInCall) -// { -// AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); -// const SourceAssetBrowserEntry* fullDetails = SourceAssetBrowserEntry::GetSourceByUuid(sourceUUIDInCall); -// if (fullDetails) -// { -// AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); -// -// AzToolsFramework::EditorRequests::Bus::Broadcast(&AzToolsFramework::EditorRequests::OpenViewPane, "Script Canvas"); -// GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, sourceUUIDInCall, -1); -// } -// }; -// -// openers.push_back({ "O3DE_ScriptCanvasEditor", "Open In Script Canvas Editor...", QIcon(), scriptCanvasEditorCallback }); -// } + + if (isScriptCanvasAsset) + { + auto scriptCanvasEditorCallback = []([[maybe_unused]] const char* fullSourceFileNameInCall, const AZ::Uuid& sourceUUIDInCall) + { + AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); + const SourceAssetBrowserEntry* fullDetails = SourceAssetBrowserEntry::GetSourceByUuid(sourceUUIDInCall); + if (fullDetails) + { + AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); + + AzToolsFramework::EditorRequests::Bus::Broadcast(&AzToolsFramework::EditorRequests::OpenViewPane, "Script Canvas"); + GeneralRequestBus::BroadcastResult(openOutcome + , &GeneralRequests::OpenScriptCanvasAsset + , SourceHandle(nullptr, sourceUUIDInCall, ""), Tracker::ScriptCanvasFileState::UNMODIFIED, -1); + } + }; + + openers.push_back({ "O3DE_ScriptCanvasEditor", "Open In Script Canvas Editor...", QIcon(), scriptCanvasEditorCallback }); + } } void SystemComponent::OnUserSettingsActivated() diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp index 636ee832d4..6936a0c368 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp @@ -619,51 +619,54 @@ namespace ScriptCanvasEditor void ExecutionLogTreeItem::ScrapeGraphCanvasData() { - // #sc_editor_asset -// if (!m_graphCanvasGraphId.IsValid()) -// { -// GeneralRequestBus::BroadcastResult(m_graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, GetAssetId()); -// -// if (!EditorGraphNotificationBus::Handler::BusIsConnected()) -// { -// ScriptCanvas::ScriptCanvasId scriptCanvasId; -// GeneralRequestBus::BroadcastResult(scriptCanvasId, &GeneralRequests::FindScriptCanvasIdByAssetId, GetAssetId()); -// -// EditorGraphNotificationBus::Handler::BusConnect(scriptCanvasId); -// } -// } -// -// if (m_graphCanvasGraphId.IsValid()) -// { -// if (!m_graphCanvasNodeId.IsValid()) -// { -// AssetGraphSceneBus::BroadcastResult(m_scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_scriptCanvasAssetNodeId); -// SceneMemberMappingRequestBus::EventResult(m_graphCanvasNodeId, m_scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); -// } -// -// if (m_graphCanvasNodeId.IsValid()) -// { -// const bool refreshDisplayData = false; -// ResolveWrapperNode(refreshDisplayData); -// -// AZStd::string displayName; -// GraphCanvas::NodeTitleRequestBus::EventResult(displayName, m_graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::GetTitle); -// -// if (!displayName.empty()) -// { -// m_displayName = displayName.c_str(); -// } -// -// GraphCanvas::NodeTitleRequestBus::Event(m_graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::ConfigureIconConfiguration, m_paletteConfiguration); -// -// OnStylesLoaded(); -// -// PopulateInputSlotData(); -// PopulateOutputSlotData(); -// -// SignalDataChanged(); -// } -// } + if (!m_graphCanvasGraphId.IsValid()) + { + GeneralRequestBus::BroadcastResult(m_graphCanvasGraphId + , &GeneralRequests::FindGraphCanvasGraphIdByAssetId, SourceHandle(nullptr, GetAssetId().m_guid, "")); + + if (!EditorGraphNotificationBus::Handler::BusIsConnected()) + { + ScriptCanvas::ScriptCanvasId scriptCanvasId; + GeneralRequestBus::BroadcastResult(scriptCanvasId + , &GeneralRequests::FindScriptCanvasIdByAssetId, SourceHandle(nullptr, GetAssetId().m_guid, "")); + + EditorGraphNotificationBus::Handler::BusConnect(scriptCanvasId); + } + } + + if (m_graphCanvasGraphId.IsValid()) + { + if (!m_graphCanvasNodeId.IsValid()) + { + AssetGraphSceneBus::BroadcastResult(m_scriptCanvasNodeId + , &AssetGraphScene::FindEditorNodeIdByAssetNodeId + , SourceHandle(nullptr, GetAssetId().m_guid, ""), m_scriptCanvasAssetNodeId); + SceneMemberMappingRequestBus::EventResult(m_graphCanvasNodeId, m_scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); + } + + if (m_graphCanvasNodeId.IsValid()) + { + const bool refreshDisplayData = false; + ResolveWrapperNode(refreshDisplayData); + + AZStd::string displayName; + GraphCanvas::NodeTitleRequestBus::EventResult(displayName, m_graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::GetTitle); + + if (!displayName.empty()) + { + m_displayName = displayName.c_str(); + } + + GraphCanvas::NodeTitleRequestBus::Event(m_graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::ConfigureIconConfiguration, m_paletteConfiguration); + + OnStylesLoaded(); + + PopulateInputSlotData(); + PopulateOutputSlotData(); + + SignalDataChanged(); + } + } } void ExecutionLogTreeItem::PopulateInputSlotData() @@ -805,8 +808,8 @@ namespace ScriptCanvasEditor { if (!m_graphCanvasGraphId.IsValid()) { - // #sc_editor_asset - // GeneralRequestBus::BroadcastResult(m_graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, m_graphIdentifier.m_assetId); + GeneralRequestBus::BroadcastResult(m_graphCanvasGraphId + , &GeneralRequests::FindGraphCanvasGraphIdByAssetId, SourceHandle(nullptr, m_graphIdentifier.m_assetId.m_guid, "")); } ScrapeInputName(); @@ -828,8 +831,7 @@ namespace ScriptCanvasEditor if (m_graphCanvasGraphId.IsValid() && m_assetInputEndpoint.IsValid()) { AZ::EntityId scriptCanvasNodeId; - // #sc_editor_asset - // AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_assetInputEndpoint.GetNodeId()); + AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, SourceHandle(nullptr, GetAssetId().m_guid, ""), m_assetInputEndpoint.GetNodeId()); GraphCanvas::NodeId graphCanvasNodeId; SceneMemberMappingRequestBus::EventResult(graphCanvasNodeId, scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); @@ -852,9 +854,9 @@ namespace ScriptCanvasEditor if (m_graphCanvasGraphId.IsValid() && m_assetOutputEndpoint.IsValid()) { AZ::EntityId scriptCanvasNodeId; - // #sc_editor_asset - // AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_assetOutputEndpoint.GetNodeId()); - + AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId + , SourceHandle(nullptr, GetAssetId().m_guid, ""), m_assetOutputEndpoint.GetNodeId()); + GraphCanvas::NodeId graphCanvasNodeId; SceneMemberMappingRequestBus::EventResult(graphCanvasNodeId, scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp index d085ebbbcf..b1827d7099 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp @@ -405,18 +405,17 @@ namespace ScriptCanvasEditor { sourceIndex = proxyModel->mapToSource(modelIndex); } - // #sc_editor_asset -// PivotTreeItem* pivotTreeItem = static_cast(sourceIndex.internalPointer()); -// -// if (pivotTreeItem) -// { -// PivotTreeGraphItem* graphItem = azrtti_cast(pivotTreeItem); -// -// if (graphItem) -// { -// GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, graphItem->GetAssetId()); -// } -// } + + if (PivotTreeItem* pivotTreeItem = static_cast(sourceIndex.internalPointer())) + { + if (PivotTreeGraphItem* graphItem = azrtti_cast(pivotTreeItem)) + { + GeneralRequestBus::Broadcast + ( &GeneralRequests::OpenScriptCanvasAssetId + , SourceHandle(nullptr, graphItem->GetAssetId().m_guid, "") + , Tracker::ScriptCanvasFileState::UNMODIFIED); + } + } } #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.cpp index 6473dcbb40..b2db9508b1 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.cpp @@ -129,8 +129,10 @@ namespace ScriptCanvasEditor { if (row == NodePaletteTreeItem::Column::Customization) { - // #sc_editor_asset - // GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, GetSourceAssetId(), -1); + GeneralRequestBus::Broadcast + ( &GeneralRequests::OpenScriptCanvasAssetId + , SourceHandle(nullptr, GetSourceAssetId().m_guid, "") + , Tracker::ScriptCanvasFileState::UNMODIFIED); } } @@ -138,9 +140,11 @@ namespace ScriptCanvasEditor { if (row != NodePaletteTreeItem::Column::Customization) { - // #sc_editor_asset - // GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, GetSourceAssetId(), -1); - // return true; + GeneralRequestBus::Broadcast + ( &GeneralRequests::OpenScriptCanvasAssetId + , SourceHandle(nullptr, GetSourceAssetId().m_guid, "") + , Tracker::ScriptCanvasFileState::UNMODIFIED); + return true; } return false; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp index 9538a5732a..4a0905c17c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp @@ -257,8 +257,10 @@ namespace ScriptCanvasEditor if (treeItem->GetAssetId().IsValid()) { - // #sc_editor_asset - // GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, treeItem->GetAssetId()); + GeneralRequestBus::Broadcast + ( &GeneralRequests::OpenScriptCanvasAssetId + , SourceHandle(nullptr, treeItem->GetAssetId().m_guid, "") + , Tracker::ScriptCanvasFileState::UNMODIFIED); } } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index f9653031b4..4eb8fb4cca 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -2673,10 +2673,8 @@ namespace ScriptCanvasEditor } } - void MainWindow::CopyPathToClipboard(int /*index*/) + void MainWindow::CopyPathToClipboard(int index) { - // #sc_editor_asset - /* QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) @@ -2684,20 +2682,15 @@ namespace ScriptCanvasEditor QClipboard* clipBoard = QGuiApplication::clipboard(); auto assetId = tabdata.value(); - - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - - if (memoryAsset) + if (!assetId.m_assetId.Path().empty()) { - clipBoard->setText(memoryAsset->GetAbsolutePath().c_str()); + clipBoard->setText(assetId.m_assetId.Path().c_str()); } else { clipBoard->setText(m_tabBar->tabText(index)); } } - */ } void MainWindow::OnActiveFileStateChanged() From 87023cae47df4223529b4d4c84889563ec8a8109 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 09:17:05 -0800 Subject: [PATCH 068/399] finish last of pre-PR clean up, including saving over previsouly opened tabs Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilder.cpp | 36 ++- .../Code/Editor/View/Widgets/GraphTabBar.cpp | 38 +++ .../Code/Editor/View/Widgets/GraphTabBar.h | 2 + .../Code/Editor/View/Windows/MainWindow.cpp | 258 ++++++------------ .../Code/Editor/View/Windows/MainWindow.h | 2 - 5 files changed, 154 insertions(+), 182 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index 60a3687d0d..00df5ad07b 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -20,6 +20,7 @@ namespace BuildVariableOverridesCpp { enum Version { + Original = 1, EditorAssetRedux, // add description above @@ -30,19 +31,29 @@ namespace BuildVariableOverridesCpp ( AZ::SerializeContext& serializeContext , AZ::SerializeContext::DataElementNode& rootElement) { - // #sc_editor_asset - ScriptCanvasBuilder::BuildVariableOverrides overrides; - overrides.m_source = SourceHandle(nullptr, assetHolder.GetAssetId().m_guid, {}); - - for (auto& variable : editableData.GetVariables()) + if (rootElement.GetVersion() < BuildVariableOverridesCpp::Version::EditorAssetRedux) { - overrides.m_overrides.push_back(variable.m_graphVariable); - } - - if (!rootElement.AddElementWithData(serializeContext, "runtimeDataOverrides", overrides)) - { - AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: failed to add 'runtimeDataOverrides'"); - return false; + auto sourceIndex = rootElement.FindElement(AZ_CRC_CE("source")); + if (sourceIndex == -1) + { + AZ_Error("ScriptCanvas", false, "BuildVariableOverrides coversion failed: 'source' was missing"); + return false; + } + + auto& sourceElement = rootElement.GetSubElement(sourceIndex); + AZ::Data::Asset asset; + if (!sourceElement.GetData(asset)) + { + AZ_Error("ScriptCanvas", false, "BuildVariableOverrides coversion failed: could not retrieve 'source' data"); + return false; + } + + ScriptCanvasEditor::SourceHandle sourceHandle(nullptr, asset.GetId().m_guid, {}); + if (!rootElement.AddElementWithData(serializeContext, "source", sourceHandle)) + { + AZ_Error("ScriptCanvas", false, "BuildVariableOverrides coversion failed: could not add updated 'source' data"); + return false; + } } return true; @@ -136,7 +147,6 @@ namespace ScriptCanvasBuilder return m_variables.empty() && m_entityIds.empty() && m_dependencies.empty(); } - // #sc_editor_asset THIS MUST GET VERSIONED! void BuildVariableOverrides::Reflect(AZ::ReflectContext* reflectContext) { if (auto serializeContext = azrtti_cast(reflectContext)) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index 53b2cecabc..4e9398fdcf 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -175,6 +175,7 @@ namespace ScriptCanvasEditor setCurrentIndex(tabIndex); return true; } + return false; } @@ -192,6 +193,43 @@ namespace ScriptCanvasEditor } } } + + return -1; + } + + int GraphTabBar::FindTab(ScriptCanvasEditor::GraphPtrConst graph) const + { + for (int tabIndex = 0; tabIndex < count(); ++tabIndex) + { + QVariant tabDataVariant = tabData(tabIndex); + if (tabDataVariant.isValid()) + { + auto tabAssetId = tabDataVariant.value(); + if (tabAssetId.m_assetId.Get() == graph) + { + return tabIndex; + } + } + } + + return -1; + } + + int GraphTabBar::FindSaveOverMatch(ScriptCanvasEditor::SourceHandle assetId) const + { + for (int tabIndex = 0; tabIndex < count(); ++tabIndex) + { + QVariant tabDataVariant = tabData(tabIndex); + if (tabDataVariant.isValid()) + { + auto tabAssetId = tabDataVariant.value(); + if (tabAssetId.m_assetId.Get() != assetId.Get() && tabAssetId.m_assetId.PathEquals(assetId)) + { + return tabIndex; + } + } + } + return -1; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h index e19ceaa4ec..939fb7c8f4 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h @@ -62,6 +62,8 @@ namespace ScriptCanvasEditor bool SelectTab(ScriptCanvasEditor::SourceHandle assetId); int FindTab(ScriptCanvasEditor::SourceHandle assetId) const; + int FindTab(ScriptCanvasEditor::GraphPtrConst graph) const; + int FindSaveOverMatch(ScriptCanvasEditor::SourceHandle assetId) const; ScriptCanvasEditor::SourceHandle FindTabByPath(AZStd::string_view path) const; ScriptCanvasEditor::SourceHandle FindAssetId(int tabIndex); ScriptCanvas::ScriptCanvasId FindScriptCanvasIdFromGraphCanvasId(const GraphCanvas::GraphId& graphCanvasGraphId) const; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 4eb8fb4cca..06877a5659 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -910,19 +910,10 @@ namespace ScriptCanvasEditor return; } - AssetTrackerRequests::AssetList unsavedAssets; - AssetTrackerRequestBus::BroadcastResult(unsavedAssets, &AssetTrackerRequests::GetUnsavedAssets); - for (int tabCounter = 0; tabCounter < m_tabBar->count(); ++tabCounter) { ScriptCanvasEditor::SourceHandle assetId = m_tabBar->FindAssetId(tabCounter); - auto resultIterator = m_processedClosedAssetIds.insert(assetId); - if (!resultIterator.second) - { - continue; - } - const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(assetId); if (fileState == Tracker::ScriptCanvasFileState::UNMODIFIED) @@ -938,30 +929,13 @@ namespace ScriptCanvasEditor if (shouldSaveResults == UnsavedChangesOptions::SAVE) { - // #sc_editor_asset -// Callbacks::OnSave saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr, ScriptCanvasEditor::SourceHandle) -// { -// if (isSuccessful) -// { -// // Continue closing. -// qobject_cast(parent())->close(); -// } -// else -// { -// // Abort closing. -// QMessageBox::critical(this, QString(), QObject::tr("Failed to save.")); -// m_processedClosedAssetIds.clear(); -// } -// }; -// ActivateAndSaveAsset(assetId, saveCB); + SaveAssetImpl(assetId, Save::InPlace); event->ignore(); return; } else if (shouldSaveResults == UnsavedChangesOptions::CANCEL_WITHOUT_SAVING) { - m_processedClosedAssetIds.clear(); event->ignore(); - return; } else if (shouldSaveResults == UnsavedChangesOptions::CONTINUE_WITHOUT_SAVING && @@ -973,20 +947,6 @@ namespace ScriptCanvasEditor } m_workspace->Save(); - - // Close all files. -// -// AssetTrackerRequests::AssetList allAssets; -// AssetTrackerRequestBus::BroadcastResult(allAssets, &AssetTrackerRequests::GetAssets); -// -// for (auto trackedAsset : allAssets) -// { -// const ScriptCanvasEditor::SourceHandle& assetId = trackedAsset->GetAsset().GetId(); -// CloseScriptCanvasAsset(assetId); -// } - - m_processedClosedAssetIds.clear(); - event->accept(); } @@ -1366,10 +1326,9 @@ namespace ScriptCanvasEditor return createdNewAsset; } - bool MainWindow::IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const + bool MainWindow::IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& assetId) const { - // #sc_editor_asset - return false; + return m_tabBar->FindTab(assetId) >= 0; } const CategoryInformation* MainWindow::FindNodePaletteCategoryInformation(AZStd::string_view categoryPath) const @@ -1537,7 +1496,7 @@ namespace ScriptCanvasEditor void MainWindow::OnFileNew() { - int scriptCanvasEditorDefaultNewNameCount = 0; + static int scriptCanvasEditorDefaultNewNameCount = 0; AZStd::string assetPath; @@ -1785,8 +1744,6 @@ namespace ScriptCanvasEditor if (saveSuccess) { - // #sc_editor_asset find a tab with the same path name and close non focused old ones with the same name - // Update the editor with the new information about this asset. ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset; int currentTabIndex = m_tabBar->currentIndex(); @@ -1799,13 +1756,26 @@ namespace ScriptCanvasEditor const bool assetIdHasChanged = assetInfo.m_assetId.m_guid != fileAssetId.Id(); fileAssetId = SourceHandle(fileAssetId, assetInfo.m_assetId.m_guid, fileAssetId.Path()); - // #sc_editor_asset // check for saving a graph over another graph with an open tab + for (;;) { - // find the saved tab by graph* - // find all tabs that match old path, and close them - // update the save tab index - // and the current index + auto graph = fileAssetId.Get(); + int tabIndexByGraph = m_tabBar->FindTab(graph); + if (tabIndexByGraph == -1) + { + AZ_Warning("ScriptCanvas", false, "unable to find graph just saved"); + break; + } + + int saveOverMatch = m_tabBar->FindSaveOverMatch(fileAssetId); + if (saveOverMatch < 0) + { + saveTabIndex = tabIndexByGraph; + currentTabIndex = m_tabBar->currentIndex(); + break; + } + + m_tabBar->CloseTab(saveOverMatch); } // this path is questionable, this is a save request that is not the current graph @@ -1818,22 +1788,7 @@ namespace ScriptCanvasEditor saveTabIndex = -1; } - // #sc_editor_asset clean up these actions as well, save and close, save as and close, just save, etc - if (saveTabIndex < 0) - { - // This asset had not been saved yet, we will need to use the in memory asset Id to get the index. - // saveTabIndex = m_tabBar->FindTab(memoryAsset->GetId()); - - if (saveTabIndex < 0) - { - // Finally, we may have Saved-As and we need the previous file asset Id to find the tab - //saveTabIndex = m_tabBar->FindTab(previousFileAssetId); - } - } - AzFramework::StringFunc::Path::GetFileName(memoryAsset.Path().c_str(), tabName); - // Update the tab's assetId to the file asset Id (necessary when saving a new asset) - // #sc_editor_asset used to be configure tab...sets the name and file state if (assetIdHasChanged) { @@ -2318,34 +2273,6 @@ namespace ScriptCanvasEditor GraphCanvas::ViewRequestBus::Event(viewId, &GraphCanvas::ViewRequests::CenterOnEndOfChain); } - // #sc_editor_asset - void MainWindow::UpdateWorkspaceStatus(const ScriptCanvasMemoryAsset& /*memoryAsset*/) - { - // only occurs on file open, do it there, if necessary - /* - ScriptCanvasEditor::SourceHandle fileAssetId = memoryAsset.GetFileAssetId(); - - size_t eraseCount = m_loadingAssets.erase(fileAssetId); - - if (eraseCount > 0) - { - AZStd::string rootFilePath; - AZ::Data::AssetInfo assetInfo = AssetHelpers::GetAssetInfo(fileAssetId, rootFilePath); - - // Don't want to use the join since I don't want the normalized path - if (!rootFilePath.empty() && !assetInfo.m_relativePath.empty()) - { - eraseCount = m_loadingWorkspaceAssets.erase(fileAssetId); - - if (eraseCount == 0) - { - AZStd::string fullPath = AZStd::string::format("%s/%s", rootFilePath.c_str(), assetInfo.m_relativePath.c_str()); - } - } - } - */ - } - void MainWindow::OnCanUndoChanged(bool canUndo) { ui->action_Undo->setEnabled(canUndo); @@ -3602,25 +3529,24 @@ namespace ScriptCanvasEditor return findChild(elementName); } - AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZ::EntityId /*assetNodeId*/) const + AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId assetNodeId) const { - // #sc_editor_asset - return AZ::EntityId{}; - // AZ::EntityId editorEntityId; - // AssetTrackerRequestBus::BroadcastResult(editorEntityId, &AssetTrackerRequests::GetEditorEntityIdFromSceneEntityId, assetId, assetNodeId); - //return AZ::EntityId{};// editorEntityId; + AZ::EntityId editorEntityId; + AssetTrackerRequestBus::BroadcastResult + ( editorEntityId, &AssetTrackerRequests::GetEditorEntityIdFromSceneEntityId, assetId.Id(), assetNodeId); + return editorEntityId; } - AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZ::EntityId /*editorNodeId*/) const + AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId editorNodeId) const { - // #sc_editor_asset - return AZ::EntityId{}; - // AZ::EntityId sceneEntityId; - // AssetTrackerRequestBus::BroadcastResult(sceneEntityId, &AssetTrackerRequests::GetSceneEntityIdFromEditorEntityId, assetId, editorNodeId); - // return sceneEntityId; + AZ::EntityId sceneEntityId; + AssetTrackerRequestBus::BroadcastResult + ( sceneEntityId, &AssetTrackerRequests::GetSceneEntityIdFromEditorEntityId, assetId.Id(), editorNodeId); + return sceneEntityId; } - GraphCanvas::Endpoint MainWindow::CreateNodeForProposalWithGroup(const AZ::EntityId& connectionId, const GraphCanvas::Endpoint& endpoint, const QPointF& scenePoint, const QPoint& screenPoint, AZ::EntityId groupTarget) + GraphCanvas::Endpoint MainWindow::CreateNodeForProposalWithGroup(const AZ::EntityId& connectionId + , const GraphCanvas::Endpoint& endpoint, const QPointF& scenePoint, const QPoint& screenPoint, AZ::EntityId groupTarget) { PushPreventUndoStateUpdate(); @@ -4072,65 +3998,63 @@ namespace ScriptCanvasEditor void MainWindow::OnAssignToSelectedEntities() { - // #sc_editor_asset consider cutting -// Tracker::ScriptCanvasFileState fileState; -// AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, m_activeGraph); -// -// bool isDocumentOpen = false; -// AzToolsFramework::EditorRequests::Bus::BroadcastResult(isDocumentOpen, &AzToolsFramework::EditorRequests::IsLevelDocumentOpen); -// -// if (fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED || !isDocumentOpen) -// { -// return; -// } -// -// AzToolsFramework::EntityIdList selectedEntityIds; -// AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); -// -// auto selectedEntityIdIter = selectedEntityIds.begin(); -// -// bool isLayerAmbiguous = false; -// AZ::EntityId targetLayer; -// -// while (selectedEntityIdIter != selectedEntityIds.end()) -// { -// bool isLayerEntity = false; -// AzToolsFramework::Layers::EditorLayerComponentRequestBus::EventResult(isLayerEntity, (*selectedEntityIdIter), &AzToolsFramework::Layers::EditorLayerComponentRequestBus::Events::HasLayer); -// -// if (isLayerEntity) -// { -// if (targetLayer.IsValid()) -// { -// isLayerAmbiguous = true; -// } -// -// targetLayer = (*selectedEntityIdIter); -// -// selectedEntityIdIter = selectedEntityIds.erase(selectedEntityIdIter); -// } -// else -// { -// ++selectedEntityIdIter; -// } -// } -// -// if (selectedEntityIds.empty()) -// { -// AZ::EntityId createdId; -// AzToolsFramework::EditorRequests::Bus::BroadcastResult(createdId, &AzToolsFramework::EditorRequests::CreateNewEntity, AZ::EntityId()); -// -// selectedEntityIds.emplace_back(createdId); -// -// if (targetLayer.IsValid() && !isLayerAmbiguous) -// { -// AZ::TransformBus::Event(createdId, &AZ::TransformBus::Events::SetParent, targetLayer); -// } -// } -// -// for (const AZ::EntityId& entityId : selectedEntityIds) -// { -// AssignGraphToEntityImpl(entityId); -// } + Tracker::ScriptCanvasFileState fileState = GetAssetFileState(m_activeGraph);; + + bool isDocumentOpen = false; + AzToolsFramework::EditorRequests::Bus::BroadcastResult(isDocumentOpen, &AzToolsFramework::EditorRequests::IsLevelDocumentOpen); + + if (fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED || !isDocumentOpen) + { + return; + } + + AzToolsFramework::EntityIdList selectedEntityIds; + AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); + + auto selectedEntityIdIter = selectedEntityIds.begin(); + + bool isLayerAmbiguous = false; + AZ::EntityId targetLayer; + + while (selectedEntityIdIter != selectedEntityIds.end()) + { + bool isLayerEntity = false; + AzToolsFramework::Layers::EditorLayerComponentRequestBus::EventResult(isLayerEntity, (*selectedEntityIdIter), &AzToolsFramework::Layers::EditorLayerComponentRequestBus::Events::HasLayer); + + if (isLayerEntity) + { + if (targetLayer.IsValid()) + { + isLayerAmbiguous = true; + } + + targetLayer = (*selectedEntityIdIter); + + selectedEntityIdIter = selectedEntityIds.erase(selectedEntityIdIter); + } + else + { + ++selectedEntityIdIter; + } + } + + if (selectedEntityIds.empty()) + { + AZ::EntityId createdId; + AzToolsFramework::EditorRequests::Bus::BroadcastResult(createdId, &AzToolsFramework::EditorRequests::CreateNewEntity, AZ::EntityId()); + + selectedEntityIds.emplace_back(createdId); + + if (targetLayer.IsValid() && !isLayerAmbiguous) + { + AZ::TransformBus::Event(createdId, &AZ::TransformBus::Events::SetParent, targetLayer); + } + } + + for (const AZ::EntityId& entityId : selectedEntityIds) + { + AssignGraphToEntityImpl(entityId); + } } void MainWindow::OnAssignToEntity(const AZ::EntityId& entityId) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 68488238ec..80117b84fe 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -532,8 +532,6 @@ namespace ScriptCanvasEditor void DisconnectEndpoints(const AZ::EntityId& sceneId, const AZStd::vector& endpoints) override; ///////////////////////////////////////////////////////////////////////////////////////////// - void UpdateWorkspaceStatus(const ScriptCanvasMemoryAsset& scriptCanvasAsset); - GraphCanvas::Endpoint HandleProposedConnection(const GraphCanvas::GraphId& graphId, const GraphCanvas::ConnectionId& connectionId, const GraphCanvas::Endpoint& endpoint, const GraphCanvas::NodeId& proposedNode, const QPoint& screenPoint); //! UndoNotificationBus From 1af39a5c5cc26028f04e00c8504b44cfa17a4462 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Fri, 10 Dec 2021 15:57:52 -0800 Subject: [PATCH 069/399] Add benchmarks, some light optimizations like SSO Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp | 12 ++ Code/Framework/AzCore/AzCore/DOM/DomUtils.h | 3 + Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 49 ++++++-- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 37 ++++++ .../AzCore/AzCore/DOM/DomValueWriter.cpp | 51 ++++++-- .../AzCore/AzCore/DOM/DomValueWriter.h | 11 +- .../AzCore/AzCore/Memory/PoolAllocator.h | 18 +-- .../AzCore/Tests/DOM/DomJsonBenchmarks.cpp | 42 ++++++- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 117 ++++++++++++++++++ .../AzCore/Tests/DOM/DomValueTests.cpp | 19 ++- 10 files changed, 319 insertions(+), 40 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp index 2e78661518..46fa5b9bac 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp @@ -21,4 +21,16 @@ namespace AZ::Dom::Utils { return backend.ReadFromBufferInPlace(string.data(), string.size(), visitor); } + + AZ::Outcome AZ::Dom::Utils::WriteToValue(Backend::WriteCallback writeCallback) + { + Value value; + AZStd::unique_ptr writer = value.GetWriteHandler(); + Visitor::Result result = writeCallback(*writer); + if (!result.IsSuccess()) + { + return AZ::Failure(result.GetError().FormatVisitorErrorMessage()); + } + return AZ::Success(AZStd::move(value)); + } } // namespace AZ::Dom::Utils diff --git a/Code/Framework/AzCore/AzCore/DOM/DomUtils.h b/Code/Framework/AzCore/AzCore/DOM/DomUtils.h index 84a6eb5687..f03e5b66b8 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomUtils.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomUtils.h @@ -9,9 +9,12 @@ #pragma once #include +#include namespace AZ::Dom::Utils { Visitor::Result ReadFromString(Backend& backend, AZStd::string_view string, AZ::Dom::Lifetime lifetime, Visitor& visitor); Visitor::Result ReadFromStringInPlace(Backend& backend, AZStd::string& string, Visitor& visitor); + + AZ::Outcome WriteToValue(Backend::WriteCallback writeCallback); } // namespace AZ::Dom::Utils diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index d9398da116..d8650601ba 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -19,7 +19,7 @@ namespace AZ::Dom { if (refCountedPointer.use_count() > 1) { - AZStd::shared_ptr newPointer = AZStd::make_shared(); + AZStd::shared_ptr newPointer = AZStd::allocate_shared(AZStdAlloc()); *newPointer = *refCountedPointer; refCountedPointer = AZStd::move(newPointer); } @@ -71,8 +71,8 @@ namespace AZ::Dom } Value::Value(Value&& value) noexcept - : m_value(value.m_value) { + operator=(value); } Value::Value(AZStd::string_view string, bool copy) @@ -174,7 +174,7 @@ namespace AZ::Dom Value& Value::operator=(Value&& other) noexcept { - m_value = other.m_value; + m_value.swap(other.m_value); return *this; } @@ -212,7 +212,7 @@ namespace AZ::Dom void Value::Swap(Value& other) noexcept { - AZStd::swap(m_value, other.m_value); + m_value.swap(other.m_value); } Type Dom::Value::GetType() const @@ -229,14 +229,15 @@ namespace AZ::Dom return AZStd::get(m_value) ? Type::TrueType : Type::FalseType; case 5: // AZStd::string_view case 6: // AZStd::shared_ptr + case 7: // ShortStringType return Type::StringType; - case 7: // ObjectPtr + case 8: // ObjectPtr return Type::ObjectType; - case 8: // ArrayPtr + case 9: // ArrayPtr return Type::ArrayType; - case 9: // NodePtr + case 10: // NodePtr return Type::NodeType; - case 10: // AZStd::any* + case 11: // AZStd::any* return Type::OpaqueType; } AZ_Assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); @@ -310,7 +311,7 @@ namespace AZ::Dom Value& Value::SetObject() { - m_value = AZStd::make_shared(); + m_value = AZStd::allocate_shared(AZStdAlloc()); return *this; } @@ -511,6 +512,7 @@ namespace AZ::Dom Value& Value::AddMember(KeyType name, const Value& value) { Object::ContainerType& object = GetObjectInternal(); + object.reserve((object.size() / Object::ReserveIncrement + 1) * Object::ReserveIncrement); if (auto memberIt = FindMutableMember(name); memberIt != object.end()) { memberIt->second = value; @@ -613,7 +615,7 @@ namespace AZ::Dom Value& Value::SetArray() { - m_value = AZStd::make_shared(); + m_value = AZStd::allocate_shared(AZStdAlloc()); return *this; } @@ -685,7 +687,9 @@ namespace AZ::Dom Value& Value::PushBack(Value value) { - GetArrayInternal().push_back(AZStd::move(value)); + Array::ContainerType& array = GetArrayInternal(); + array.reserve((array.size() / Array::ReserveIncrement + 1) * Array::ReserveIncrement); + array.push_back(AZStd::move(value)); return *this; } @@ -717,7 +721,7 @@ namespace AZ::Dom void Value::SetNode(AZ::Name name) { - m_value = AZStd::make_shared(name); + m_value = AZStd::allocate_shared(AZStdAlloc(), name); } void Value::SetNode(AZStd::string_view name) @@ -899,6 +903,11 @@ namespace AZ::Dom return AZStd::get(m_value); case 6: // AZStd::shared_ptr return *AZStd::get>(m_value); + case 7: // ShortStringType + { + const ShortStringType& ShortString = AZStd::get(m_value); + return { ShortString.m_data.data(), ShortString.m_size }; + } } AZ_Assert(false, "AZ::Dom::Value: Called GetString on a non-string type"); return {}; @@ -911,12 +920,26 @@ namespace AZ::Dom void Value::SetString(AZStd::string_view value) { + if (value.size() <= ShortStringSize) + { + ShortStringType buffer; + buffer.m_size = value.size(); + memcpy(buffer.m_data.data(), value.data(), buffer.m_size); + m_value = buffer; + } m_value = value; } void Value::CopyFromString(AZStd::string_view value) { - m_value = AZStd::make_shared(value); + if (value.size() <= ShortStringSize) + { + SetString(value); + } + else + { + m_value = AZStd::allocate_shared(AZStdAlloc(), value); + } } AZStd::any& Value::GetOpaqueValue() const diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 39ae5a5c37..4dd3bde197 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -11,11 +11,13 @@ #include #include #include +#include #include #include #include #include #include +#include namespace AZ::Dom { @@ -34,6 +36,22 @@ namespace AZ::Dom OpaqueType = 8, }; + class ValueAllocator final : public ThreadPoolBase + { + public: + AZ_CLASS_ALLOCATOR(ValueAllocator, SystemAllocator, 0); + AZ_TYPE_INFO(ValueAllocator, "{5BC8B389-72C7-459E-B502-12E74D61869F}"); + + ValueAllocator() + : ThreadPoolBase("DomValueAllocator", "Allocator for AZ::Dom::Value") + { + } + }; + + // class ValueAllocator : public Internal::PoolAllocatorHelper; using Iterator = ContainerType::iterator; using ConstIterator = ContainerType::const_iterator; + static constexpr const size_t ReserveIncrement = 4; private: ContainerType m_values; @@ -59,6 +78,7 @@ namespace AZ::Dom using ContainerType = AZStd::vector; using Iterator = ContainerType::iterator; using ConstIterator = ContainerType::const_iterator; + static constexpr const size_t ReserveIncrement = 8; private: ContainerType m_values; @@ -293,6 +313,18 @@ namespace AZ::Dom explicit Value(AZStd::any* opaqueValue); + static constexpr const size_t ShortStringSize = sizeof(AZStd::string_view) - sizeof(size_t); + struct ShortStringType + { + AZStd::array m_data; + size_t m_size; + + bool operator==(const ShortStringType& other) const + { + return m_size == other.m_size ? memcmp(m_data.data(), other.m_data.data(), m_size) == 0 : false; + } + }; + // If using the the copy on write model, anything stored internally as a shared_ptr will // detach and copy when doing a mutating operation if use_count() > 1. @@ -311,6 +343,7 @@ namespace AZ::Dom // StringType AZStd::string_view, AZStd::shared_ptr, + ShortStringType, // ObjectType ObjectPtr, // ArrayType @@ -320,6 +353,10 @@ namespace AZ::Dom // OpaqueType AZStd::any*>; + static_assert( + sizeof(ValueType) == sizeof(AZStd::variant), + "ValueType should have no members larger than ShortStringType"); + ValueType m_value; }; } // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index a760cc5b28..cf46a77d54 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -103,35 +103,68 @@ namespace AZ::Dom } const ValueInfo& topEntry = m_entryStack.top(); - if (topEntry.m_container.GetType() != containerType) + Value& container = topEntry.m_container; + ValueBuffer& buffer = GetValueBuffer(); + + if (container.GetType() != containerType) { return VisitorFailure( VisitorErrorCode::InternalError, AZStd::string::format("AZ::Dom::ValueWriter: %s called from within a different container type", endMethodName)); } - if (topEntry.m_attributeCount != attributeCount) + if (buffer.m_attributes.size() != attributeCount) { return VisitorFailure( VisitorErrorCode::InternalError, AZStd::string::format( "AZ::Dom::ValueWriter: %s expected %llu attributes but received %llu attributes instead", endMethodName, attributeCount, - topEntry.m_attributeCount)); + buffer.m_attributes.size())); } - if (topEntry.m_elementCount != elementCount) + if (buffer.m_elements.size() != elementCount) { return VisitorFailure( VisitorErrorCode::InternalError, AZStd::string::format( "AZ::Dom::ValueWriter: %s expected %llu elements but received %llu elements instead", endMethodName, elementCount, - topEntry.m_elementCount)); + buffer.m_elements.size())); + } + if (buffer.m_attributes.size() > 0) + { + container.MemberReserve(buffer.m_attributes.size()); + for (AZStd::pair& entry : buffer.m_attributes) + { + container.AddMember(AZStd::move(entry.first), AZStd::move(entry.second)); + } + buffer.m_attributes.clear(); + } + + if(buffer.m_elements.size() > 0) + { + container.Reserve(buffer.m_elements.size()); + for (Value& entry : buffer.m_elements) + { + container.PushBack(AZStd::move(entry)); + } + buffer.m_elements.clear(); } m_entryStack.pop(); return FinishWrite(); } + ValueWriter::ValueBuffer& ValueWriter::GetValueBuffer() + { + if (m_entryStack.size() <= m_valueBuffers.size()) + { + return m_valueBuffers[m_entryStack.size() - 1]; + } + + m_valueBuffers.resize(m_entryStack.size()); + return m_valueBuffers[m_entryStack.size() - 1]; + } + Visitor::Result ValueWriter::EndObject(AZ::u64 attributeCount) { return EndContainer(Type::ObjectType, attributeCount, 0); @@ -192,16 +225,16 @@ namespace AZ::Dom m_entryStack.top().m_value.Swap(value); ValueInfo& newEntry = m_entryStack.top(); + constexpr const size_t reserveSize = 8; + if (!newEntry.m_key.IsEmpty()) { - newEntry.m_container.AddMember(newEntry.m_key, AZStd::move(value)); + GetValueBuffer().m_attributes.emplace_back(AZStd::move(newEntry.m_key), AZStd::move(value)); newEntry.m_key = AZ::Name(); - ++newEntry.m_attributeCount; } else { - newEntry.m_container.PushBack(AZStd::move(value)); - ++newEntry.m_elementCount; + GetValueBuffer().m_elements.emplace_back(AZStd::move(value)); } return VisitorSuccess(); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h index fb5f4324a6..617184a926 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h @@ -48,11 +48,18 @@ namespace AZ::Dom KeyType m_key; Value m_value; Value& m_container; - AZ::u64 m_attributeCount = 0; - AZ::u64 m_elementCount = 0; }; + struct ValueBuffer + { + AZStd::vector m_elements; + AZStd::vector> m_attributes; + }; + + ValueBuffer& GetValueBuffer(); + Value& m_result; AZStd::stack m_entryStack; + AZStd::vector m_valueBuffers; }; } // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h b/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h index 72418b3d6e..bf24f04156 100644 --- a/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h @@ -25,12 +25,12 @@ namespace AZ * Template you can use to create your own thread pool allocators, as you can't inherit from ThreadPoolAllocator. * This is the case because we use tread local storage and we need separate "static" instance for each allocator. */ - template + template class PoolAllocatorHelper - : public SimpleSchemaAllocator + : public SimpleSchemaAllocator { public: - using Base = SimpleSchemaAllocator; + using Base = SimpleSchemaAllocator; using pointer_type = typename Base::pointer_type; using size_type = typename Base::size_type; using difference_type = typename Base::difference_type; @@ -140,13 +140,13 @@ namespace AZ * use PoolAllocatorThreadSafe or do the sync yourself. */ class PoolAllocator - : public Internal::PoolAllocatorHelper + : public Internal::PoolAllocatorHelper { public: AZ_CLASS_ALLOCATOR(PoolAllocator, SystemAllocator, 0); AZ_TYPE_INFO(PoolAllocator, "{D3DC61AF-0949-4BFA-87E0-62FA03A4C025}"); - using Base = Internal::PoolAllocatorHelper; + using Base = Internal::PoolAllocatorHelper; PoolAllocator(const char* name = "PoolAllocator", const char* desc = "Generic pool allocator for small objects") : Base(name, desc) @@ -154,21 +154,21 @@ namespace AZ } }; - template - using ThreadPoolBase = Internal::PoolAllocatorHelper >; + template + using ThreadPoolBase = Internal::PoolAllocatorHelper, ProfileAllocations >; /*! * Thread safe pool allocator. If you want to create your own thread pool heap, * inherit from ThreadPoolBase, as we need unique static variable for allocator type. */ class ThreadPoolAllocator final - : public ThreadPoolBase + : public ThreadPoolBase { public: AZ_CLASS_ALLOCATOR(ThreadPoolAllocator, SystemAllocator, 0); AZ_TYPE_INFO(ThreadPoolAllocator, "{05B4857F-CD06-4942-99FD-CA6A7BAE855A}"); - using Base = ThreadPoolBase; + using Base = ThreadPoolBase; ThreadPoolAllocator() : Base("PoolAllocatorThreadSafe", "Generic thread safe pool allocator for small objects") diff --git a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp index 0baa4aeb53..3e6143e805 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp @@ -8,9 +8,10 @@ #if defined(HAVE_BENCHMARK) -#include #include #include +#include +#include #include #include #include @@ -25,22 +26,26 @@ namespace Benchmark { UnitTest::AllocatorsBenchmarkFixture::SetUp(st); AZ::NameDictionary::Create(); + AZ::AllocatorInstance::Create(); } void SetUp(::benchmark::State& st) override { UnitTest::AllocatorsBenchmarkFixture::SetUp(st); AZ::NameDictionary::Create(); + AZ::AllocatorInstance::Create(); } void TearDown(::benchmark::State& st) override { + AZ::AllocatorInstance::Destroy(); AZ::NameDictionary::Destroy(); UnitTest::AllocatorsBenchmarkFixture::TearDown(st); } void TearDown(const ::benchmark::State& st) override { + AZ::AllocatorInstance::Destroy(); AZ::NameDictionary::Destroy(); UnitTest::AllocatorsBenchmarkFixture::TearDown(st); } @@ -143,6 +148,30 @@ namespace Benchmark } BENCHMARK_REGISTER_JSON(DomJsonBenchmark, DomDeserializeToDocumentInPlace) + BENCHMARK_DEFINE_F(DomJsonBenchmark, DomDeserializeToDomValueInPlace)(benchmark::State& state) + { + AZ::Dom::JsonBackend backend; + AZStd::string serializedPayload = GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1)); + + for (auto _ : state) + { + state.PauseTiming(); + AZStd::string payloadCopy = serializedPayload; + state.ResumeTiming(); + + auto result = AZ::Dom::Utils::WriteToValue( + [&](AZ::Dom::Visitor& visitor) + { + return AZ::Dom::Utils::ReadFromStringInPlace(backend, payloadCopy, visitor); + }); + + benchmark::DoNotOptimize(result.GetValue()); + } + + state.SetBytesProcessed(serializedPayload.size() * state.iterations()); + } + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, DomDeserializeToDomValueInPlace) + BENCHMARK_DEFINE_F(DomJsonBenchmark, DomDeserializeToDocument)(benchmark::State& state) { AZ::Dom::JsonBackend backend; @@ -179,6 +208,17 @@ namespace Benchmark } BENCHMARK_REGISTER_JSON(DomJsonBenchmark, JsonUtilsDeserializeToDocument) + BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonPayloadGeneration)(benchmark::State& state) + { + for (auto _ : state) + { + benchmark::DoNotOptimize(GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1))); + } + + state.SetItemsProcessed(state.range(0) * state.range(0) * state.iterations()); + } + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonPayloadGeneration) + #undef BENCHMARK_REGISTER_JSON } // namespace Benchmark diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index e69de29bb2..d11ef7f69e 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -0,0 +1,117 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include + +namespace AZ::Dom::Benchmark +{ + class DomValueBenchmark : public UnitTest::AllocatorsBenchmarkFixture + { + public: + void SetUp(const ::benchmark::State& st) override + { + UnitTest::AllocatorsBenchmarkFixture::SetUp(st); + AZ::NameDictionary::Create(); + AZ::AllocatorInstance::Create(); + } + + void SetUp(::benchmark::State& st) override + { + UnitTest::AllocatorsBenchmarkFixture::SetUp(st); + AZ::NameDictionary::Create(); + AZ::AllocatorInstance::Create(); + } + + void TearDown(::benchmark::State& st) override + { + AZ::AllocatorInstance::Destroy(); + AZ::NameDictionary::Destroy(); + UnitTest::AllocatorsBenchmarkFixture::TearDown(st); + } + + void TearDown(const ::benchmark::State& st) override + { + AZ::AllocatorInstance::Destroy(); + AZ::NameDictionary::Destroy(); + UnitTest::AllocatorsBenchmarkFixture::TearDown(st); + } + + Value GenerateDomBenchmarkPayload(int64_t entryCount, int64_t stringTemplateLength) + { + Value root(Type::ObjectType); + + AZStd::string entryTemplate; + while (entryTemplate.size() < static_cast(stringTemplateLength)) + { + entryTemplate += "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor "; + } + entryTemplate.resize(stringTemplateLength); + AZStd::string buffer; + + auto createString = [&](int n) -> Value + { + return Value(AZStd::string::format("#%i %s", n, entryTemplate.c_str()), true); + }; + + auto createEntry = [&](int n) -> Value + { + Value entry(Type::ObjectType); + entry.AddMember("string", createString(n)); + entry.AddMember("int", n); + entry.AddMember("double", static_cast(n) * 0.5); + entry.AddMember("bool", n % 2 == 0); + entry.AddMember("null", Value(Type::NullType)); + return entry; + }; + + auto createArray = [&]() -> Value + { + Value array(Type::ArrayType); + for (int i = 0; i < entryCount; ++i) + { + array.PushBack(createEntry(i)); + } + return array; + }; + + auto createObject = [&]() -> Value + { + Value object; + object.SetObject(); + for (int i = 0; i < entryCount; ++i) + { + buffer = AZStd::string::format("Key%i", i); + object.AddMember(AZ::Name(buffer), createArray()); + } + return object; + }; + + root["entries"] = createObject(); + + return root; + } + }; + + BENCHMARK_DEFINE_F(DomValueBenchmark, ValuePayloadGeneration)(benchmark::State& state) + { + for (auto _ : state) + { + benchmark::DoNotOptimize(GenerateDomBenchmarkPayload(state.range(0), state.range(1))); + } + + state.SetItemsProcessed(state.range(0) * state.range(0) * state.iterations()); + } + BENCHMARK_REGISTER_F(DomValueBenchmark, ValuePayloadGeneration) + ->Args({ 10, 5 }) + ->Args({ 10, 500 }) + ->Args({ 100, 5 }) + ->Args({ 100, 500 }) + ->Unit(benchmark::kMillisecond); +} // namespace AZ::Dom::Benchmark diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp index 84e2e16958..125f426e02 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -25,12 +25,14 @@ namespace AZ::Dom::Tests { UnitTest::AllocatorsFixture::SetUp(); NameDictionary::Create(); + AZ::AllocatorInstance::Create(); } void TearDown() override { m_value = Value(); + AZ::AllocatorInstance::Destroy(); NameDictionary::Destroy(); UnitTest::AllocatorsFixture::TearDown(); } @@ -279,19 +281,24 @@ namespace AZ::Dom::Tests TEST_F(DomValueTests, String) { + const char* s1 = "reference string long enough to avoid SSO"; + const char* s2 = "copy string long enough to avoid SSO"; + m_value.SetObject(); - AZStd::string stringToReference = "foo"; + AZStd::string stringToReference = s1; m_value["no_copy"] = Value(stringToReference, false); - AZStd::string stringToCopy = "bar"; + AZStd::string stringToCopy = s2; m_value["copy"] = Value(stringToCopy, true); EXPECT_EQ(m_value["no_copy"].GetType(), Type::StringType); - EXPECT_EQ(m_value["no_copy"].GetString(), stringToReference); - EXPECT_EQ(m_value["no_copy"].GetString().data(), stringToReference.data()); + EXPECT_EQ(m_value["no_copy"].GetString(), s1); + stringToReference.at(0) = 'F'; + EXPECT_NE(m_value["no_copy"].GetString(), s1); EXPECT_EQ(m_value["copy"].GetType(), Type::StringType); - EXPECT_EQ(m_value["copy"].GetString(), stringToCopy); - EXPECT_NE(m_value["copy"].GetString().data(), stringToCopy.data()); + EXPECT_EQ(m_value["copy"].GetString(), s2); + stringToCopy.at(0) = 'F'; + EXPECT_EQ(m_value["copy"].GetString(), s2); PerformValueChecks(); } From 809ee2dce96fb3464a7a5d5a020469843dcdedc0 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Fri, 10 Dec 2021 16:18:38 -0800 Subject: [PATCH 070/399] Fix "force string copy" logic Signed-off-by: Nicholas Van Sickle --- .../AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp b/Code/Framework/AzCore/AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp index 17f9bfea54..bc8ac9167c 100644 --- a/Code/Framework/AzCore/AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp @@ -361,7 +361,7 @@ namespace AZ::Dom::Json bool RapidJsonReadHandler::String(const char* str, rapidjson::SizeType length, bool copy) { - const Lifetime lifetime = copy ? m_stringLifetime : Lifetime::Temporary; + const Lifetime lifetime = !copy ? m_stringLifetime : Lifetime::Temporary; return CheckResult(m_visitor->String(AZStd::string_view(str, length), lifetime)); } @@ -377,7 +377,7 @@ namespace AZ::Dom::Json { m_visitor->Key(AZ::Name(key)); } - const Lifetime lifetime = copy ? m_stringLifetime : Lifetime::Temporary; + const Lifetime lifetime = !copy ? m_stringLifetime : Lifetime::Temporary; return CheckResult(m_visitor->RawKey(key, lifetime)); } From 1f2635d24bdaa200e256312df2df364b9cd26c2c Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Fri, 10 Dec 2021 16:35:26 -0800 Subject: [PATCH 071/399] Switch to the high pref heap allocator, roll back pool interface changes Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 13 ++++++------- .../AzCore/AzCore/Memory/PoolAllocator.h | 18 +++++++++--------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 4dd3bde197..9399e10d15 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -36,22 +37,20 @@ namespace AZ::Dom OpaqueType = 8, }; - class ValueAllocator final : public ThreadPoolBase + class ValueAllocator final : public SimpleSchemaAllocator { public: - AZ_CLASS_ALLOCATOR(ValueAllocator, SystemAllocator, 0); AZ_TYPE_INFO(ValueAllocator, "{5BC8B389-72C7-459E-B502-12E74D61869F}"); + using Base = SimpleSchemaAllocator; + ValueAllocator() - : ThreadPoolBase("DomValueAllocator", "Allocator for AZ::Dom::Value") + : Base("DomValueAllocator", "Allocator for AZ::Dom::Value") { + DisableOverriding(); } }; - // class ValueAllocator : public Internal::PoolAllocatorHelper + template class PoolAllocatorHelper - : public SimpleSchemaAllocator + : public SimpleSchemaAllocator { public: - using Base = SimpleSchemaAllocator; + using Base = SimpleSchemaAllocator; using pointer_type = typename Base::pointer_type; using size_type = typename Base::size_type; using difference_type = typename Base::difference_type; @@ -140,13 +140,13 @@ namespace AZ * use PoolAllocatorThreadSafe or do the sync yourself. */ class PoolAllocator - : public Internal::PoolAllocatorHelper + : public Internal::PoolAllocatorHelper { public: AZ_CLASS_ALLOCATOR(PoolAllocator, SystemAllocator, 0); AZ_TYPE_INFO(PoolAllocator, "{D3DC61AF-0949-4BFA-87E0-62FA03A4C025}"); - using Base = Internal::PoolAllocatorHelper; + using Base = Internal::PoolAllocatorHelper; PoolAllocator(const char* name = "PoolAllocator", const char* desc = "Generic pool allocator for small objects") : Base(name, desc) @@ -154,21 +154,21 @@ namespace AZ } }; - template - using ThreadPoolBase = Internal::PoolAllocatorHelper, ProfileAllocations >; + template + using ThreadPoolBase = Internal::PoolAllocatorHelper >; /*! * Thread safe pool allocator. If you want to create your own thread pool heap, * inherit from ThreadPoolBase, as we need unique static variable for allocator type. */ class ThreadPoolAllocator final - : public ThreadPoolBase + : public ThreadPoolBase { public: AZ_CLASS_ALLOCATOR(ThreadPoolAllocator, SystemAllocator, 0); AZ_TYPE_INFO(ThreadPoolAllocator, "{05B4857F-CD06-4942-99FD-CA6A7BAE855A}"); - using Base = ThreadPoolBase; + using Base = ThreadPoolBase; ThreadPoolAllocator() : Base("PoolAllocatorThreadSafe", "Generic thread safe pool allocator for small objects") From 5da5ff90670c5260019989de8881d5e67b96ca4c Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 10 Dec 2021 17:13:23 -0800 Subject: [PATCH 072/399] Removed file size limit on .shadervariantlist files. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp | 4 ++-- Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/JsonUtils.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp index 5eaa0d9ddb..8dc67bb3d1 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp @@ -241,7 +241,7 @@ namespace AZ { // Need to get the name of the shader file from the template so that we can preprocess the shader data and setup // source file dependencies. - if (!RPI::JsonUtils::LoadObjectFromFile(variantListFullPath, shaderVariantList)) + if (!RPI::JsonUtils::LoadObjectFromFile(variantListFullPath, shaderVariantList, AZStd::numeric_limits::max())) { AZ_Error(ShaderVariantAssetBuilderName, false, "Failed to parse Shader Variant List Descriptor JSON from [%s]", variantListFullPath.c_str()); return LoadResult{LoadResult::Code::Error}; @@ -635,7 +635,7 @@ namespace AZ AzFramework::StringFunc::Path::ConstructFull(request.m_watchFolder.data(), request.m_sourceFile.data(), variantListFullPath, true); RPI::ShaderVariantListSourceData shaderVariantListDescriptor; - if (!RPI::JsonUtils::LoadObjectFromFile(variantListFullPath, shaderVariantListDescriptor)) + if (!RPI::JsonUtils::LoadObjectFromFile(variantListFullPath, shaderVariantListDescriptor, AZStd::numeric_limits::max())) { AZ_Assert(false, "Failed to parse Shader Variant List Descriptor JSON [%s]", variantListFullPath.c_str()); response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/JsonUtils.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/JsonUtils.h index 4715acd64c..9f4cdcf31b 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/JsonUtils.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/JsonUtils.h @@ -29,7 +29,7 @@ namespace AZ //! Loads serialized object data from a json file at the specified path //! Errors will be reported using AZ trace template - bool LoadObjectFromFile(const AZStd::string& path, ObjectType& objectData); + bool LoadObjectFromFile(const AZStd::string& path, ObjectType& objectData, size_t maxFileSize = DefaultMaxFileSize); //! Saves serialized object data to a json file at the specified path //! Errors will be reported using AZ trace @@ -39,11 +39,11 @@ namespace AZ // Definitions... template - bool LoadObjectFromFile(const AZStd::string& path, ObjectType& objectData) + bool LoadObjectFromFile(const AZStd::string& path, ObjectType& objectData, size_t maxFileSize) { objectData = ObjectType(); - auto loadOutcome = AZ::JsonSerializationUtils::ReadJsonFile(path, DefaultMaxFileSize); + auto loadOutcome = AZ::JsonSerializationUtils::ReadJsonFile(path, maxFileSize); if (!loadOutcome.IsSuccess()) { AZ_Error("AZ::RPI::JsonUtils", false, "%s", loadOutcome.GetError().c_str()); From c53c97cf5f80bda645654cc4613be86a9eccc373 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Sat, 11 Dec 2021 15:54:57 -0800 Subject: [PATCH 073/399] Add another round of benchmarks Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 12 +- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 2 + .../AzCore/AzCore/DOM/DomValueWriter.cpp | 6 + .../AzCore/AzCore/DOM/DomValueWriter.h | 1 + .../AzCore/AzCore/DOM/DomVisitor.cpp | 5 + Code/Framework/AzCore/AzCore/DOM/DomVisitor.h | 2 + .../AzCore/Tests/DOM/DomJsonBenchmarks.cpp | 86 ++++++++++++-- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 110 +++++++++++++++++- 8 files changed, 210 insertions(+), 14 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index d8650601ba..ed4488267a 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -61,6 +61,11 @@ namespace AZ::Dom return m_children; } + Value::Value(AZStd::shared_ptr string) + : m_value(string) + { + } + Value::Value() { } @@ -895,6 +900,11 @@ namespace AZ::Dom m_value = aznumeric_cast(value); } + void Value::SetString(AZStd::shared_ptr string) + { + m_value = string; + } + AZStd::string_view Value::GetString() const { switch (m_value.index()) @@ -992,7 +1002,7 @@ namespace AZ::Dom } else if constexpr (AZStd::is_same_v>) { - result = visitor.String(*arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); + result = visitor.RefCountedString(arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); } else if constexpr (AZStd::is_same_v) { diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 9399e10d15..ac6a9d0c51 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -127,6 +127,7 @@ namespace AZ::Dom Value(const Value&); Value(Value&&) noexcept; Value(AZStd::string_view string, bool copy); + Value(AZStd::shared_ptr string); Value(int32_t value); Value(uint32_t value); @@ -281,6 +282,7 @@ namespace AZ::Dom AZStd::string_view GetString() const; size_t GetStringLength() const; void SetString(AZStd::string_view); + void SetString(AZStd::shared_ptr); void CopyFromString(AZStd::string_view); // opaque type API... diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index cf46a77d54..a8cc1f3947 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -68,6 +68,12 @@ namespace AZ::Dom return FinishWrite(); } + Visitor::Result ValueWriter::RefCountedString(AZStd::shared_ptr value, [[maybe_unused]] Lifetime lifetime) + { + CurrentValue().SetString(value); + return FinishWrite(); + } + Visitor::Result ValueWriter::StartObject() { CurrentValue().SetObject(); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h index 617184a926..4c1d5a26ee 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h @@ -26,6 +26,7 @@ namespace AZ::Dom Result Double(double value) override; Result String(AZStd::string_view value, Lifetime lifetime) override; + Result RefCountedString(AZStd::shared_ptr value, Lifetime lifetime) override; Result StartObject() override; Result EndObject(AZ::u64 attributeCount) override; Result Key(AZ::Name key) override; diff --git a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp index ad314da385..af64c4cea8 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp @@ -105,6 +105,11 @@ namespace AZ::Dom return VisitorSuccess(); } + Visitor::Result Visitor::RefCountedString(AZStd::shared_ptr value, Lifetime lifetime) + { + return String(*value, lifetime); + } + Visitor::Result Visitor::OpaqueValue([[maybe_unused]] const OpaqueType& value, [[maybe_unused]] Lifetime lifetime) { if (!SupportsOpaqueValues()) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h index bbe78131c3..3439a566e2 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h @@ -12,6 +12,7 @@ #include #include #include +#include namespace AZ::Dom { @@ -170,6 +171,7 @@ namespace AZ::Dom //! Operates on a string value. As strings are a reference type. //! Storage semantics are provided to indicate where the value may be stored persistently or requires a copy. virtual Result String(AZStd::string_view value, Lifetime lifetime); + virtual Result RefCountedString(AZStd::shared_ptr value, Lifetime lifetime); //! Operates on an opaque value. As opaque values are a reference type, storage semantics are provided to //! indicate where the value may be stored persistently or requires a copy. //! The base implementation of OpaqueValue rejects the operation, as opaque values are meant for special diff --git a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp index 3e6143e805..98e62f4aa6 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp @@ -50,7 +50,7 @@ namespace Benchmark UnitTest::AllocatorsBenchmarkFixture::TearDown(st); } - AZStd::string GenerateDomJsonBenchmarkPayload(int64_t entryCount, int64_t stringTemplateLength) + rapidjson::Document GenerateDomJsonBenchmarkDocument(int64_t entryCount, int64_t stringTemplateLength) { rapidjson::Document document; document.SetObject(); @@ -108,6 +108,13 @@ namespace Benchmark document.SetObject(); document.AddMember("entries", createObject(), document.GetAllocator()); + return document; + } + + AZStd::string GenerateDomJsonBenchmarkPayload(int64_t entryCount, int64_t stringTemplateLength) + { + rapidjson::Document document = GenerateDomJsonBenchmarkDocument(entryCount, stringTemplateLength); + AZStd::string serializedJson; auto result = AZ::JsonSerializationUtils::WriteJsonString(document, serializedJson); AZ_Assert(result.IsSuccess(), "Failed to serialize generated JSON"); @@ -124,7 +131,7 @@ namespace Benchmark ->Args({ 100, 500 }) \ ->Unit(benchmark::kMillisecond); - BENCHMARK_DEFINE_F(DomJsonBenchmark, DomDeserializeToDocumentInPlace)(benchmark::State& state) + BENCHMARK_DEFINE_F(DomJsonBenchmark, AzDomDeserializeToRapidjsonInPlace)(benchmark::State& state) { AZ::Dom::JsonBackend backend; AZStd::string serializedPayload = GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1)); @@ -146,9 +153,9 @@ namespace Benchmark state.SetBytesProcessed(serializedPayload.size() * state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, DomDeserializeToDocumentInPlace) + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, AzDomDeserializeToRapidjsonInPlace) - BENCHMARK_DEFINE_F(DomJsonBenchmark, DomDeserializeToDomValueInPlace)(benchmark::State& state) + BENCHMARK_DEFINE_F(DomJsonBenchmark, AzDomDeserializeToAzDomValueInPlace)(benchmark::State& state) { AZ::Dom::JsonBackend backend; AZStd::string serializedPayload = GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1)); @@ -170,9 +177,9 @@ namespace Benchmark state.SetBytesProcessed(serializedPayload.size() * state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, DomDeserializeToDomValueInPlace) + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, AzDomDeserializeToAzDomValueInPlace) - BENCHMARK_DEFINE_F(DomJsonBenchmark, DomDeserializeToDocument)(benchmark::State& state) + BENCHMARK_DEFINE_F(DomJsonBenchmark, AzDomDeserializeToRapidjson)(benchmark::State& state) { AZ::Dom::JsonBackend backend; AZStd::string serializedPayload = GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1)); @@ -190,9 +197,29 @@ namespace Benchmark state.SetBytesProcessed(serializedPayload.size() * state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, DomDeserializeToDocument) + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, AzDomDeserializeToRapidjson) + + BENCHMARK_DEFINE_F(DomJsonBenchmark, AzDomDeserializeToAzDomValue)(benchmark::State& state) + { + AZ::Dom::JsonBackend backend; + AZStd::string serializedPayload = GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1)); + + for (auto _ : state) + { + auto result = AZ::Dom::Utils::WriteToValue( + [&](AZ::Dom::Visitor& visitor) + { + return AZ::Dom::Utils::ReadFromString(backend, serializedPayload, AZ::Dom::Lifetime::Temporary, visitor); + }); + + benchmark::DoNotOptimize(result.GetValue()); + } + + state.SetBytesProcessed(serializedPayload.size() * state.iterations()); + } + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, AzDomDeserializeToAzDomValue) - BENCHMARK_DEFINE_F(DomJsonBenchmark, JsonUtilsDeserializeToDocument)(benchmark::State& state) + BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonDeserializeToRapidjson)(benchmark::State& state) { AZ::Dom::JsonBackend backend; AZStd::string serializedPayload = GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1)); @@ -206,9 +233,9 @@ namespace Benchmark state.SetBytesProcessed(serializedPayload.size() * state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, JsonUtilsDeserializeToDocument) + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonDeserializeToRapidjson) - BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonPayloadGeneration)(benchmark::State& state) + BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonMakeComplexObject)(benchmark::State& state) { for (auto _ : state) { @@ -217,7 +244,44 @@ namespace Benchmark state.SetItemsProcessed(state.range(0) * state.range(0) * state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonPayloadGeneration) + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonMakeComplexObject) + + BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonLookupMemberByString)(benchmark::State& state) + { + rapidjson::Document document(rapidjson::kObjectType); + AZStd::vector keys; + for (int64_t i = 0; i < state.range(0); ++i) + { + AZStd::string key(AZStd::string::format("key%" PRId64, i)); + keys.push_back(key); + document.AddMember(rapidjson::Value(key.data(), static_cast(key.size()), document.GetAllocator()), rapidjson::Value(i), document.GetAllocator()); + } + + for (auto _ : state) + { + for (const AZStd::string& key : keys) + { + benchmark::DoNotOptimize(document.FindMember(key.data())); + } + } + + state.SetItemsProcessed(state.iterations() * state.range(0)); + } + BENCHMARK_REGISTER_F(DomJsonBenchmark, RapidjsonLookupMemberByString)->Arg(100)->Arg(1000)->Arg(10000)->Unit(benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonDeepCopy)(benchmark::State& state) + { + rapidjson::Document original = GenerateDomJsonBenchmarkDocument(state.range(0), state.range(1)); + + for (auto _ : state) + { + rapidjson::Document copy; + original.Accept(copy); + } + + state.SetItemsProcessed(state.iterations()); + } + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonDeepCopy) #undef BENCHMARK_REGISTER_JSON } // namespace Benchmark diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index d11ef7f69e..e3a0db594c 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -9,6 +9,7 @@ #include #include #include +#include namespace AZ::Dom::Benchmark { @@ -99,7 +100,7 @@ namespace AZ::Dom::Benchmark } }; - BENCHMARK_DEFINE_F(DomValueBenchmark, ValuePayloadGeneration)(benchmark::State& state) + BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueMakeComplexObject)(benchmark::State& state) { for (auto _ : state) { @@ -108,10 +109,115 @@ namespace AZ::Dom::Benchmark state.SetItemsProcessed(state.range(0) * state.range(0) * state.iterations()); } - BENCHMARK_REGISTER_F(DomValueBenchmark, ValuePayloadGeneration) + BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueMakeComplexObject) ->Args({ 10, 5 }) ->Args({ 10, 500 }) ->Args({ 100, 5 }) ->Args({ 100, 500 }) ->Unit(benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueShallowCopy)(benchmark::State& state) + { + Value original = GenerateDomBenchmarkPayload(state.range(0), state.range(1)); + + for (auto _ : state) + { + Value copy = original; + benchmark::DoNotOptimize(copy); + } + + state.SetItemsProcessed(state.iterations()); + } + BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueShallowCopy) + ->Args({ 10, 5 }) + ->Args({ 10, 500 }) + ->Args({ 100, 5 }) + ->Args({ 100, 500 }) + ->Unit(benchmark::kNanosecond); + + BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueShallowCopyAndMutate)(benchmark::State& state) + { + Value original = GenerateDomBenchmarkPayload(state.range(0), state.range(1)); + + for (auto _ : state) + { + Value copy = original; + copy["entries"]["Key0"].PushBack(42); + benchmark::DoNotOptimize(copy); + } + + state.SetItemsProcessed(state.iterations()); + } + BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueShallowCopyAndMutate) + ->Args({ 10, 5 }) + ->Args({ 10, 500 }) + ->Args({ 100, 5 }) + ->Args({ 100, 500 }) + ->Unit(benchmark::kNanosecond); + + BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueDeepCopy)(benchmark::State& state) + { + Value original = GenerateDomBenchmarkPayload(state.range(0), state.range(1)); + + for (auto _ : state) + { + Value copy = original.DeepCopy(); + benchmark::DoNotOptimize(copy); + } + + state.SetItemsProcessed(state.iterations()); + } + BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueDeepCopy) + ->Args({ 10, 5 }) + ->Args({ 10, 500 }) + ->Args({ 100, 5 }) + ->Args({ 100, 500 }) + ->Unit(benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(DomValueBenchmark, LookupMemberByName)(benchmark::State& state) + { + Value value(Type::ObjectType); + AZStd::vector keys; + for (int64_t i = 0; i < state.range(0); ++i) + { + AZ::Name key(AZStd::string::format("key%" PRId64, i)); + keys.push_back(key); + value[key] = i; + } + + for (auto _ : state) + { + for (const AZ::Name& key : keys) + { + benchmark::DoNotOptimize(value[key]); + } + } + + state.SetItemsProcessed(state.iterations() * state.range(0)); + } + BENCHMARK_REGISTER_F(DomValueBenchmark, LookupMemberByName)->Arg(100)->Arg(1000)->Arg(10000)->Unit(benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(DomValueBenchmark, LookupMemberByString)(benchmark::State& state) + { + Value value(Type::ObjectType); + AZStd::vector keys; + for (int64_t i = 0; i < state.range(0); ++i) + { + AZStd::string key(AZStd::string::format("key%" PRId64, i)); + keys.push_back(key); + value[key] = i; + } + + for (auto _ : state) + { + for (const AZStd::string& key : keys) + { + benchmark::DoNotOptimize(value[key]); + } + } + + state.SetItemsProcessed(state.iterations() * state.range(0)); + } + BENCHMARK_REGISTER_F(DomValueBenchmark, LookupMemberByString)->Arg(100)->Arg(1000)->Arg(10000)->Unit(benchmark::kMillisecond); + } // namespace AZ::Dom::Benchmark From cc120c772cab1ba8a601ca063a85d7e9838b00c2 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Sun, 12 Dec 2021 12:58:52 -0800 Subject: [PATCH 074/399] Add RapidjsonCopyAndMutate to compare w/ shallow copy Signed-off-by: Nicholas Van Sickle --- .../AzCore/Tests/DOM/DomJsonBenchmarks.cpp | 20 ++++++++++++++++++- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 4 ++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp index 98e62f4aa6..477802dc37 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp @@ -276,13 +276,31 @@ namespace Benchmark for (auto _ : state) { rapidjson::Document copy; - original.Accept(copy); + copy.CopyFrom(original, copy.GetAllocator(), true); + benchmark::DoNotOptimize(copy); } state.SetItemsProcessed(state.iterations()); } + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonDeepCopy) + BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonCopyAndMutate)(benchmark::State& state) + { + rapidjson::Document original = GenerateDomJsonBenchmarkDocument(state.range(0), state.range(1)); + + for (auto _ : state) + { + rapidjson::Document copy; + copy.CopyFrom(original, copy.GetAllocator(), true); + copy["entries"]["Key0"].PushBack(42, copy.GetAllocator()); + benchmark::DoNotOptimize(copy); + } + + state.SetItemsProcessed(state.iterations()); + } + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonCopyAndMutate) + #undef BENCHMARK_REGISTER_JSON } // namespace Benchmark diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index e3a0db594c..3e02eaff2e 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -135,7 +135,7 @@ namespace AZ::Dom::Benchmark ->Args({ 100, 500 }) ->Unit(benchmark::kNanosecond); - BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueShallowCopyAndMutate)(benchmark::State& state) + BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueCopyAndMutate)(benchmark::State& state) { Value original = GenerateDomBenchmarkPayload(state.range(0), state.range(1)); @@ -148,7 +148,7 @@ namespace AZ::Dom::Benchmark state.SetItemsProcessed(state.iterations()); } - BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueShallowCopyAndMutate) + BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueCopyAndMutate) ->Args({ 10, 5 }) ->Args({ 10, 500 }) ->Args({ 100, 5 }) From d9ac3c21208442916f3345c01e73306a722beb82 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Sun, 12 Dec 2021 13:56:10 -0800 Subject: [PATCH 075/399] Tidy up Type enum Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 82 +++++++++---------- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 18 ++-- .../AzCore/AzCore/DOM/DomValueWriter.cpp | 12 +-- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 12 +-- .../AzCore/Tests/DOM/DomValueTests.cpp | 38 ++++----- 5 files changed, 81 insertions(+), 81 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index ed4488267a..59e21a7d8b 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -141,31 +141,31 @@ namespace AZ::Dom { switch (type) { - case Type::NullType: + case Type::Null: // Null is the default initialized value break; - case Type::FalseType: + case Type::False: m_value = false; break; - case Type::TrueType: + case Type::True: m_value = true; break; - case Type::ObjectType: + case Type::Object: SetObject(); break; - case Type::ArrayType: + case Type::Array: SetArray(); break; - case Type::StringType: + case Type::String: SetString(""); break; - case Type::NumberType: + case Type::Number: m_value = 0.0; break; - case Type::NodeType: + case Type::Node: SetNode(""); break; - case Type::OpaqueType: + case Type::Opaque: AZ_Assert(false, "AZ::Dom::Value may not be constructed with an empty opaque type"); break; } @@ -225,43 +225,43 @@ namespace AZ::Dom switch (m_value.index()) { case 0: // AZStd::monostate - return Type::NullType; + return Type::Null; case 1: // int64_t case 2: // uint64_t case 3: // double - return Type::NumberType; + return Type::Number; case 4: // bool - return AZStd::get(m_value) ? Type::TrueType : Type::FalseType; + return AZStd::get(m_value) ? Type::True : Type::False; case 5: // AZStd::string_view case 6: // AZStd::shared_ptr case 7: // ShortStringType - return Type::StringType; + return Type::String; case 8: // ObjectPtr - return Type::ObjectType; + return Type::Object; case 9: // ArrayPtr - return Type::ArrayType; + return Type::Array; case 10: // NodePtr - return Type::NodeType; + return Type::Node; case 11: // AZStd::any* - return Type::OpaqueType; + return Type::Opaque; } AZ_Assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); - return Type::NullType; + return Type::Null; } bool Value::IsNull() const { - return GetType() == Type::NullType; + return GetType() == Type::Null; } bool Value::IsFalse() const { - return GetType() == Type::FalseType; + return GetType() == Type::False; } bool Value::IsTrue() const { - return GetType() == Type::TrueType; + return GetType() == Type::True; } bool Value::IsBool() const @@ -271,27 +271,27 @@ namespace AZ::Dom bool Value::IsNode() const { - return GetType() == Type::NodeType; + return GetType() == Type::Node; } bool Value::IsObject() const { - return GetType() == Type::ObjectType; + return GetType() == Type::Object; } bool Value::IsArray() const { - return GetType() == Type::ArrayType; + return GetType() == Type::Array; } bool Value::IsOpaqueValue() const { - return GetType() == Type::OpaqueType; + return GetType() == Type::Opaque; } bool Value::IsNumber() const { - return GetType() == Type::NumberType; + return GetType() == Type::Number; } bool Value::IsInt() const @@ -311,7 +311,7 @@ namespace AZ::Dom bool Value::IsString() const { - return GetType() == Type::StringType; + return GetType() == Type::String; } Value& Value::SetObject() @@ -322,13 +322,13 @@ namespace AZ::Dom const Node& Value::GetNodeInternal() const { - AZ_Assert(GetType() == Type::NodeType, "AZ::Dom::Value: attempted to retrieve a node from a non-node value"); + AZ_Assert(GetType() == Type::Node, "AZ::Dom::Value: attempted to retrieve a node from a non-node value"); return *AZStd::get(m_value); } Node& Value::GetNodeInternal() { - AZ_Assert(GetType() == Type::NodeType, "AZ::Dom::Value: attempted to retrieve a node from a non-node value"); + AZ_Assert(GetType() == Type::Node, "AZ::Dom::Value: attempted to retrieve a node from a non-node value"); return *CheckCopyOnWrite(AZStd::get(m_value)); } @@ -336,9 +336,9 @@ namespace AZ::Dom { const Type type = GetType(); AZ_Assert( - type == Type::ObjectType || type == Type::NodeType, + type == Type::Object || type == Type::Node, "AZ::Dom::Value: attempted to retrieve an object from a value that isn't an object or a node"); - if (type == Type::ObjectType) + if (type == Type::Object) { return AZStd::get(m_value)->m_values; } @@ -352,9 +352,9 @@ namespace AZ::Dom { const Type type = GetType(); AZ_Assert( - type == Type::ObjectType || type == Type::NodeType, + type == Type::Object || type == Type::Node, "AZ::Dom::Value: attempted to retrieve an object from a value that isn't an object or a node"); - if (type == Type::ObjectType) + if (type == Type::Object) { return CheckCopyOnWrite(AZStd::get(m_value))->m_values; } @@ -368,9 +368,9 @@ namespace AZ::Dom { const Type type = GetType(); AZ_Assert( - type == Type::ArrayType || type == Type::NodeType, + type == Type::Array || type == Type::Node, "AZ::Dom::Value: attempted to retrieve an array from a value that isn't an array or a node"); - if (type == Type::ArrayType) + if (type == Type::Array) { return AZStd::get(m_value)->m_values; } @@ -384,9 +384,9 @@ namespace AZ::Dom { const Type type = GetType(); AZ_Assert( - type == Type::ArrayType || type == Type::NodeType, + type == Type::Array || type == Type::Node, "AZ::Dom::Value: attempted to retrieve an array from a value that isn't an array or node"); - if (type == Type::ArrayType) + if (type == Type::Array) { return CheckCopyOnWrite(AZStd::get(m_value))->m_values; } @@ -751,13 +751,13 @@ namespace AZ::Dom void Value::SetNodeValue(Value value) { - AZ_Assert(GetType() == Type::NodeType, "AZ::Dom::Value: Attempted to set value for non-node type"); + AZ_Assert(GetType() == Type::Node, "AZ::Dom::Value: Attempted to set value for non-node type"); Array::ContainerType& nodeChildren = GetArrayInternal(); // Set the first non-node child, if one is found for (Value& entry : nodeChildren) { - if (entry.GetType() != Type::NodeType) + if (entry.GetType() != Type::Node) { entry = AZStd::move(value); return; @@ -770,13 +770,13 @@ namespace AZ::Dom Value Value::GetNodeValue() const { - AZ_Assert(GetType() == Type::NodeType, "AZ::Dom::Value: Attempted to get value for non-node type"); + AZ_Assert(GetType() == Type::Node, "AZ::Dom::Value: Attempted to get value for non-node type"); const Array::ContainerType& nodeChildren = GetArrayInternal(); // Get the first non-node child, if one is found for (const Value& entry : nodeChildren) { - if (entry.GetType() != Type::NodeType) + if (entry.GetType() != Type::Node) { return entry; } diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index ac6a9d0c51..274f6b1934 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -26,15 +26,15 @@ namespace AZ::Dom enum class Type { - NullType = 0, - FalseType = 1, - TrueType = 2, - ObjectType = 3, - ArrayType = 4, - StringType = 5, - NumberType = 6, - NodeType = 7, - OpaqueType = 8, + Null = 0, + False = 1, + True = 2, + Object = 3, + Array = 4, + String = 5, + Number = 6, + Node = 7, + Opaque = 8, }; class ValueAllocator final : public SimpleSchemaAllocator diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index a8cc1f3947..3e48c097c8 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -87,13 +87,13 @@ namespace AZ::Dom const char* endMethodName; switch (containerType) { - case Type::ObjectType: + case Type::Object: endMethodName = "EndObject"; break; - case Type::ArrayType: + case Type::Array: endMethodName = "EndArray"; break; - case Type::NodeType: + case Type::Node: endMethodName = "EndNode"; break; default: @@ -173,7 +173,7 @@ namespace AZ::Dom Visitor::Result ValueWriter::EndObject(AZ::u64 attributeCount) { - return EndContainer(Type::ObjectType, attributeCount, 0); + return EndContainer(Type::Object, attributeCount, 0); } Visitor::Result ValueWriter::Key(AZ::Name key) @@ -199,7 +199,7 @@ namespace AZ::Dom Visitor::Result ValueWriter::EndArray(AZ::u64 elementCount) { - return EndContainer(Type::ArrayType, 0, elementCount); + return EndContainer(Type::Array, 0, elementCount); } Visitor::Result ValueWriter::StartNode(AZ::Name name) @@ -217,7 +217,7 @@ namespace AZ::Dom Visitor::Result ValueWriter::EndNode(AZ::u64 attributeCount, AZ::u64 elementCount) { - return EndContainer(Type::NodeType, attributeCount, elementCount); + return EndContainer(Type::Node, attributeCount, elementCount); } Visitor::Result ValueWriter::FinishWrite() diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index 3e02eaff2e..51d2e5c10c 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -46,7 +46,7 @@ namespace AZ::Dom::Benchmark Value GenerateDomBenchmarkPayload(int64_t entryCount, int64_t stringTemplateLength) { - Value root(Type::ObjectType); + Value root(Type::Object); AZStd::string entryTemplate; while (entryTemplate.size() < static_cast(stringTemplateLength)) @@ -63,18 +63,18 @@ namespace AZ::Dom::Benchmark auto createEntry = [&](int n) -> Value { - Value entry(Type::ObjectType); + Value entry(Type::Object); entry.AddMember("string", createString(n)); entry.AddMember("int", n); entry.AddMember("double", static_cast(n) * 0.5); entry.AddMember("bool", n % 2 == 0); - entry.AddMember("null", Value(Type::NullType)); + entry.AddMember("null", Value(Type::Null)); return entry; }; auto createArray = [&]() -> Value { - Value array(Type::ArrayType); + Value array(Type::Array); for (int i = 0; i < entryCount; ++i) { array.PushBack(createEntry(i)); @@ -176,7 +176,7 @@ namespace AZ::Dom::Benchmark BENCHMARK_DEFINE_F(DomValueBenchmark, LookupMemberByName)(benchmark::State& state) { - Value value(Type::ObjectType); + Value value(Type::Object); AZStd::vector keys; for (int64_t i = 0; i < state.range(0); ++i) { @@ -199,7 +199,7 @@ namespace AZ::Dom::Benchmark BENCHMARK_DEFINE_F(DomValueBenchmark, LookupMemberByString)(benchmark::State& state) { - Value value(Type::ObjectType); + Value value(Type::Object); AZStd::vector keys; for (int64_t i = 0; i < state.range(0); ++i) { diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp index 125f426e02..62f3ad7601 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -79,7 +79,7 @@ namespace AZ::Dom::Tests m_value.SetArray(); for (int j = 0; j < 5; ++j) { - Value nestedArray(Type::ArrayType); + Value nestedArray(Type::Array); for (int i = 0; i < 5; ++i) { nestedArray.PushBack(Value(i)); @@ -127,7 +127,7 @@ namespace AZ::Dom::Tests m_value.SetObject(); for (int j = 0; j < 3; ++j) { - Value nestedObject(Type::ObjectType); + Value nestedObject(Type::Object); for (int i = 0; i < 5; ++i) { nestedObject.AddMember(AZStd::string::format("Key%i", i), Value(i)); @@ -189,7 +189,7 @@ namespace AZ::Dom::Tests for (int i = 0; i < 5; ++i) { - Value childNode(Type::NodeType); + Value childNode(Type::Node); childNode.SetNodeName(childNodeName); childNode.SetNodeValue(i); @@ -218,9 +218,9 @@ namespace AZ::Dom::Tests m_value["int64_min"] = AZStd::numeric_limits::min(); m_value["int64_max"] = AZStd::numeric_limits::max(); - EXPECT_EQ(m_value["int64_min"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["int64_min"].GetType(), Type::Number); EXPECT_EQ(m_value["int64_min"].GetInt64(), AZStd::numeric_limits::min()); - EXPECT_EQ(m_value["int64_max"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["int64_max"].GetType(), Type::Number); EXPECT_EQ(m_value["int64_max"].GetInt64(), AZStd::numeric_limits::max()); PerformValueChecks(); @@ -232,9 +232,9 @@ namespace AZ::Dom::Tests m_value["uint64_min"] = AZStd::numeric_limits::min(); m_value["uint64_max"] = AZStd::numeric_limits::max(); - EXPECT_EQ(m_value["uint64_min"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["uint64_min"].GetType(), Type::Number); EXPECT_EQ(m_value["uint64_min"].GetInt64(), AZStd::numeric_limits::min()); - EXPECT_EQ(m_value["uint64_max"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["uint64_max"].GetType(), Type::Number); EXPECT_EQ(m_value["uint64_max"].GetInt64(), AZStd::numeric_limits::max()); PerformValueChecks(); @@ -246,9 +246,9 @@ namespace AZ::Dom::Tests m_value["double_min"] = AZStd::numeric_limits::min(); m_value["double_max"] = AZStd::numeric_limits::max(); - EXPECT_EQ(m_value["double_min"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["double_min"].GetType(), Type::Number); EXPECT_EQ(m_value["double_min"].GetDouble(), AZStd::numeric_limits::min()); - EXPECT_EQ(m_value["double_max"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["double_max"].GetType(), Type::Number); EXPECT_EQ(m_value["double_max"].GetDouble(), AZStd::numeric_limits::max()); PerformValueChecks(); @@ -257,9 +257,9 @@ namespace AZ::Dom::Tests TEST_F(DomValueTests, Null) { m_value.SetObject(); - m_value["null_value"] = Value(Type::NullType); + m_value["null_value"] = Value(Type::Null); - EXPECT_EQ(m_value["null_value"].GetType(), Type::NullType); + EXPECT_EQ(m_value["null_value"].GetType(), Type::Null); EXPECT_EQ(m_value["null_type"], Value()); PerformValueChecks(); @@ -271,9 +271,9 @@ namespace AZ::Dom::Tests m_value["true_value"] = true; m_value["false_value"] = false; - EXPECT_EQ(m_value["true_value"].GetType(), Type::TrueType); + EXPECT_EQ(m_value["true_value"].GetType(), Type::True); EXPECT_EQ(m_value["true_value"].GetBool(), true); - EXPECT_EQ(m_value["false_value"].GetType(), Type::FalseType); + EXPECT_EQ(m_value["false_value"].GetType(), Type::False); EXPECT_EQ(m_value["false_value"].GetBool(), false); PerformValueChecks(); @@ -290,12 +290,12 @@ namespace AZ::Dom::Tests AZStd::string stringToCopy = s2; m_value["copy"] = Value(stringToCopy, true); - EXPECT_EQ(m_value["no_copy"].GetType(), Type::StringType); + EXPECT_EQ(m_value["no_copy"].GetType(), Type::String); EXPECT_EQ(m_value["no_copy"].GetString(), s1); stringToReference.at(0) = 'F'; EXPECT_NE(m_value["no_copy"].GetString(), s1); - EXPECT_EQ(m_value["copy"].GetType(), Type::StringType); + EXPECT_EQ(m_value["copy"].GetType(), Type::String); EXPECT_EQ(m_value["copy"].GetString(), s2); stringToCopy.at(0) = 'F'; EXPECT_EQ(m_value["copy"].GetString(), s2); @@ -305,10 +305,10 @@ namespace AZ::Dom::Tests TEST_F(DomValueTests, CopyOnWrite_Object) { - Value v1(Type::ObjectType); + Value v1(Type::Object); v1["foo"] = 5; - Value nestedObject(Type::ObjectType); + Value nestedObject(Type::Object); v1["obj"] = nestedObject; Value v2 = v1; @@ -333,11 +333,11 @@ namespace AZ::Dom::Tests TEST_F(DomValueTests, CopyOnWrite_Array) { - Value v1(Type::ArrayType); + Value v1(Type::Array); v1.PushBack(1); v1.PushBack(2); - Value nestedArray(Type::ArrayType); + Value nestedArray(Type::Array); v1.PushBack(nestedArray); Value v2 = v1; From e080ade885d84fa0bd0852b705dd46670b5e78bf Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Sun, 12 Dec 2021 14:20:16 -0800 Subject: [PATCH 076/399] Switch high perf allocator back on for containers, modest perf boost Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 274f6b1934..4b09068ec4 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -24,6 +24,7 @@ namespace AZ::Dom { using KeyType = AZ::Name; + //! The type of underlying value stored in a value. \see Value enum class Type { Null = 0, @@ -37,6 +38,9 @@ namespace AZ::Dom Opaque = 8, }; + //! The allocator used by Value. + //! Value heap allocates shared_ptrs for its container storage (Array / Object / Node) alongside the vector + //! contents of its container storage. class ValueAllocator final : public SimpleSchemaAllocator { public: @@ -56,7 +60,7 @@ namespace AZ::Dom class Array { public: - using ContainerType = AZStd::vector; + using ContainerType = AZStd::vector>; using Iterator = ContainerType::iterator; using ConstIterator = ContainerType::const_iterator; static constexpr const size_t ReserveIncrement = 4; @@ -74,7 +78,7 @@ namespace AZ::Dom { public: using EntryType = AZStd::pair; - using ContainerType = AZStd::vector; + using ContainerType = AZStd::vector>; using Iterator = ContainerType::iterator; using ConstIterator = ContainerType::const_iterator; static constexpr const size_t ReserveIncrement = 8; From 40e1116e26628849c91fc450f4ce2c3720aca297 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Mon, 13 Dec 2021 06:10:36 -0600 Subject: [PATCH 077/399] Use LegacySystemInterfaceCreated to initialize physics material library. (#6168) (#6347) * Use LegacySystemInterfaceCreated to initialize physics material library. OnCatalogLoaded was used before but it's not called when running the editor without assets processed yet. Signed-off-by: moraaar Co-authored-by: moraaar --- Gems/PhysX/Code/Source/System/PhysXSystem.cpp | 23 +++++++++++++++---- Gems/PhysX/Code/Source/System/PhysXSystem.h | 11 ++++----- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp index cc21285f8c..447df6dcc5 100644 --- a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp +++ b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp @@ -7,6 +7,8 @@ */ #include #include +#include +#include #include #include @@ -97,7 +99,20 @@ namespace PhysX m_systemConfig = *physXConfig; } - AzFramework::AssetCatalogEventBus::Handler::BusConnect(); + // If the settings registry isn't available, something earlier in startup will report that failure. + if (auto* settingsRegistry = AZ::SettingsRegistry::Get(); + settingsRegistry != nullptr) + { + // Automatically register the event if it's not registered, because + // this system is initialized before the settings registry has loaded the event list. + AZ::ComponentApplicationLifecycle::RegisterHandler( + *settingsRegistry, m_componentApplicationLifecycleHandler, + [this]([[maybe_unused]] AZStd::string_view path, [[maybe_unused]] AZ::SettingsRegistryInterface::Type type) + { + InitializeMaterialLibrary(); + }, + "LegacySystemInterfaceCreated"); // LegacySystemInterfaceCreated is signaled after critical assets have been processed + } m_state = State::Initialized; m_initializeEvent.Signal(&m_systemConfig); @@ -118,7 +133,7 @@ namespace PhysX RemoveAllScenes(); - AzFramework::AssetCatalogEventBus::Handler::BusDisconnect(); + m_componentApplicationLifecycleHandler.Disconnect(); m_materialLibraryAssetHelper.Disconnect(); // Clear the asset reference in deactivate. The asset system is shut down before destructors are called // for system components, causing any hanging asset references to become crashes on shutdown in release builds. @@ -362,10 +377,8 @@ namespace PhysX return &m_systemConfig; } - void PhysXSystem::OnCatalogLoaded([[maybe_unused]]const char* catalogFile) + void PhysXSystem::InitializeMaterialLibrary() { - // now that assets can be resolved, lets load the default material library. - if (!m_systemConfig.m_materialLibraryAsset.GetId().IsValid()) { m_onMaterialLibraryLoadErrorEvent.Signal(AzPhysics::SystemEvents::MaterialLibraryLoadErrorType::InvalidId); diff --git a/Gems/PhysX/Code/Source/System/PhysXSystem.h b/Gems/PhysX/Code/Source/System/PhysXSystem.h index d1250b6958..48b5dfa075 100644 --- a/Gems/PhysX/Code/Source/System/PhysXSystem.h +++ b/Gems/PhysX/Code/Source/System/PhysXSystem.h @@ -7,10 +7,9 @@ */ #pragma once -#include #include #include -#include +#include #include #include @@ -35,7 +34,6 @@ namespace PhysX { class PhysXSystem : public AZ::Interface::Registrar - , private AzFramework::AssetCatalogEventBus::Handler { public: AZ_CLASS_ALLOCATOR_DECL; @@ -89,10 +87,9 @@ namespace PhysX //! @param cookingParams The cooking params to use when setting up PhysX cooking interface. void InitializePhysXSdk(const physx::PxCookingParams& cookingParams); void ShutdownPhysXSdk(); - bool LoadMaterialLibrary(); - // AzFramework::AssetCatalogEventBus::Handler ... - void OnCatalogLoaded(const char* catalogFile) override; + void InitializeMaterialLibrary(); + bool LoadMaterialLibrary(); PhysXSystemConfiguration m_systemConfig; AzPhysics::SceneConfiguration m_defaultSceneConfiguration; @@ -145,6 +142,8 @@ namespace PhysX OnMaterialLibraryReloadedCallback m_onMaterialLibraryReloadedCallback; }; MaterialLibraryAssetHelper m_materialLibraryAssetHelper; + + AZ::SettingsRegistryInterface::NotifyEventHandler m_componentApplicationLifecycleHandler; }; //! Helper function for getting the PhysX System interface from inside the PhysX gem. From 82ebca826164085d6ef3a8a6f1f2c087c761c103 Mon Sep 17 00:00:00 2001 From: Andre Mitchell Date: Mon, 13 Dec 2021 07:16:14 -0500 Subject: [PATCH 078/399] Disable unused HideActionWhileEntitiesDeselected function in EditorListener. It is only used when the slice editor is enabled, which causes build errors when it is not enabled. Signed-off-by: Andre Mitchell --- Code/Editor/Core/LevelEditorMenuHandler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Code/Editor/Core/LevelEditorMenuHandler.cpp b/Code/Editor/Core/LevelEditorMenuHandler.cpp index 6be2456d2a..91a609ccf2 100644 --- a/Code/Editor/Core/LevelEditorMenuHandler.cpp +++ b/Code/Editor/Core/LevelEditorMenuHandler.cpp @@ -104,6 +104,11 @@ namespace } } + // Currently (December 13, 2021), this function is only used by slice editor code. + // When the slice editor is not enabled, there are no references to the + // HideActionWhileEntitiesDeselected function, causing a compiler warning and + // subsequently a build error. +#ifdef ENABLE_SLICE_EDITOR void HideActionWhileEntitiesDeselected(QAction* action, EEditorNotifyEvent editorNotifyEvent) { if (action == nullptr) @@ -127,6 +132,7 @@ namespace break; } } +#endif void DisableActionWhileInSimMode(QAction* action, EEditorNotifyEvent editorNotifyEvent) { From 0216d0ae9f75927491feab2effa0e2273374fbc3 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 13 Dec 2021 09:11:06 -0800 Subject: [PATCH 079/399] Clarify shared string semantics Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 16 +++++----- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 30 +++++++------------ .../AzCore/AzCore/DOM/DomValueWriter.cpp | 2 +- .../AzCore/AzCore/DOM/DomValueWriter.h | 2 +- .../AzCore/AzCore/DOM/DomVisitor.cpp | 2 +- Code/Framework/AzCore/AzCore/DOM/DomVisitor.h | 11 +++++-- 6 files changed, 30 insertions(+), 33 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 59e21a7d8b..72eb7ebadd 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -61,7 +61,7 @@ namespace AZ::Dom return m_children; } - Value::Value(AZStd::shared_ptr string) + Value::Value(AZStd::shared_ptr string) : m_value(string) { } @@ -233,7 +233,7 @@ namespace AZ::Dom case 4: // bool return AZStd::get(m_value) ? Type::True : Type::False; case 5: // AZStd::string_view - case 6: // AZStd::shared_ptr + case 6: // AZStd::shared_ptr case 7: // ShortStringType return Type::String; case 8: // ObjectPtr @@ -900,7 +900,7 @@ namespace AZ::Dom m_value = aznumeric_cast(value); } - void Value::SetString(AZStd::shared_ptr string) + void Value::SetString(AZStd::shared_ptr string) { m_value = string; } @@ -911,8 +911,8 @@ namespace AZ::Dom { case 5: // AZStd::string_view return AZStd::get(m_value); - case 6: // AZStd::shared_ptr - return *AZStd::get>(m_value); + case 6: // AZStd::shared_ptr + return *AZStd::get>(m_value); case 7: // ShortStringType { const ShortStringType& ShortString = AZStd::get(m_value); @@ -948,7 +948,7 @@ namespace AZ::Dom } else { - m_value = AZStd::allocate_shared(AZStdAlloc(), value); + m_value = AZStd::allocate_shared(AZStdAlloc(), value); } } @@ -1000,7 +1000,7 @@ namespace AZ::Dom { result = visitor.String(arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); } - else if constexpr (AZStd::is_same_v>) + else if constexpr (AZStd::is_same_v>) { result = visitor.RefCountedString(arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); } @@ -1096,7 +1096,7 @@ namespace AZ::Dom if (IsString() && other.IsString()) { // If we both hold the same ref counted string we don't need to do a full comparison - if (AZStd::holds_alternative>(m_value) && m_value == other.m_value) + if (AZStd::holds_alternative>(m_value) && m_value == other.m_value) { return true; } diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 4b09068ec4..1a09b9a3c8 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -39,8 +39,7 @@ namespace AZ::Dom }; //! The allocator used by Value. - //! Value heap allocates shared_ptrs for its container storage (Array / Object / Node) alongside the vector - //! contents of its container storage. + //! Value heap allocates shared_ptrs for its container storage (Array / Object / Node) alongside class ValueAllocator final : public SimpleSchemaAllocator { public: @@ -131,7 +130,7 @@ namespace AZ::Dom Value(const Value&); Value(Value&&) noexcept; Value(AZStd::string_view string, bool copy); - Value(AZStd::shared_ptr string); + Value(AZStd::shared_ptr string); Value(int32_t value); Value(uint32_t value); @@ -242,10 +241,6 @@ namespace AZ::Dom const Array::ContainerType& GetArray() const; // Node API (supports both object + array API, plus a dedicated NodeName)... - // bool CanConvertToNodeFromObject() const; - // Value& ConvertToNodeFromObject(); - // Value& ConvertToObjectFromNode(); - void SetNode(AZ::Name name); void SetNode(AZStd::string_view name); @@ -282,14 +277,14 @@ namespace AZ::Dom float GetFloat() const; void SetFloat(float); - // string API... + // String API... AZStd::string_view GetString() const; size_t GetStringLength() const; void SetString(AZStd::string_view); - void SetString(AZStd::shared_ptr); + void SetString(AZStd::shared_ptr); void CopyFromString(AZStd::string_view); - // opaque type API... + // Opaque type API... AZStd::any& GetOpaqueValue() const; //! This sets this Value to represent a value of an type that the DOM has //! no formal knowledge of. Where possible, it should be preferred to @@ -298,10 +293,10 @@ namespace AZ::Dom //! values. void SetOpaqueValue(AZStd::any&); - // null API... + // Null API... void SetNull(); - // Visitor API + // Visitor API... Visitor::Result Accept(Visitor& visitor, bool copyStrings) const; AZStd::unique_ptr GetWriteHandler(); @@ -330,12 +325,9 @@ namespace AZ::Dom } }; - // If using the the copy on write model, anything stored internally as a shared_ptr will - // detach and copy when doing a mutating operation if use_count() > 1. - - // This internal storage will not have a 1:1 mapping to the public Type, as there may be - // multiple storage options (e.g. strings being stored as non-owning string_view or - // owning shared_ptr) + //! The internal storage type for Value. + //! These types do not correspond one-to-one with the Value's external Type as there may be multiple storage classes + //! for the same type in some instances, such as string storage using ValueType = AZStd::variant< // NullType AZStd::monostate, @@ -347,7 +339,7 @@ namespace AZ::Dom bool, // StringType AZStd::string_view, - AZStd::shared_ptr, + AZStd::shared_ptr, ShortStringType, // ObjectType ObjectPtr, diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index 3e48c097c8..ef99809290 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -68,7 +68,7 @@ namespace AZ::Dom return FinishWrite(); } - Visitor::Result ValueWriter::RefCountedString(AZStd::shared_ptr value, [[maybe_unused]] Lifetime lifetime) + Visitor::Result ValueWriter::RefCountedString(AZStd::shared_ptr value, [[maybe_unused]] Lifetime lifetime) { CurrentValue().SetString(value); return FinishWrite(); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h index 4c1d5a26ee..6086ff4fe5 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h @@ -26,7 +26,7 @@ namespace AZ::Dom Result Double(double value) override; Result String(AZStd::string_view value, Lifetime lifetime) override; - Result RefCountedString(AZStd::shared_ptr value, Lifetime lifetime) override; + Result RefCountedString(AZStd::shared_ptr value, Lifetime lifetime) override; Result StartObject() override; Result EndObject(AZ::u64 attributeCount) override; Result Key(AZ::Name key) override; diff --git a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp index af64c4cea8..5e3d6c2882 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp @@ -105,7 +105,7 @@ namespace AZ::Dom return VisitorSuccess(); } - Visitor::Result Visitor::RefCountedString(AZStd::shared_ptr value, Lifetime lifetime) + Visitor::Result Visitor::RefCountedString(AZStd::shared_ptr value, Lifetime lifetime) { return String(*value, lifetime); } diff --git a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h index 3439a566e2..938df1bb5a 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h @@ -168,10 +168,15 @@ namespace AZ::Dom virtual Result Uint64(AZ::u64 value); //! Operates on a double precision, 64 bit floating point value. virtual Result Double(double value); - //! Operates on a string value. As strings are a reference type. - //! Storage semantics are provided to indicate where the value may be stored persistently or requires a copy. + //! Operates on a string value. As strings are a reference type, + //! storage semantics are provided to indicate where the value may be stored persistently or requires a copy. + //! \param lifetime Specifies the lifetime of this string - if the string has a temporary lifetime, it cannot + //! safely be stored as a reference. virtual Result String(AZStd::string_view value, Lifetime lifetime); - virtual Result RefCountedString(AZStd::shared_ptr value, Lifetime lifetime); + //! Operates on a ref-counted string value. S + //! \param lifetime Specifies the lifetime of this string. If the string has a temporary lifetime, it may not + //! be safely stored as a reference, but may still be safely stored as a ref-counted shared_ptr. + virtual Result RefCountedString(AZStd::shared_ptr value, Lifetime lifetime); //! Operates on an opaque value. As opaque values are a reference type, storage semantics are provided to //! indicate where the value may be stored persistently or requires a copy. //! The base implementation of OpaqueValue rejects the operation, as opaque values are meant for special From b0ef83e194a4d149e9402c87fe23243af628ea79 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 10:31:51 -0800 Subject: [PATCH 080/399] Delete $tmp29198_Test_LY_79396.scriptcanvas Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../$tmp29198_Test_LY_79396.scriptcanvas | 69 ------------------- 1 file changed, 69 deletions(-) delete mode 100644 Gems/ScriptCanvasTesting/Assets/ScriptCanvas/Tests/$tmp29198_Test_LY_79396.scriptcanvas diff --git a/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/Tests/$tmp29198_Test_LY_79396.scriptcanvas b/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/Tests/$tmp29198_Test_LY_79396.scriptcanvas deleted file mode 100644 index 278d74c28d..0000000000 --- a/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/Tests/$tmp29198_Test_LY_79396.scriptcanvas +++ /dev/null @@ -1,69 +0,0 @@ -{ - "Type": "JsonSerialization", - "Version": 1, - "ClassName": "ScriptCanvasData", - "ClassData": { - "m_scriptCanvas": { - "Id": { - "id": 32884619828465 - }, - "Name": "Script Canvas Graph", - "Components": { - "Component_[14322649685925277086]": { - "$type": "EditorGraphVariableManagerComponent", - "Id": 14322649685925277086, - "m_variableData": { - "m_nameVariableMap": [ - { - "Key": { - "m_id": "{142C0457-38E5-496E-A4F2-67E91852CBCB}" - }, - "Value": { - "Datum": { - "isOverloadedStorage": false, - "scriptCanvasType": { - "m_type": 4, - "m_azType": "{5CBE5640-DF5C-5A49-9195-D790881A0747}" - }, - "isNullPointer": false, - "$type": "{5CBE5640-DF5C-5A49-9195-D790881A0747} AZStd::vector", - "value": [ - [ - 0.0, - 0.0, - -498814079205376.0, - 0.0 - ], - [ - 0.0, - 0.0, - 1.1865528051967005e38, - 0.0 - ] - ], - "label": "Variable 7" - }, - "VariableId": { - "m_id": "{142C0457-38E5-496E-A4F2-67E91852CBCB}" - }, - "VariableName": "Variable 7" - } - }, - { - "Key": { - "m_id": "{21DD2B3D-ADC9-46E1-B44C-965A6E2AE543}" - }, - "Value": { - "Datum": { - "isOverloadedStorage": false, - "scriptCanvasType": { - "m_type": 4, - "m_azType": "{9ABF5933-C8FC-53CD-A518-B6AF433CF496}" - }, - "isNullPointer": false, - "$type": "{9ABF5933-C8FC-53CD-A518-B6AF433CF496} AZStd::unordered_map", - "value": [ - { - "Key": true, - "Value": { - "roll": \ No newline at end of file From d31c6a27744b56c63c6811a7c67d446f12faa96a Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 13:08:03 -0800 Subject: [PATCH 081/399] remove uneeded files/comments Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilderWorker.cpp | 1 - .../Code/Builder/ScriptCanvasBuilderWorker.h | 2 +- .../ScriptCanvas/Assets/ScriptCanvasFileHandling.h | 1 - .../Assets/ScriptCanvasSourceFileHandle.cpp | 9 --------- .../ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h | 10 ---------- .../ScriptCanvas/Code/Editor/View/Windows/MainWindow.h | 1 - .../Code/scriptcanvasgem_editor_files.cmake | 2 -- 7 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index bf98e62b71..ac7bd4406a 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index 77b90df3e0..817fe5d294 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -59,7 +59,7 @@ namespace ScriptCanvasBuilder PrefabIntegration, CorrectGraphVariableVersion, ReflectEntityIdNodes, - FixExecutionStateNodeableConstrution, + FixExecutionStateNodeableConstruction, // add new entries above Current, diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h index dd0e7aeb62..bd3d2b9f0a 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h @@ -12,7 +12,6 @@ #include #include #include -#include namespace AZ { diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp deleted file mode 100644 index 258a862a19..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h deleted file mode 100644 index 1d14b9b21b..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 80117b84fe..fed4f28f4f 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index 449298097f..77ccf7fda9 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -28,8 +28,6 @@ set(FILES Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetBus.h Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetTypes.h Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h - Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h - Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetHandler.h Editor/Assets/ScriptCanvasFileHandling.cpp Editor/Assets/ScriptCanvasAssetHandler.cpp From 0cc4c062131fa87d6aa5c541fc23d8dd91286dcd Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 13:08:34 -0800 Subject: [PATCH 082/399] remove uneeded files/comments Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index be8f274cd6..a969187743 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -387,7 +387,7 @@ namespace ScriptCanvasEditor bool m_saveFormatConverted = true; ScriptCanvasEditor::SourceHandle m_assetId; - // #sc_editor_asset temporary step in cleaning up the graph / asset class structure. This reference is deliberately weak. + // temporary step in cleaning up the graph / asset class structure. This reference is deliberately weak. ScriptCanvas::ScriptCanvasData* m_owner; }; } From 07bf8fc7550684fc378385aceac14ead6e1e3931 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 16:02:29 -0800 Subject: [PATCH 083/399] fix linux build error Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp | 3 +-- Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h | 1 - Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp | 3 --- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp index 01595e0702..992b33889b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp @@ -19,8 +19,7 @@ namespace ScriptCanvasEditor { ScriptCanvasMemoryAsset::ScriptCanvasMemoryAsset() - : m_isSaving(false) - , m_sourceInError(false) + : m_sourceInError(false) { m_undoState = AZStd::make_unique(this); } diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h index 6eecc5e04f..45647eba1b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h @@ -321,7 +321,6 @@ namespace ScriptCanvasEditor //! The undo helper is an object that implements the Undo behaviors AZStd::unique_ptr m_undoHelper; - bool m_isSaving; bool m_sourceInError; AZ::Data::AssetId m_sourceUuid; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp index 722e9d1c71..69fe4053fe 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp @@ -70,11 +70,8 @@ namespace ScriptCanvasEditor { EditorGraphRequests* editorGraphRequests = EditorGraphRequestBus::FindFirstHandler(scriptCanvasId); editorGraphRequests->CreateGraphCanvasScene(); - AZ::EntityId graphCanvasSceneId = editorGraphRequests->GetGraphCanvasGraphId(); - m_graphicsView->SetScene(graphCanvasSceneId); - m_scriptCanvasId = scriptCanvasId; } From 4f00718a38c6b08b30a526b3217f6f105aab4fd3 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 18:18:06 -0800 Subject: [PATCH 084/399] fix linux build error, change translation system errors to warnings Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/GraphCanvas/Code/Source/Translation/TranslationAsset.cpp | 2 +- .../Code/Source/Translation/TranslationSerializer.cpp | 2 +- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Gems/GraphCanvas/Code/Source/Translation/TranslationAsset.cpp b/Gems/GraphCanvas/Code/Source/Translation/TranslationAsset.cpp index a461866c46..3b026b4579 100644 --- a/Gems/GraphCanvas/Code/Source/Translation/TranslationAsset.cpp +++ b/Gems/GraphCanvas/Code/Source/Translation/TranslationAsset.cpp @@ -195,7 +195,7 @@ namespace GraphCanvas } else { - AZ_Error("TranslationAsset", false, "Serialization of the TranslationFormat failed for: %s", asset.GetHint().c_str()); + AZ_Warning("TranslationAsset", false, "Serialization of the TranslationFormat failed for: %s", asset.GetHint().c_str()); } } } diff --git a/Gems/GraphCanvas/Code/Source/Translation/TranslationSerializer.cpp b/Gems/GraphCanvas/Code/Source/Translation/TranslationSerializer.cpp index 80e488f3dc..5f8d8bc3f1 100644 --- a/Gems/GraphCanvas/Code/Source/Translation/TranslationSerializer.cpp +++ b/Gems/GraphCanvas/Code/Source/Translation/TranslationSerializer.cpp @@ -146,7 +146,7 @@ namespace GraphCanvas AZStd::string baseKey = contextStr; if (keyStr.empty()) { - AZ_Error("TranslationDatabase", false, "Every entry in the Translation data must have a key: %s", baseKey.c_str()); + AZ_Warning("TranslationDatabase", false, "Every entry in the Translation data must have a key: %s", baseKey.c_str()); return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Unsupported, "Every entry in the Translation data must have a key"); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 06877a5659..146c563ea7 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -256,7 +256,6 @@ namespace ScriptCanvasEditor EditorSettings::EditorWorkspace::WorkspaceAssetSaveData assetSaveData; assetSaveData.m_assetId = sourceId; - ScriptCanvas::ScriptCanvasId scriptCanvasId = m_mainWindow->FindScriptCanvasIdByAssetId(assetId); activeAssets.push_back(assetSaveData); } } From b10c679c3347cd221cc52ca14b8ff3c9c3289b63 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 19:55:27 -0800 Subject: [PATCH 085/399] fixed string_view printf error caught by linux compiler Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 146c563ea7..7a0834bb26 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1571,7 +1571,7 @@ namespace ScriptCanvasEditor if (outTabIndex == -1) { - return AZ::Failure(AZStd::string::format("Script Canvas Asset %.*s is not open in a tab", assetPath.data())); + return AZ::Failure(AZStd::string::format("Script Canvas Asset %.*s is not open in a tab", assetPath.size(), assetPath.data())); } SetActiveAsset(handle); From 3e728d1183218968e7d096da534f8cdc87688686 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 20:17:36 -0800 Subject: [PATCH 086/399] fixed another string_view printf error caught by linux compiler Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 7a0834bb26..fa13681879 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1571,7 +1571,8 @@ namespace ScriptCanvasEditor if (outTabIndex == -1) { - return AZ::Failure(AZStd::string::format("Script Canvas Asset %.*s is not open in a tab", assetPath.size(), assetPath.data())); + return AZ::Failure(AZStd::string::format("Script Canvas Asset %.*s is not open in a tab" + , static_cast(assetPath.size()), assetPath.data())); } SetActiveAsset(handle); From b9bbe233be80c46afa40187d73c07061d445b4eb Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Mon, 6 Dec 2021 12:12:46 -0800 Subject: [PATCH 087/399] Restore undo/redo Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Assets/ScriptCanvasFileHandling.cpp | 9 +++- .../Editor/Assets/ScriptCanvasMemoryAsset.cpp | 2 - .../Editor/Assets/ScriptCanvasUndoHelper.cpp | 48 +++++++++++++------ .../Editor/Assets/ScriptCanvasUndoHelper.h | 16 +++++-- .../Code/Editor/Components/EditorGraph.cpp | 1 + .../ScriptCanvas/Components/EditorGraph.h | 2 + .../Editor/Undo/ScriptCanvasGraphCommand.cpp | 14 +++--- .../Editor/Undo/ScriptCanvasGraphCommand.h | 8 ++-- .../Editor/Undo/ScriptCanvasUndoManager.cpp | 4 +- .../Editor/Undo/ScriptCanvasUndoManager.h | 1 + 10 files changed, 68 insertions(+), 37 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index be909e5043..c4579c9042 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -252,11 +252,16 @@ namespace ScriptCanvasEditor AZ::u64 entityId = aznumeric_caster(ScriptCanvas::MathNodeUtilities::GetRandomIntegral(1, std::numeric_limits::max())); entity->SetId(AZ::EntityId(entityId)); - entity->Init(); - entity->Activate(); auto graph = entity->FindComponent(); graph->MarkOwnership(*scriptCanvasData); + + entity->Init(); + entity->Activate(); + } + else + { + return AZ::Failure(AZStd::string("Loaded script canvas file was missing a necessary Entity.")); } return AZ::Success(ScriptCanvasEditor::SourceHandle(scriptCanvasData, path)); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp index 992b33889b..a20a6e54a1 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp @@ -278,8 +278,6 @@ namespace ScriptCanvasEditor EditorGraphNotificationBus::Handler::BusDisconnect(); EditorGraphNotificationBus::Handler::BusConnect(m_scriptCanvasId); - - m_undoHelper = AZStd::make_unique(*this); } ScriptCanvasEditor::Widget::CanvasWidget* ScriptCanvasMemoryAsset::CreateView(QWidget* /*parent*/) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp index 388da67987..31bdf0077c 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp @@ -9,13 +9,19 @@ #include "ScriptCanvasUndoHelper.h" #include "ScriptCanvasMemoryAsset.h" #include +#include namespace ScriptCanvasEditor { - UndoHelper::UndoHelper(ScriptCanvasMemoryAsset& memoryAsset) - : m_memoryAsset(memoryAsset) + UndoHelper::UndoHelper() + : m_undoState(this) { - UndoRequestBus::Handler::BusConnect(memoryAsset.GetScriptCanvasId()); + } + + UndoHelper::UndoHelper(SourceHandle memoryAsset) + : m_undoState(this) + { + SetSource(memoryAsset); } UndoHelper::~UndoHelper() @@ -23,15 +29,21 @@ namespace ScriptCanvasEditor UndoRequestBus::Handler::BusDisconnect(); } + void UndoHelper::SetSource(SourceHandle source) + { + m_memoryAsset = source; + UndoRequestBus::Handler::BusConnect(source.Get()->GetScriptCanvasId()); + } + ScriptCanvasEditor::UndoCache* UndoHelper::GetSceneUndoCache() { - return m_memoryAsset.GetUndoState()->m_undoCache.get(); + return m_undoState.m_undoCache.get(); } ScriptCanvasEditor::UndoData UndoHelper::CreateUndoData() { - AZ::EntityId graphCanvasGraphId = m_memoryAsset.GetGraphId(); - ScriptCanvas::ScriptCanvasId scriptCanvasId = m_memoryAsset.GetScriptCanvasId(); + AZ::EntityId graphCanvasGraphId = m_memoryAsset.Get()->GetGraphCanvasGraphId(); + ScriptCanvas::ScriptCanvasId scriptCanvasId = m_memoryAsset.Get()->GetScriptCanvasId(); GraphCanvas::GraphModelRequestBus::Event(graphCanvasGraphId, &GraphCanvas::GraphModelRequests::OnSaveDataDirtied, graphCanvasGraphId); @@ -56,17 +68,17 @@ namespace ScriptCanvasEditor void UndoHelper::BeginUndoBatch(AZStd::string_view label) { - m_memoryAsset.GetUndoState()->BeginUndoBatch(label); + m_undoState.BeginUndoBatch(label); } void UndoHelper::EndUndoBatch() { - m_memoryAsset.GetUndoState()->EndUndoBatch(); + m_undoState.EndUndoBatch(); } void UndoHelper::AddUndo(AzToolsFramework::UndoSystem::URSequencePoint* sequencePoint) { - if (SceneUndoState* sceneUndoState = m_memoryAsset.GetUndoState()) + if (SceneUndoState* sceneUndoState = &m_undoState) { if (!sceneUndoState->m_currentUndoBatch) { @@ -105,7 +117,7 @@ namespace ScriptCanvasEditor { AZ_PROFILE_FUNCTION(ScriptCanvas); - SceneUndoState* sceneUndoState = m_memoryAsset.GetUndoState(); + SceneUndoState* sceneUndoState = &m_undoState; if (sceneUndoState) { AZ_Warning("Script Canvas", !sceneUndoState->m_currentUndoBatch, "Script Canvas Editor has an open undo batch when performing a redo operation"); @@ -125,7 +137,7 @@ namespace ScriptCanvasEditor { AZ_PROFILE_FUNCTION(ScriptCanvas); - SceneUndoState* sceneUndoState = m_memoryAsset.GetUndoState(); + SceneUndoState* sceneUndoState = &m_undoState; if (sceneUndoState) { AZ_Warning("Script Canvas", !sceneUndoState->m_currentUndoBatch, "Script Canvas Editor has an open undo batch when performing a redo operation"); @@ -143,7 +155,7 @@ namespace ScriptCanvasEditor void UndoHelper::Reset() { - if (SceneUndoState* sceneUndoState = m_memoryAsset.GetUndoState()) + if (SceneUndoState* sceneUndoState = &m_undoState) { AZ_Warning("Script Canvas", !sceneUndoState->m_currentUndoBatch, "Script Canvas Editor has an open undo batch when resetting the undo stack"); sceneUndoState->m_undoStack->Reset(); @@ -162,17 +174,23 @@ namespace ScriptCanvasEditor bool UndoHelper::CanUndo() const { - return m_memoryAsset.GetUndoState()->m_undoStack->CanUndo(); + return m_undoState.m_undoStack->CanUndo(); } bool UndoHelper::CanRedo() const { - return m_memoryAsset.GetUndoState()->m_undoStack->CanRedo(); + return m_undoState.m_undoStack->CanRedo(); + } + + void UndoHelper::OnUndoStackChanged() + { + UndoNotificationBus::Broadcast(&UndoNotifications::OnCanUndoChanged, m_undoState.m_undoStack->CanUndo()); + UndoNotificationBus::Broadcast(&UndoNotifications::OnCanRedoChanged, m_undoState.m_undoStack->CanRedo()); } void UndoHelper::UpdateCache() { - ScriptCanvas::ScriptCanvasId scriptCanvasId = m_memoryAsset.GetScriptCanvasId(); + ScriptCanvas::ScriptCanvasId scriptCanvasId = m_memoryAsset.Get()->GetScriptCanvasId(); UndoCache* undoCache = nullptr; UndoRequestBus::EventResult(undoCache, scriptCanvasId, &UndoRequests::GetSceneUndoCache); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h index 7bf5c8b630..3652b07686 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h @@ -8,22 +8,27 @@ #pragma once #include +#include namespace ScriptCanvasEditor { - class ScriptCanvasMemoryAsset; // Helper class that provides the implementation for UndoRequestBus - class UndoHelper : UndoRequestBus::Handler + class UndoHelper + : public UndoRequestBus::Handler + , public AzToolsFramework::UndoSystem::IUndoNotify { public: - UndoHelper(ScriptCanvasMemoryAsset& memoryAsset); + UndoHelper(); + UndoHelper(SourceHandle source); ~UndoHelper(); UndoCache* GetSceneUndoCache() override; UndoData CreateUndoData() override; + void SetSource(SourceHandle source); + void BeginUndoBatch(AZStd::string_view label) override; void EndUndoBatch() override; void AddUndo(AzToolsFramework::UndoSystem::URSequencePoint* seqPoint) override; @@ -41,6 +46,7 @@ namespace ScriptCanvasEditor bool CanRedo() const override; private: + void OnUndoStackChanged() override; void UpdateCache(); @@ -51,7 +57,7 @@ namespace ScriptCanvasEditor }; Status m_status = Status::Idle; - - ScriptCanvasMemoryAsset& m_memoryAsset; + SceneUndoState m_undoState; + SourceHandle m_memoryAsset; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 79621bbddb..a46b2a4a5c 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -1067,6 +1067,7 @@ namespace ScriptCanvasEditor void Graph::MarkOwnership(ScriptCanvas::ScriptCanvasData& owner) { m_owner = &owner; + m_undoHelper.SetSource(SourceHandle(GetOwnership(), {}, "")); } ScriptCanvas::DataPtr Graph::GetOwnership() const diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index a969187743..9157aaeac9 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -34,6 +34,7 @@ #include #include +#include namespace ScriptCanvas { @@ -380,6 +381,7 @@ namespace ScriptCanvasEditor GraphCanvas::NodeFocusCyclingHelper m_focusHelper; GraphStatisticsHelper m_statisticsHelper; + UndoHelper m_undoHelper; bool m_ignoreSaveRequests; diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp index 4e3e0c85ad..406e139ef1 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -19,7 +20,6 @@ #include #include -#include namespace ScriptCanvasEditor { @@ -36,7 +36,7 @@ namespace ScriptCanvasEditor { } - void GraphItemCommand::Capture(ScriptCanvasMemoryAsset&, bool) + void GraphItemCommand::Capture(SourceHandle&, bool) { } @@ -105,10 +105,10 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemChangeCommand::Capture(ScriptCanvasMemoryAsset& memoryAsset, bool captureUndo) + void GraphItemChangeCommand::Capture(SourceHandle& memoryAsset, bool captureUndo) { - m_scriptCanvasId = memoryAsset.GetScriptCanvasId(); - m_graphCanvasGraphId = memoryAsset.GetGraphId(); + m_scriptCanvasId = memoryAsset.Get()->GetScriptCanvasId(); + m_graphCanvasGraphId = memoryAsset.Get()->GetGraphCanvasGraphId(); UndoCache* undoCache = nullptr; UndoRequestBus::EventResult(undoCache, m_scriptCanvasId, &UndoRequests::GetSceneUndoCache); @@ -204,7 +204,7 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemAddCommand::Capture(ScriptCanvasMemoryAsset& memoryAsset, bool) + void GraphItemAddCommand::Capture(SourceHandle& memoryAsset, bool) { GraphItemChangeCommand::Capture(memoryAsset, false); } @@ -225,7 +225,7 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemRemovalCommand::Capture(ScriptCanvasMemoryAsset& memoryAsset, bool) + void GraphItemRemovalCommand::Capture(SourceHandle& memoryAsset, bool) { GraphItemChangeCommand::Capture(memoryAsset, true); } diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h index e0f5adde7e..61102f690c 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h @@ -46,7 +46,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - virtual void Capture(ScriptCanvasMemoryAsset& memoryAsset, bool captureUndo); + virtual void Capture(SourceHandle& memoryAsset, bool captureUndo); bool Changed() const override; @@ -76,7 +76,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(ScriptCanvasMemoryAsset& memoryAsset, bool captureUndo) override; + void Capture(SourceHandle& memoryAsset, bool captureUndo) override; void RestoreItem(const AZStd::vector& restoreBuffer) override; @@ -103,7 +103,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(ScriptCanvasMemoryAsset& memoryAsset, bool captureUndo) override; + void Capture(SourceHandle& memoryAsset, bool captureUndo) override; protected: GraphItemAddCommand(const GraphItemAddCommand&) = delete; @@ -124,7 +124,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(ScriptCanvasMemoryAsset& memoryAsset, bool captureUndo) override; + void Capture(SourceHandle& memoryAsset, bool captureUndo) override; protected: GraphItemRemovalCommand(const GraphItemRemovalCommand&) = delete; diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasUndoManager.cpp b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasUndoManager.cpp index 4d24720227..5a01507352 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasUndoManager.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasUndoManager.cpp @@ -28,9 +28,9 @@ namespace ScriptCanvasEditor // SceneUndoState SceneUndoState::SceneUndoState(AzToolsFramework::UndoSystem::IUndoNotify* undoNotify) - : m_undoStack(AZStd::make_unique(c_undoLimit, undoNotify)) - , m_undoCache(AZStd::make_unique()) { + m_undoStack = AZStd::make_unique(c_undoLimit, undoNotify); + m_undoCache = AZStd::make_unique(); } void SceneUndoState::BeginUndoBatch(AZStd::string_view label) diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasUndoManager.h b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasUndoManager.h index 52d7b1de3e..1d207e9408 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasUndoManager.h +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasUndoManager.h @@ -61,6 +61,7 @@ namespace ScriptCanvasEditor public: AZ_CLASS_ALLOCATOR(SceneUndoState, AZ::SystemAllocator, 0); + SceneUndoState() = default; SceneUndoState(AzToolsFramework::UndoSystem::IUndoNotify* undoNotify); ~SceneUndoState(); From d8e531519961948ebab9f7d5e5731d4459649956 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Mon, 6 Dec 2021 13:37:29 -0800 Subject: [PATCH 088/399] Use weak reference for undo state, as it is an entirely internal class Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Editor/Assets/ScriptCanvasUndoHelper.cpp | 24 +++++++++---------- .../Editor/Assets/ScriptCanvasUndoHelper.h | 6 ++--- .../Code/Editor/Components/EditorGraph.cpp | 2 +- .../Editor/Undo/ScriptCanvasGraphCommand.cpp | 16 ++++++------- .../Editor/Undo/ScriptCanvasGraphCommand.h | 8 +++---- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp index 31bdf0077c..f125a4cbc9 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp @@ -18,10 +18,10 @@ namespace ScriptCanvasEditor { } - UndoHelper::UndoHelper(SourceHandle memoryAsset) + UndoHelper::UndoHelper(Graph* graph) : m_undoState(this) { - SetSource(memoryAsset); + SetSource(graph); } UndoHelper::~UndoHelper() @@ -29,10 +29,10 @@ namespace ScriptCanvasEditor UndoRequestBus::Handler::BusDisconnect(); } - void UndoHelper::SetSource(SourceHandle source) + void UndoHelper::SetSource(Graph* graph) { - m_memoryAsset = source; - UndoRequestBus::Handler::BusConnect(source.Get()->GetScriptCanvasId()); + m_graph = graph; + UndoRequestBus::Handler::BusConnect(graph->GetScriptCanvasId()); } ScriptCanvasEditor::UndoCache* UndoHelper::GetSceneUndoCache() @@ -42,8 +42,8 @@ namespace ScriptCanvasEditor ScriptCanvasEditor::UndoData UndoHelper::CreateUndoData() { - AZ::EntityId graphCanvasGraphId = m_memoryAsset.Get()->GetGraphCanvasGraphId(); - ScriptCanvas::ScriptCanvasId scriptCanvasId = m_memoryAsset.Get()->GetScriptCanvasId(); + AZ::EntityId graphCanvasGraphId = m_graph->GetGraphCanvasGraphId(); + ScriptCanvas::ScriptCanvasId scriptCanvasId = m_graph->GetScriptCanvasId(); GraphCanvas::GraphModelRequestBus::Event(graphCanvasGraphId, &GraphCanvas::GraphModelRequests::OnSaveDataDirtied, graphCanvasGraphId); @@ -94,22 +94,22 @@ namespace ScriptCanvasEditor void UndoHelper::AddGraphItemChangeUndo(AZStd::string_view undoLabel) { GraphItemChangeCommand* command = aznew GraphItemChangeCommand(undoLabel); - command->Capture(m_memoryAsset, true); - command->Capture(m_memoryAsset, false); + command->Capture(m_graph, true); + command->Capture(m_graph, false); AddUndo(command); } void UndoHelper::AddGraphItemAdditionUndo(AZStd::string_view undoLabel) { GraphItemAddCommand* command = aznew GraphItemAddCommand(undoLabel); - command->Capture(m_memoryAsset, false); + command->Capture(m_graph, false); AddUndo(command); } void UndoHelper::AddGraphItemRemovalUndo(AZStd::string_view undoLabel) { GraphItemRemovalCommand* command = aznew GraphItemRemovalCommand(undoLabel); - command->Capture(m_memoryAsset, true); + command->Capture(m_graph, true); AddUndo(command); } @@ -190,7 +190,7 @@ namespace ScriptCanvasEditor void UndoHelper::UpdateCache() { - ScriptCanvas::ScriptCanvasId scriptCanvasId = m_memoryAsset.Get()->GetScriptCanvasId(); + ScriptCanvas::ScriptCanvasId scriptCanvasId = m_graph->GetScriptCanvasId(); UndoCache* undoCache = nullptr; UndoRequestBus::EventResult(undoCache, scriptCanvasId, &UndoRequests::GetSceneUndoCache); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h index 3652b07686..e2d4f008fa 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h @@ -21,13 +21,13 @@ namespace ScriptCanvasEditor public: UndoHelper(); - UndoHelper(SourceHandle source); + UndoHelper(Graph* source); ~UndoHelper(); UndoCache* GetSceneUndoCache() override; UndoData CreateUndoData() override; - void SetSource(SourceHandle source); + void SetSource(Graph* source); void BeginUndoBatch(AZStd::string_view label) override; void EndUndoBatch() override; @@ -58,6 +58,6 @@ namespace ScriptCanvasEditor Status m_status = Status::Idle; SceneUndoState m_undoState; - SourceHandle m_memoryAsset; + Graph* m_graph = nullptr; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index a46b2a4a5c..b50457adbf 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -481,6 +481,7 @@ namespace ScriptCanvasEditor ScriptCanvas::Graph::Activate(); PostActivate(); + m_undoHelper.SetSource(this); } void Graph::Deactivate() @@ -1067,7 +1068,6 @@ namespace ScriptCanvasEditor void Graph::MarkOwnership(ScriptCanvas::ScriptCanvasData& owner) { m_owner = &owner; - m_undoHelper.SetSource(SourceHandle(GetOwnership(), {}, "")); } ScriptCanvas::DataPtr Graph::GetOwnership() const diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp index 406e139ef1..944a5e667d 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp @@ -36,7 +36,7 @@ namespace ScriptCanvasEditor { } - void GraphItemCommand::Capture(SourceHandle&, bool) + void GraphItemCommand::Capture(Graph*, bool) { } @@ -105,10 +105,10 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemChangeCommand::Capture(SourceHandle& memoryAsset, bool captureUndo) + void GraphItemChangeCommand::Capture(Graph* graph, bool captureUndo) { - m_scriptCanvasId = memoryAsset.Get()->GetScriptCanvasId(); - m_graphCanvasGraphId = memoryAsset.Get()->GetGraphCanvasGraphId(); + m_scriptCanvasId = graph->GetScriptCanvasId(); + m_graphCanvasGraphId = graph->GetGraphCanvasGraphId(); UndoCache* undoCache = nullptr; UndoRequestBus::EventResult(undoCache, m_scriptCanvasId, &UndoRequests::GetSceneUndoCache); @@ -204,9 +204,9 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemAddCommand::Capture(SourceHandle& memoryAsset, bool) + void GraphItemAddCommand::Capture(Graph* graph, bool) { - GraphItemChangeCommand::Capture(memoryAsset, false); + GraphItemChangeCommand::Capture(graph, false); } //// Graph Item Removal Command @@ -225,8 +225,8 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemRemovalCommand::Capture(SourceHandle& memoryAsset, bool) + void GraphItemRemovalCommand::Capture(Graph* graph, bool) { - GraphItemChangeCommand::Capture(memoryAsset, true); + GraphItemChangeCommand::Capture(graph, true); } } diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h index 61102f690c..b9435d0702 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h @@ -46,7 +46,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - virtual void Capture(SourceHandle& memoryAsset, bool captureUndo); + virtual void Capture(Graph* graph, bool captureUndo); bool Changed() const override; @@ -76,7 +76,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(SourceHandle& memoryAsset, bool captureUndo) override; + void Capture(Graph* graph, bool captureUndo) override; void RestoreItem(const AZStd::vector& restoreBuffer) override; @@ -103,7 +103,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(SourceHandle& memoryAsset, bool captureUndo) override; + void Capture(Graph* graph, bool captureUndo) override; protected: GraphItemAddCommand(const GraphItemAddCommand&) = delete; @@ -124,7 +124,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(SourceHandle& memoryAsset, bool captureUndo) override; + void Capture(Graph* graph, bool captureUndo) override; protected: GraphItemRemovalCommand(const GraphItemRemovalCommand&) = delete; From d284d908b9409df175207de45dba3eb41ff93b35 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 8 Dec 2021 16:11:38 -0800 Subject: [PATCH 089/399] Make version explorer wait on AP for dependent assets Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Builder/ScriptCanvasBuilderWorker.cpp | 3 +- ...ntReceiverEventNodeDescriptorComponent.cpp | 2 +- .../Code/Editor/View/Windows/MainWindow.cpp | 18 +- .../Windows/Tools/UpgradeTool/Controller.cpp | 5 + .../Windows/Tools/UpgradeTool/Controller.h | 3 +- .../Windows/Tools/UpgradeTool/ModelTraits.h | 2 + .../Windows/Tools/UpgradeTool/Modifier.cpp | 292 ++++++++++++++---- .../View/Windows/Tools/UpgradeTool/Modifier.h | 44 ++- .../Windows/Tools/UpgradeTool/Scanner.cpp | 4 +- .../Grammar/PrimitivesDeclarations.cpp | 1 + .../Grammar/PrimitivesDeclarations.h | 1 + 11 files changed, 293 insertions(+), 82 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index ac7bd4406a..6c35007987 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -281,7 +281,8 @@ namespace ScriptCanvasBuilder } else { - if (AzFramework::StringFunc::Find(fileNameOnly, s_unitTestParseErrorPrefix) != AZStd::string::npos) + if (!ScriptCanvas::Grammar::g_processingErrorsForUnitTestsEnabled + && AzFramework::StringFunc::Find(fileNameOnly, s_unitTestParseErrorPrefix) != AZStd::string::npos) { response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; } diff --git a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/ScriptEventReceiverEventNodeDescriptorComponent.cpp b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/ScriptEventReceiverEventNodeDescriptorComponent.cpp index ab231ae637..43bfc4b221 100644 --- a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/ScriptEventReceiverEventNodeDescriptorComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/ScriptEventReceiverEventNodeDescriptorComponent.cpp @@ -190,7 +190,7 @@ namespace ScriptCanvasEditor { scriptCanvasSlot = eventHandler->GetSlot(slotId); - int& index = (scriptCanvasSlot->IsData() && scriptCanvasSlot->IsInput()) ? paramIndex : outputIndex; + int& index = (scriptCanvasSlot && scriptCanvasSlot->IsData() && scriptCanvasSlot->IsInput()) ? paramIndex : outputIndex; if (scriptCanvasSlot && scriptCanvasSlot->IsVisible()) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index fa13681879..306068bd5c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1880,10 +1880,6 @@ namespace ScriptCanvasEditor void MainWindow::OnFileOpen() { - AZ::SerializeContext* serializeContext = nullptr; - EBUS_EVENT_RESULT(serializeContext, AZ::ComponentApplicationBus, GetSerializeContext); - AZ_Assert(serializeContext, "Failed to acquire application serialize context."); - AZStd::string assetRoot; { AZStd::array assetRootChar; @@ -1892,21 +1888,9 @@ namespace ScriptCanvasEditor } AZStd::string assetPath = AZStd::string::format("%s/scriptcanvas", assetRoot.c_str()); - - AZ::EBusAggregateResults> fileFilters; - AssetRegistryRequestBus::BroadcastResult(fileFilters, &AssetRegistryRequests::GetAssetHandlerFileFilters); - QString filter; - AZStd::set filterSet; - auto aggregateFilters = fileFilters.values; - for (auto aggregateFilters2 : fileFilters.values) - { - for (const AZStd::string& fileFilter : aggregateFilters2) - { - filterSet.insert(fileFilter); - } - } + AZStd::set filterSet { ".scriptcanvas" }; QStringList nameFilters; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp index b8ae59d43b..f14bc0f965 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp @@ -189,6 +189,11 @@ namespace ScriptCanvasEditor OnButtonPressUpgradeImplementation(info); } + void Controller::OnUpgradeDependencyWaitInterval([[maybe_unused]] const SourceHandle& info) + { + AddLogEntries(); + } + void Controller::OnUpgradeModificationBegin([[maybe_unused]] const ModifyConfiguration& config, const SourceHandle& info) { for (auto* item : FindTableItems(info)) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.h index 2d7b78060e..ab428c0ba3 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.h @@ -93,9 +93,10 @@ namespace ScriptCanvasEditor ( const ModifyConfiguration& config , const AZStd::vector& assets , const AZStd::vector& sortedOrder) override; + void OnUpgradeDependencyWaitInterval(const SourceHandle& info) override; void OnUpgradeModificationBegin(const ModifyConfiguration& config, const SourceHandle& info) override; void OnUpgradeModificationEnd(const ModifyConfiguration& config, const SourceHandle& info, ModificationResult result) override; - + void SetLoggingPreferences(); void SetSpinnerIsBusy(bool isBusy); void SetRowBusy(int index); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/ModelTraits.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/ModelTraits.h index 4ab9015a6c..9351d8c26c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/ModelTraits.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/ModelTraits.h @@ -22,6 +22,7 @@ namespace ScriptCanvasEditor SourceHandle modifySingleAsset; bool backupGraphBeforeModification = false; bool successfulDependencyUpgradeRequired = true; + AZ::s32 perDependencyWaitSecondsMax = 20; }; struct ModificationResult @@ -98,6 +99,7 @@ namespace ScriptCanvasEditor ( const ModifyConfiguration& config , const AZStd::vector& assets , const AZStd::vector& sortedOrder) = 0; + virtual void OnUpgradeDependencyWaitInterval(const SourceHandle& info) = 0; virtual void OnUpgradeModificationBegin(const ModifyConfiguration& config, const SourceHandle& info) = 0; virtual void OnUpgradeModificationEnd(const ModifyConfiguration& config, const SourceHandle& info, ModificationResult result) = 0; }; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index 3c8605e915..e46f0ada24 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -30,38 +30,141 @@ namespace ScriptCanvasEditor AZ_Assert(m_config.modification, "No modification function provided"); ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeBegin, modification, m_assets); AZ::SystemTickBus::Handler::BusConnect(); + AzFramework::AssetSystemInfoBus::Handler::BusConnect(); + AzFramework::AssetSystemInfoBus::Handler::BusConnect(); + m_result.asset = m_assets[GetCurrentIndex()]; } - size_t Modifier::GetCurrentIndex() const + Modifier::~Modifier() { - return m_state == State::GatheringDependencies - ? m_assetIndex - : m_dependencyOrderedAssetIndicies[m_assetIndex]; + AzFramework::AssetSystemInfoBus::Handler::BusDisconnect(); + AzFramework::AssetSystemInfoBus::Handler::BusDisconnect(); + } + bool Modifier::AllDependenciesCleared(const AZStd::unordered_set& dependencies) const + { + for (auto index : dependencies) + { + SourceHandle dependency = m_assets[index]; + CompleteDescriptionInPlace(dependency); + + if (dependency.Id().IsNull() || !m_assetsCompletedByAP.contains(dependency.Id())) + { + return false; + } + } + + return true; } - AZStd::unordered_set& Modifier::GetOrCreateDependencyIndexSet() + bool Modifier::AnyDependenciesFailed(const AZStd::unordered_set& dependencies) const { - auto iter = m_dependencies.find(m_assetIndex); - if (iter == m_dependencies.end()) + for (auto index : dependencies) { - iter = m_dependencies.insert_or_assign(m_assetIndex, AZStd::unordered_set()).first; + SourceHandle dependency = m_assets[index]; + CompleteDescriptionInPlace(dependency); + + if (dependency.Id().IsNull() || m_assetsFailedByAP.contains(dependency.Id())) + { + return true; + } } - return iter->second; + return false; } - const ModificationResults& Modifier::GetResult() const + AZStd::sys_time_t Modifier::CalculateRemainingWaitTime(const AZStd::unordered_set& dependencies) const { - return m_results; + auto maxSeconds = AZStd::chrono::seconds(dependencies.size() * m_config.perDependencyWaitSecondsMax); + auto waitedSeconds = AZStd::chrono::seconds(AZStd::chrono::system_clock::now() - m_waitTimeStamp); + return (maxSeconds - waitedSeconds).count(); + } + + void Modifier::SourceFileChanged(AZStd::string relativePath, [[maybe_unused]] AZStd::string scanFolder, [[maybe_unused]] AZ::Uuid fileAssetId) + { + AZ_TracePrintf("SC", "received SourceFileChanged: %s", relativePath.c_str()); + VE_LOG("received SourceFileChanged: %s", relativePath.c_str()); + } + + void Modifier::SourceFileFailed(AZStd::string relativePath, [[maybe_unused]] AZStd::string scanFolder, [[maybe_unused]] AZ::Uuid fileAssetId) + { + AZ_TracePrintf("SC", "received SourceFileFailed: %s", relativePath.c_str()); + VE_LOG("received SourceFileFailed: %s", relativePath.c_str()); + } + + void Modifier::ProcessNotifications() + { + AZStd::lock_guard lock(m_mutex); + + for (const auto& assetPath : m_successNotifications) + { + VE_LOG("received AssetCompilationSuccess: %s", assetPath.c_str()); + SourceHandle sourceHandle(nullptr, {}, assetPath.c_str()); + CompleteDescriptionInPlace(sourceHandle); + + if (m_attemptedAssets.contains(sourceHandle.Id())) + { + m_assetsCompletedByAP.insert(sourceHandle.Id()); + } + } + + m_successNotifications.clear(); + + for (const auto& assetPath : m_failureNotifications) + { + VE_LOG("received AssetCompilationFailed: %s", assetPath.c_str()); + SourceHandle sourceHandle(nullptr, {}, assetPath.c_str()); + CompleteDescriptionInPlace(sourceHandle); + + if (m_attemptedAssets.contains(sourceHandle.Id())) + { + m_assetsFailedByAP.insert(sourceHandle.Id()); + } + } + + m_failureNotifications.clear(); + } + + void Modifier::AssetCompilationSuccess([[maybe_unused]] const AZStd::string& assetPath) + { + AZStd::lock_guard lock(m_mutex); + // test failure path m_successNotifications.insert(assetPath); + m_failureNotifications.insert(assetPath); + } + + void Modifier::AssetCompilationFailed(const AZStd::string& assetPath) + { + AZStd::lock_guard lock(m_mutex); + m_failureNotifications.insert(assetPath); + } + + void Modifier::CheckDependencies() + { + ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, m_result.asset); + + if (auto dependencies = GetDependencies(GetCurrentIndex()); dependencies != nullptr && !dependencies->empty()) + { + VE_LOG + ( "dependencies found for %s, update will wait for the AP to finish processing them" + , m_result.asset.Path().c_str()); + + m_waitTimeStamp = AZStd::chrono::system_clock::now(); + m_waitLogTimeStamp = AZStd::chrono::system_clock::time_point{}; + m_modifyState = ModifyState::WaitingForDependencyProcessing; + } + else + { + m_modifyState = ModifyState::StartModification; + } } - + void Modifier::GatherDependencies() { AZ::SerializeContext* serializeContext{}; AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationBus::Events::GetSerializeContext); AZ_Assert(serializeContext, "SerializeContext is required to enumerate dependent assets in the ScriptCanvas file"); + LoadAsset(); bool anyFailures = false; if (m_result.asset.Get() && m_result.asset.Mod()->GetGraphData()) @@ -101,7 +204,7 @@ namespace ScriptCanvasEditor , nullptr)) { anyFailures = true; - VE_LOG("Modifier: ERROR - Failed to gather dependencies from graph data: %s" + VE_LOG("Modifier: ERROR - Failed to gather dependencies from graph data: %s" , m_result.asset.Path().c_str()) } } @@ -111,16 +214,40 @@ namespace ScriptCanvasEditor VE_LOG("Modifier: ERROR - Failed to load asset %s for modification, even though it scanned properly" , m_result.asset.Path().c_str()); } - + ModelNotificationsBus::Broadcast ( &ModelNotificationsTraits::OnUpgradeDependenciesGathered , m_result.asset , anyFailures ? Result::Failure : Result::Success); + } - ReleaseCurrentAsset(); + size_t Modifier::GetCurrentIndex() const + { + return m_state == State::GatheringDependencies + ? m_assetIndex + : m_dependencyOrderedAssetIndicies[m_assetIndex]; + } - // Flush asset database events to ensure no asset references are held by closures queued on Ebuses. - AZ::Data::AssetManager::Instance().DispatchEvents(); + const AZStd::unordered_set* Modifier::GetDependencies(size_t index) const + { + auto iter = m_dependencies.find(index); + return iter != m_dependencies.end() ? &iter->second : nullptr; + } + + AZStd::unordered_set& Modifier::GetOrCreateDependencyIndexSet() + { + auto iter = m_dependencies.find(m_assetIndex); + if (iter == m_dependencies.end()) + { + iter = m_dependencies.insert_or_assign(m_assetIndex, AZStd::unordered_set()).first; + } + + return iter->second; + } + + const ModificationResults& Modifier::GetResult() const + { + return m_results; } void Modifier::LoadAsset() @@ -144,7 +271,7 @@ namespace ScriptCanvasEditor } else if (m_result.asset.Describe() != result.asset.Describe()) { - ReportModificationError("Received modifiction complete notification for different result"); + ReportModificationError("Received modification complete notification for different result"); } else { @@ -154,9 +281,6 @@ namespace ScriptCanvasEditor void Modifier::ModifyCurrentAsset() { - m_result = {}; - m_result.asset = m_assets[GetCurrentIndex()]; - ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, m_result.asset); LoadAsset(); if (m_result.asset.IsGraphValid()) @@ -171,34 +295,55 @@ namespace ScriptCanvasEditor } } - void Modifier::ModifyNextAsset() + void Modifier::InitializeResult() { - ModelNotificationsBus::Broadcast - ( &ModelNotificationsTraits::OnUpgradeModificationEnd, m_config, m_result.asset, m_result); + m_result = {}; + + if (m_assetIndex != m_assets.size()) + { + m_result.asset = m_assets[GetCurrentIndex()]; + CompleteDescriptionInPlace(m_result.asset); + m_attemptedAssets.insert(m_result.asset.Id()); + } + } + + void Modifier::NextAsset() + { + ++m_assetIndex; + InitializeResult(); + } + + void Modifier::NextModification() + { + ModelNotificationsBus::Broadcast( &ModelNotificationsTraits::OnUpgradeModificationEnd, m_config, m_result.asset, m_result); ModificationNotificationsBus::Handler::BusDisconnect(); + NextAsset(); + m_fileSaveResult = {}; m_modifyState = ModifyState::Idle; - ReleaseCurrentAsset(); - ++m_assetIndex; - m_result = {}; } void Modifier::ReleaseCurrentAsset() { m_result.asset = m_result.asset.Describe(); + // Flush asset database events to ensure no asset references are held by closures queued on Ebuses. + AZ::Data::AssetManager::Instance().DispatchEvents(); } void Modifier::ReportModificationError(AZStd::string_view report) { m_result.errorMessage = report; m_results.m_failures.push_back({ m_result.asset.Describe(), report }); - ModifyNextAsset(); + m_assetsFailedByAP.insert(m_result.asset.Id()); + NextModification(); } void Modifier::ReportModificationSuccess() { - m_result.asset = m_result.asset.Describe(); + // \note DO NOT put asset into the m_assetsCompletedByAP here. That can only be done when the message is received by the AP m_results.m_successes.push_back({ m_result.asset.Describe(), {} }); - ModifyNextAsset(); + AzFramework::AssetSystemRequestBus::Broadcast( + &AzFramework::AssetSystem::AssetSystemRequests::EscalateAssetByUuid, m_result.asset.Id()); + NextModification(); } void Modifier::ReportSaveResult() @@ -214,9 +359,6 @@ namespace ScriptCanvasEditor { ReportModificationError(m_fileSaveResult.fileSaveError); } - - m_fileSaveResult = {}; - m_modifyState = ModifyState::Idle; } void Modifier::OnFileSaveComplete(const FileSaveResult& result) @@ -316,49 +458,87 @@ namespace ScriptCanvasEditor m_assetIndex = 0; m_state = State::ModifyingGraphs; + InitializeResult(); } else { GatherDependencies(); - ReleaseCurrentAsset(); - ++m_assetIndex; + NextAsset(); } } void Modifier::TickUpdateGraph() { - if (m_assetIndex == m_assets.size()) + AZStd::lock_guard lock(m_mutex); + + switch (m_modifyState) { - VE_LOG("Modifier: Complete."); - AZ::SystemTickBus::Handler::BusDisconnect(); + case ScriptCanvasEditor::VersionExplorer::Modifier::ModifyState::Idle: + if (m_assetIndex == m_assets.size()) + { + VE_LOG("Modifier: Complete."); + AZ::SystemTickBus::Handler::BusDisconnect(); - if (m_onComplete) + if (m_onComplete) + { + m_onComplete(); + } + } + else { - m_onComplete(); + CheckDependencies(); } + break; + case ScriptCanvasEditor::VersionExplorer::Modifier::ModifyState::WaitingForDependencyProcessing: + WaitForDependencies(); + break; + case ScriptCanvasEditor::VersionExplorer::Modifier::ModifyState::StartModification: + ModifyCurrentAsset(); + break; + case ScriptCanvasEditor::VersionExplorer::Modifier::ModifyState::ReportResult: + ReportSaveResult(); + break; + default: + break; } - else + } + + void Modifier::WaitForDependencies() + { + const AZ::s32 LogPeriodSeconds = 5; + + ProcessNotifications(); + + auto dependencies = GetDependencies(GetCurrentIndex()); + if (dependencies == nullptr || dependencies->empty() || AllDependenciesCleared(*dependencies)) + { + m_modifyState = ModifyState::StartModification; + } + else if (AnyDependenciesFailed(*dependencies)) + { + ReportModificationError("A required dependency failed to update, graph cannot update."); + } + else if (AZStd::chrono::seconds(CalculateRemainingWaitTime(*dependencies)).count() < 0) + { + ReportModificationError("Dependency update time has taken too long, aborting modification."); + } + else if (AZStd::chrono::seconds(AZStd::chrono::system_clock::now() - m_waitLogTimeStamp).count() > LogPeriodSeconds) { - AZStd::lock_guard lock(m_mutex); + m_waitLogTimeStamp = AZStd::chrono::system_clock::now(); - switch (m_modifyState) - { - case ScriptCanvasEditor::VersionExplorer::Modifier::ModifyState::Idle: - ModifyCurrentAsset(); - break; - case ScriptCanvasEditor::VersionExplorer::Modifier::ModifyState::ReportResult: - ReportSaveResult(); - break; - default: - break; - } + AZ_TracePrintf + ( ScriptCanvas::k_VersionExplorerWindow.data() + , "Waiting for dependencies for %d more seconds: %s" + , AZStd::chrono::seconds(CalculateRemainingWaitTime(*dependencies)).count() + , m_result.asset.Path().c_str()); + + ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeDependencyWaitInterval, m_result.asset); } } const AZStd::unordered_set* Modifier::Sorter::GetDependencies(size_t index) const { - auto iter = modifier->m_dependencies.find(index); - return iter != modifier->m_dependencies.end() ? &iter->second : nullptr; + return modifier->GetDependencies(index); } void Modifier::Sorter::Sort() @@ -379,7 +559,7 @@ namespace ScriptCanvasEditor if (markedTemporary.contains(index)) { AZ_Error - (ScriptCanvas::k_VersionExplorerWindow.data() + ( ScriptCanvas::k_VersionExplorerWindow.data() , false , "Modifier: Dependency sort has failed during, circular dependency detected for Asset: %s" , modifier->m_result.asset.Path().c_str()); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h index 32b9253bb5..4e0718f6a1 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h @@ -9,17 +9,23 @@ #pragma once #include +#include #include #include #include +// probably not needed if using the asset system bus +#include + namespace ScriptCanvasEditor { namespace VersionExplorer { - class Modifier - : private AZ::SystemTickBus::Handler - , private ModificationNotificationsBus::Handler + class Modifier final + : public AZ::SystemTickBus::Handler + , public ModificationNotificationsBus::Handler + , public AzToolsFramework::AssetSystemBus::Handler + , public AzFramework::AssetSystemInfoBus::Handler { public: AZ_CLASS_ALLOCATOR(Modifier, AZ::SystemAllocator, 0); @@ -29,6 +35,8 @@ namespace ScriptCanvasEditor , AZStd::vector&& assets , AZStd::function onComplete); + virtual ~Modifier(); + const ModificationResults& GetResult() const; ModificationResults&& TakeResult(); @@ -56,6 +64,8 @@ namespace ScriptCanvasEditor enum class ModifyState { Idle, + WaitingForDependencyProcessing, + StartModification, InProgress, Saving, ReportResult @@ -82,13 +92,27 @@ namespace ScriptCanvasEditor ModificationResults m_results; AZStd::unique_ptr m_fileSaver; FileSaveResult m_fileSaveResult; + AZStd::unordered_set m_attemptedAssets; + AZStd::unordered_set m_assetsCompletedByAP; + AZStd::unordered_set m_assetsFailedByAP; + AZStd::chrono::system_clock::time_point m_waitLogTimeStamp; + AZStd::chrono::system_clock::time_point m_waitTimeStamp; + AZStd::unordered_set m_successNotifications; + AZStd::unordered_set m_failureNotifications; - size_t GetCurrentIndex() const; + bool AllDependenciesCleared(const AZStd::unordered_set& dependencies) const; + bool AnyDependenciesFailed(const AZStd::unordered_set& dependencies) const; + AZStd::sys_time_t CalculateRemainingWaitTime(const AZStd::unordered_set& dependencies) const; + void CheckDependencies(); void GatherDependencies(); + size_t GetCurrentIndex() const; + const AZStd::unordered_set* GetDependencies(size_t index) const; AZStd::unordered_set& GetOrCreateDependencyIndexSet(); + void InitializeResult(); void LoadAsset(); void ModifyCurrentAsset(); - void ModifyNextAsset(); + void NextAsset(); + void NextModification(); void ModificationComplete(const ModificationResult& result) override; void ReleaseCurrentAsset(); void ReportModificationError(AZStd::string_view report); @@ -96,10 +120,20 @@ namespace ScriptCanvasEditor void ReportSaveResult(); void SaveModifiedGraph(const ModificationResult& result); void SortGraphsByDependencies(); + + + /// use all this to track the success of dependencies + void SourceFileChanged(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; + void SourceFileFailed(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; + void AssetCompilationSuccess(const AZStd::string& assetPath) override; + void AssetCompilationFailed(const AZStd::string& assetPath) override; + void ProcessNotifications(); + void OnFileSaveComplete(const FileSaveResult& result); void OnSystemTick() override; void TickGatherDependencies(); void TickUpdateGraph(); + void WaitForDependencies(); }; } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp index 816ded8a7b..c1551af9f9 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp @@ -81,7 +81,9 @@ namespace ScriptCanvasEditor void Scanner::FilterAsset(SourceHandle asset) { - if (m_config.filter && m_config.filter(asset) == ScanConfiguration::Filter::Exclude) + AZStd::string name = asset.Path().c_str(); + + if ((m_config.filter && m_config.filter(asset) == ScanConfiguration::Filter::Exclude) || !name.contains("LY_SC_UnitTest_FunctionContainer")) { VE_LOG("Scanner: Excluded: %s ", ModCurrentAsset().Path().c_str()); m_result.m_filteredAssets.push_back(ModCurrentAsset().Describe()); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp index 14f7a926b1..52f00af6c2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp @@ -15,6 +15,7 @@ namespace ScriptCanvas AZ_CVAR(bool, g_disableParseOnGraphValidation, false, {}, AZ::ConsoleFunctorFlags::Null, "In case parsing the graph is interfering with opening a graph, disable parsing on validation"); AZ_CVAR(bool, g_printAbstractCodeModel, true, {}, AZ::ConsoleFunctorFlags::Null, "Print out the Abstract Code Model at the end of parsing for debug purposes."); AZ_CVAR(bool, g_printAbstractCodeModelAtPrefabTime, false, {}, AZ::ConsoleFunctorFlags::Null, "Print out the Abstract Code Model at the end of parsing (at prefab time) for debug purposes."); + AZ_CVAR(bool, g_processingErrorsForUnitTestsEnabled, false, {}, AZ::ConsoleFunctorFlags::Null, "Enable AP processing errors on parse failure for unit tests."); AZ_CVAR(bool, g_saveRawTranslationOuputToFile, true, {}, AZ::ConsoleFunctorFlags::Null, "Save out the raw result of translation for debug purposes."); AZ_CVAR(bool, g_saveRawTranslationOuputToFileAtPrefabTime, false, {}, AZ::ConsoleFunctorFlags::Null, "Save out the raw result of translation (at prefab time) for debug purposes."); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h index a6ce31d6e7..3caec6ddb5 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h @@ -245,6 +245,7 @@ namespace ScriptCanvas AZ_CVAR_EXTERNED(bool, g_disableParseOnGraphValidation); AZ_CVAR_EXTERNED(bool, g_printAbstractCodeModel); AZ_CVAR_EXTERNED(bool, g_printAbstractCodeModelAtPrefabTime); + AZ_CVAR_EXTERNED(bool, g_processingErrorsForUnitTestsEnabled); AZ_CVAR_EXTERNED(bool, g_saveRawTranslationOuputToFile); AZ_CVAR_EXTERNED(bool, g_saveRawTranslationOuputToFileAtPrefabTime); From 169416c2f947e9f9c818eafe10066170ecd4d6f1 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 8 Dec 2021 16:31:08 -0800 Subject: [PATCH 090/399] remove testing code Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp | 2 ++ .../Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp | 3 +-- .../Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp index f14bc0f965..b666ef32f5 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp @@ -216,6 +216,8 @@ namespace ScriptCanvasEditor else { VE_LOG("Failed to modify %s: %s", result.asset.Path().c_str(), result.errorMessage.data()); + AZ_Warning(ScriptCanvas::k_VersionExplorerWindow.data() + , false, "Failed to modify %s: %s", result.asset.Path().c_str(), result.errorMessage.data()); } for (auto* item : FindTableItems(info)) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index e46f0ada24..a5515248e5 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -128,8 +128,7 @@ namespace ScriptCanvasEditor void Modifier::AssetCompilationSuccess([[maybe_unused]] const AZStd::string& assetPath) { AZStd::lock_guard lock(m_mutex); - // test failure path m_successNotifications.insert(assetPath); - m_failureNotifications.insert(assetPath); + m_successNotifications.insert(assetPath); } void Modifier::AssetCompilationFailed(const AZStd::string& assetPath) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp index c1551af9f9..061025faf5 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp @@ -83,7 +83,7 @@ namespace ScriptCanvasEditor { AZStd::string name = asset.Path().c_str(); - if ((m_config.filter && m_config.filter(asset) == ScanConfiguration::Filter::Exclude) || !name.contains("LY_SC_UnitTest_FunctionContainer")) + if (m_config.filter && m_config.filter(asset) == ScanConfiguration::Filter::Exclude) { VE_LOG("Scanner: Excluded: %s ", ModCurrentAsset().Path().c_str()); m_result.m_filteredAssets.push_back(ModCurrentAsset().Describe()); From ac6c90cd2cc86bd9c1aae14d08f0c5d8dc3b07e3 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 8 Dec 2021 17:32:57 -0800 Subject: [PATCH 091/399] pre-PR cleanup Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Windows/Tools/UpgradeTool/Modifier.cpp | 184 ++++++++---------- .../View/Windows/Tools/UpgradeTool/Modifier.h | 25 +-- .../Windows/Tools/UpgradeTool/Scanner.cpp | 2 - 3 files changed, 93 insertions(+), 118 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index a5515248e5..14b292e489 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -31,14 +31,12 @@ namespace ScriptCanvasEditor ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeBegin, modification, m_assets); AZ::SystemTickBus::Handler::BusConnect(); AzFramework::AssetSystemInfoBus::Handler::BusConnect(); - AzFramework::AssetSystemInfoBus::Handler::BusConnect(); m_result.asset = m_assets[GetCurrentIndex()]; } Modifier::~Modifier() { AzFramework::AssetSystemInfoBus::Handler::BusDisconnect(); - AzFramework::AssetSystemInfoBus::Handler::BusDisconnect(); } bool Modifier::AllDependenciesCleared(const AZStd::unordered_set& dependencies) const @@ -73,58 +71,6 @@ namespace ScriptCanvasEditor return false; } - AZStd::sys_time_t Modifier::CalculateRemainingWaitTime(const AZStd::unordered_set& dependencies) const - { - auto maxSeconds = AZStd::chrono::seconds(dependencies.size() * m_config.perDependencyWaitSecondsMax); - auto waitedSeconds = AZStd::chrono::seconds(AZStd::chrono::system_clock::now() - m_waitTimeStamp); - return (maxSeconds - waitedSeconds).count(); - } - - void Modifier::SourceFileChanged(AZStd::string relativePath, [[maybe_unused]] AZStd::string scanFolder, [[maybe_unused]] AZ::Uuid fileAssetId) - { - AZ_TracePrintf("SC", "received SourceFileChanged: %s", relativePath.c_str()); - VE_LOG("received SourceFileChanged: %s", relativePath.c_str()); - } - - void Modifier::SourceFileFailed(AZStd::string relativePath, [[maybe_unused]] AZStd::string scanFolder, [[maybe_unused]] AZ::Uuid fileAssetId) - { - AZ_TracePrintf("SC", "received SourceFileFailed: %s", relativePath.c_str()); - VE_LOG("received SourceFileFailed: %s", relativePath.c_str()); - } - - void Modifier::ProcessNotifications() - { - AZStd::lock_guard lock(m_mutex); - - for (const auto& assetPath : m_successNotifications) - { - VE_LOG("received AssetCompilationSuccess: %s", assetPath.c_str()); - SourceHandle sourceHandle(nullptr, {}, assetPath.c_str()); - CompleteDescriptionInPlace(sourceHandle); - - if (m_attemptedAssets.contains(sourceHandle.Id())) - { - m_assetsCompletedByAP.insert(sourceHandle.Id()); - } - } - - m_successNotifications.clear(); - - for (const auto& assetPath : m_failureNotifications) - { - VE_LOG("received AssetCompilationFailed: %s", assetPath.c_str()); - SourceHandle sourceHandle(nullptr, {}, assetPath.c_str()); - CompleteDescriptionInPlace(sourceHandle); - - if (m_attemptedAssets.contains(sourceHandle.Id())) - { - m_assetsFailedByAP.insert(sourceHandle.Id()); - } - } - - m_failureNotifications.clear(); - } - void Modifier::AssetCompilationSuccess([[maybe_unused]] const AZStd::string& assetPath) { AZStd::lock_guard lock(m_mutex); @@ -137,6 +83,13 @@ namespace ScriptCanvasEditor m_failureNotifications.insert(assetPath); } + AZStd::sys_time_t Modifier::CalculateRemainingWaitTime(const AZStd::unordered_set& dependencies) const + { + auto maxSeconds = AZStd::chrono::seconds(dependencies.size() * m_config.perDependencyWaitSecondsMax); + auto waitedSeconds = AZStd::chrono::seconds(AZStd::chrono::system_clock::now() - m_waitTimeStamp); + return (maxSeconds - waitedSeconds).count(); + } + void Modifier::CheckDependencies() { ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, m_result.asset); @@ -249,6 +202,18 @@ namespace ScriptCanvasEditor return m_results; } + void Modifier::InitializeResult() + { + m_result = {}; + + if (m_assetIndex != m_assets.size()) + { + m_result.asset = m_assets[GetCurrentIndex()]; + CompleteDescriptionInPlace(m_result.asset); + m_attemptedAssets.insert(m_result.asset.Id()); + } + } + void Modifier::LoadAsset() { auto& handle = m_result.asset; @@ -294,18 +259,6 @@ namespace ScriptCanvasEditor } } - void Modifier::InitializeResult() - { - m_result = {}; - - if (m_assetIndex != m_assets.size()) - { - m_result.asset = m_assets[GetCurrentIndex()]; - CompleteDescriptionInPlace(m_result.asset); - m_attemptedAssets.insert(m_result.asset.Id()); - } - } - void Modifier::NextAsset() { ++m_assetIndex; @@ -321,6 +274,72 @@ namespace ScriptCanvasEditor m_modifyState = ModifyState::Idle; } + void Modifier::OnFileSaveComplete(const FileSaveResult& result) + { + if (!result.tempFileRemovalError.empty()) + { + VE_LOG + ("Temporary file not removed for %s: %s" + , m_result.asset.Path().c_str() + , result.tempFileRemovalError.c_str()); + } + + AZStd::lock_guard lock(m_mutex); + m_modifyState = ModifyState::ReportResult; + m_fileSaver.reset(); + m_fileSaveResult = result; + } + + void Modifier::OnSystemTick() + { + switch (m_state) + { + case State::GatheringDependencies: + TickGatherDependencies(); + break; + + case State::ModifyingGraphs: + TickUpdateGraph(); + break; + } + + AZ::Data::AssetManager::Instance().DispatchEvents(); + AZ::SystemTickBus::ExecuteQueuedEvents(); + } + + void Modifier::ProcessNotifications() + { + AZStd::lock_guard lock(m_mutex); + + for (const auto& assetPath : m_successNotifications) + { + VE_LOG("received AssetCompilationSuccess: %s", assetPath.c_str()); + SourceHandle sourceHandle(nullptr, {}, assetPath.c_str()); + CompleteDescriptionInPlace(sourceHandle); + + if (m_attemptedAssets.contains(sourceHandle.Id())) + { + m_assetsCompletedByAP.insert(sourceHandle.Id()); + } + } + + m_successNotifications.clear(); + + for (const auto& assetPath : m_failureNotifications) + { + VE_LOG("received AssetCompilationFailed: %s", assetPath.c_str()); + SourceHandle sourceHandle(nullptr, {}, assetPath.c_str()); + CompleteDescriptionInPlace(sourceHandle); + + if (m_attemptedAssets.contains(sourceHandle.Id())) + { + m_assetsFailedByAP.insert(sourceHandle.Id()); + } + } + + m_failureNotifications.clear(); + } + void Modifier::ReleaseCurrentAsset() { m_result.asset = m_result.asset.Describe(); @@ -360,39 +379,6 @@ namespace ScriptCanvasEditor } } - void Modifier::OnFileSaveComplete(const FileSaveResult& result) - { - if (!result.tempFileRemovalError.empty()) - { - VE_LOG - ( "Temporary file not removed for %s: %s" - , m_result.asset.Path().c_str() - , result.tempFileRemovalError.c_str()); - } - - AZStd::lock_guard lock(m_mutex); - m_modifyState = ModifyState::ReportResult; - m_fileSaver.reset(); - m_fileSaveResult = result; - } - - void Modifier::OnSystemTick() - { - switch (m_state) - { - case State::GatheringDependencies: - TickGatherDependencies(); - break; - - case State::ModifyingGraphs: - TickUpdateGraph(); - break; - } - - AZ::Data::AssetManager::Instance().DispatchEvents(); - AZ::SystemTickBus::ExecuteQueuedEvents(); - } - void Modifier::SaveModifiedGraph(const ModificationResult& result) { m_modifyState = ModifyState::Saving; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h index 4e0718f6a1..699287dd48 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h @@ -14,9 +14,6 @@ #include #include -// probably not needed if using the asset system bus -#include - namespace ScriptCanvasEditor { namespace VersionExplorer @@ -24,7 +21,6 @@ namespace ScriptCanvasEditor class Modifier final : public AZ::SystemTickBus::Handler , public ModificationNotificationsBus::Handler - , public AzToolsFramework::AssetSystemBus::Handler , public AzFramework::AssetSystemInfoBus::Handler { public: @@ -86,12 +82,13 @@ namespace ScriptCanvasEditor // dependency indices by asset info index (only exist if graphs have them) AZStd::unordered_map> m_dependencies; AZStd::unordered_map m_assetInfoIndexById; - AZStd::vector m_failures; ModifyConfiguration m_config; ModificationResult m_result; ModificationResults m_results; AZStd::unique_ptr m_fileSaver; FileSaveResult m_fileSaveResult; + // m_attemptedAssets is assets attempted to be processed by modification, as opposed to + // those processed by the AP as a result of one of their dependencies being processed. AZStd::unordered_set m_attemptedAssets; AZStd::unordered_set m_assetsCompletedByAP; AZStd::unordered_set m_assetsFailedByAP; @@ -102,6 +99,8 @@ namespace ScriptCanvasEditor bool AllDependenciesCleared(const AZStd::unordered_set& dependencies) const; bool AnyDependenciesFailed(const AZStd::unordered_set& dependencies) const; + void AssetCompilationSuccess(const AZStd::string& assetPath) override; + void AssetCompilationFailed(const AZStd::string& assetPath) override; AZStd::sys_time_t CalculateRemainingWaitTime(const AZStd::unordered_set& dependencies) const; void CheckDependencies(); void GatherDependencies(); @@ -110,27 +109,19 @@ namespace ScriptCanvasEditor AZStd::unordered_set& GetOrCreateDependencyIndexSet(); void InitializeResult(); void LoadAsset(); + void ModificationComplete(const ModificationResult& result) override; void ModifyCurrentAsset(); void NextAsset(); void NextModification(); - void ModificationComplete(const ModificationResult& result) override; + void OnFileSaveComplete(const FileSaveResult& result); + void OnSystemTick() override; + void ProcessNotifications(); void ReleaseCurrentAsset(); void ReportModificationError(AZStd::string_view report); void ReportModificationSuccess(); void ReportSaveResult(); void SaveModifiedGraph(const ModificationResult& result); void SortGraphsByDependencies(); - - - /// use all this to track the success of dependencies - void SourceFileChanged(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; - void SourceFileFailed(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; - void AssetCompilationSuccess(const AZStd::string& assetPath) override; - void AssetCompilationFailed(const AZStd::string& assetPath) override; - void ProcessNotifications(); - - void OnFileSaveComplete(const FileSaveResult& result); - void OnSystemTick() override; void TickGatherDependencies(); void TickUpdateGraph(); void WaitForDependencies(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp index 061025faf5..816ded8a7b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp @@ -81,8 +81,6 @@ namespace ScriptCanvasEditor void Scanner::FilterAsset(SourceHandle asset) { - AZStd::string name = asset.Path().c_str(); - if (m_config.filter && m_config.filter(asset) == ScanConfiguration::Filter::Exclude) { VE_LOG("Scanner: Excluded: %s ", ModCurrentAsset().Path().c_str()); From 0f07de7454d1d491cbbb0803a1adaebae96ad9e1 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 8 Dec 2021 17:44:01 -0800 Subject: [PATCH 092/399] fix verbose setting Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Editor/Include/ScriptCanvas/Components/GraphUpgrade.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h index 0e6e69c4bf..8a28059753 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h @@ -102,9 +102,6 @@ namespace ScriptCanvasEditor void Log(const char* format, ...); private: - - bool m_verbose = true; - StateMachine* m_stateMachine; }; @@ -363,7 +360,7 @@ namespace ScriptCanvasEditor template void ScriptCanvasEditor::State::Log(const char* format, ...) { - if (m_verbose) + if (GetVerbose()) { char sBuffer[2048]; va_list ArgList; From aeabf21bba7819684adf5bce587d186509a9fc1d Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 8 Dec 2021 18:52:24 -0800 Subject: [PATCH 093/399] clean up debug output settings Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h | 2 +- .../Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp | 2 ++ .../Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h index 8a28059753..9fedc2d1f3 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h @@ -360,7 +360,7 @@ namespace ScriptCanvasEditor template void ScriptCanvasEditor::State::Log(const char* format, ...) { - if (GetVerbose()) + if (m_stateMachine->GetVerbose()) { char sBuffer[2048]; va_list ArgList; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp index 86a1c1f42e..5df1e32c8f 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp @@ -145,6 +145,7 @@ namespace ScriptCanvasEditor } Idle(); + RestoreSettings(); } void Model::OnScanComplete() @@ -161,6 +162,7 @@ namespace ScriptCanvasEditor return; } + CacheSettings(); m_state = State::Scanning; m_log.Activate(); m_keepEditorAlive = AZStd::make_unique(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp index 7d76dbc27d..829a1098dc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp @@ -2384,9 +2384,8 @@ namespace ScriptCanvas AZ_TracePrintf("ScriptCanvas", "%s", pretty.data()); AZ_TracePrintf("ScriptCanvas", "SubgraphInterface:"); AZ_TracePrintf("ScriptCanvas", ToString(m_subgraphInterface).data()); + AZ_TracePrintf("Script Canvas", "Parse Duration: %8.4f ms\n", m_parseDuration / 1000.0); } - - AZ_TracePrintf("Script Canvas", "Parse Duration: %8.4f ms\n", m_parseDuration / 1000.0); } } } From cbc70b4b8838f613b8df80ff7a78d21a8544d342 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Tue, 30 Nov 2021 14:05:31 -0800 Subject: [PATCH 094/399] Add dialog window for messaging when SC assets fail to save Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index fed4f28f4f..1c0055fce6 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -50,7 +50,7 @@ #include #include - +//#include #include #include From dc538d94e5acddd886611b2407bc4536e774223b Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Tue, 30 Nov 2021 15:02:06 -0800 Subject: [PATCH 095/399] update error window message and add AP launch request Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 306068bd5c..d461ad2a31 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -155,6 +155,7 @@ #include #include +#include namespace ScriptCanvasEditor { From 0963bc0cc564f26a9b589b75053039cbc742e395 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Tue, 30 Nov 2021 15:30:42 -0800 Subject: [PATCH 096/399] removed commented out include Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 1c0055fce6..28e9cab948 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -50,7 +50,6 @@ #include #include -//#include #include #include From 9830925309e74646317a9012e01bf1012c3b60c0 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 8 Dec 2021 22:54:21 -0800 Subject: [PATCH 097/399] small fixes for SC play in editor and warnings Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Components/EditorScriptCanvasComponent.cpp | 10 ---------- .../Components/EditorScriptCanvasComponent.h | 4 +--- .../Code/Editor/SystemComponent.cpp | 17 ++++++++++++++--- Gems/ScriptCanvas/Code/Editor/SystemComponent.h | 10 +++++++++- .../Code/Include/ScriptCanvas/Core/Graph.cpp | 12 ++++++++++++ 5 files changed, 36 insertions(+), 17 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 9209196873..ff1dd2e3a6 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -431,16 +431,6 @@ namespace ScriptCanvasEditor AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); } - void EditorScriptCanvasComponent::OnStartPlayInEditor() - { - ScriptCanvas::Execution::PerformanceStatisticsEBus::Broadcast(&ScriptCanvas::Execution::PerformanceStatisticsBus::ClearSnaphotStatistics); - } - - void EditorScriptCanvasComponent::OnStopPlayInEditor() - { - AZ::ScriptSystemRequestBus::Broadcast(&AZ::ScriptSystemRequests::GarbageCollect); - } - void EditorScriptCanvasComponent::SetAssetId(const SourceHandle& assetId) { if (m_sourceHandle.Describe() != assetId.Describe()) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 52cf49070b..76514267a3 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -93,9 +93,7 @@ namespace ScriptCanvasEditor //===================================================================== // EditorEntityContextNotificationBus - void OnStartPlayInEditor() override; - - void OnStopPlayInEditor() override; + protected: enum class SourceChangeDescription : AZ::u8 diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 0be2d564ee..758c395238 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -337,9 +338,19 @@ namespace ScriptCanvasEditor , SourceHandle(nullptr, sourceUUIDInCall, ""), Tracker::ScriptCanvasFileState::UNMODIFIED, -1); } }; - - openers.push_back({ "O3DE_ScriptCanvasEditor", "Open In Script Canvas Editor...", QIcon(), scriptCanvasEditorCallback }); - } + + openers.push_back({ "O3DE_ScriptCanvasEditor", "Open In Script Canvas Editor...", QIcon(ScriptCanvasAssetDescription().GetIconPathImpl()), scriptCanvasEditorCallback }); + } + } + + void SystemComponent::OnStartPlayInEditor() + { + ScriptCanvas::Execution::PerformanceStatisticsEBus::Broadcast(&ScriptCanvas::Execution::PerformanceStatisticsBus::ClearSnaphotStatistics); + } + + void SystemComponent::OnStopPlayInEditor() + { + AZ::ScriptSystemRequestBus::Broadcast(&AZ::ScriptSystemRequests::GarbageCollect); } void SystemComponent::OnUserSettingsActivated() diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.h b/Gems/ScriptCanvas/Code/Editor/SystemComponent.h index 6f85b3c5a6..c2c42c5b9d 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.h @@ -23,6 +23,7 @@ #include #include #include +#include namespace ScriptCanvasEditor { @@ -36,6 +37,8 @@ namespace ScriptCanvasEditor , private AZ::Data::AssetBus::MultiHandler , private AzToolsFramework::AssetSeedManagerRequests::Bus::Handler , private AzToolsFramework::EditorContextMenuBus::Handler + , private AzToolsFramework::EditorEntityContextNotificationBus::Handler + { public: AZ_COMPONENT(SystemComponent, "{1DE7A120-4371-4009-82B5-8140CB1D7B31}"); @@ -97,7 +100,12 @@ namespace ScriptCanvasEditor //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// - + + protected: + void OnStartPlayInEditor() override; + + void OnStopPlayInEditor() override; + private: SystemComponent(const SystemComponent&) = delete; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index 9c2c854055..b58e4d1536 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -85,6 +85,18 @@ namespace ScriptCanvas } } + if (componentElementNode.GetVersion() < GraphCpp::GraphVersion::FixupVersionDataTypeId) + { + if (auto subElement = componentElementNode.FindSubElement(AZ_CRC_CE("versionData"))) + { + if (subElement->GetId() == azrtti_typeid()) + { + componentElementNode.RemoveElementByName(AZ_CRC_CE("versionData")); + componentElementNode.AddElementWithData(context, "versionData", VersionData()); + } + } + } + return true; } From a5b30ffc5a35d73fa4fec36cbb1d5fbff7b257e3 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 8 Dec 2021 23:23:03 -0800 Subject: [PATCH 098/399] fix interpreted statics Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Execution/Interpreted/ExecutionInterpretedAPI.cpp | 9 +++++---- .../Execution/Interpreted/ExecutionStateInterpreted.cpp | 5 ++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp index 1855b348f2..561708dea1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp @@ -503,20 +503,21 @@ namespace ScriptCanvas void InitializeInterpretedStatics(RuntimeData& runtimeData) { - if (!runtimeData.m_areStaticsInitialized) + AZ_Error("ScriptCanvas", !runtimeData.m_areStaticsInitialized, "ScriptCanvas runtime data already initalized"); { runtimeData.m_areStaticsInitialized = true; for (auto& dependency : runtimeData.m_requiredAssets) { - InitializeInterpretedStatics(dependency.Get()->GetData()); + if (!dependency.Get()->GetData().m_areStaticsInitialized) + { + InitializeInterpretedStatics(dependency.Get()->GetData()); + } } #if defined(AZ_PROFILE_BUILD) || defined(AZ_DEBUG_BUILD) Execution::InitializeFromLuaStackFunctions(const_cast(runtimeData.m_debugMap)); #endif - AZ_WarningOnce("ScriptCanvas", !runtimeData.m_areStaticsInitialized, "ScriptCanvas runtime data already initalized"); - if (runtimeData.RequiresStaticInitialization()) { AZ::ScriptLoadResult result{}; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp index 3ae52846cd..3b963317ec 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp @@ -49,7 +49,10 @@ namespace ScriptCanvas , config.asset.GetId().ToString().data()); #endif - Execution::InitializeInterpretedStatics(runtimeAsset->GetData()); + if (!runtimeAsset->GetData().m_areStaticsInitialized) + { + Execution::InitializeInterpretedStatics(runtimeAsset->GetData()); + } } void ExecutionStateInterpreted::ClearLuaRegistryIndex() From 837e532ad791db8086361f0a2a8bfafe67254045 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 9 Dec 2021 11:43:36 -0800 Subject: [PATCH 099/399] fail safe for EditorScriptCanvasComponents saved before AZ::IO::Path got json support Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/Components/EditorScriptCanvasComponent.cpp | 2 ++ .../Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index ff1dd2e3a6..3d8599fdfb 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -295,6 +295,8 @@ namespace ScriptCanvasEditor EditorScriptCanvasComponentLoggingBus::Handler::BusConnect(entityId); EditorLoggingComponentNotificationBus::Broadcast(&EditorLoggingComponentNotifications::OnEditorScriptCanvasComponentActivated, GetNamedEntityId(), GetGraphIdentifier()); + CompleteDescriptionInPlace(m_sourceHandle); + AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h index 699287dd48..d5147cab61 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h @@ -31,7 +31,7 @@ namespace ScriptCanvasEditor , AZStd::vector&& assets , AZStd::function onComplete); - virtual ~Modifier(); + ~Modifier(); const ModificationResults& GetResult() const; ModificationResults&& TakeResult(); From 0a1dc3c4bda95efa2cb8bd30aa62fb091a473cc9 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 9 Dec 2021 18:58:47 -0800 Subject: [PATCH 100/399] Fix missing asset handler error on EditorSCComponent load from pre SourceHandle files Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../EditorScriptCanvasComponent.cpp | 2 +- .../Components/EditorScriptCanvasComponent.h | 6 +- .../EditorScriptCanvasComponentSerializer.cpp | 69 ++++++++++++++++--- 3 files changed, 64 insertions(+), 13 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 3d8599fdfb..3ad2580d3c 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -317,6 +316,7 @@ namespace ScriptCanvasEditor void EditorScriptCanvasComponent::BuildGameEntityData() { using namespace ScriptCanvasBuilder; + CompleteDescriptionInPlace(m_sourceHandle); m_runtimeDataIsValid = false; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 76514267a3..d797f8db08 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -9,15 +9,16 @@ #pragma once #include +#include #include #include #include #include #include #include +#include #include #include -#include namespace ScriptCanvasEditor { @@ -39,11 +40,12 @@ namespace ScriptCanvasEditor , private EditorScriptCanvasComponentLoggingBus::Handler , private EditorScriptCanvasComponentRequestBus::Handler , private AzToolsFramework::EditorEntityContextNotificationBus::Handler - { public: AZ_COMPONENT(EditorScriptCanvasComponent, "{C28E2D29-0746-451D-A639-7F113ECF5D72}", AzToolsFramework::Components::EditorComponentBase); + friend class AZ::EditorScriptCanvasComponentSerializer; + EditorScriptCanvasComponent(); EditorScriptCanvasComponent(const SourceHandle& sourceHandle); ~EditorScriptCanvasComponent() override; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp index dfda030403..596c2d9dbf 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp @@ -27,23 +27,72 @@ namespace AZ , "EditorScriptCanvasComponentSerializer Load against output typeID that was not EditorScriptCanvasComponent"); AZ_Assert(outputValue, "EditorScriptCanvasComponentSerializer Load against null output"); + // load as parent class auto outputComponent = reinterpret_cast(outputValue); - JsonSerializationResult::ResultCode result = BaseJsonSerializer::Load(outputValue, outputValueTypeId, inputValue, context); + JsonSerializationResult::ResultCode result = BaseJsonSerializer::Load(outputValue + , azrtti_typeid(), inputValue, context); + + // load child data one by one... + result.Combine(BaseJsonSerializer::Load(outputValue, outputValueTypeId, inputValue, context)); if (result.GetProcessing() != JSR::Processing::Halted) { + result.Combine(ContinueLoadingFromJsonObjectField + ( &outputComponent->m_name + , azrtti_typeid(outputComponent->m_name) + , inputValue + , "m_name" + , context)); + + result.Combine(ContinueLoadingFromJsonObjectField + ( &outputComponent->m_runtimeDataIsValid + , azrtti_typeid(outputComponent->m_runtimeDataIsValid) + , inputValue + , "runtimeDataIsValid" + , context)); + + result.Combine(ContinueLoadingFromJsonObjectField + ( &outputComponent->m_variableOverrides + , azrtti_typeid(outputComponent->m_variableOverrides) + , inputValue + , "runtimeDataOverrides" + , context)); + auto assetHolderMember = inputValue.FindMember("m_assetHolder"); - if (assetHolderMember != inputValue.MemberEnd()) + if (assetHolderMember == inputValue.MemberEnd()) { - ScriptCanvasEditor::ScriptCanvasAssetHolder assetHolder; - result.Combine - ( ContinueLoading(&assetHolder - , azrtti_typeid(), assetHolderMember->value, context)); - - if (result.GetProcessing() != JSR::Processing::Halted) + // file was saved with SourceHandle data + result.Combine(ContinueLoadingFromJsonObjectField + ( &outputComponent->m_sourceHandle + , azrtti_typeid(outputComponent->m_sourceHandle) + , inputValue + , "sourceHandle" + , context)); + } + else + { + // manually load the old asset info data + const rapidjson::Value& assetHolderValue = assetHolderMember->value; + if (auto assetMember = assetHolderValue.FindMember("m_asset"); assetMember != assetHolderValue.MemberEnd()) { - outputComponent->InitializeSource - ( ScriptCanvasEditor::SourceHandle(nullptr, assetHolder.GetAssetId().m_guid, assetHolder.GetAssetHint())); + const rapidjson::Value& assetValue = assetMember->value; + + AZ::Data::AssetId assetId{}; + if (auto assetIdMember = assetValue.FindMember("assetId"); assetIdMember != assetValue.MemberEnd()) + { + result.Combine(ContinueLoading(&assetId, azrtti_typeid(assetId), assetIdMember->value, context)); + } + + AZStd::string path{}; + if (auto pathMember = assetValue.FindMember("assetHint"); pathMember != assetValue.MemberEnd()) + { + result.Combine(ContinueLoading(&path, azrtti_typeid(path), pathMember->value, context)); + } + + if (result.GetProcessing() != JSR::Processing::Halted) + { + outputComponent->InitializeSource(ScriptCanvasEditor::SourceHandle(nullptr, assetId.m_guid, path)); + } } } } From 8da04f15d3a7e7c1b02e0d3431fe0bd90dfb481c Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 13 Dec 2021 11:15:02 -0800 Subject: [PATCH 101/399] Add some Value documentation Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 36 +++++++++---- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 50 +++++++++++++------ .../AzCore/Tests/DOM/DomValueTests.cpp | 16 +++--- 3 files changed, 68 insertions(+), 34 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 72eb7ebadd..dcecc67460 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -144,12 +144,9 @@ namespace AZ::Dom case Type::Null: // Null is the default initialized value break; - case Type::False: + case Type::Bool: m_value = false; break; - case Type::True: - m_value = true; - break; case Type::Object: SetObject(); break; @@ -159,8 +156,14 @@ namespace AZ::Dom case Type::String: SetString(""); break; - case Type::Number: - m_value = 0.0; + case Type::Int64: + m_value = int64_t{}; + break; + case Type::Uint64: + m_value = uint64_t{}; + break; + case Type::Double: + m_value = double{}; break; case Type::Node: SetNode(""); @@ -227,11 +230,13 @@ namespace AZ::Dom case 0: // AZStd::monostate return Type::Null; case 1: // int64_t + return Type::Int64; case 2: // uint64_t + return Type::Uint64; case 3: // double - return Type::Number; + return Type::Double; case 4: // bool - return AZStd::get(m_value) ? Type::True : Type::False; + return Type::Bool; case 5: // AZStd::string_view case 6: // AZStd::shared_ptr case 7: // ShortStringType @@ -256,12 +261,12 @@ namespace AZ::Dom bool Value::IsFalse() const { - return GetType() == Type::False; + return IsBool() && !AZStd::get(m_value); } bool Value::IsTrue() const { - return GetType() == Type::True; + return IsBool() && AZStd::get(m_value); } bool Value::IsBool() const @@ -291,7 +296,16 @@ namespace AZ::Dom bool Value::IsNumber() const { - return GetType() == Type::Number; + switch (GetType()) + { + case Type::Int64: + [[fallthrough]]; + case Type::Uint64: + [[fallthrough]]; + case Type::Double: + return true; + } + return false; } bool Value::IsInt() const diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 1a09b9a3c8..7ba73a8a4b 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -10,15 +10,15 @@ #include #include +#include #include #include -#include +#include #include #include #include #include #include -#include namespace AZ::Dom { @@ -27,19 +27,20 @@ namespace AZ::Dom //! The type of underlying value stored in a value. \see Value enum class Type { - Null = 0, - False = 1, - True = 2, - Object = 3, - Array = 4, - String = 5, - Number = 6, - Node = 7, - Opaque = 8, + Null, + Bool, + Object, + Array, + String, + Int64, + Uint64, + Double, + Node, + Opaque, }; //! The allocator used by Value. - //! Value heap allocates shared_ptrs for its container storage (Array / Object / Node) alongside + //! Value heap allocates shared_ptrs for its container storage (Array / Object / Node) alongside class ValueAllocator final : public SimpleSchemaAllocator { public: @@ -56,6 +57,7 @@ namespace AZ::Dom class Value; + //! Internal storage for a Value array: an ordered list of Values. class Array { public: @@ -73,6 +75,7 @@ namespace AZ::Dom using ArrayPtr = AZStd::shared_ptr; using ConstArrayPtr = AZStd::shared_ptr; + //! Internal storage for a Value object: an ordered list of Name / Value pairs. class Object { public: @@ -91,6 +94,9 @@ namespace AZ::Dom using ObjectPtr = AZStd::shared_ptr; using ConstObjectPtr = AZStd::shared_ptr; + //! Storage for a Value node: a named Value with both properties and children. + //! Properties are stored as an ordered list of Name / Value pairs. + //! Children are stored as an oredered list of Values. class Node { public: @@ -122,6 +128,21 @@ namespace AZ::Dom using NodePtr = AZStd::shared_ptr; using ConstNodePtr = AZStd::shared_ptr; + //! Value is a typed union of Dom types that can represent the types provdied by AZ::Dom::Visitor. + //! Value can be one of the following types: + //! - Null: a type with no value, this is the default type for Value + //! - Bool: a true or false boolean value + //! - Object: a container with an ordered list of Name/Value pairs, analagous to a JSON object + //! - Array: a container with an ordered list of Values, analagous to a JSON array + //! - String: a UTF-8 string + //! - Int64: a signed, 64-bit integer + //! - Uint64: an unsigned, 64-bit integer + //! - Double: a double precision floating point value + //! - Node: a container with a Name, an ordered list of Name/Values pairs (attributes), and an ordered list of Values (children), + //! analagous to an XML node + //! - Opaque: an arbitrary value stored in an AZStd::any. This is a non-serializable representation of an entry used only for in-memory + //! options. This is intended to be used as an intermediate value over the course of DOM transformation and as a proxy to pass through + //! types of which the DOM has no knowledge to other systems. class Value { public: @@ -327,7 +348,7 @@ namespace AZ::Dom //! The internal storage type for Value. //! These types do not correspond one-to-one with the Value's external Type as there may be multiple storage classes - //! for the same type in some instances, such as string storage + //! for the same type in some instances, such as string storage using ValueType = AZStd::variant< // NullType AZStd::monostate, @@ -351,8 +372,7 @@ namespace AZ::Dom AZStd::any*>; static_assert( - sizeof(ValueType) == sizeof(AZStd::variant), - "ValueType should have no members larger than ShortStringType"); + sizeof(ValueType) == sizeof(AZStd::variant), "ValueType should have no members larger than ShortStringType"); ValueType m_value; }; diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp index 62f3ad7601..b88ab746b9 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -218,9 +218,9 @@ namespace AZ::Dom::Tests m_value["int64_min"] = AZStd::numeric_limits::min(); m_value["int64_max"] = AZStd::numeric_limits::max(); - EXPECT_EQ(m_value["int64_min"].GetType(), Type::Number); + EXPECT_EQ(m_value["int64_min"].GetType(), Type::Int64); EXPECT_EQ(m_value["int64_min"].GetInt64(), AZStd::numeric_limits::min()); - EXPECT_EQ(m_value["int64_max"].GetType(), Type::Number); + EXPECT_EQ(m_value["int64_max"].GetType(), Type::Int64); EXPECT_EQ(m_value["int64_max"].GetInt64(), AZStd::numeric_limits::max()); PerformValueChecks(); @@ -232,9 +232,9 @@ namespace AZ::Dom::Tests m_value["uint64_min"] = AZStd::numeric_limits::min(); m_value["uint64_max"] = AZStd::numeric_limits::max(); - EXPECT_EQ(m_value["uint64_min"].GetType(), Type::Number); + EXPECT_EQ(m_value["uint64_min"].GetType(), Type::Uint64); EXPECT_EQ(m_value["uint64_min"].GetInt64(), AZStd::numeric_limits::min()); - EXPECT_EQ(m_value["uint64_max"].GetType(), Type::Number); + EXPECT_EQ(m_value["uint64_max"].GetType(), Type::Uint64); EXPECT_EQ(m_value["uint64_max"].GetInt64(), AZStd::numeric_limits::max()); PerformValueChecks(); @@ -246,9 +246,9 @@ namespace AZ::Dom::Tests m_value["double_min"] = AZStd::numeric_limits::min(); m_value["double_max"] = AZStd::numeric_limits::max(); - EXPECT_EQ(m_value["double_min"].GetType(), Type::Number); + EXPECT_EQ(m_value["double_min"].GetType(), Type::Double); EXPECT_EQ(m_value["double_min"].GetDouble(), AZStd::numeric_limits::min()); - EXPECT_EQ(m_value["double_max"].GetType(), Type::Number); + EXPECT_EQ(m_value["double_max"].GetType(), Type::Double); EXPECT_EQ(m_value["double_max"].GetDouble(), AZStd::numeric_limits::max()); PerformValueChecks(); @@ -271,9 +271,9 @@ namespace AZ::Dom::Tests m_value["true_value"] = true; m_value["false_value"] = false; - EXPECT_EQ(m_value["true_value"].GetType(), Type::True); + EXPECT_EQ(m_value["true_value"].GetType(), Type::Bool); EXPECT_EQ(m_value["true_value"].GetBool(), true); - EXPECT_EQ(m_value["false_value"].GetType(), Type::False); + EXPECT_EQ(m_value["false_value"].GetType(), Type::Bool); EXPECT_EQ(m_value["false_value"].GetBool(), false); PerformValueChecks(); From 2d13b648dad18c5205946370dfdda90f2e2eb78a Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Fri, 10 Dec 2021 19:08:18 -0600 Subject: [PATCH 102/399] Change Vulkan RHI CommandList::SetStreamBuffers to not do 2 memory allocation per draw by using fixed_vector Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp index 2620aa5f7b..45c04da491 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp @@ -6,6 +6,7 @@ * */ #include +#include #include #include #include @@ -688,8 +689,8 @@ namespace AZ if (interval != InvalidInterval) { uint32_t numBuffers = interval.m_max - interval.m_min + 1; - AZStd::vector nativeBuffers(numBuffers, VK_NULL_HANDLE); - AZStd::vector offsets(numBuffers, 0); + AZStd::fixed_vector nativeBuffers(numBuffers, VK_NULL_HANDLE); + AZStd::fixed_vector offsets(numBuffers, 0); for (uint32_t i = 0; i < numBuffers; ++i) { const RHI::StreamBufferView& bufferView = streams[i + interval.m_min]; From d044f51a8913f60666e379fe143affeaa3dc79a6 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 13 Dec 2021 11:21:38 -0800 Subject: [PATCH 103/399] Remove DomDocument for now Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomDocument.cpp | 0 Code/Framework/AzCore/AzCore/DOM/DomDocument.h | 0 Code/Framework/AzCore/AzCore/azcore_files.cmake | 2 -- 3 files changed, 2 deletions(-) delete mode 100644 Code/Framework/AzCore/AzCore/DOM/DomDocument.cpp delete mode 100644 Code/Framework/AzCore/AzCore/DOM/DomDocument.h diff --git a/Code/Framework/AzCore/AzCore/DOM/DomDocument.cpp b/Code/Framework/AzCore/AzCore/DOM/DomDocument.cpp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Code/Framework/AzCore/AzCore/DOM/DomDocument.h b/Code/Framework/AzCore/AzCore/DOM/DomDocument.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Code/Framework/AzCore/AzCore/azcore_files.cmake b/Code/Framework/AzCore/AzCore/azcore_files.cmake index e17fb941b8..ef2511bddc 100644 --- a/Code/Framework/AzCore/AzCore/azcore_files.cmake +++ b/Code/Framework/AzCore/AzCore/azcore_files.cmake @@ -127,8 +127,6 @@ set(FILES Debug/TraceReflection.h DOM/DomBackend.cpp DOM/DomBackend.h - DOM/DomDocument.cpp - DOM/DomDocument.h DOM/DomUtils.cpp DOM/DomUtils.h DOM/DomValue.cpp From 202226c2cb616dd62c3353ee3adfed805ae2ab60 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 13 Dec 2021 11:31:23 -0800 Subject: [PATCH 104/399] Document short string usage Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 7ba73a8a4b..5cb67123e5 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -334,6 +334,8 @@ namespace AZ::Dom explicit Value(AZStd::any* opaqueValue); + // Determine the short string buffer size based on the size of our largest internal type (string_view) + // minus the size of the short string size field. static constexpr const size_t ShortStringSize = sizeof(AZStd::string_view) - sizeof(size_t); struct ShortStringType { @@ -348,7 +350,7 @@ namespace AZ::Dom //! The internal storage type for Value. //! These types do not correspond one-to-one with the Value's external Type as there may be multiple storage classes - //! for the same type in some instances, such as string storage + //! for the same type in some instances, such as string storage. using ValueType = AZStd::variant< // NullType AZStd::monostate, From af91cea8ef25280af54c4d37dadcdb073bca50c7 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 13 Dec 2021 11:56:53 -0800 Subject: [PATCH 105/399] Add copy-on-write note Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 5cb67123e5..ecaea3db3d 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -143,6 +143,10 @@ namespace AZ::Dom //! - Opaque: an arbitrary value stored in an AZStd::any. This is a non-serializable representation of an entry used only for in-memory //! options. This is intended to be used as an intermediate value over the course of DOM transformation and as a proxy to pass through //! types of which the DOM has no knowledge to other systems. + //! \note Value is a copy-on-write data structure and may be cheaply returned by value. Heap allocated data larger than the size of the + //! value itself (objects, arrays, and nodes) are copied by new Values only when their contents change, so care should be taken in + //! performance critical code to avoid mutation operations such as operator[] to avoid copies. It is recommended that an immutable Value + //! be explicitly be stored as a `const Value` to avoid accidental detach and copy operations. class Value { public: From 946a77e9144c582f99f024c88f7831191a1150f9 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 13 Dec 2021 12:06:24 -0800 Subject: [PATCH 106/399] Document ValueWriter, add basic OpaqueValue handling Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp | 6 ++++++ Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h | 6 ++++++ Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp | 2 +- Code/Framework/AzCore/AzCore/DOM/DomVisitor.h | 3 +-- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index ef99809290..172f7f2a92 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -220,6 +220,12 @@ namespace AZ::Dom return EndContainer(Type::Node, attributeCount, elementCount); } + Visitor::Result ValueWriter::OpaqueValue(OpaqueType& value) + { + CurrentValue().SetOpaqueValue(value); + return FinishWrite(); + } + Visitor::Result ValueWriter::FinishWrite() { if (m_entryStack.empty()) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h index 6086ff4fe5..7430ff910b 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h @@ -13,6 +13,8 @@ namespace AZ::Dom { + //! Visitor that writes to a Value. + //! Supports all Visitor operations. class ValueWriter : public Visitor { public: @@ -36,6 +38,7 @@ namespace AZ::Dom Result StartNode(AZ::Name name) override; Result RawStartNode(AZStd::string_view name, Lifetime lifetime) override; Result EndNode(AZ::u64 attributeCount, AZ::u64 elementCount) override; + Result OpaqueValue(OpaqueType& value) override; private: Result FinishWrite(); @@ -60,7 +63,10 @@ namespace AZ::Dom ValueBuffer& GetValueBuffer(); Value& m_result; + // Stores info about the current value being processed AZStd::stack m_entryStack; + // Provides temporary storage for elements and attributes to prevent extra heap allocations + // These buffers persist to be reused even as the entry stack changes AZStd::vector m_valueBuffers; }; } // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp index 5e3d6c2882..4e13a2a95c 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp @@ -110,7 +110,7 @@ namespace AZ::Dom return String(*value, lifetime); } - Visitor::Result Visitor::OpaqueValue([[maybe_unused]] const OpaqueType& value, [[maybe_unused]] Lifetime lifetime) + Visitor::Result Visitor::OpaqueValue([[maybe_unused]] OpaqueType& value) { if (!SupportsOpaqueValues()) { diff --git a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h index 938df1bb5a..3bf1b3419b 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h @@ -181,8 +181,7 @@ namespace AZ::Dom //! indicate where the value may be stored persistently or requires a copy. //! The base implementation of OpaqueValue rejects the operation, as opaque values are meant for special //! cases with specific implementations, not generic usage. - //! Storage semantics are provided to indicate where the value may be stored persistently or requires a copy. - virtual Result OpaqueValue(const OpaqueType& value, Lifetime lifetime); + virtual Result OpaqueValue(OpaqueType& value); //! Operates on a raw value encoded as a UTF-8 string that hasn't had its type deduced. //! Visitors that support raw values (\see VisitorFlags::SupportsRawValues) may parse the raw value and //! forward it to the corresponding value call or calls of their choice. From aa9799a63b0b9c413e5f1431a299d41275648987 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 13 Dec 2021 15:05:17 -0800 Subject: [PATCH 107/399] Use the high perf allocator for DomValueWriter Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h index 7430ff910b..488535ace6 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h @@ -56,17 +56,17 @@ namespace AZ::Dom struct ValueBuffer { - AZStd::vector m_elements; - AZStd::vector> m_attributes; + Array::ContainerType m_elements; + Object::ContainerType m_attributes; }; ValueBuffer& GetValueBuffer(); Value& m_result; // Stores info about the current value being processed - AZStd::stack m_entryStack; + AZStd::stack>> m_entryStack; // Provides temporary storage for elements and attributes to prevent extra heap allocations // These buffers persist to be reused even as the entry stack changes - AZStd::vector m_valueBuffers; + AZStd::vector> m_valueBuffers; }; } // namespace AZ::Dom From 98fa18558eabb8e28d2901357bff481148c1d6b5 Mon Sep 17 00:00:00 2001 From: AMZN-Phil Date: Mon, 13 Dec 2021 17:40:09 -0800 Subject: [PATCH 108/399] Force Project Manager to use VS2019 Signed-off-by: AMZN-Phil --- .../Platform/Windows/ProjectBuilderWorker_windows.cpp | 1 + .../ProjectManager/Platform/Windows/ProjectUtils_windows.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp b/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp index 075c6de774..79258d83ea 100644 --- a/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp +++ b/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp @@ -19,6 +19,7 @@ namespace O3DE::ProjectManager QString targetBuildPath = QDir(m_projectInfo.m_path).filePath(ProjectBuildPathPostfix); return AZ::Success(QStringList{ ProjectCMakeCommand, + "-G", "Visual Studio 16 2019" "-B", targetBuildPath, "-S", m_projectInfo.m_path, QString("-DLY_3RDPARTY_PATH=").append(thirdPartyPath), diff --git a/Code/Tools/ProjectManager/Platform/Windows/ProjectUtils_windows.cpp b/Code/Tools/ProjectManager/Platform/Windows/ProjectUtils_windows.cpp index 41a878f0ae..89032320cd 100644 --- a/Code/Tools/ProjectManager/Platform/Windows/ProjectUtils_windows.cpp +++ b/Code/Tools/ProjectManager/Platform/Windows/ProjectUtils_windows.cpp @@ -77,7 +77,7 @@ namespace O3DE::ProjectManager if (vsWhereFile.exists() && vsWhereFile.isFile()) { QStringList vsWhereBaseArguments = QStringList{"-version", - "16.9.2", + "[16.9.2,17)", "-latest", "-requires", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64"}; From f71b134a84516c05973166276b78eeeb1d9300ff Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 13 Dec 2021 22:25:45 -0800 Subject: [PATCH 109/399] Ensure JsonSerializer::StoreTypeName stores the correct type for generic types Signed-off-by: Nicholas Van Sickle --- .../Serialization/Json/JsonSerializer.cpp | 10 +- .../Serialization/Json/JsonSerializer.h | 2 +- .../Serialization/Json/TestCases_TypeId.cpp | 94 +++++++++++++++++++ 3 files changed, 100 insertions(+), 6 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.cpp b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.cpp index 8b6c1d154c..46cc0443da 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.cpp @@ -150,7 +150,7 @@ namespace AZ { // Not using InsertTypeId here to avoid needing to create the temporary value and swap it in that call. node.AddMember(rapidjson::StringRef(JsonSerialization::TypeIdFieldIdentifier), - StoreTypeName(classData, context), context.GetJsonAllocator()); + StoreTypeName(classData, classData.m_typeId, context), context.GetJsonAllocator()); result = ResultCode(Tasks::WriteValue, Outcomes::Success); } return result.Combine(StoreClass(node, object, defaultObject, classData, context)); @@ -531,7 +531,7 @@ namespace AZ return ResolvePointerResult::ContinueProcessing; } - rapidjson::Value JsonSerializer::StoreTypeName(const SerializeContext::ClassData& classData, JsonSerializerContext& context) + rapidjson::Value JsonSerializer::StoreTypeName(const SerializeContext::ClassData& classData, const Uuid& typeId, JsonSerializerContext& context) { rapidjson::Value result; AZStd::vector ids = context.GetSerializeContext()->FindClassId(Crc32(classData.m_name)); @@ -544,7 +544,7 @@ namespace AZ // Only write the Uuid for the class if there are multiple classes sharing the same name. // In this case it wouldn't be enough to determine which class needs to be used. The // class name is still added as a comment for be friendlier for users to read. - AZStd::string fullName = classData.m_typeId.ToString(); + AZStd::string fullName = typeId.ToString(); fullName += ' '; fullName += classData.m_name; result.SetString(fullName.c_str(), aznumeric_caster(fullName.size()), context.GetJsonAllocator()); @@ -560,7 +560,7 @@ namespace AZ const SerializeContext::ClassData* data = context.GetSerializeContext()->FindClassData(typeId); if (data) { - output = JsonSerializer::StoreTypeName(*data, context); + output = JsonSerializer::StoreTypeName(*data, typeId, context); return context.Report(Tasks::WriteValue, Outcomes::Success, "Type id successfully stored to json value."); } else @@ -580,7 +580,7 @@ namespace AZ { rapidjson::Value insertedObject(rapidjson::kObjectType); insertedObject.AddMember( - rapidjson::StringRef(JsonSerialization::TypeIdFieldIdentifier), StoreTypeName(classData, context), + rapidjson::StringRef(JsonSerialization::TypeIdFieldIdentifier), StoreTypeName(classData, classData.m_typeId, context), context.GetJsonAllocator()); for (auto& element : output.GetObject()) diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.h b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.h index 22dd768ec5..0b72fca529 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.h +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.h @@ -79,7 +79,7 @@ namespace AZ const void*& object, const void*& defaultObject, AZStd::any& defaultObjectStorage, const SerializeContext::ClassData*& elementClassData, const AZ::IRttiHelper& rtti, JsonSerializerContext& context); - static rapidjson::Value StoreTypeName(const SerializeContext::ClassData& classData, JsonSerializerContext& context); + static rapidjson::Value StoreTypeName(const SerializeContext::ClassData& classData, const Uuid& typeId, JsonSerializerContext& context); static JsonSerializationResult::ResultCode StoreTypeName(rapidjson::Value& output, const Uuid& typeId, JsonSerializerContext& context); diff --git a/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp b/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp index 60b8f55dce..c6c08ca9ae 100644 --- a/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp +++ b/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp @@ -10,6 +10,72 @@ #include #include #include +#include + +namespace AZ +{ + template + struct SerializeGenericTypeInfo> + { + using ThisType = JsonSerializationTests::TemplatedClass; + + class GenericTemplatedClassInfo : public GenericClassInfo + { + public: + GenericTemplatedClassInfo() + : m_classData{ SerializeContext::ClassData::Create( + "TemplatedClass", "{CA4ADF74-66E7-4D16-B4AC-F71278C60EC7}", nullptr, nullptr) } + { + } + + SerializeContext::ClassData* GetClassData() override + { + return &m_classData; + } + + size_t GetNumTemplatedArguments() override + { + return 1; + } + + const Uuid& GetSpecializedTypeId() const override + { + return m_classData.m_typeId; + } + + const Uuid& GetGenericTypeId() const override + { + return m_classData.m_typeId; + } + + const Uuid& GetTemplatedTypeId(size_t element) override + { + (void)element; + return SerializeGenericTypeInfo::GetClassTypeId(); + } + + void Reflect(SerializeContext* serializeContext) override + { + if (serializeContext) + { + serializeContext->RegisterGenericClassInfo( + GetSpecializedTypeId(), this, &AZ::AnyTypeInfoConcept>::CreateAny); + serializeContext->RegisterGenericClassInfo( + azrtti_typeid(), this, + &AZ::AnyTypeInfoConcept::CreateAny); + } + } + + SerializeContext::ClassData m_classData; + }; + + using ClassInfoType = GenericTemplatedClassInfo; + static ClassInfoType* GetGenericInfo() + { + return GetCurrentSerializeContextModule().CreateGenericClassInfo(); + } + }; +} // namespace AZ namespace JsonSerializationTests { @@ -286,4 +352,32 @@ namespace JsonSerializationTests EXPECT_EQ(Processing::Halted, result.GetProcessing()); EXPECT_EQ(Outcomes::Unknown, result.GetOutcome()); } + + TEST_F(JsonSerializationTests, StoreTypeId_TemplatedType_StoresUuidWithName) + { + using namespace AZ; + using namespace AZ::JsonSerializationResult; + + m_serializeContext->RegisterGenericType>(); + m_serializeContext->RegisterGenericType>(); + + Uuid input = azrtti_typeid>(); + ResultCode result = JsonSerialization::StoreTypeId( + *m_jsonDocument, m_jsonDocument->GetAllocator(), input, AZStd::string_view{}, *m_serializationSettings); + + EXPECT_EQ(Processing::Completed, result.GetProcessing()); + + AZStd::string expected = + AZStd::string::format(R"("%s TemplatedClass")", azrtti_typeid>().ToString().c_str()); + Expect_DocStrEq(expected.c_str(), false); + + input = azrtti_typeid>(); + result = JsonSerialization::StoreTypeId( + *m_jsonDocument, m_jsonDocument->GetAllocator(), input, AZStd::string_view{}, *m_serializationSettings); + + expected = + AZStd::string::format(R"("%s TemplatedClass")", azrtti_typeid>().ToString().c_str()); + EXPECT_EQ(Processing::Completed, result.GetProcessing()); + Expect_DocStrEq(expected.c_str(), false); + } } // namespace JsonSerializationTests From 197e7b95e1b217991c5599134b492dbecf9cedfc Mon Sep 17 00:00:00 2001 From: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> Date: Tue, 14 Dec 2021 09:24:10 +0000 Subject: [PATCH 110/399] Fix for change with axis gizmo labels not appearing (#6256) (#6387) Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> --- .../EditorTransformComponentSelection.cpp | 7 +++---- .../Code/Source/AtomDebugDisplayViewportInterface.cpp | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp index 9ac28cfd91..8c7e5aba98 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp @@ -3534,10 +3534,9 @@ namespace AzToolsFramework debugDisplay.SetLineWidth(1.0f); const float labelOffset = ed_viewportGizmoAxisLabelOffset; - const float screenScale = GetScreenDisplayScaling(viewportId); - const auto labelXScreenPosition = (gizmoStart + (gizmoAxisX * labelOffset)) * editorCameraState.m_viewportSize * screenScale; - const auto labelYScreenPosition = (gizmoStart + (gizmoAxisY * labelOffset)) * editorCameraState.m_viewportSize * screenScale; - const auto labelZScreenPosition = (gizmoStart + (gizmoAxisZ * labelOffset)) * editorCameraState.m_viewportSize * screenScale; + const auto labelXScreenPosition = (gizmoStart + (gizmoAxisX * labelOffset)) * editorCameraState.m_viewportSize; + const auto labelYScreenPosition = (gizmoStart + (gizmoAxisY * labelOffset)) * editorCameraState.m_viewportSize; + const auto labelZScreenPosition = (gizmoStart + (gizmoAxisZ * labelOffset)) * editorCameraState.m_viewportSize; // draw the label of of each axis for the gizmo const float labelSize = ed_viewportGizmoAxisLabelSize; diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp b/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp index 39cc2f63b2..af91615283 100644 --- a/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp +++ b/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp @@ -1362,8 +1362,9 @@ namespace AZ::AtomBridge // if 2d draw need to project pos to screen first AzFramework::TextDrawParameters params; AZ::RPI::ViewportContextPtr viewportContext = GetViewportContext(); + const auto dpiScaleFactor = viewportContext->GetDpiScalingFactor(); params.m_drawViewportId = viewportContext->GetId(); // get the viewport ID so default viewport works - params.m_position = AZ::Vector3(x, y, 1.0f); + params.m_position = AZ::Vector3(x * dpiScaleFactor, y * dpiScaleFactor, 1.0f); params.m_color = m_rendState.m_color; params.m_scale = AZ::Vector2(size); params.m_hAlign = center ? AzFramework::TextHorizontalAlignment::Center : AzFramework::TextHorizontalAlignment::Left; //! Horizontal text alignment From dc9d1a2f312263058a06c0147ab831ea8eb0996f Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Thu, 9 Dec 2021 18:35:18 -0600 Subject: [PATCH 111/399] Introduced a Json Serializer for the AzCore mutable path classes Added UnitTest for Json Serialization of AzCore Path types resolves #2477 Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/IO/Path/Path.h | 1 + Code/Framework/AzCore/AzCore/IO/Path/Path.inl | 7 + .../AzCore/AzCore/IO/Path/PathReflect.cpp | 14 +- .../Serialization/Json/PathSerializer.cpp | 127 ++++++++++++++++++ .../Serialization/Json/PathSerializer.h | 26 ++++ .../AzCore/AzCore/azcore_files.cmake | 2 + .../Json/PathSerializerTests.cpp | 106 +++++++++++++++ .../AzCore/Tests/azcoretests_files.cmake | 1 + 8 files changed, 280 insertions(+), 4 deletions(-) create mode 100644 Code/Framework/AzCore/AzCore/Serialization/Json/PathSerializer.cpp create mode 100644 Code/Framework/AzCore/AzCore/Serialization/Json/PathSerializer.h create mode 100644 Code/Framework/AzCore/Tests/Serialization/Json/PathSerializerTests.cpp diff --git a/Code/Framework/AzCore/AzCore/IO/Path/Path.h b/Code/Framework/AzCore/AzCore/IO/Path/Path.h index 094dee16f2..7f89809294 100644 --- a/Code/Framework/AzCore/AzCore/IO/Path/Path.h +++ b/Code/Framework/AzCore/AzCore/IO/Path/Path.h @@ -484,6 +484,7 @@ namespace AZ::IO // as_posix //! Replicates the behavior of the Python pathlib as_posix method //! by replacing the Windows Path Separator with the Posix Path Seperator + constexpr string_type AsPosix() const; AZStd::string StringAsPosix() const; constexpr AZStd::fixed_string FixedMaxPathStringAsPosix() const noexcept; diff --git a/Code/Framework/AzCore/AzCore/IO/Path/Path.inl b/Code/Framework/AzCore/AzCore/IO/Path/Path.inl index 5ac15fc728..0dc1799528 100644 --- a/Code/Framework/AzCore/AzCore/IO/Path/Path.inl +++ b/Code/Framework/AzCore/AzCore/IO/Path/Path.inl @@ -1043,6 +1043,13 @@ namespace AZ::IO // as_posix // Returns a copy of the path with the path separators converted to PosixPathSeparator template + constexpr auto BasicPath::AsPosix() const -> string_type + { + string_type resultPath(m_path.begin(), m_path.end()); + AZStd::replace(resultPath.begin(), resultPath.end(), WindowsPathSeparator, PosixPathSeparator); + return resultPath; + } + template AZStd::string BasicPath::StringAsPosix() const { AZStd::string resultPath(m_path.begin(), m_path.end()); diff --git a/Code/Framework/AzCore/AzCore/IO/Path/PathReflect.cpp b/Code/Framework/AzCore/AzCore/IO/Path/PathReflect.cpp index 55a991f19f..1d0cdba66c 100644 --- a/Code/Framework/AzCore/AzCore/IO/Path/PathReflect.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Path/PathReflect.cpp @@ -7,6 +7,8 @@ */ #include +#include +#include #include #include @@ -35,10 +37,8 @@ namespace AZ::IO size_t Save(const void* classPtr, IO::GenericStream& stream, bool) override { /// Save paths out using the PosixPathSeparator - PathType path(reinterpret_cast(classPtr)->Native(), AZ::IO::PosixPathSeparator); - path.MakePreferred(); - - return static_cast(stream.Write(path.Native().size(), path.c_str())); + auto posixPathString{ reinterpret_cast(classPtr)->AsPosix() }; + return static_cast(stream.Write(posixPathString.size(), posixPathString.c_str())); } bool Load(void* classPtr, IO::GenericStream& stream, unsigned int, bool) override @@ -73,5 +73,11 @@ namespace AZ::IO AZ::SerializeContext::IDataSerializer::CreateDefaultDeleteDeleter() }) ; } + else if (auto jsonContext = azrtti_cast(context)) + { + jsonContext->Serializer() + ->HandlesType() + ->HandlesType(); + } } } diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/PathSerializer.cpp b/Code/Framework/AzCore/AzCore/Serialization/Json/PathSerializer.cpp new file mode 100644 index 0000000000..7c057730e8 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/PathSerializer.cpp @@ -0,0 +1,127 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include +#include +#include +#include + +namespace AZ::JsonPathSerializerInternal +{ + template + static JsonSerializationResult::Result Load(PathType* pathValue, const rapidjson::Value& inputValue, + JsonDeserializerContext& context) + { + namespace JSR = JsonSerializationResult; // Used remove name conflicts in AzCore in uber builds. + + AZ_Assert(pathValue, "Expected a valid pointer to load from json value."); + + switch (inputValue.GetType()) + { + case rapidjson::kArrayType: + case rapidjson::kObjectType: + case rapidjson::kFalseType: + case rapidjson::kTrueType: + case rapidjson::kNumberType: + [[fallthrough]]; + case rapidjson::kNullType: + return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Unsupported, + "Unsupported type. String values can't be read from arrays, objects or null."); + case rapidjson::kStringType: + { + size_t pathLength = inputValue.GetStringLength(); + if (pathLength <= pathValue->Native().max_size()) + { + *pathValue = PathType(AZStd::string_view(inputValue.GetString(), pathLength)).LexicallyNormal(); + return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Success, "Successfully read path."); + } + using UuidString = AZStd::fixed_string; + using ErrorString = AZStd::fixed_string<256>; + return context.Report(JsonSerializationResult::Tasks::ReadField, JSR::Outcomes::Invalid, + ErrorString::format("Json string value is too large to fit within path type %s. It needs to be less than %zu code points", + azrtti_typeid().template ToString().c_str(), pathValue->Native().max_size())); + } + default: + return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Unknown, "Unknown json type encountered for string value."); + } + } + template + static JsonSerializationResult::Result StoreWithDefault(rapidjson::Value& outputValue, const PathType* pathValue, + const PathType* defaultPathValue, JsonSerializerContext& context) + { + namespace JSR = JsonSerializationResult; // Removes name conflicts in AzCore in uber builds. + + if (context.ShouldKeepDefaults() || defaultPathValue == nullptr || *pathValue != *defaultPathValue) + { + auto posixPathString = pathValue->AsPosix(); + outputValue.SetString(posixPathString.c_str(), aznumeric_caster(posixPathString.size()), context.GetJsonAllocator()); + return context.Report(JSR::Tasks::WriteValue, JSR::Outcomes::Success, "Path successfully stored."); + } + + return context.Report(JSR::Tasks::WriteValue, JSR::Outcomes::DefaultsUsed, "Default Path used."); + } +} + +namespace AZ +{ + AZ_CLASS_ALLOCATOR_IMPL(JsonPathSerializer, SystemAllocator, 0); + + JsonSerializationResult::Result JsonPathSerializer::Load(void* outputValue, const Uuid& outputValueTypeId, + const rapidjson::Value& inputValue, JsonDeserializerContext& context) + { + if (outputValueTypeId == azrtti_typeid()) + { + return JsonPathSerializerInternal::Load(reinterpret_cast(outputValue), inputValue, + context); + } + else if (outputValueTypeId == azrtti_typeid()) + { + return JsonPathSerializerInternal::Load(reinterpret_cast(outputValue), inputValue, + context); + } + + using UuidString = AZStd::fixed_string; + auto errorTypeIdString = outputValueTypeId.ToString(); + AZ_Assert(false, "Unable to serialize json string" + " to a path of type %s", errorTypeIdString.c_str()); + + using ErrorString = AZStd::fixed_string<256>; + return context.Report(JsonSerializationResult::Tasks::ReadField, JsonSerializationResult::Outcomes::TypeMismatch, + ErrorString::format("Output value type ID %s is not a valid Path type", errorTypeIdString.c_str())); + } + + JsonSerializationResult::Result JsonPathSerializer::Store(rapidjson::Value& outputValue, const void* inputValue, + const void* defaultValue, const Uuid& valueTypeId, JsonSerializerContext& context) + { + if (valueTypeId == azrtti_typeid()) + { + return JsonPathSerializerInternal::StoreWithDefault(outputValue, + reinterpret_cast(inputValue), + reinterpret_cast(defaultValue), context); + } + else if (valueTypeId == azrtti_typeid()) + { + return JsonPathSerializerInternal::StoreWithDefault(outputValue, + reinterpret_cast(inputValue), + reinterpret_cast(defaultValue), context); + } + + using UuidString = AZStd::fixed_string; + auto errorTypeIdString = valueTypeId.ToString(); + AZ_Assert(false, "Unable to serialize path type %s to a json string", + errorTypeIdString.c_str()); + + using ErrorString = AZStd::fixed_string<256>; + return context.Report(JsonSerializationResult::Tasks::WriteValue, JsonSerializationResult::Outcomes::TypeMismatch, + ErrorString::format("Input value type ID %s is not a valid Path type", errorTypeIdString.c_str())); + } + +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/PathSerializer.h b/Code/Framework/AzCore/AzCore/Serialization/Json/PathSerializer.h new file mode 100644 index 0000000000..609a489ec4 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/PathSerializer.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +namespace AZ +{ + class JsonPathSerializer + : public BaseJsonSerializer + { + public: + AZ_RTTI(JsonPathSerializer, "{F6FBA901-07E0-4F03-A0B6-72A9A6CE1E96}", BaseJsonSerializer); + AZ_CLASS_ALLOCATOR_DECL; + JsonSerializationResult::Result Load(void* outputValue, const Uuid& outputValueTypeId, const rapidjson::Value& inputValue, + JsonDeserializerContext& context) override; + JsonSerializationResult::Result Store(rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue, + const Uuid& valueTypeId, JsonSerializerContext& context) override; + }; +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/azcore_files.cmake b/Code/Framework/AzCore/AzCore/azcore_files.cmake index e8001f7215..0dfce11247 100644 --- a/Code/Framework/AzCore/AzCore/azcore_files.cmake +++ b/Code/Framework/AzCore/AzCore/azcore_files.cmake @@ -533,6 +533,8 @@ set(FILES Serialization/Json/JsonUtils.cpp Serialization/Json/MapSerializer.h Serialization/Json/MapSerializer.cpp + Serialization/Json/PathSerializer.h + Serialization/Json/PathSerializer.cpp Serialization/Json/RegistrationContext.h Serialization/Json/RegistrationContext.cpp Serialization/Json/SmartPointerSerializer.h diff --git a/Code/Framework/AzCore/Tests/Serialization/Json/PathSerializerTests.cpp b/Code/Framework/AzCore/Tests/Serialization/Json/PathSerializerTests.cpp new file mode 100644 index 0000000000..e00a4171a2 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Serialization/Json/PathSerializerTests.cpp @@ -0,0 +1,106 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include +#include + +namespace JsonSerializationTests +{ + template + class PathTestDescription + : public JsonSerializerConformityTestDescriptor + { + public: + using JsonSerializerConformityTestDescriptor::Reflect; + void Reflect(AZStd::unique_ptr& serializeContext) override + { + AZ::IO::PathReflect(serializeContext.get()); + } + void Reflect(AZStd::unique_ptr& jsonContext) override + { + AZ::IO::PathReflect(jsonContext.get()); + } + AZStd::shared_ptr CreateSerializer() override + { + return AZStd::make_shared(); + } + + AZStd::shared_ptr CreateDefaultInstance() override + { + return AZStd::make_shared(); + } + + AZStd::shared_ptr CreateFullySetInstance() override + { + return AZStd::make_shared("O3DE/Relative/Path"); + } + + AZStd::string_view GetJsonForFullySetInstance() override + { + return R"("O3DE/Relative/Path")"; + } + + void ConfigureFeatures(JsonSerializerConformityTestDescriptorFeatures& features) override + { + features.EnableJsonType(rapidjson::kStringType); + features.m_supportsPartialInitialization = false; + features.m_supportsInjection = false; + } + + bool AreEqual(const PathType& lhs, const PathType& rhs) override + { + return lhs == rhs; + } + }; + + using PathConformityTestTypes = ::testing::Types< + PathTestDescription, + PathTestDescription + >; + INSTANTIATE_TYPED_TEST_CASE_P(Path, JsonSerializerConformityTests, PathConformityTestTypes); + + + class PathSerializerTests + : public BaseJsonSerializerFixture + { + public: + AZStd::unique_ptr m_serializer; + + void SetUp() override + { + BaseJsonSerializerFixture::SetUp(); + m_serializer = AZStd::make_unique(); + } + + void TearDown() override + { + m_serializer.reset(); + BaseJsonSerializerFixture::TearDown(); + } + }; + + TEST_F(PathSerializerTests, LoadingIntoFixedMaxPath_GreaterThanMaxPathLength_Fails) + { + AZ::IO::Path testPath; + // Fill a path greater than the AZ::IO::MaxPathLength in write it to Json + testPath.Native().append(AZ::IO::MaxPathLength + 2, 'a'); + + rapidjson::Value loadPathValue; + AZ::JsonSerializationResult::ResultCode resultCode = m_serializer->Store(loadPathValue, + &testPath, nullptr, azrtti_typeid(), *m_jsonSerializationContext); + EXPECT_EQ(AZ::JsonSerializationResult::Outcomes::Success, resultCode.GetOutcome()); + + AZ::IO::FixedMaxPath resultPath; + AZ::JsonSerializationResult::ResultCode result = m_serializer->Load(&resultPath, azrtti_typeid(), + loadPathValue, *m_jsonDeserializationContext); + EXPECT_GE(result.GetOutcome(), AZ::JsonSerializationResult::Outcomes::Invalid); + } +} // namespace JsonSerializationTests diff --git a/Code/Framework/AzCore/Tests/azcoretests_files.cmake b/Code/Framework/AzCore/Tests/azcoretests_files.cmake index b7fe113bc6..98f268b61a 100644 --- a/Code/Framework/AzCore/Tests/azcoretests_files.cmake +++ b/Code/Framework/AzCore/Tests/azcoretests_files.cmake @@ -111,6 +111,7 @@ set(FILES Serialization/Json/MapSerializerTests.cpp Serialization/Json/MathVectorSerializerTests.cpp Serialization/Json/MathMatrixSerializerTests.cpp + Serialization/Json/PathSerializerTests.cpp Serialization/Json/SmartPointerSerializerTests.cpp Serialization/Json/StringSerializerTests.cpp Serialization/Json/TestCases.h From 069eb6710d38fa67fbd94010e30a2794cf0ff75d Mon Sep 17 00:00:00 2001 From: chiyenteng <82238204+chiyenteng@users.noreply.github.com> Date: Wed, 15 Dec 2021 08:25:18 -0800 Subject: [PATCH 112/399] Make python automated test 'test_WindowsMacPlatforms_MoveCorruptedSliceFile_MoveSuccess' to use prefab instead Signed-off-by: chiyenteng <82238204+chiyenteng@users.noreply.github.com> --- .../ap_fixtures/clear_moveoutput_fixture.py | 2 +- .../asset_relocator_tests.py | 12 +- .../C21968388/DependencyScannerAsset.prefab | 908 ++++++++++++++++++ 3 files changed, 915 insertions(+), 7 deletions(-) create mode 100644 AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/assets/C21968388/DependencyScannerAsset.prefab diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py index 30ecac9a65..17da43a5b9 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py @@ -4,7 +4,7 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT -Fixture for clearing out 'MoveOutput' folders from \dev and \dev\PROJECT +Fixture for clearing out 'MoveOutput' folders from \\dev and \\dev\\PROJECT """ # Import builtin libraries diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_relocator_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_relocator_tests.py index 744720323e..42c83c7c25 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_relocator_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_relocator_tests.py @@ -169,17 +169,17 @@ class TestsAssetRelocator_WindowsAndMac(object): @pytest.mark.test_case_id("C21968388") @pytest.mark.assetpipeline - def test_WindowsMacPlatforms_MoveCorruptedSliceFile_MoveSuccess(self, request, workspace, ap_setup_fixture, + def test_WindowsMacPlatforms_MoveCorruptedPrefabFile_MoveSuccess(self, request, workspace, ap_setup_fixture, asset_processor): """ Asset with UUID/AssetId reference in non-standard format is successfully scanned and relocated to the MoveOutput folder. - This test uses a pre-corrupted .slice file. + This test uses a pre-corrupted .prefab file. Test Steps: - 1. Create temporary testing environment with a corrupted slice - 2. Attempt to move the corrupted slice - 3. Verify that corrupted slice was moved successfully + 1. Create temporary testing environment with a corrupted prefab + 2. Attempt to move the corrupted prefab + 3. Verify that corrupted prefab was moved successfully """ env = ap_setup_fixture @@ -187,7 +187,7 @@ class TestsAssetRelocator_WindowsAndMac(object): asset_folder = "C21968388" source_dir, _ = asset_processor.prepare_test_environment(env["tests_dir"], asset_folder) - filename = "DependencyScannerAsset.slice" + filename = "DependencyScannerAsset.prefab" file_path = os.path.join(source_dir, filename) dst_rel_path = os.path.join("MoveOutput", filename) dst_full_path = os.path.join(source_dir, dst_rel_path) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/assets/C21968388/DependencyScannerAsset.prefab b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/assets/C21968388/DependencyScannerAsset.prefab new file mode 100644 index 0000000000..1ba25b4463 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/assets/C21968388/DependencyScannerAsset.prefab @@ -0,0 +1,908 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "DependencyScannerAsset", + "Components": { + "Component_[10182366347512475253]": { + "$type": "EditorPrefabComponent", + "Id": 10182366347512475253 + }, + "Component_[12917798267488243668]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12917798267488243668 + }, + "Component_[3261249813163778338]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3261249813163778338 + }, + "Component_[3837204912784440039]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 3837204912784440039 + }, + "Component_[4272963378099646759]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 4272963378099646759, + "Parent Entity": "" + }, + "Component_[4848458548047175816]": { + "$type": "EditorVisibilityComponent", + "Id": 4848458548047175816 + }, + "Component_[5787060997243919943]": { + "$type": "EditorInspectorComponent", + "Id": 5787060997243919943 + }, + "Component_[7804170251266531779]": { + "$type": "EditorLockComponent", + "Id": 7804170251266531779 + }, + "Component_[7874177159288365422]": { + "$type": "EditorEntitySortComponent", + "Id": 7874177159288365422 + }, + "Component_[8018146290632383969]": { + "$type": "EditorEntityIconComponent", + "Id": 8018146290632383969 + }, + "Component_[8452360690590857075]": { + "$type": "SelectionComponent", + "Id": 8452360690590857075 + } + } + }, + "Entities": { + "Entity_[274004659287]": { + "Id": "Entity_[274004659287]", + "Name": "DependencyScannerAsset", + "Components": { + "Component_[10849460799799271301]": { + "$type": "EditorPendingCompositionComponent", + "Id": 10849460799799271301 + }, + "Component_[11098142762746045658]": { + "$type": "SelectionComponent", + "Id": 11098142762746045658 + }, + "Component_[11154538629717040387]": { + "$type": "EditorEntitySortComponent", + "Id": 11154538629717040387, + "Child Entity Order": [ + "Entity_[305822185575]", + "Entity_[278299626583]", + "Entity_[282594593879]", + "Entity_[286889561175]", + "Entity_[291184528471]" + ] + }, + "Component_[1365196255752273753]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1365196255752273753 + }, + "Component_[280906579560376421]": { + "$type": "EditorLockComponent", + "Id": 280906579560376421 + }, + "Component_[4629965429001113748]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4629965429001113748 + }, + "Component_[4876910656129741263]": { + "$type": "EditorEntityIconComponent", + "Id": 4876910656129741263 + }, + "Component_[5763306492614623496]": { + "$type": "EditorInspectorComponent", + "Id": 5763306492614623496, + "ComponentOrderEntryArray": [ + { + "ComponentId": 7514977506847036117 + } + ] + }, + "Component_[7327709568605458460]": { + "$type": "EditorVisibilityComponent", + "Id": 7327709568605458460 + }, + "Component_[7514977506847036117]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7514977506847036117, + "Parent Entity": "ContainerEntity" + } + } + }, + "Entity_[278299626583]": { + "Id": "Entity_[278299626583]", + "Name": "AssetIDMatch", + "Components": { + "Component_[10285740519857855186]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10285740519857855186 + }, + "Component_[11273731016303624898]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11273731016303624898, + "Parent Entity": "Entity_[274004659287]" + }, + "Component_[1136790983026972010]": { + "$type": "EditorVisibilityComponent", + "Id": 1136790983026972010 + }, + "Component_[12777313618328131055]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12777313618328131055 + }, + "Component_[13256044902558773795]": { + "$type": "EditorLockComponent", + "Id": 13256044902558773795 + }, + "Component_[15834551022302435776]": { + "$type": "EditorInspectorComponent", + "Id": 15834551022302435776, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11273731016303624898 + }, + { + "ComponentId": 9671522714018290727, + "SortIndex": 1 + } + ] + }, + "Component_[16345420368214930095]": { + "$type": "SelectionComponent", + "Id": 16345420368214930095 + }, + "Component_[5309075942188429052]": { + "$type": "EditorEntitySortComponent", + "Id": 5309075942188429052 + }, + "Component_[8639731896786645938]": { + "$type": "EditorEntityIconComponent", + "Id": 8639731896786645938 + }, + "Component_[9844585173698551415]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9844585173698551415 + } + } + }, + "Entity_[282594593879]": { + "Id": "Entity_[282594593879]", + "Name": "UUIDMatch", + "Components": { + "Component_[10379494986254888760]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10379494986254888760 + }, + "Component_[10932830014545295552]": { + "$type": "SelectionComponent", + "Id": 10932830014545295552 + }, + "Component_[16077882919902242532]": { + "$type": "EditorEntitySortComponent", + "Id": 16077882919902242532 + }, + "Component_[2150375322459274584]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2150375322459274584 + }, + "Component_[2645455411436465820]": { + "$type": "EditorEntityIconComponent", + "Id": 2645455411436465820 + }, + "Component_[5422214869037468733]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5422214869037468733 + }, + "Component_[7238126895911071330]": { + "$type": "EditorInspectorComponent", + "Id": 7238126895911071330, + "ComponentOrderEntryArray": [ + { + "ComponentId": 8407607000804893064 + }, + { + "ComponentId": 12952323341649885242, + "SortIndex": 1 + } + ] + }, + "Component_[7981670269715131988]": { + "$type": "EditorVisibilityComponent", + "Id": 7981670269715131988 + }, + "Component_[8407607000804893064]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 8407607000804893064, + "Parent Entity": "Entity_[274004659287]" + }, + "Component_[8567641786004090803]": { + "$type": "EditorLockComponent", + "Id": 8567641786004090803 + } + } + }, + "Entity_[286889561175]": { + "Id": "Entity_[286889561175]", + "Name": "RelativeProductMatch", + "Components": { + "Component_[10180645282669228972]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10180645282669228972, + "Parent Entity": "Entity_[274004659287]" + }, + "Component_[10200807690182688147]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10200807690182688147 + }, + "Component_[11014661873645081316]": { + "$type": "EditorInspectorComponent", + "Id": 11014661873645081316, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10180645282669228972 + }, + { + "ComponentId": 12869852248016369650, + "SortIndex": 1 + } + ] + }, + "Component_[12869852248016369650]": { + "$type": "{77CDE991-EC1A-B7C1-B112-7456ABAC81A1} EditorSpawnerComponent", + "Id": 12869852248016369650, + "Slice": { + "assetId": { + "guid": "{29F14025-3BD2-5CA9-A9DE-B8B349268C2F}", + "subId": 2 + }, + "assetHint": "slices/bullet.dynamicslice" + } + }, + "Component_[15136448544716183259]": { + "$type": "EditorOnlyEntityComponent", + "Id": 15136448544716183259 + }, + "Component_[15966001894874626764]": { + "$type": "SelectionComponent", + "Id": 15966001894874626764 + }, + "Component_[16167982631516160155]": { + "$type": "EditorEntityIconComponent", + "Id": 16167982631516160155 + }, + "Component_[16672905198052847867]": { + "$type": "EditorEntitySortComponent", + "Id": 16672905198052847867 + }, + "Component_[4506946122562404190]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4506946122562404190 + }, + "Component_[6836304267269231429]": { + "$type": "EditorLockComponent", + "Id": 6836304267269231429 + }, + "Component_[8756593519140349183]": { + "$type": "EditorVisibilityComponent", + "Id": 8756593519140349183 + } + } + }, + "Entity_[291184528471]": { + "Id": "Entity_[291184528471]", + "Name": "RelativeSourceMatch", + "Components": { + "Component_[11694027325905361034]": { + "$type": "EditorEntitySortComponent", + "Id": 11694027325905361034 + }, + "Component_[13891029613307790064]": { + "$type": "EditorEntityIconComponent", + "Id": 13891029613307790064 + }, + "Component_[15933511034411930900]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15933511034411930900, + "Parent Entity": "Entity_[274004659287]" + }, + "Component_[17540827492846961803]": { + "$type": "EditorLockComponent", + "Id": 17540827492846961803 + }, + "Component_[2850297705939373458]": { + "$type": "SelectionComponent", + "Id": 2850297705939373458 + }, + "Component_[4809103331004345812]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4809103331004345812 + }, + "Component_[5654779331777839943]": { + "$type": "EditorInspectorComponent", + "Id": 5654779331777839943, + "ComponentOrderEntryArray": [ + { + "ComponentId": 15933511034411930900 + }, + { + "ComponentId": 10284025539900054207, + "SortIndex": 1 + } + ] + }, + "Component_[6097019179005900386]": { + "$type": "EditorVisibilityComponent", + "Id": 6097019179005900386 + }, + "Component_[7748387730313625157]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 7748387730313625157 + }, + "Component_[9822265453841229082]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9822265453841229082 + } + } + }, + "Entity_[297232250983]": { + "Id": "Entity_[297232250983]", + "Name": "1151F14D38A65579888ABE3139882E68:[0]", + "Components": { + "Component_[11936148741777754959]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 11936148741777754959 + }, + "Component_[12610073699988743015]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12610073699988743015, + "Parent Entity": "Entity_[305822185575]" + }, + "Component_[1603205169722765279]": { + "$type": "EditorLockComponent", + "Id": 1603205169722765279 + }, + "Component_[17691206348057560715]": { + "$type": "EditorPendingCompositionComponent", + "Id": 17691206348057560715 + }, + "Component_[2711821203680330048]": { + "$type": "SelectionComponent", + "Id": 2711821203680330048 + }, + "Component_[3887480309311474860]": { + "$type": "EditorVisibilityComponent", + "Id": 3887480309311474860 + }, + "Component_[5853968883842282450]": { + "$type": "EditorEntityIconComponent", + "Id": 5853968883842282450 + }, + "Component_[7679080692843343453]": { + "$type": "EditorCommentComponent", + "Id": 7679080692843343453, + "Configuration": "Asset ID that matches an existing dependency of this asset (am_grass1.mtl)" + }, + "Component_[8024752235278898687]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8024752235278898687 + }, + "Component_[8373296084678231042]": { + "$type": "EditorEntitySortComponent", + "Id": 8373296084678231042 + }, + "Component_[9782967158965587831]": { + "$type": "EditorInspectorComponent", + "Id": 9782967158965587831, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12610073699988743015 + }, + { + "ComponentId": 7679080692843343453, + "SortIndex": 1 + } + ] + } + } + }, + "Entity_[301527218279]": { + "Id": "Entity_[301527218279]", + "Name": "Slices/bullet.dynamicslice", + "Components": { + "Component_[15613078542630153866]": { + "$type": "EditorInspectorComponent", + "Id": 15613078542630153866, + "ComponentOrderEntryArray": [ + { + "ComponentId": 2483032678718995164 + }, + { + "ComponentId": 9734604379060902193, + "SortIndex": 1 + } + ] + }, + "Component_[16098942854900817264]": { + "$type": "SelectionComponent", + "Id": 16098942854900817264 + }, + "Component_[16720139961856477500]": { + "$type": "EditorEntitySortComponent", + "Id": 16720139961856477500 + }, + "Component_[2483032678718995164]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 2483032678718995164, + "Parent Entity": "Entity_[305822185575]" + }, + "Component_[2502984783426127018]": { + "$type": "EditorLockComponent", + "Id": 2502984783426127018 + }, + "Component_[46714013890147210]": { + "$type": "EditorOnlyEntityComponent", + "Id": 46714013890147210 + }, + "Component_[4907474530744780429]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4907474530744780429 + }, + "Component_[5420332829198300813]": { + "$type": "EditorPendingCompositionComponent", + "Id": 5420332829198300813 + }, + "Component_[7683578164681693579]": { + "$type": "EditorEntityIconComponent", + "Id": 7683578164681693579 + }, + "Component_[8312115250363172310]": { + "$type": "EditorVisibilityComponent", + "Id": 8312115250363172310 + }, + "Component_[9734604379060902193]": { + "$type": "EditorCommentComponent", + "Id": 9734604379060902193, + "Configuration": "Relative product path that matches an existing dependency of this asset" + } + } + }, + "Entity_[305822185575]": { + "Id": "Entity_[305822185575]", + "Name": "AssetReferences", + "Components": { + "Component_[13422135993444528172]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13422135993444528172 + }, + "Component_[13988015667379021413]": { + "$type": "EditorLockComponent", + "Id": 13988015667379021413 + }, + "Component_[14885956487876614434]": { + "$type": "EditorVisibilityComponent", + "Id": 14885956487876614434 + }, + "Component_[15550715415947731915]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15550715415947731915 + }, + "Component_[2576266145980379805]": { + "$type": "EditorInspectorComponent", + "Id": 2576266145980379805, + "ComponentOrderEntryArray": [ + { + "ComponentId": 3176911836967955668 + }, + { + "ComponentId": 836721549453007197, + "SortIndex": 1 + } + ] + }, + "Component_[3176911836967955668]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3176911836967955668, + "Parent Entity": "Entity_[274004659287]" + }, + "Component_[5613459137294642234]": { + "$type": "SelectionComponent", + "Id": 5613459137294642234 + }, + "Component_[6400873582148097152]": { + "$type": "EditorEntityIconComponent", + "Id": 6400873582148097152 + }, + "Component_[684670817803453913]": { + "$type": "EditorEntitySortComponent", + "Id": 684670817803453913, + "Child Entity Order": [ + "Entity_[323002054759]", + "Entity_[327297022055]", + "Entity_[301527218279]", + "Entity_[318707087463]", + "Entity_[297232250983]", + "Entity_[314412120167]", + "Entity_[331591989351]", + "Entity_[310117152871]" + ] + }, + "Component_[8118206464926826097]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118206464926826097 + }, + "Component_[836721549453007197]": { + "$type": "EditorCommentComponent", + "Id": 836721549453007197, + "Configuration": "Entity names are used to trigger the missing dependency scanner. Comments are stripped from dynamic slices." + } + } + }, + "Entity_[310117152871]": { + "Id": "Entity_[310117152871]", + "Name": "Materials/FakeMaterial.mtl", + "Components": { + "Component_[10593857511582714674]": { + "$type": "EditorInspectorComponent", + "Id": 10593857511582714674, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11797216659359478300 + }, + { + "ComponentId": 13816702107134233983, + "SortIndex": 1 + } + ] + }, + "Component_[11797216659359478300]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11797216659359478300, + "Parent Entity": "Entity_[305822185575]" + }, + "Component_[13816702107134233983]": { + "$type": "EditorCommentComponent", + "Id": 13816702107134233983, + "Configuration": "Invalid path that does not match an existing dependency of this asset" + }, + "Component_[14868583012186337705]": { + "$type": "EditorOnlyEntityComponent", + "Id": 14868583012186337705 + }, + "Component_[14965348027145283648]": { + "$type": "EditorEntitySortComponent", + "Id": 14965348027145283648 + }, + "Component_[15075774238648121688]": { + "$type": "EditorEntityIconComponent", + "Id": 15075774238648121688 + }, + "Component_[16157883709857447266]": { + "$type": "EditorLockComponent", + "Id": 16157883709857447266 + }, + "Component_[17712080510249108208]": { + "$type": "EditorVisibilityComponent", + "Id": 17712080510249108208 + }, + "Component_[2247408514677946398]": { + "$type": "SelectionComponent", + "Id": 2247408514677946398 + }, + "Component_[5565369976544134481]": { + "$type": "EditorPendingCompositionComponent", + "Id": 5565369976544134481 + }, + "Component_[6044814215558788086]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 6044814215558788086 + } + } + }, + "Entity_[314412120167]": { + "Id": "Entity_[314412120167]", + "Name": "88888888-4444-4444-4444-CCCCCCCCCCCC", + "Components": { + "Component_[10072177500579430176]": { + "$type": "EditorLockComponent", + "Id": 10072177500579430176 + }, + "Component_[10853215476279564671]": { + "$type": "EditorCommentComponent", + "Id": 10853215476279564671, + "Configuration": "UUID that does not exist" + }, + "Component_[13413154971272749631]": { + "$type": "SelectionComponent", + "Id": 13413154971272749631 + }, + "Component_[15316173756367163440]": { + "$type": "EditorInspectorComponent", + "Id": 15316173756367163440, + "ComponentOrderEntryArray": [ + { + "ComponentId": 3266728630359207653 + }, + { + "ComponentId": 10853215476279564671, + "SortIndex": 1 + } + ] + }, + "Component_[15809307959802829291]": { + "$type": "EditorEntitySortComponent", + "Id": 15809307959802829291 + }, + "Component_[17649652752752487081]": { + "$type": "EditorEntityIconComponent", + "Id": 17649652752752487081 + }, + "Component_[2130036493438440377]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2130036493438440377 + }, + "Component_[3266728630359207653]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3266728630359207653, + "Parent Entity": "Entity_[305822185575]" + }, + "Component_[5892125564582966187]": { + "$type": "EditorVisibilityComponent", + "Id": 5892125564582966187 + }, + "Component_[597602776660257245]": { + "$type": "EditorOnlyEntityComponent", + "Id": 597602776660257245 + }, + "Component_[8238652007701465495]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8238652007701465495 + } + } + }, + "Entity_[318707087463]": { + "Id": "Entity_[318707087463]", + "Name": "BBA1A5494C73578894BF0692CDA5FC33", + "Components": { + "Component_[10222455787643359341]": { + "$type": "EditorPendingCompositionComponent", + "Id": 10222455787643359341 + }, + "Component_[11487845392038268864]": { + "$type": "SelectionComponent", + "Id": 11487845392038268864 + }, + "Component_[12135534290310046764]": { + "$type": "EditorVisibilityComponent", + "Id": 12135534290310046764 + }, + "Component_[14412623226519978498]": { + "$type": "EditorOnlyEntityComponent", + "Id": 14412623226519978498 + }, + "Component_[14516371382857751872]": { + "$type": "EditorEntityIconComponent", + "Id": 14516371382857751872 + }, + "Component_[16011611743122468576]": { + "$type": "EditorInspectorComponent", + "Id": 16011611743122468576, + "ComponentOrderEntryArray": [ + { + "ComponentId": 4157328932578509254 + }, + { + "ComponentId": 8524796860605854850, + "SortIndex": 1 + } + ] + }, + "Component_[3813931698067937301]": { + "$type": "EditorEntitySortComponent", + "Id": 3813931698067937301 + }, + "Component_[4157328932578509254]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 4157328932578509254, + "Parent Entity": "Entity_[305822185575]" + }, + "Component_[8524796860605854850]": { + "$type": "EditorCommentComponent", + "Id": 8524796860605854850, + "Configuration": "UUID that matches an existing dependency of this asset (lumbertank_body.cgf)" + }, + "Component_[8660819596448699427]": { + "$type": "EditorLockComponent", + "Id": 8660819596448699427 + }, + "Component_[8768262795169819026]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8768262795169819026 + } + } + }, + "Entity_[323002054759]": { + "Id": "Entity_[323002054759]", + "Name": "Materials/am_rockground.mtl", + "Components": { + "Component_[13459503224133892836]": { + "$type": "EditorEntityIconComponent", + "Id": 13459503224133892836 + }, + "Component_[1346698328271204385]": { + "$type": "EditorVisibilityComponent", + "Id": 1346698328271204385 + }, + "Component_[13662830241397426219]": { + "$type": "SelectionComponent", + "Id": 13662830241397426219 + }, + "Component_[14169735046939083706]": { + "$type": "EditorInspectorComponent", + "Id": 14169735046939083706, + "ComponentOrderEntryArray": [ + { + "ComponentId": 833157791612452820 + }, + { + "ComponentId": 3573928838741352115, + "SortIndex": 1 + } + ] + }, + "Component_[16049700338512950477]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16049700338512950477 + }, + "Component_[16191253524853449302]": { + "$type": "EditorOnlyEntityComponent", + "Id": 16191253524853449302 + }, + "Component_[1737139665005484521]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1737139665005484521 + }, + "Component_[17562284119637289685]": { + "$type": "EditorEntitySortComponent", + "Id": 17562284119637289685 + }, + "Component_[3573928838741352115]": { + "$type": "EditorCommentComponent", + "Id": 3573928838741352115, + "Configuration": "Relative source path that matches an existing dependency of this asset" + }, + "Component_[485401015869338526]": { + "$type": "EditorLockComponent", + "Id": 485401015869338526 + }, + "Component_[833157791612452820]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 833157791612452820, + "Parent Entity": "Entity_[305822185575]" + } + } + }, + "Entity_[327297022055]": { + "Id": "Entity_[327297022055]", + "Name": "Config/Game.xml", + "Components": { + "Component_[11848260632907964142]": { + "$type": "EditorInspectorComponent", + "Id": 11848260632907964142, + "ComponentOrderEntryArray": [ + { + "ComponentId": 497869813123895830 + }, + { + "ComponentId": 5248857300320701553, + "SortIndex": 1 + } + ] + }, + "Component_[12842864953492512672]": { + "$type": "EditorEntitySortComponent", + "Id": 12842864953492512672 + }, + "Component_[16656501539883791157]": { + "$type": "EditorLockComponent", + "Id": 16656501539883791157 + }, + "Component_[17365661125603122123]": { + "$type": "EditorEntityIconComponent", + "Id": 17365661125603122123 + }, + "Component_[2967487135389707052]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 2967487135389707052 + }, + "Component_[3356294263684362888]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3356294263684362888 + }, + "Component_[497869813123895830]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 497869813123895830, + "Parent Entity": "Entity_[305822185575]" + }, + "Component_[5248857300320701553]": { + "$type": "EditorCommentComponent", + "Id": 5248857300320701553, + "Configuration": "Valid path that does not match an existing dependency of this asset. Should report as a missing dependency" + }, + "Component_[746309483212393367]": { + "$type": "SelectionComponent", + "Id": 746309483212393367 + }, + "Component_[8319831469290771470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8319831469290771470 + }, + "Component_[9369067377618608622]": { + "$type": "EditorVisibilityComponent", + "Id": 9369067377618608622 + } + } + }, + "Entity_[331591989351]": { + "Id": "Entity_[331591989351]", + "Name": "1151F14D38A65579888ABE3139882E68:[333]", + "Components": { + "Component_[104857639379046106]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 104857639379046106, + "Parent Entity": "Entity_[305822185575]" + }, + "Component_[1061601983221247493]": { + "$type": "EditorLockComponent", + "Id": 1061601983221247493 + }, + "Component_[11028443253330664986]": { + "$type": "EditorVisibilityComponent", + "Id": 11028443253330664986 + }, + "Component_[13806275118632081006]": { + "$type": "EditorEntitySortComponent", + "Id": 13806275118632081006 + }, + "Component_[13922573109551604801]": { + "$type": "EditorEntityIconComponent", + "Id": 13922573109551604801 + }, + "Component_[17027032709917108335]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 17027032709917108335 + }, + "Component_[17030988165269698825]": { + "$type": "EditorOnlyEntityComponent", + "Id": 17030988165269698825 + }, + "Component_[2294579021665535860]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2294579021665535860 + }, + "Component_[5863078697041048226]": { + "$type": "EditorInspectorComponent", + "Id": 5863078697041048226, + "ComponentOrderEntryArray": [ + { + "ComponentId": 104857639379046106 + }, + { + "ComponentId": 9466290982672370664, + "SortIndex": 1 + } + ] + }, + "Component_[7608263859116142496]": { + "$type": "SelectionComponent", + "Id": 7608263859116142496 + }, + "Component_[9466290982672370664]": { + "$type": "EditorCommentComponent", + "Id": 9466290982672370664, + "Configuration": "Asset ID that does not exist (am_grass1.mtl UUID, no matching product ID)" + } + } + } + } +} \ No newline at end of file From 105524b7c05409c174a27e5511d9ff612e602b26 Mon Sep 17 00:00:00 2001 From: AMZN-Phil Date: Wed, 15 Dec 2021 09:29:40 -0800 Subject: [PATCH 113/399] Add a missing comma to fix generator Signed-off-by: AMZN-Phil --- .../Platform/Windows/ProjectBuilderWorker_windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp b/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp index 79258d83ea..e355c65762 100644 --- a/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp +++ b/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp @@ -19,7 +19,7 @@ namespace O3DE::ProjectManager QString targetBuildPath = QDir(m_projectInfo.m_path).filePath(ProjectBuildPathPostfix); return AZ::Success(QStringList{ ProjectCMakeCommand, - "-G", "Visual Studio 16 2019" + "-G", "Visual Studio 16 2019", "-B", targetBuildPath, "-S", m_projectInfo.m_path, QString("-DLY_3RDPARTY_PATH=").append(thirdPartyPath), From 352b4ab6907eb9bf7890bd4670c34a1781d12409 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Wed, 15 Dec 2021 10:23:58 -0800 Subject: [PATCH 114/399] Make DomValue final Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index ecaea3db3d..1b69c73ecc 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -147,7 +147,7 @@ namespace AZ::Dom //! value itself (objects, arrays, and nodes) are copied by new Values only when their contents change, so care should be taken in //! performance critical code to avoid mutation operations such as operator[] to avoid copies. It is recommended that an immutable Value //! be explicitly be stored as a `const Value` to avoid accidental detach and copy operations. - class Value + class Value final { public: // Constructors... From 411674e8fcefaf16b97b8483c4e986c3ce53820a Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 15 Dec 2021 16:51:14 -0800 Subject: [PATCH 115/399] chore[EmotionFX]: replace usage of SafeNormalize ref: https://github.com/o3de/o3de/pull/6433 Signed-off-by: Michael Pollind --- .../EMotionFX/Rendering/Common/RenderUtil.cpp | 2 +- .../EMotionFX/Source/BlendTreeFootIKNode.cpp | 4 ++-- .../EMotionFX/Source/BlendTreeTwoLinkIKNode.cpp | 17 ++++++++--------- Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp | 16 ++++++++-------- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp index 6fd28ee72f..0ebaf8bfee 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp @@ -688,7 +688,7 @@ namespace MCommon const AZ::Vector3 nodeWorldPos = pose->GetWorldSpaceTransform(jointIndex).m_position; const AZ::Vector3 parentWorldPos = pose->GetWorldSpaceTransform(parentIndex).m_position; const AZ::Vector3 bone = parentWorldPos - nodeWorldPos; - const AZ::Vector3 boneDirection = MCore::SafeNormalize(bone); + const AZ::Vector3 boneDirection = bone.GetNormalizedSafe(); const float boneLength = MCore::SafeLength(bone); const float boneScale = GetBoneScale(actorInstance, joint); const float parentBoneScale = GetBoneScale(actorInstance, skeleton->GetNode(parentIndex)); diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeFootIKNode.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeFootIKNode.cpp index d81b090300..25fcfa7193 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeFootIKNode.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeFootIKNode.cpp @@ -258,9 +258,9 @@ namespace EMotionFX // Calculate the matrix to rotate the solve plane. void BlendTreeFootIKNode::CalculateMatrix(const AZ::Vector3& goal, const AZ::Vector3& bendDir, AZ::Matrix3x3* outForward) { - const AZ::Vector3 x = MCore::SafeNormalize(goal); + const AZ::Vector3 x = goal.GetNormalizedSafe(); const float dot = bendDir.Dot(x); - const AZ::Vector3 y = MCore::SafeNormalize(bendDir - (dot * x)); + const AZ::Vector3 y = (bendDir - (dot * x)).GetNormalizedSafe(); const AZ::Vector3 z = x.Cross(y); outForward->SetRow(0, x); outForward->SetRow(1, y); diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeTwoLinkIKNode.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeTwoLinkIKNode.cpp index 9a91a59390..ec9d69c68a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeTwoLinkIKNode.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeTwoLinkIKNode.cpp @@ -189,11 +189,11 @@ namespace EMotionFX void BlendTreeTwoLinkIKNode::CalculateMatrix(const AZ::Vector3& goal, const AZ::Vector3& bendDir, AZ::Matrix3x3* outForward) { // the inverse matrix defines a coordinate system whose x axis contains P, so X = unit(P). - const AZ::Vector3 x = MCore::SafeNormalize(goal); + const AZ::Vector3 x = goal.GetNormalizedSafe(); // the y axis of the inverse is perpendicular to P, so Y = unit( D - X(D . X) ). const float dot = bendDir.Dot(x); - const AZ::Vector3 y = MCore::SafeNormalize(bendDir - (dot * x)); + const AZ::Vector3 y = (bendDir - (dot * x)).GetNormalizedSafe(); // the z axis of the inverse is perpendicular to both X and Y, so Z = X x Y. const AZ::Vector3 z = x.Cross(y); @@ -372,11 +372,11 @@ namespace EMotionFX if (m_relativeBendDir && !m_extractBendDir) { bendDir = actorInstance->GetWorldSpaceTransform().m_rotation.TransformVector(bendDir); - bendDir = MCore::SafeNormalize(bendDir); + bendDir.NormalizeSafe(); } else { - bendDir = MCore::SafeNormalize(bendDir); + bendDir.NormalizeSafe(); } // if end node rotation is enabled @@ -470,8 +470,8 @@ namespace EMotionFX // calculate the differences between the current forward vector and the new one after IK AZ::Vector3 oldForward = globalTransformB.m_position - globalTransformA.m_position; AZ::Vector3 newForward = midPos - globalTransformA.m_position; - oldForward = MCore::SafeNormalize(oldForward); - newForward = MCore::SafeNormalize(newForward); + oldForward.NormalizeSafe(); + newForward.NormalizeSafe(); // perform a delta rotation to rotate into the new direction after IK float dotProduct = oldForward.Dot(newForward); @@ -499,9 +499,8 @@ namespace EMotionFX oldForward = endEffectorNodePos - globalTransformB.m_position; } - oldForward = MCore::SafeNormalize(oldForward); - newForward = goal - globalTransformB.m_position; - newForward = MCore::SafeNormalize(newForward); + oldForward.NormalizeSafe(); + newForward = (goal - globalTransformB.m_position).GetNormalizedSafe(); // calculate the delta rotation dotProduct = oldForward.Dot(newForward); diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp index 9845ec1939..9130636e2a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp @@ -581,8 +581,8 @@ namespace EMotionFX &curTangent, &curBitangent); // normalize the vectors - curTangent = MCore::SafeNormalize(curTangent); - curBitangent = MCore::SafeNormalize(curBitangent); + curTangent.NormalizeSafe(); + curBitangent.NormalizeSafe(); // store the tangents in the orgTangents array const AZ::Vector4 vec4Tangent(curTangent.GetX(), curTangent.GetY(), curTangent.GetZ(), 1.0f); @@ -605,7 +605,7 @@ namespace EMotionFX { // get the normal AZ::Vector3 normal(normals[i]); - normal = MCore::SafeNormalize(normal); + normal.NormalizeSafe(); // get the tangent AZ::Vector3 tangent = AZ::Vector3(orgTangents[i].GetX(), orgTangents[i].GetY(), orgTangents[i].GetZ()); @@ -631,7 +631,7 @@ namespace EMotionFX // Gram-Schmidt orthogonalize AZ::Vector3 fixedTangent = tangent - (normal * normal.Dot(tangent)); - fixedTangent = MCore::SafeNormalize(fixedTangent); + fixedTangent.NormalizeSafe(); // calculate handedness const AZ::Vector3 crossResult = normal.Cross(tangent); @@ -1671,7 +1671,7 @@ namespace EMotionFX const AZ::Vector3& posA = positions[ indexA ]; const AZ::Vector3& posB = positions[ indexB ]; const AZ::Vector3& posC = positions[ indexC ]; - AZ::Vector3 faceNormal = MCore::SafeNormalize((posB - posA).Cross(posC - posB)); + AZ::Vector3 faceNormal = (posB - posA).Cross(posC - posB).GetNormalizedSafe(); // store the tangents in the orgTangents array smoothNormals[ orgVerts[indexA] ] += faceNormal; @@ -1684,7 +1684,7 @@ namespace EMotionFX // normalize for (uint32 i = 0; i < m_numOrgVerts; ++i) { - smoothNormals[i] = MCore::SafeNormalize(smoothNormals[i]); + smoothNormals[i].NormalizeSafe(); } for (uint32 i = 0; i < m_numVertices; ++i) @@ -1721,7 +1721,7 @@ namespace EMotionFX const AZ::Vector3& posA = positions[ indexA ]; const AZ::Vector3& posB = positions[ indexB ]; const AZ::Vector3& posC = positions[ indexC ]; - AZ::Vector3 faceNormal = MCore::SafeNormalize((posB - posA).Cross(posC - posB)); + AZ::Vector3 faceNormal = (posB - posA).Cross(posC - posB).GetNormalizedSafe(); // store the tangents in the orgTangents array normals[indexA] = normals[indexA] + faceNormal; @@ -1734,7 +1734,7 @@ namespace EMotionFX // normalize the normals for (uint32 i = 0; i < m_numVertices; ++i) { - normals[i] = MCore::SafeNormalize(normals[i]); + normals[i].NormalizeSafe(); } } } From 68c756b6f45864416d7f12ebf71be368602e0116 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 15 Dec 2021 17:02:50 -0800 Subject: [PATCH 116/399] mark duplicate methods under MCore::Vector as deprecated Signed-off-by: Michael Pollind --- Gems/EMotionFX/Code/MCore/Source/Vector.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Gems/EMotionFX/Code/MCore/Source/Vector.h b/Gems/EMotionFX/Code/MCore/Source/Vector.h index 3f5765762c..d904efcaaa 100644 --- a/Gems/EMotionFX/Code/MCore/Source/Vector.h +++ b/Gems/EMotionFX/Code/MCore/Source/Vector.h @@ -17,12 +17,14 @@ namespace MCore { + //! @deprecated Use AZ::Vector3::NormalizeSafeWithLength() inline float SafeLength(const AZ::Vector3& rhs) { const float lenSq = rhs.Dot(rhs); return (lenSq > FLT_EPSILON) ? sqrtf(lenSq) : 0.0f; } + //! @deprecated Use AZ::Vector3::GetNormalizedSafe() inline AZ::Vector3 SafeNormalize(const AZ::Vector3& rhs) { AZ::Vector3 result(0.0f); @@ -43,6 +45,7 @@ namespace MCore return AZ::Vector3(vec.GetX() - fac * n.GetX(), vec.GetY() - fac * n.GetY(), vec.GetZ() - fac * n.GetZ()); } + //! @deprecated Use AZ::Vector3::Project() MCORE_INLINE AZ::Vector3 Projected(const AZ::Vector3& vec, const AZ::Vector3& projectOnto) { AZ::Vector3 result = projectOnto; @@ -60,6 +63,7 @@ namespace MCore (MCore::Math::Abs(val.GetX() - val.GetZ()) < MCore::Math::epsilon)); } + //! @deprecated Use AZ::Vector3::Lerp() template <> MCORE_INLINE AZ::Vector3 LinearInterpolate(const AZ::Vector3& source, const AZ::Vector3& target, float timeValue) { From fb36145e2e1f34574948233aa65eaa97f20e6e67 Mon Sep 17 00:00:00 2001 From: moudgils <47460854+moudgils@users.noreply.github.com> Date: Wed, 15 Dec 2021 18:35:17 -0800 Subject: [PATCH 117/399] Rte fixes for stability (#6434) * Fixed SRG updated related crash Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com> * Fixed SRG compile issue with metal which leads to multiple gpu crashes inlucde ImGuiPass render crash (#6315) Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> Co-authored-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> --- .../Source/RHI/ShaderResourceGroupPool.cpp | 19 ++------ .../Metal/Code/Source/RHI/PipelineState.cpp | 15 ++++-- .../Source/RHI/ShaderResourceGroupPool.cpp | 48 ++++++++----------- .../Source/RHI/ShaderResourceGroupPool.cpp | 2 +- 4 files changed, 37 insertions(+), 47 deletions(-) diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.cpp index 087a36dc2f..ab969365f6 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.cpp @@ -204,23 +204,19 @@ namespace AZ { ShaderResourceGroup& group = static_cast(groupBase); auto& device = static_cast(GetDevice()); - group.m_compiledDataIndex = (group.m_compiledDataIndex + 1) % RHI::Limits::Device::FrameCountMax; if (!groupData.IsAnyResourceTypeUpdated()) { return RHI::ResultCode::Success; } - if (m_constantBufferSize && - groupData.IsResourceTypeEnabledForCompilation(static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::ConstantDataMask))) + group.m_compiledDataIndex = (group.m_compiledDataIndex + 1) % RHI::Limits::Device::FrameCountMax; + if (m_constantBufferSize) { memcpy(group.GetCompiledData().m_cpuConstantAddress, groupData.GetConstantData().data(), groupData.GetConstantData().size()); } - if (m_viewsDescriptorTableSize && - groupData.IsResourceTypeEnabledForCompilation( - static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::ImageViewMask) | - static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::BufferViewMask))) + if (m_viewsDescriptorTableSize) { //Lazy initialization for cbv/srv/uav Descriptor Tables if (!group.m_viewsDescriptorTable.IsValid()) @@ -245,17 +241,12 @@ namespace AZ UpdateViewsDescriptorTable(descriptorTable, groupData); } - if (m_unboundedArrayCount && - groupData.IsResourceTypeEnabledForCompilation( - static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::ImageViewUnboundedArrayMask) | - static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::BufferViewUnboundedArrayMask))) + if (m_unboundedArrayCount) { UpdateUnboundedArrayDescriptorTables(group, groupData); } - if (m_samplersDescriptorTableSize && - groupData.IsResourceTypeEnabledForCompilation( - static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::SamplerMask))) + if (m_samplersDescriptorTableSize) { const DescriptorTable descriptorTable( group.m_samplersDescriptorTable.GetOffset() + group.m_compiledDataIndex * m_samplersDescriptorTableSize, diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineState.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineState.cpp index 8d6ab8fee3..ddd6401723 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineState.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineState.cpp @@ -61,10 +61,19 @@ namespace AZ NSError* error = nil; id lib = nil; - + + bool loadFromByteCode = false; + + // MacOS Big Sur (11.16.x) has issue loading some shader's byte code when GPUCapture(Metal) is on. + // Only enable it for Monterey (12.x) + if(@available(iOS 14.0, macOS 12.0, *)) + { + loadFromByteCode = true; + } + const uint8_t* shaderByteCode = reinterpret_cast(shaderFunction->GetByteCode().data()); const int byteCodeLength = shaderFunction->GetByteCode().size(); - if(byteCodeLength > 0 ) + if(byteCodeLength > 0 && loadFromByteCode) { dispatch_data_t dispatchByteCodeData = dispatch_data_create(shaderByteCode, byteCodeLength, NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); lib = [mtlDevice newLibraryWithData:dispatchByteCodeData error:&error]; @@ -74,7 +83,7 @@ namespace AZ //In case byte code was not generated try to create the lib with source code MTLCompileOptions* compileOptions = [MTLCompileOptions alloc]; compileOptions.fastMathEnabled = YES; - compileOptions.languageVersion = MTLLanguageVersion2_0; + compileOptions.languageVersion = MTLLanguageVersion2_2; lib = [mtlDevice newLibraryWithSource:source options:compileOptions error:&error]; diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/ShaderResourceGroupPool.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI/ShaderResourceGroupPool.cpp index 0a9c001868..a2854e7d1e 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/ShaderResourceGroupPool.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/ShaderResourceGroupPool.cpp @@ -6,7 +6,6 @@ * */ -#include #include #include #include @@ -62,57 +61,48 @@ namespace AZ RHI::ResultCode ShaderResourceGroupPool::CompileGroupInternal(RHI::ShaderResourceGroup& groupBase, const RHI::ShaderResourceGroupData& groupData) { ShaderResourceGroup& group = static_cast(groupBase); - group.UpdateCompiledDataIndex(); if (!groupData.IsAnyResourceTypeUpdated()) { return RHI::ResultCode::Success; } + group.UpdateCompiledDataIndex(); ArgumentBuffer& argBuffer = *group.m_compiledArgBuffers[group.m_compiledDataIndex]; argBuffer.ClearResourceTracking(); auto constantData = groupData.GetConstantData(); - if (!constantData.empty() && groupData.IsResourceTypeEnabledForCompilation(static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::ConstantDataMask))) + if (!constantData.empty()) { argBuffer.UpdateConstantBufferViews(groupData.GetConstantData()); } const RHI::ShaderResourceGroupLayout* layout = groupData.GetLayout(); uint32_t shaderInputIndex = 0; - if (groupData.IsResourceTypeEnabledForCompilation(static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::ImageViewMask))) + for (const RHI::ShaderInputImageDescriptor& shaderInputImage : layout->GetShaderInputListForImages()) { - for (const RHI::ShaderInputImageDescriptor& shaderInputImage : layout->GetShaderInputListForImages()) - { - const RHI::ShaderInputImageIndex imageInputIndex(shaderInputIndex); - AZStd::array_view> imageViews = groupData.GetImageViewArray(imageInputIndex); - argBuffer.UpdateImageViews(shaderInputImage, imageInputIndex, imageViews); - ++shaderInputIndex; - } + const RHI::ShaderInputImageIndex imageInputIndex(shaderInputIndex); + AZStd::array_view> imageViews = groupData.GetImageViewArray(imageInputIndex); + argBuffer.UpdateImageViews(shaderInputImage, imageInputIndex, imageViews); + ++shaderInputIndex; } - if (groupData.IsResourceTypeEnabledForCompilation(static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::SamplerMask))) + shaderInputIndex = 0; + for (const RHI::ShaderInputSamplerDescriptor& shaderInputSampler : layout->GetShaderInputListForSamplers()) { - shaderInputIndex = 0; - for (const RHI::ShaderInputSamplerDescriptor& shaderInputSampler : layout->GetShaderInputListForSamplers()) - { - const RHI::ShaderInputSamplerIndex samplerInputIndex(shaderInputIndex); - AZStd::array_view samplerStates = groupData.GetSamplerArray(samplerInputIndex); - argBuffer.UpdateSamplers(shaderInputSampler, samplerInputIndex, samplerStates); - ++shaderInputIndex; - } + const RHI::ShaderInputSamplerIndex samplerInputIndex(shaderInputIndex); + AZStd::array_view samplerStates = groupData.GetSamplerArray(samplerInputIndex); + argBuffer.UpdateSamplers(shaderInputSampler, samplerInputIndex, samplerStates); + ++shaderInputIndex; } - if (groupData.IsResourceTypeEnabledForCompilation(static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::BufferViewMask))) + shaderInputIndex = 0; + for (const RHI::ShaderInputBufferDescriptor& shaderInputBuffer : layout->GetShaderInputListForBuffers()) { - shaderInputIndex = 0; - for (const RHI::ShaderInputBufferDescriptor& shaderInputBuffer : layout->GetShaderInputListForBuffers()) - { - const RHI::ShaderInputBufferIndex bufferInputIndex(shaderInputIndex); - AZStd::array_view> bufferViews = groupData.GetBufferViewArray(bufferInputIndex); - argBuffer.UpdateBufferViews(shaderInputBuffer, bufferInputIndex, bufferViews); - ++shaderInputIndex; - } + const RHI::ShaderInputBufferIndex bufferInputIndex(shaderInputIndex); + AZStd::array_view> bufferViews = groupData.GetBufferViewArray(bufferInputIndex); + argBuffer.UpdateBufferViews(shaderInputBuffer, bufferInputIndex, bufferViews); + ++shaderInputIndex; } return RHI::ResultCode::Success; diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/ShaderResourceGroupPool.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/ShaderResourceGroupPool.cpp index b2772d716e..2c6eb2bc34 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/ShaderResourceGroupPool.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/ShaderResourceGroupPool.cpp @@ -104,13 +104,13 @@ namespace AZ RHI::ResultCode ShaderResourceGroupPool::CompileGroupInternal(RHI::ShaderResourceGroup& groupBase, const RHI::ShaderResourceGroupData& groupData) { auto& group = static_cast(groupBase); - group.UpdateCompiledDataIndex(m_currentIteration); if (!groupData.IsAnyResourceTypeUpdated()) { return RHI::ResultCode::Success; } + group.UpdateCompiledDataIndex(m_currentIteration); DescriptorSet& descriptorSet = *group.m_compiledData[group.GetCompileDataIndex()]; const RHI::ShaderResourceGroupLayout* layout = groupData.GetLayout(); From 195764a4274d08afe3dcf97acabce100c252e743 Mon Sep 17 00:00:00 2001 From: sphrose <82213493+sphrose@users.noreply.github.com> Date: Thu, 16 Dec 2021 15:03:53 +0000 Subject: [PATCH 118/399] review changes Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com> --- Gems/SurfaceData/Code/CMakeLists.txt | 3 --- .../Editor/EditorSurfaceDataSystemComponent.cpp | 5 +---- .../Source/Editor/EditorSurfaceDataSystemComponent.h | 10 ---------- Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp | 12 +++++++----- .../Components/TerrainSurfaceDataSystemComponent.cpp | 9 +++++++++ .../Components/TerrainSurfaceDataSystemComponent.h | 6 ++++++ 6 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Gems/SurfaceData/Code/CMakeLists.txt b/Gems/SurfaceData/Code/CMakeLists.txt index c35da595d6..54363d265e 100644 --- a/Gems/SurfaceData/Code/CMakeLists.txt +++ b/Gems/SurfaceData/Code/CMakeLists.txt @@ -70,7 +70,6 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) AZ::AzToolsFramework Gem::SurfaceData.Static Gem::LmbrCentral.Editor - Gem::Terrain RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor ) @@ -98,11 +97,9 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzTest - AZ::AzToolsFramework Legacy::CryCommon Gem::SurfaceData.Static Gem::LmbrCentral - Gem::Terrain ) ly_add_googletest( NAME Gem::SurfaceData.Tests diff --git a/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp b/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp index 0285ab5ca4..a847da4347 100644 --- a/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp +++ b/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp @@ -123,10 +123,7 @@ namespace SurfaceData void EditorSurfaceDataSystemComponent::GetRegisteredSurfaceTagNames(SurfaceTagNameSet& masks) const { - for (const auto& tagName : Constants::s_allTagNames) - { - masks.insert(tagName); - } + masks.insert(Constants::s_unassignedTagName); for (const auto& assetPair : m_surfaceTagNameAssets) { diff --git a/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.h b/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.h index 68f7ea7291..466da8482e 100644 --- a/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.h +++ b/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.h @@ -14,7 +14,6 @@ #include #include #include -#include namespace AZ::Data { @@ -23,15 +22,6 @@ namespace AZ::Data namespace SurfaceData { - namespace Constants - { - static const char* s_allTagNames[] = { - Constants::s_unassignedTagName, - Terrain::Constants::s_terrainHoleTagName, - Terrain::Constants::s_terrainTagName, - }; - } //namespace Constants - class EditorSurfaceDataSystemConfig : public AZ::ComponentConfig { diff --git a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp index 23c0a1d4c6..8f4420bcc5 100644 --- a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp +++ b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp @@ -23,8 +23,8 @@ #include #include #include +#include #include -#include struct MockGlobalEnvironment { @@ -281,15 +281,17 @@ public: TEST_F(SurfaceDataTestApp, SurfaceData_TestRegisteredTags) { + // Check that only the unassigned tag exists if no other providers are registered. AZStd::vector> registeredTags = SurfaceData::SurfaceTag::GetRegisteredTags(); - for (const auto& searchTerm : SurfaceData::Constants::s_allTagNames) - { - ASSERT_TRUE(AZStd::find_if(registeredTags.begin(), registeredTags.end(), [searchTerm](decltype(registeredTags)::value_type pair) + const auto& searchTerm = SurfaceData::Constants::s_unassignedTagName; + + ASSERT_TRUE(AZStd::find_if( + registeredTags.begin(), registeredTags.end(), + [searchTerm](decltype(registeredTags)::value_type pair) { return pair.second == searchTerm; })); - } } #if AZ_TRAIT_DISABLE_FAILED_SURFACE_DATA_TESTS diff --git a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp index 8c75aafa65..b36283bd3c 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp @@ -15,6 +15,7 @@ #include #include #include +#include namespace Terrain { @@ -240,6 +241,8 @@ namespace Terrain // Start listening for surface data events AZ_Assert((m_providerHandle != SurfaceData::InvalidSurfaceDataRegistryHandle), "Invalid surface data handle"); SurfaceData::SurfaceDataProviderRequestBus::Handler::BusConnect(m_providerHandle); + + SurfaceData::SurfaceDataTagProviderRequestBus::Handler::BusConnect(); } else if (terrainValidBeforeUpdate && !terrainValidAfterUpdate) { @@ -263,4 +266,10 @@ namespace Terrain { UpdateTerrainData(dirtyRegion); } + + void TerrainSurfaceDataSystemComponent::GetRegisteredSurfaceTagNames(SurfaceData::SurfaceTagNameSet& names) const + { + names.insert(Constants::s_terrainHoleTagName); + names.insert(Constants::s_terrainTagName); + } } diff --git a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.h b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.h index d9c7893c77..4d9a5b7481 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.h +++ b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.h @@ -13,6 +13,7 @@ #include #include #include +#include namespace Terrain { @@ -32,6 +33,7 @@ namespace Terrain : public AZ::Component , private SurfaceData::SurfaceDataProviderRequestBus::Handler , private AzFramework::Terrain::TerrainDataNotificationBus::Handler + , private SurfaceData::SurfaceDataTagProviderRequestBus::Handler { friend class EditorTerrainSurfaceDataSystemComponent; TerrainSurfaceDataSystemComponent(const TerrainSurfaceDataSystemConfig&); @@ -72,5 +74,9 @@ namespace Terrain AZ::Aabb m_terrainBounds = AZ::Aabb::CreateNull(); AZStd::atomic_bool m_terrainBoundsIsValid{ false }; + + ////////////////////////////////////////////////////////////////////////// + // SurfaceData::SurfaceDataTagProviderRequestBus + void GetRegisteredSurfaceTagNames(SurfaceData::SurfaceTagNameSet& names) const override; }; } From 94ddafc7a2c5c1987e25bfca845c16d03b35f1fc Mon Sep 17 00:00:00 2001 From: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> Date: Thu, 16 Dec 2021 09:19:44 -0800 Subject: [PATCH 119/399] Atom/qingtao/image builder fixes (#6432) * LYN-8837 o3de Material Editor - Texture Settings Editor - Hangs when converting texture (#6359) Fixed a editor hanging issue when preview texture with astc format (starts multiple job threads inside a job thread) Fixed an issue of changing texture setting didn't trigger image re-process. Fixed an issue with image asset which has texture setting may have dependency with wrong preset Added a EIF_HDR for source image in hdr format. Fixed astc compression issue which may wrongly compress image to HDR astc format Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> (cherry picked from commit d9f0a3012d13f739e2df261f176afdb7cecc44fb) * ATOM-16958 [Image Builder] Alpha data would be removed for source image with alpha content (#6412) Fixed a regression issue with image builder which it can choose proper preset for images with alpha content. Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> (cherry picked from commit b640f6d691b97ae608081c9a4dd7cbddb019721a) --- .../Config/AlbedoWithGenericAlpha.preset | 2 +- .../Atom/ImageProcessing/PixelFormats.h | 1 + .../BuilderSettings/BuilderSettingManager.cpp | 14 +++- .../Source/Compressors/ASTCCompressor.cpp | 76 ++++++++++++++----- .../Code/Source/ImageBuilderComponent.cpp | 20 +++-- .../Code/Source/ImageLoader/ImageLoaders.cpp | 19 ++++- .../Code/Source/Processing/ImageConvert.cpp | 2 +- .../Code/Source/Processing/ImageFlags.h | 2 +- .../Source/Processing/PixelFormatInfo.cpp | 18 +++++ 9 files changed, 117 insertions(+), 37 deletions(-) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Assets/Config/AlbedoWithGenericAlpha.preset b/Gems/Atom/Asset/ImageProcessingAtom/Assets/Config/AlbedoWithGenericAlpha.preset index c315ede21c..3340fd39e4 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Assets/Config/AlbedoWithGenericAlpha.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Assets/Config/AlbedoWithGenericAlpha.preset @@ -7,7 +7,7 @@ "UUID": "{5D9ECB52-4CD9-4CB8-80E3-10CAE5EFB8A2}", "Name": "AlbedoWithGenericAlpha", "RGB_Weight": "CIEXYZ", - "PixelFormat": "ASTC_4x4", + "PixelFormat": "BC3", "MipMapSetting": { "MipGenType": "Box" } diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/PixelFormats.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/PixelFormats.h index 4da996dbde..1d11a05c17 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/PixelFormats.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/PixelFormats.h @@ -79,6 +79,7 @@ namespace ImageProcessingAtom }; bool IsASTCFormat(EPixelFormat fmt); + bool IsHDRFormat(EPixelFormat fmt); } // namespace ImageProcessingAtom namespace AZ diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/BuilderSettingManager.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/BuilderSettingManager.cpp index 1ae406c6fd..0e9681f38b 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/BuilderSettingManager.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/BuilderSettingManager.cpp @@ -620,6 +620,7 @@ namespace ImageProcessingAtom { PresetName emptyPreset; + //get file mask of this image file AZStd::string fileMask = GetFileMask(imageFilePath); @@ -636,8 +637,17 @@ namespace ImageProcessingAtom } if (outPreset == emptyPreset) - { - outPreset = m_defaultPreset; + { + auto image = IImageObjectPtr(LoadImageFromFile(imageFilePath)); + if (image->GetAlphaContent() == EAlphaContent::eAlphaContent_Absent + || image->GetAlphaContent() == EAlphaContent::eAlphaContent_OnlyWhite) + { + outPreset = m_defaultPreset; + } + else + { + outPreset = m_defaultPresetAlpha; + } } return outPreset; diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ASTCCompressor.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ASTCCompressor.cpp index 4ef47c043d..91829bb5be 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ASTCCompressor.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ASTCCompressor.cpp @@ -78,7 +78,7 @@ namespace ImageProcessingAtom return true; } - astcenc_profile GetAstcProfile(bool isSrgb, EPixelFormat pixelFormat) + astcenc_profile GetAstcProfile(bool isSrgb, bool isHDR) { // select profile depends on LDR or HDR, SRGB or Linear // ASTCENC_PRF_LDR @@ -86,8 +86,6 @@ namespace ImageProcessingAtom // ASTCENC_PRF_HDR_RGB_LDR_A // ASTCENC_PRF_HDR - auto formatInfo = CPixelFormats::GetInstance().GetPixelFormatInfo(pixelFormat); - bool isHDR = formatInfo->eSampleType == ESampleType::eSampleType_Half || formatInfo->eSampleType == ESampleType::eSampleType_Float; astcenc_profile profile; if (isHDR) { @@ -170,7 +168,7 @@ namespace ImageProcessingAtom auto dstFormatInfo = CPixelFormats::GetInstance().GetPixelFormatInfo(fmtDst); const float quality = GetAstcCompressQuality(compressOption->compressQuality); - const astcenc_profile profile = GetAstcProfile(srcImage->HasImageFlags(EIF_SRGBRead), fmtSrc); + const astcenc_profile profile = GetAstcProfile(srcImage->HasImageFlags(EIF_SRGBRead), srcImage->HasImageFlags(EIF_HDR)); astcenc_config config; astcenc_error status; @@ -182,10 +180,12 @@ namespace ImageProcessingAtom // Create a context based on the configuration astcenc_context* context; AZ::u32 blockCount = ((srcImage->GetWidth(0)+ dstFormatInfo->blockWidth-1)/dstFormatInfo->blockWidth) * ((srcImage->GetHeight(0) + dstFormatInfo->blockHeight-1)/dstFormatInfo->blockHeight); - AZ::u32 threadCount = AZStd::min(AZStd::thread::hardware_concurrency(), blockCount); + AZ::u32 threadCount = AZStd::min(AZStd::thread::hardware_concurrency()/2, blockCount); status = astcenc_context_alloc(&config, threadCount, &context); AZ_Assert( status == ASTCENC_SUCCESS, "ERROR: Codec context alloc failed: %s\n", astcenc_get_error_string(status)); + AZ::Job* currentJob = AZ::JobContext::GetGlobalContext()->GetJobManager().GetCurrentJob(); + const astcenc_type dataType =GetAstcDataType(fmtSrc); // Compress the image for each mips @@ -209,29 +209,65 @@ namespace ImageProcessingAtom dstImage->GetImagePointer(mip, dstMem, dstPitch); AZ::u32 dataSize = dstImage->GetMipBufSize(mip); - // Create jobs for each compression thread - auto completionJob = aznew AZ::JobCompletion(); - for (AZ::u32 threadIdx = 0; threadIdx < threadCount; threadIdx++) + if (threadCount == 1) + { + astcenc_error error = astcenc_compress_image(context, &image, &swizzle, dstMem, dataSize, 0); + if (error != ASTCENC_SUCCESS) + { + status = error; + } + } + else { - const auto jobLambda = [&status, context, &image, &swizzle, dstMem, dataSize, threadIdx]() + AZ::JobCompletion* completionJob = nullptr; + if (!currentJob) { + completionJob = aznew AZ::JobCompletion(); + } + // Create jobs for each compression thread + for (AZ::u32 threadIdx = 0; threadIdx < threadCount; threadIdx++) + { + const auto jobLambda = [&status, context, &image, &swizzle, dstMem, dataSize, threadIdx]() + { + astcenc_error error = astcenc_compress_image(context, &image, &swizzle, dstMem, dataSize, threadIdx); + if (error != ASTCENC_SUCCESS) + { + status = error; + } + }; + + AZ::Job* simulationJob = AZ::CreateJobFunction(AZStd::move(jobLambda), true, nullptr); //auto-deletes + + // adds this job as child to current job if there is a current job + // otherwise adds it as a dependent for the complete job + if (currentJob) + { + currentJob->StartAsChild(simulationJob); + } + else + { + simulationJob->SetDependent(completionJob); + simulationJob->Start(); + } + astcenc_error error = astcenc_compress_image(context, &image, &swizzle, dstMem, dataSize, threadIdx); if (error != ASTCENC_SUCCESS) { status = error; } - }; - - AZ::Job* simulationJob = AZ::CreateJobFunction(AZStd::move(jobLambda), true, nullptr); //auto-deletes - simulationJob->SetDependent(completionJob); - simulationJob->Start(); - } + } + + if (currentJob) + { + currentJob->WaitForChildren(); + } - if (completionJob) - { - completionJob->StartAndWaitForCompletion(); - delete completionJob; - completionJob = nullptr; + if (completionJob) + { + completionJob->StartAndWaitForCompletion(); + delete completionJob; + completionJob = nullptr; + } } if (status != ASTCENC_SUCCESS) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp index 57596f4a71..5e021a3fdd 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp @@ -74,7 +74,7 @@ namespace ImageProcessingAtom builderDescriptor.m_busId = azrtti_typeid(); builderDescriptor.m_createJobFunction = AZStd::bind(&ImageBuilderWorker::CreateJobs, &m_imageBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2); builderDescriptor.m_processJobFunction = AZStd::bind(&ImageBuilderWorker::ProcessJob, &m_imageBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2); - builderDescriptor.m_version = 26; // [ATOM-15086] + builderDescriptor.m_version = 27; // [ATOM-16958] builderDescriptor.m_analysisFingerprint = ImageProcessingAtom::BuilderSettingManager::Instance()->GetAnalysisFingerprint(); m_imageBuilder.BusConnect(builderDescriptor.m_busId); AssetBuilderSDK::AssetBuilderBus::Broadcast(&AssetBuilderSDK::AssetBuilderBusTraits::RegisterBuilderInformation, builderDescriptor); @@ -221,18 +221,19 @@ namespace ImageProcessingAtom m_isShuttingDown = true; } - PresetName GetImagePreset(const AZStd::string& filepath) + PresetName GetImagePreset(const AZStd::string& imageFileFullPath) { // first let preset from asset info TextureSettings textureSettings; - StringOutcome output = TextureSettings::LoadTextureSetting(filepath, textureSettings); + AZStd::string settingFilePath = imageFileFullPath + TextureSettings::ExtensionName; + TextureSettings::LoadTextureSetting(settingFilePath, textureSettings); if (!textureSettings.m_preset.IsEmpty()) { return textureSettings.m_preset; } - return BuilderSettingManager::Instance()->GetSuggestedPreset(filepath); + return BuilderSettingManager::Instance()->GetSuggestedPreset(imageFileFullPath); } void HandlePresetDependency(PresetName presetName, AZStd::vector& sourceDependencyList) @@ -283,6 +284,10 @@ namespace ImageProcessingAtom return; } + // Full path of the image file + AZStd::string fullPath; + AzFramework::StringFunc::Path::Join(request.m_watchFolder.data(), request.m_sourceFile.data(), fullPath, true, true); + // Get the extension of the file AZStd::string ext; AzFramework::StringFunc::Path::GetExtension(request.m_sourceFile.c_str(), ext, false); @@ -305,13 +310,12 @@ namespace ImageProcessingAtom // add source dependency for .assetinfo file AssetBuilderSDK::SourceFileDependency sourceFileDependency; sourceFileDependency.m_sourceDependencyType = AssetBuilderSDK::SourceFileDependency::SourceFileDependencyType::Absolute; - sourceFileDependency.m_sourceFileDependencyPath = request.m_sourceFile; - AZ::StringFunc::Path::ReplaceExtension(sourceFileDependency.m_sourceFileDependencyPath, TextureSettings::ExtensionName); + sourceFileDependency.m_sourceFileDependencyPath = fullPath + TextureSettings::ExtensionName; response.m_sourceFileDependencyList.push_back(sourceFileDependency); // add source dependencies for .preset files - // Get the preset for this file - auto presetName = GetImagePreset(request.m_sourceFile); + // Get the preset for this file + auto presetName = GetImagePreset(fullPath.c_str()); HandlePresetDependency(presetName, response.m_sourceFileDependencyList); response.m_result = AssetBuilderSDK::CreateJobsResultCode::Success; diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/ImageLoaders.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/ImageLoaders.cpp index e756174810..74517f5b18 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/ImageLoaders.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/ImageLoaders.cpp @@ -8,6 +8,7 @@ #include +#include #include // warning C4251: class QT_Type needs to have dll-interface to be used by clients of class 'QT_Type' AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") @@ -26,21 +27,31 @@ namespace ImageProcessingAtom return nullptr; } + IImageObject* loadedImage = nullptr; if (TIFFLoader::IsExtensionSupported(ext.toUtf8())) { - return TIFFLoader::LoadImageFromTIFF(filename); + loadedImage = TIFFLoader::LoadImageFromTIFF(filename); } else if (DdsLoader::IsExtensionSupported(ext.toUtf8())) { - return DdsLoader::LoadImageFromFile(filename); + loadedImage = DdsLoader::LoadImageFromFile(filename); } else if (QtImageLoader::IsExtensionSupported(ext.toUtf8())) { - return QtImageLoader::LoadImageFromFile(filename); + loadedImage = QtImageLoader::LoadImageFromFile(filename); } else if (ExrLoader::IsExtensionSupported(ext.toUtf8())) { - return ExrLoader::LoadImageFromFile(filename); + loadedImage = ExrLoader::LoadImageFromFile(filename); + } + + if (loadedImage) + { + if (IsHDRFormat(loadedImage->GetPixelFormat())) + { + loadedImage->AddImageFlags(EIF_HDR); + } + return loadedImage; } AZ_Warning("ImageProcessing", false, "No proper image loader to load file: %s", filename.c_str()); diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageConvert.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageConvert.cpp index defca690a3..058daf7ca4 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageConvert.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageConvert.cpp @@ -193,7 +193,7 @@ namespace ImageProcessingAtom } m_image->Get()->Swizzle(swizzle.c_str()); - if (!m_input->m_presetSetting.m_discardAlpha) + if (m_input->m_presetSetting.m_discardAlpha) { m_alphaContent = EAlphaContent::eAlphaContent_Absent; } diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageFlags.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageFlags.h index d25533cccd..cefd315448 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageFlags.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageFlags.h @@ -19,7 +19,7 @@ namespace ImageProcessingAtom const static AZ::u32 EIF_Decal = 0x4; // this is usually set through the preset const static AZ::u32 EIF_Greyscale = 0x8; // hint for the engine (e.g. greyscale light beams can be applied to shadow mask), can be for DXT1 because compression artfacts don't count as color const static AZ::u32 EIF_SupressEngineReduce = 0x10; // info for the engine: don't reduce texture resolution on this texture - const static AZ::u32 EIF_UNUSED_BIT = 0x40; // Free to use + const static AZ::u32 EIF_HDR = 0x40; // the image contains HDR data const static AZ::u32 EIF_AttachedAlpha = 0x400; // deprecated: info for the engine: it's a texture with attached alpha channel const static AZ::u32 EIF_SRGBRead = 0x800; // info for the engine: if gamma corrected rendering is on, this texture requires SRGBRead (it's not stored in linear) const static AZ::u32 EIF_DontResize = 0x8000; // info for the engine: for dds textures that shouldn't be resized diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/PixelFormatInfo.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/PixelFormatInfo.cpp index 8a741d6637..a413a29862 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/PixelFormatInfo.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/PixelFormatInfo.cpp @@ -52,6 +52,24 @@ namespace ImageProcessingAtom return false; } + bool IsHDRFormat(EPixelFormat fmt) + { + switch (fmt) + { + case ePixelFormat_BC6UH: + case ePixelFormat_R9G9B9E5: + case ePixelFormat_R32G32B32A32F: + case ePixelFormat_R32G32F: + case ePixelFormat_R32F: + case ePixelFormat_R16G16B16A16F: + case ePixelFormat_R16G16F: + case ePixelFormat_R16F: + return true; + default: + return false; + } + } + PixelFormatInfo::PixelFormatInfo( uint32_t a_bitsPerPixel, uint32_t a_Channels, From fc3c5fbd09ed410305cc4f436155850117203701 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Thu, 16 Dec 2021 09:43:00 -0800 Subject: [PATCH 120/399] [Mac] Fix build error in (#6410) Signed-off-by: amzn-sj --- .../Code/Editor/Framework/ScriptCanvasGraphUtilities.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl index 74d0f76dce..8bac7b460f 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl @@ -268,7 +268,7 @@ namespace ScriptCanvasEditor RuntimeDataOverrides dependencyRuntimeDataOverrides; dependencyRuntimeDataOverrides.m_runtimeAsset = dependency.runtimeAsset; - AZStd::string dependencyHint = AZStd::string::format("dependency_%d", index); + AZStd::string dependencyHint = AZStd::string::format("dependency_%zu", index); dependencyRuntimeDataOverrides.m_runtimeAsset.SetHint(dependencyHint); dependencyRuntimeDataOverrides.m_runtimeAsset.Get()->m_runtimeData.m_script.SetHint(dependencyHint); From d7dc2579270d2f78786c14d69648692e714a11bc Mon Sep 17 00:00:00 2001 From: hershey5045 <43485729+hershey5045@users.noreply.github.com> Date: Thu, 16 Dec 2021 12:07:37 -0800 Subject: [PATCH 121/399] Add MainPipeline to pass hierarchy for when HDR color grading component requests for the lut generation's image attachment. (#6436) Signed-off-by: hershey5045 <43485729+hershey5045@users.noreply.github.com> --- .../ColorGrading/EditorHDRColorGradingComponent.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/ColorGrading/EditorHDRColorGradingComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/ColorGrading/EditorHDRColorGradingComponent.cpp index 3cc9535d7a..67db519669 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/ColorGrading/EditorHDRColorGradingComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/ColorGrading/EditorHDRColorGradingComponent.cpp @@ -11,6 +11,9 @@ #include #include #include +#include +#include +#include namespace AZ { @@ -199,7 +202,14 @@ namespace AZ } const char* LutAttachment = "LutOutput"; - const AZStd::vector LutGenerationPassHierarchy{ "LutGenerationPass" }; + auto renderPipelineName = AZ::Interface::Get() + ->GetDefaultViewportContext() + ->GetCurrentPipeline() + ->GetId(); + const AZStd::vector LutGenerationPassHierarchy{ + renderPipelineName.GetCStr(), + "LutGenerationPass" + }; char resolvedOutputFilePath[AZ_MAX_PATH_LEN] = { 0 }; AZ::IO::FileIOBase::GetDirectInstance()->ResolvePath(m_currentTiffFilePath.c_str(), resolvedOutputFilePath, AZ_MAX_PATH_LEN); From 016eda6cf13fdbaba417b6efc2c63f5e5d3039e3 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Wed, 8 Dec 2021 13:57:45 -0800 Subject: [PATCH 122/399] Fixed infinite recursion when adding prefabs While processing prefabs into spawnables new prefabs can be added for later processing. Because the new prefabs were immediately added to the list of prefabs it could happen that the new prefabs would be added to the active processor for processing, which could lead to infinite recursion. Adding prefabs while iterating prefabs now delays the addition until the iteration has completed. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Spawnable/PrefabProcessorContext.cpp | 26 +++++++++++++++++-- .../Prefab/Spawnable/PrefabProcessorContext.h | 1 + 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp index efef0f53de..ff32ac2ea5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp @@ -32,8 +32,24 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils bool PrefabProcessorContext::AddPrefab(AZStd::string prefabName, PrefabDom prefab) { - auto result = m_prefabs.emplace(AZStd::move(prefabName), AZStd::move(prefab)); - return result.second; + if (!m_isIterating) + { + auto result = m_prefabs.emplace(AZStd::move(prefabName), AZStd::move(prefab)); + return result.second; + } + else + { + auto it = m_prefabs.find(prefabName); + if (it == m_prefabs.end()) + { + auto result = m_pendingPrefabAdditions.emplace(AZStd::move(prefabName), AZStd::move(prefab)); + return result.second; + } + else + { + return false; + } + } } void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) @@ -43,7 +59,13 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils { callback(it.first, it.second); } + m_isIterating = false; + for (auto& prefab : m_pendingPrefabAdditions) + { + m_prefabs.emplace(AZStd::move(prefab.first), AZStd::move(prefab.second)); + } + m_pendingPrefabAdditions.clear(); } void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) const diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h index d35a09a574..ade17e2ff0 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h @@ -134,6 +134,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils AZ::Data::AssetLoadBehavior ToAssetLoadBehavior(EntityAliasSpawnableLoadBehavior loadBehavior) const; NamedPrefabContainer m_prefabs; + NamedPrefabContainer m_pendingPrefabAdditions; SpawnableEntityAliasStore m_entityAliases; ProcessedObjectStoreContainer m_products; ProductAssetDependencyContainer m_registeredProductAssetDependencies; From 7e38a5f35cbf99e0fd852bfc276b65cce0716a53 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Wed, 8 Dec 2021 18:32:18 -0800 Subject: [PATCH 123/399] Fixed entity registration issue when setting up Spawnable Entity Aliases. In some cases entities created for use as a Spawnable Entity Alias would share an entity id with their original. This is no longer working due to a reverse lookup from an entity id to its PrefabDOM. Upon further investigation this turned out to not matter as instances that are created by the PrefabCatchmentProcessor would create new entity ids any way. This cause unexpected behavior at runtime as entity relations may be broken. This will be addressed in a future fix. Testing the above also highlighted a possible double delete in the builder when aliases were registered. This has also been fixed. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Prefab/Spawnable/PrefabProcessorContext.cpp | 5 +++-- .../Prefab/Spawnable/SpawnableUtils.cpp | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp index ff32ac2ea5..d4fd785118 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp @@ -246,9 +246,10 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils it = aliasVisitors.emplace(source->m_spawnable.GetId(), AZStd::move(visitor)).first; } it->second.AddAlias( - AZ::Data::Asset(&target->m_spawnable, loadBehavior), alias.m_tag, sourceIndex, targetIndex, + AZ::Data::Asset(target->m_spawnable.GetId(), azrtti_typeid()), alias.m_tag, + sourceIndex, targetIndex, alias.m_aliasType, alias.m_loadBehavior == EntityAliasSpawnableLoadBehavior::QueueLoad); - + // Register the dependency between the two spawnables. RegisterProductAssetDependency(source->m_spawnable.GetId(), target->m_spawnable.GetId(), loadBehavior); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp index 5e552aad3f..b51df104fe 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp @@ -86,7 +86,9 @@ namespace AzToolsFramework::Prefab::SpawnableUtils entityData.has_value(), "SpawnbleUtils were unable to locate entity '%.*s' in Instance '%s' for replacing.", AZ_STRING_ARG(alias), source.GetTemplateSourcePath().c_str()); auto placeholder = AZStd::make_unique(entityData->get().GetId(), entityData->get().GetName()); - return instance->ReplaceEntity(AZStd::move(placeholder), alias); + AZStd::unique_ptr result = instance->ReplaceEntity(AZStd::move(placeholder), alias); + result->SetId(AZ::Entity::MakeId()); + return result; } AZStd::unique_ptr ReplaceEntityWithPlaceholder(AZ::EntityId entityId, AzFramework::Spawnable& source) @@ -102,7 +104,7 @@ namespace AzToolsFramework::Prefab::SpawnableUtils aznumeric_cast(entityId)); source.GetEntities()[index] = AZStd::make_unique(original->GetId(), original->GetName()); - + original->SetId(AZ::Entity::MakeId()); return original; } @@ -123,10 +125,9 @@ namespace AzToolsFramework::Prefab::SpawnableUtils case PCU::EntityAliasType::Replace: return ResultPair(ReplaceEntityWithPlaceholder(entityId, source), AzFramework::Spawnable::EntityAliasType::Replace); case PCU::EntityAliasType::Additional: - ResultPair(AZStd::make_unique(AZ::Entity::MakeId()), AzFramework::Spawnable::EntityAliasType::Additional); + ResultPair(AZStd::make_unique(), AzFramework::Spawnable::EntityAliasType::Additional); case PCU::EntityAliasType::Merge: - // Use the same entity id as the original entity so at runtime the entity ids can be verified to match. - ResultPair(AZStd::make_unique(entityId), AzFramework::Spawnable::EntityAliasType::Merge); + ResultPair(AZStd::make_unique(), AzFramework::Spawnable::EntityAliasType::Merge); default: AZ_Assert( false, "Invalid PrefabProcessorContext::EntityAliasType type (%i) provided.", aznumeric_cast(aliasType)); From cbea11c452559170f03d2bedbfff1cc4d922b7bb Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Thu, 9 Dec 2021 14:48:56 -0800 Subject: [PATCH 124/399] Minor performance optimization to Prefab Instance. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../AzToolsFramework/Prefab/Instance/Instance.cpp | 8 ++++---- .../AzToolsFramework/Prefab/Instance/Instance.h | 4 ++-- .../Prefab/Spawnable/PrefabProcessorContext.cpp | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.cpp index 490a151925..c685735f40 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.cpp @@ -142,14 +142,14 @@ namespace AzToolsFramework return m_templateSourcePath; } - void Instance::SetTemplateSourcePath(AZ::IO::PathView sourcePath) + void Instance::SetTemplateSourcePath(AZ::IO::Path sourcePath) { - m_templateSourcePath = sourcePath; + m_templateSourcePath = AZStd::move(sourcePath); } - void Instance::SetContainerEntityName(AZStd::string_view containerName) + void Instance::SetContainerEntityName(AZStd::string containerName) { - m_containerEntity->SetName(containerName); + m_containerEntity->SetName(AZStd::move(containerName)); } bool Instance::AddEntity(AZ::Entity& entity) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h index 25971093cd..625357f485 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h @@ -80,8 +80,8 @@ namespace AzToolsFramework void SetTemplateId(TemplateId templateId); const AZ::IO::Path& GetTemplateSourcePath() const; - void SetTemplateSourcePath(AZ::IO::PathView sourcePath); - void SetContainerEntityName(AZStd::string_view containerName); + void SetTemplateSourcePath(AZ::IO::Path sourcePath); + void SetContainerEntityName(AZStd::string containerName); bool AddEntity(AZ::Entity& entity); bool AddEntity(AZStd::unique_ptr&& entity); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp index d4fd785118..d79b270bb8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp @@ -154,6 +154,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils { using namespace AzToolsFramework::Prefab; + // Resolve prefab links into spawnable links for the provided spawnable. for (EntityAliasStore& entityAlias : m_entityAliases) { auto sourcePrefab = AZStd::get_if(&entityAlias.m_source); From 76a913882c78c631a8bf649ed0d6c4ba6c08439c Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Fri, 10 Dec 2021 09:03:36 -0800 Subject: [PATCH 125/399] Resolving links in the Prefab Processing Stack now also makes sure that entity ids of aliased entities are appropriately unique or match. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Spawnable/PrefabProcessorContext.cpp | 24 +++++++++++++++++++ .../Prefab/Spawnable/SpawnableUtils.cpp | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp index d79b270bb8..5c67c8f3b3 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -253,6 +254,29 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils // Register the dependency between the two spawnables. RegisterProductAssetDependency(source->m_spawnable.GetId(), target->m_spawnable.GetId(), loadBehavior); + + // Patch up all entity ids so the alias points to the same entity id if needed. + switch (alias.m_aliasType) + { + case AzFramework::Spawnable::EntityAliasType::Original: + continue; + case AzFramework::Spawnable::EntityAliasType::Disable: + continue; + case AzFramework::Spawnable::EntityAliasType::Replace: + break; // Requires entity id for alias in source and target spawnable matches. + case AzFramework::Spawnable::EntityAliasType::Additional: + continue; + case AzFramework::Spawnable::EntityAliasType::Merge: + break; // Requires entity id for alias in source and target spawnable matches. + default: + continue; + } + + auto entityIdMapper = [source, target](const AZ::EntityId& originalId, bool /*isEntityId*/) -> AZ::EntityId + { + return originalId == target->m_index ? source->m_index : originalId; + }; + AZ::EntityUtils::ReplaceEntityIdsAndEntityRefs(&target->m_spawnable, entityIdMapper); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp index b51df104fe..feed44c740 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp @@ -85,9 +85,9 @@ namespace AzToolsFramework::Prefab::SpawnableUtils AZ_Assert( entityData.has_value(), "SpawnbleUtils were unable to locate entity '%.*s' in Instance '%s' for replacing.", AZ_STRING_ARG(alias), source.GetTemplateSourcePath().c_str()); - auto placeholder = AZStd::make_unique(entityData->get().GetId(), entityData->get().GetName()); + // A new entity id can be used for the placeholder as `ReplaceEntity` will swap the entity ids. + auto placeholder = AZStd::make_unique(AZ::Entity::MakeId(), entityData->get().GetName()); AZStd::unique_ptr result = instance->ReplaceEntity(AZStd::move(placeholder), alias); - result->SetId(AZ::Entity::MakeId()); return result; } From 9def902e1ceac7fc82b0a9bca91c75647c755d54 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Fri, 10 Dec 2021 17:52:03 -0800 Subject: [PATCH 126/399] Fixes up parents for entities that are moved to another Prefab. This fixes issues with entities that are moved to another Prefab and have a parent that was also moved to the same Prefab. Entities that have their parent moved to another Prefab continue to work as is because a placeholder entity is always left behind. Entities that are moved to another Prefab but have a parent that's still in the original Prefab will currently not work correctly. This will be a addressed in a future commit. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Components/TransformComponent.cpp | 25 +-- .../Prefab/Spawnable/SpawnableUtils.cpp | 169 +++++++----------- .../Prefab/Spawnable/SpawnableUtils.h | 18 +- 3 files changed, 78 insertions(+), 134 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp index 809f664a10..2f3fc3cb8b 100644 --- a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp @@ -585,21 +585,24 @@ namespace AzFramework EBUS_EVENT_PTR(m_notificationBus, AZ::TransformNotificationBus, OnParentChanged, oldParent, parentId); m_parentChangedEvent.Signal(oldParent, parentId); - if (oldParent != parentId) // Don't send removal notification while activating. + if (GetEntity() != nullptr) { - EBUS_EVENT_ID(oldParent, AZ::TransformNotificationBus, OnChildRemoved, GetEntityId()); - auto oldParentTransform = AZ::TransformBus::FindFirstHandler(oldParent); - if (oldParentTransform) + if (oldParent != parentId) // Don't send removal notification while activating. { - oldParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Removed, GetEntityId()); + EBUS_EVENT_ID(oldParent, AZ::TransformNotificationBus, OnChildRemoved, GetEntityId()); + auto oldParentTransform = AZ::TransformBus::FindFirstHandler(oldParent); + if (oldParentTransform) + { + oldParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Removed, GetEntityId()); + } } - } - EBUS_EVENT_ID(parentId, AZ::TransformNotificationBus, OnChildAdded, GetEntityId()); - auto newParentTransform = AZ::TransformBus::FindFirstHandler(parentId); - if (newParentTransform) - { - newParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Added, GetEntityId()); + EBUS_EVENT_ID(parentId, AZ::TransformNotificationBus, OnChildAdded, GetEntityId()); + auto newParentTransform = AZ::TransformBus::FindFirstHandler(parentId); + if (newParentTransform) + { + newParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Added, GetEntityId()); + } } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp index feed44c740..e30417324c 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -52,14 +53,32 @@ namespace AzToolsFramework::Prefab::SpawnableUtils return result; } + const AZ::Entity* FindEntity(AZ::EntityId entityId, const AzToolsFramework::Prefab::Instance& source) + { + const AZ::Entity* result = nullptr; + source.GetConstEntities( + [&result, entityId](const AZ::Entity& entity) + { + if (entity.GetId() != entityId) + { + return true; + } + else + { + result = &entity; + return false; + } + }); + return result; + } + AZ::Entity* FindEntity(AZ::EntityId entityId, AzFramework::Spawnable& source) { uint32_t index = AzToolsFramework::Prefab::SpawnableUtils::FindEntityIndex(entityId, source); return index != InvalidEntityIndex ? source.GetEntities()[index].get() : nullptr; } - template - AZStd::unique_ptr CloneEntity(AZ::EntityId entityId, T& source) + AZStd::unique_ptr CloneEntity(AZ::EntityId entityId, AzToolsFramework::Prefab::Instance& source) { AZ::Entity* target = Internal::FindEntity(entityId, source); AZ_Assert( @@ -74,43 +93,30 @@ namespace AzToolsFramework::Prefab::SpawnableUtils return clone; } - AZStd::unique_ptr ReplaceEntityWithPlaceholder(AZ::EntityId entityId, AzToolsFramework::Prefab::Instance& source) + AZStd::unique_ptr ReplaceEntityWithPlaceholder( + AZ::EntityId entityId, + [[maybe_unused]] AZStd::string_view sourcePrefabName, + AzToolsFramework::Prefab::Instance& source) { auto&& [instance, alias] = source.FindInstanceAndAlias(entityId); AZ_Assert( - instance, "SpawnbleUtils were unable to locate entity alias with id %zu in Instance '%s' for replacing.", - aznumeric_cast(entityId), source.GetTemplateSourcePath().c_str()); + instance, "SpawnbleUtils were unable to locate entity alias with id %zu in Instance '%.*s' for replacing.", + aznumeric_cast(entityId), AZ_STRING_ARG(sourcePrefabName)); EntityOptionalReference entityData = instance->GetEntity(alias); AZ_Assert( - entityData.has_value(), "SpawnbleUtils were unable to locate entity '%.*s' in Instance '%s' for replacing.", - AZ_STRING_ARG(alias), source.GetTemplateSourcePath().c_str()); + entityData.has_value(), "SpawnbleUtils were unable to locate entity '%.*s' in Instance '%.*s' for replacing.", + AZ_STRING_ARG(alias), AZ_STRING_ARG(sourcePrefabName)); // A new entity id can be used for the placeholder as `ReplaceEntity` will swap the entity ids. auto placeholder = AZStd::make_unique(AZ::Entity::MakeId(), entityData->get().GetName()); - AZStd::unique_ptr result = instance->ReplaceEntity(AZStd::move(placeholder), alias); - return result; - } - - AZStd::unique_ptr ReplaceEntityWithPlaceholder(AZ::EntityId entityId, AzFramework::Spawnable& source) - { - uint32_t index = AzToolsFramework::Prefab::SpawnableUtils::FindEntityIndex(entityId, source); - AZ_Assert( - index != InvalidEntityIndex, "SpawnbleUtils were unable to locate entity alias with id %zu in Spawnable for replacing.", - aznumeric_cast(entityId)); - - AZStd::unique_ptr original = AZStd::move(source.GetEntities()[index]); - AZ_Assert( - original, "SpawnbleUtils were unable to locate entity with id %zu in Spawnable for replacing.", - aznumeric_cast(entityId)); - - source.GetEntities()[index] = AZStd::make_unique(original->GetId(), original->GetName()); - original->SetId(AZ::Entity::MakeId()); - return original; + return instance->ReplaceEntity(AZStd::move(placeholder), alias); } - template AZStd::pair, AzFramework::Spawnable::EntityAliasType> ApplyAlias( - Source& source, AZ::EntityId entityId, AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasType aliasType) + AZStd::string_view sourcePrefabName, + AzToolsFramework::Prefab::Instance& source, + AZ::EntityId entityId, + AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasType aliasType) { namespace PCU = AzToolsFramework::Prefab::PrefabConversionUtils; using ResultPair = AZStd::pair, AzFramework::Spawnable::EntityAliasType>; @@ -123,11 +129,13 @@ namespace AzToolsFramework::Prefab::SpawnableUtils case PCU::EntityAliasType::OptionalReplace: return ResultPair(CloneEntity(entityId, source), AzFramework::Spawnable::EntityAliasType::Replace); case PCU::EntityAliasType::Replace: - return ResultPair(ReplaceEntityWithPlaceholder(entityId, source), AzFramework::Spawnable::EntityAliasType::Replace); + return ResultPair( + ReplaceEntityWithPlaceholder(entityId, sourcePrefabName, source), + AzFramework::Spawnable::EntityAliasType::Replace); case PCU::EntityAliasType::Additional: - ResultPair(AZStd::make_unique(), AzFramework::Spawnable::EntityAliasType::Additional); + return ResultPair(AZStd::make_unique(), AzFramework::Spawnable::EntityAliasType::Additional); case PCU::EntityAliasType::Merge: - ResultPair(AZStd::make_unique(), AzFramework::Spawnable::EntityAliasType::Merge); + return ResultPair(AZStd::make_unique(), AzFramework::Spawnable::EntityAliasType::Merge); default: AZ_Assert( false, "Invalid PrefabProcessorContext::EntityAliasType type (%i) provided.", aznumeric_cast(aliasType)); @@ -183,7 +191,8 @@ namespace AzToolsFramework::Prefab::SpawnableUtils AliasPath alias = source.GetAliasPathRelativeToInstance(entityId); if (!alias.empty()) { - auto&& [replacement, storedAliasType] = Internal::ApplyAlias(source, entityId, aliasType); + auto&& [replacement, storedAliasType] = + Internal::ApplyAlias(sourcePrefabName, source, entityId, aliasType); if (replacement) { AZ::Entity* result = replacement.get(); @@ -213,82 +222,30 @@ namespace AzToolsFramework::Prefab::SpawnableUtils } } - AZ::Entity* CreateEntityAlias( - AZStd::string sourcePrefabName, - AzToolsFramework::Prefab::Instance& source, - AzFramework::Spawnable& target, - AZ::EntityId entityId, - AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasType aliasType, - AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasSpawnableLoadBehavior loadBehavior, - uint32_t tag, - AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context) + void PatchParents(const AzToolsFramework::Prefab::Instance& source, AzToolsFramework::Prefab::Instance& target) { - using namespace AzToolsFramework::Prefab::PrefabConversionUtils; - - AliasPath alias = source.GetAliasPathRelativeToInstance(entityId); - if (!alias.empty()) - { - auto&& [replacement, storedAliasType] = Internal::ApplyAlias(source, entityId, aliasType); - if (replacement) + target.GetEntities( + [&source, &target](AZStd::unique_ptr& entity) { - AZ::Entity* result = replacement.get(); - target.GetEntities().push_back(AZStd::move(replacement)); - - EntityAliasStore store; - store.m_aliasType = storedAliasType; - store.m_source.emplace(AZStd::move(sourcePrefabName), AZStd::move(alias)); - store.m_target.emplace(target, result->GetId()); - store.m_tag = tag; - store.m_loadBehavior = loadBehavior; - context.RegisterSpawnableEntityAlias(AZStd::move(store)); - - return result; - } - else - { - AZ_Assert(false, "A replacement for entity with id %zu could not be created.", static_cast(entityId)); - return nullptr; - } - } - else - { - AZ_Assert(false, "Entity with id %llu was not found in the source prefab.", static_cast(entityId)); - return nullptr; - } - } - - AZ::Entity* CreateEntityAlias( - AzFramework::Spawnable& source, - AzFramework::Spawnable& target, - AZ::EntityId entityId, - AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasType aliasType, - AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasSpawnableLoadBehavior loadBehavior, - uint32_t tag, - AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context) - { - using namespace AzToolsFramework::Prefab::PrefabConversionUtils; - - auto&& [replacement, storedAliasType] = Internal::ApplyAlias(source, entityId, aliasType); - if (replacement) - { - AZ::Entity* result = replacement.get(); - target.GetEntities().push_back(AZStd::move(replacement)); - - EntityAliasStore store; - store.m_aliasType = storedAliasType; - store.m_source.emplace(source, entityId); - store.m_target.emplace(target, result->GetId()); - store.m_tag = tag; - store.m_loadBehavior = loadBehavior; - context.RegisterSpawnableEntityAlias(AZStd::move(store)); - - return result; - } - else - { - AZ_Assert(false, "A replacement for entity with id %zu could not be created.", static_cast(entityId)); - return nullptr; - } + AzFramework::TransformComponent* transform = entity->FindComponent(); + if (transform) + { + if (transform->GetParentId().IsValid()) + { + AliasPath originalParentAlias = source.GetAliasPathRelativeToInstance(transform->GetParentId()); + if (!originalParentAlias.empty()) + { + AZ::EntityId targetParentId = target.GetEntityIdFromAliasPath(originalParentAlias); + if (targetParentId.IsValid()) + { + // If this is valid then the parent was moved to the target spawnable so adjust the entity id. + transform->SetParent(targetParentId); + } + } + } + } + return true; + }); } uint32_t FindEntityIndex(AZ::EntityId entity, const AzFramework::Spawnable& spawnable) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h index ea8a49857e..ea33ca09cc 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h @@ -41,23 +41,7 @@ namespace AzToolsFramework::Prefab::SpawnableUtils AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasSpawnableLoadBehavior loadBehavior, uint32_t tag, AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context); - AZ::Entity* CreateEntityAlias( - AZStd::string sourcePrefabName, - AzToolsFramework::Prefab::Instance& source, - AzFramework::Spawnable& target, - AZ::EntityId entityId, - AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasType aliasType, - AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasSpawnableLoadBehavior loadBehavior, - uint32_t tag, - AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context); - AZ::Entity* CreateEntityAlias( - AzFramework::Spawnable& source, - AzFramework::Spawnable& target, - AZ::EntityId entityId, - AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasType aliasType, - AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasSpawnableLoadBehavior loadBehavior, - uint32_t tag, - AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context); + void PatchParents(const AzToolsFramework::Prefab::Instance& source, AzToolsFramework::Prefab::Instance& target); uint32_t FindEntityIndex(AZ::EntityId entity, const AzFramework::Spawnable& spawnable); From b8e3b27ea92964c50e131793458ba71aaa30ff66 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Tue, 14 Dec 2021 15:02:04 -0800 Subject: [PATCH 127/399] Added a PrefabDocument for Prefab to simplify working with Prefabs during conversion to spawnables. The new PrefabDocument handles the Prefab and the Instance. This reduces the number of times the Instance has to be reloaded from the Prefab and keeps the entity ids stable between steps. The intention is for all the PrefabDocument to conceptually manipulate the Prefab DOM, although behind the scenes it will manipulate the Instance for now. The Instance should only be directly used in case the PrefabDocument doesn't provide the functionality yet. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../PrefabEditorEntityOwnershipService.cpp | 1 + .../Prefab/Spawnable/EditorInfoRemover.cpp | 45 ++------ .../Prefab/Spawnable/EditorInfoRemover.h | 5 +- .../Spawnable/PrefabCatchmentProcessor.cpp | 63 +++++----- .../Spawnable/PrefabCatchmentProcessor.h | 2 +- .../Prefab/Spawnable/PrefabDocument.cpp | 109 ++++++++++++++++++ .../Prefab/Spawnable/PrefabDocument.h | 47 ++++++++ .../Spawnable/PrefabProcessorContext.cpp | 45 +++----- .../Prefab/Spawnable/PrefabProcessorContext.h | 15 ++- .../aztoolsframework_files.cmake | 2 + .../PrefabBuilder/PrefabBuilderComponent.cpp | 10 +- .../PrefabBuilder/PrefabBuilderComponent.h | 2 +- 12 files changed, 230 insertions(+), 116 deletions(-) create mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp create mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp index b91a0aac93..3d962ade67 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp @@ -417,6 +417,7 @@ namespace AzToolsFramework bool readyToCreateRootSpawnable = m_playInEditorData.m_assetsCache.IsActivated(); if (!readyToCreateRootSpawnable && !m_playInEditorData.m_assetsCache.Activate(Prefab::PrefabConversionUtils::PlayInEditor)) + { AZ_Error("Prefab", false, "Failed to create a prefab processing stack from key '%.*s'.", AZ_STRING_ARG(Prefab::PrefabConversionUtils::PlayInEditor)); return; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.cpp index dfba1d54ba..3f6d698bbe 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.cpp @@ -37,7 +37,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils } prefabProcessorContext.ListPrefabs( - [this, &serializeContext, &prefabProcessorContext]([[maybe_unused]] AZStd::string_view prefabName, PrefabDom& prefab) + [this, &serializeContext, &prefabProcessorContext]([[maybe_unused]] AZStd::string_view prefabName, PrefabDocument& prefab) { auto result = RemoveEditorInfo(prefab, serializeContext, prefabProcessorContext); if (!result) @@ -58,10 +58,9 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils } } - void EditorInfoRemover::GetEntitiesFromInstance( - AZStd::unique_ptr& instance, EntityList& hierarchyEntities) + void EditorInfoRemover::GetEntitiesFromInstance(AzToolsFramework::Prefab::Instance& instance, EntityList& hierarchyEntities) { - instance->GetAllEntitiesInHierarchy( + instance.GetAllEntitiesInHierarchy( [&hierarchyEntities](const AZStd::unique_ptr& entity) { hierarchyEntities.emplace_back(entity.get()); @@ -498,7 +497,7 @@ exportComponent, prefabProcessorContext); } EditorInfoRemover::RemoveEditorInfoResult EditorInfoRemover::RemoveEditorInfo( - PrefabDom& prefab, + PrefabDocument& prefab, AZ::SerializeContext* serializeContext, PrefabProcessorContext& prefabProcessorContext) { @@ -510,28 +509,10 @@ exportComponent, prefabProcessorContext); m_componentRequirementsValidator.SetPlatformTags(prefabProcessorContext.GetPlatformTags()); - // convert Prefab DOM into Prefab Instance. - AZStd::unique_ptr instance(aznew Instance()); - if (!Prefab::PrefabDomUtils::LoadInstanceFromPrefabDom(*instance, prefab, - Prefab::PrefabDomUtils::LoadFlags::AssignRandomEntityId)) - { - PrefabDomValueReference sourceReference = PrefabDomUtils::FindPrefabDomValue(prefab, PrefabDomUtils::SourceName); - - AZStd::string errorMessage("Failed to Load Prefab Instance from given Prefab Dom during Removal of Editor Info."); - if (sourceReference.has_value() && - sourceReference->get().IsString() && - sourceReference->get().GetStringLength() != 0) - { - AZStd::string_view source(sourceReference->get().GetString(), sourceReference->get().GetStringLength()); - errorMessage += AZStd::string::format("Prefab Source: %.*s", AZ_STRING_ARG(source)); - } - - return AZ::Failure(errorMessage); - } - // grab all nested entities from the Instance as source entities. + Instance& sourceInstance = prefab.GetInstance(); EntityList sourceEntities; - GetEntitiesFromInstance(instance, sourceEntities); + GetEntitiesFromInstance(sourceInstance, sourceEntities); EntityList exportEntities; @@ -597,7 +578,7 @@ exportComponent, prefabProcessorContext); exportEntitiesMap.emplace(entity->GetId(), entity); } ); - instance->RemoveNestedEntities( + sourceInstance.RemoveNestedEntities( [&exportEntitiesMap](const AZStd::unique_ptr& entity) { return exportEntitiesMap.find(entity->GetId()) == exportEntitiesMap.end(); @@ -605,7 +586,7 @@ exportComponent, prefabProcessorContext); ); // replace entities of instance with exported ones. - instance->GetAllEntitiesInHierarchy( + sourceInstance.GetAllEntitiesInHierarchy( [&exportEntitiesMap](AZStd::unique_ptr& entity) { auto entityId = entity->GetId(); @@ -614,16 +595,6 @@ exportComponent, prefabProcessorContext); } ); - // save the final result in the target Prefab DOM. - PrefabDom filteredPrefab; - if (!PrefabDomUtils::StoreInstanceInPrefabDom(*instance, filteredPrefab)) - { - return AZ::Failure(AZStd::string::format( - "Saving exported Prefab Instance within a Prefab Dom failed.") - ); - } - prefab.Swap(filteredPrefab); - return AZ::Success(); } } // namespace AzToolsFramework::Prefab::PrefabConversionUtils diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.h index dc10952733..dbad58d2f5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.h @@ -43,7 +43,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils using RemoveEditorInfoResult = AZ::Outcome; RemoveEditorInfoResult RemoveEditorInfo( - PrefabDom& prefab, + PrefabDocument& prefab, AZ::SerializeContext* serializeContext, PrefabProcessorContext& prefabProcessorContext); @@ -51,8 +51,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils protected: using EntityList = AZStd::vector; - static void GetEntitiesFromInstance( - AZStd::unique_ptr& instance, EntityList& hierarchyEntities); + static void GetEntitiesFromInstance(AzToolsFramework::Prefab::Instance& instance, EntityList& hierarchyEntities); static bool ReadComponentAttribute( AZ::Component* component, diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp index 7a54950c47..4658eea49f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp @@ -25,7 +25,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils { AZ::DataStream::StreamType serializationFormat = m_serializationFormat == SerializationFormats::Binary ? AZ::DataStream::StreamType::ST_BINARY : AZ::DataStream::StreamType::ST_XML; - context.ListPrefabs([&context, serializationFormat](AZStd::string_view prefabName, PrefabDom& prefab) + context.ListPrefabs([&context, serializationFormat](AZStd::string_view prefabName, PrefabDocument& prefab) { ProcessPrefab(context, prefabName, prefab, serializationFormat); }); @@ -45,7 +45,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils } } - void PrefabCatchmentProcessor::ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDom& prefab, + void PrefabCatchmentProcessor::ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDocument& prefab, AZ::DataStream::StreamType serializationFormat) { using namespace AzToolsFramework::Prefab::SpawnableUtils; @@ -64,45 +64,34 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils AZStd::move(uniqueName), context.GetSourceUuid(), AZStd::move(serializer)); AZ_Assert(spawnable, "Failed to create a new spawnable."); - Instance instance; - if (Prefab::PrefabDomUtils::LoadInstanceFromPrefabDom( - instance, prefab, object.GetReferencedAssets(), - Prefab::PrefabDomUtils::LoadFlags::AssignRandomEntityId)) // Always assign random entity ids because the spawnable is - // going to be used to create clones of the entities. - { - // Resolve entity aliases that store PrefabDOM information to use the spawnable instead. This is done before the entities are - // moved from the instance as they'd otherwise can't be found. - context.ResolveSpawnableEntityAliases(prefabName, *spawnable, instance); + Instance& instance = prefab.GetInstance(); + // Resolve entity aliases that store PrefabDOM information to use the spawnable instead. This is done before the entities are + // moved from the instance as they'd otherwise can't be found. + context.ResolveSpawnableEntityAliases(prefabName, *spawnable, instance); - AzFramework::Spawnable::EntityList& entities = spawnable->GetEntities(); - instance.DetachAllEntitiesInHierarchy( - [&entities, &context](AZStd::unique_ptr entity) + AzFramework::Spawnable::EntityList& entities = spawnable->GetEntities(); + instance.DetachAllEntitiesInHierarchy( + [&entities, &context](AZStd::unique_ptr entity) + { + if (entity) { - if (entity) + entity->InvalidateDependencies(); + AZ::Entity::DependencySortOutcome evaluation = entity->EvaluateDependenciesGetDetails(); + if (evaluation.IsSuccess()) + { + entities.emplace_back(AZStd::move(entity)); + } + else { - entity->InvalidateDependencies(); - AZ::Entity::DependencySortOutcome evaluation = entity->EvaluateDependenciesGetDetails(); - if (evaluation.IsSuccess()) - { - entities.emplace_back(AZStd::move(entity)); - } - else - { - AZ_Error( - "Prefabs", false, "Entity '%s' %s cannot be activated for the following reason: %s", - entity->GetName().c_str(), entity->GetId().ToString().c_str(), evaluation.GetError().m_message.c_str()); - context.ErrorEncountered(); - } + AZ_Error( + "Prefabs", false, "Entity '%s' %s cannot be activated for the following reason: %s", + entity->GetName().c_str(), entity->GetId().ToString().c_str(), evaluation.GetError().m_message.c_str()); + context.ErrorEncountered(); } - }); + } + }); - SpawnableUtils::SortEntitiesByTransformHierarchy(*spawnable); - context.GetProcessedObjects().push_back(AZStd::move(object)); - } - else - { - AZ_Error("Prefabs", false, "Failed to convert prefab '%.*s' to a spawnable.", AZ_STRING_ARG(prefabName)); - context.ErrorEncountered(); - } + SpawnableUtils::SortEntitiesByTransformHierarchy(*spawnable); + context.GetProcessedObjects().push_back(AZStd::move(object)); } } // namespace AzToolsFramework::Prefab::PrefabConversionUtils diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.h index 253321f8e7..a3556d73b7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.h @@ -40,7 +40,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils static void Reflect(AZ::ReflectContext* context); protected: - static void ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDom& prefab, + static void ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDocument& prefab, AZ::DataStream::StreamType serializationFormat); SerializationFormats m_serializationFormat{ SerializationFormats::Binary }; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp new file mode 100644 index 0000000000..1f55e0df1a --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp @@ -0,0 +1,109 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace AzToolsFramework::Prefab::PrefabConversionUtils +{ + PrefabDocument::PrefabDocument(AZStd::string name) + : m_name(AZStd::move(name)) + , m_instance(AZStd::make_unique()) + { + m_instance->SetTemplateSourcePath(AZ::IO::Path("InMemory") / name); + } + + bool PrefabDocument::SetPrefabDom(const PrefabDom& prefab) + { + if (ConstructInstanceFromPrefabDom(prefab)) + { + constexpr bool copyConstStrings = true; + m_dom.CopyFrom(prefab, m_dom.GetAllocator(), copyConstStrings); + return true; + } + else + { + return false; + } + } + + bool PrefabDocument::SetPrefabDom(PrefabDom&& prefab) + { + if (ConstructInstanceFromPrefabDom(prefab)) + { + m_dom = AZStd::move(prefab); + return true; + } + else + { + return false; + } + } + + const AZStd::string& PrefabDocument::GetName() const + { + return m_name; + } + + const PrefabDom& PrefabDocument::GetDom() const + { + if (m_isDirty) + { + m_isDirty = !PrefabDomUtils::StoreInstanceInPrefabDom(*m_instance, m_dom); + } + return m_dom; + } + + PrefabDom&& PrefabDocument::TakeDom() + { + if (m_isDirty) + { + m_isDirty = !PrefabDomUtils::StoreInstanceInPrefabDom(*m_instance, m_dom); + } + return AZStd::move(m_dom); + } + + AzToolsFramework::Prefab::Instance& PrefabDocument::GetInstance() + { + // Assume that changes will be made to the instance. + m_isDirty = true; + return *m_instance; + } + + const AzToolsFramework::Prefab::Instance& PrefabDocument::GetInstance() const + { + return *m_instance; + } + + bool PrefabDocument::ConstructInstanceFromPrefabDom(const PrefabDom& prefab) + { + using namespace AzToolsFramework::Prefab; + + m_instance->Reset(); + if (PrefabDomUtils::LoadInstanceFromPrefabDom(*m_instance, prefab, PrefabDomUtils::LoadFlags::AssignRandomEntityId)) + { + return true; + } + else + { + AZStd::string errorMessage("Failed to construct Prefab instance from given PrefabDOM"); + + PrefabDomValueConstReference sourceReference = PrefabDomUtils::FindPrefabDomValue(prefab, PrefabDomUtils::SourceName); + if (sourceReference.has_value() && sourceReference->get().IsString() && sourceReference->get().GetStringLength() != 0) + { + errorMessage += " (Source: "; + errorMessage += AZStd::string_view(sourceReference->get().GetString(), sourceReference->get().GetStringLength()); + errorMessage += ')'; + } + + errorMessage += '.'; + AZ_Error("PrefabDocument", false, errorMessage.c_str()); + return false; + } + } +} // namespace AzToolsFramework::Prefab::PrefabConversionUtils diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h new file mode 100644 index 0000000000..804082b03b --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include + +namespace AzToolsFramework::Prefab::PrefabConversionUtils +{ + class PrefabDocument final + { + public: + explicit PrefabDocument(AZStd::string name); + PrefabDocument(const PrefabDocument&) = delete; + PrefabDocument(PrefabDocument&&) = default; + + PrefabDocument& operator=(const PrefabDocument&) = delete; + PrefabDocument& operator=(PrefabDocument&&) = default; + + bool SetPrefabDom(const PrefabDom& prefab); + bool SetPrefabDom(PrefabDom&& prefab); + + const AZStd::string& GetName() const; + const PrefabDom& GetDom() const; + PrefabDom&& TakeDom(); + + // Where possible, prefer functions directly on the PrefabDocument Instead of using the Instance. + AzToolsFramework::Prefab::Instance& GetInstance(); + const AzToolsFramework::Prefab::Instance& GetInstance() const; + + private: + bool ConstructInstanceFromPrefabDom(const PrefabDom& prefab); + + mutable PrefabDom m_dom; + AZStd::unique_ptr m_instance; + AZStd::string m_name; + mutable bool m_isDirty{ false }; + }; +} // namespace AzToolsFramework::Prefab::PrefabConversionUtils diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp index 5c67c8f3b3..0fd428fa3b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -31,49 +32,39 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils : m_sourceUuid(sourceUuid) {} - bool PrefabProcessorContext::AddPrefab(AZStd::string prefabName, PrefabDom prefab) + bool PrefabProcessorContext::AddPrefab(PrefabDocument&& document) { - if (!m_isIterating) + AZStd::string name = document.GetName(); + if (!m_prefabNames.contains(name)) { - auto result = m_prefabs.emplace(AZStd::move(prefabName), AZStd::move(prefab)); - return result.second; - } - else - { - auto it = m_prefabs.find(prefabName); - if (it == m_prefabs.end()) - { - auto result = m_pendingPrefabAdditions.emplace(AZStd::move(prefabName), AZStd::move(prefab)); - return result.second; - } - else - { - return false; - } + m_prefabNames.emplace(AZStd::move(name)); + PrefabContainer& container = m_isIterating ? m_pendingPrefabAdditions : m_prefabs; + container.push_back(AZStd::move(document)); + return true; } + return false; } - void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) + void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) { m_isIterating = true; - for (auto& it : m_prefabs) + for (PrefabDocument& document : m_prefabs) { - callback(it.first, it.second); + callback(document.GetName(), document); } m_isIterating = false; - for (auto& prefab : m_pendingPrefabAdditions) - { - m_prefabs.emplace(AZStd::move(prefab.first), AZStd::move(prefab.second)); - } + m_prefabs.insert( + m_prefabs.end(), AZStd::make_move_iterator(m_pendingPrefabAdditions.begin()), + AZStd::make_move_iterator(m_pendingPrefabAdditions.end())); m_pendingPrefabAdditions.clear(); } - void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) const + void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) const { - for (const auto& it : m_prefabs) + for (const PrefabDocument& document : m_prefabs) { - callback(it.first, it.second); + callback(document.GetName(), document); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h index ade17e2ff0..4c2dc73ed8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h @@ -21,6 +21,7 @@ #include #include #include +#include #include namespace AzToolsFramework::Prefab::PrefabConversionUtils @@ -93,9 +94,9 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils explicit PrefabProcessorContext(const AZ::Uuid& sourceUuid); virtual ~PrefabProcessorContext() = default; - virtual bool AddPrefab(AZStd::string prefabName, PrefabDom prefab); - virtual void ListPrefabs(const AZStd::function& callback); - virtual void ListPrefabs(const AZStd::function& callback) const; + virtual bool AddPrefab(PrefabDocument&& document); + virtual void ListPrefabs(const AZStd::function& callback); + virtual void ListPrefabs(const AZStd::function& callback) const; virtual bool HasPrefabs() const; virtual bool RegisterSpawnableProductAssetDependency( @@ -128,13 +129,15 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils virtual void ErrorEncountered(); protected: - using NamedPrefabContainer = AZStd::unordered_map; + using PrefabNames = AZStd::unordered_set; + using PrefabContainer = AZStd::vector; using SpawnableEntityAliasStore = AZStd::vector; AZ::Data::AssetLoadBehavior ToAssetLoadBehavior(EntityAliasSpawnableLoadBehavior loadBehavior) const; - NamedPrefabContainer m_prefabs; - NamedPrefabContainer m_pendingPrefabAdditions; + PrefabContainer m_prefabs; + PrefabContainer m_pendingPrefabAdditions; + PrefabNames m_prefabNames; SpawnableEntityAliasStore m_entityAliases; ProcessedObjectStoreContainer m_products; ProductAssetDependencyContainer m_registeredProductAssetDependencies; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index 2c25cc9222..4c23289805 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -730,6 +730,8 @@ set(FILES Prefab/Spawnable/PrefabConversionPipeline.h Prefab/Spawnable/PrefabConversionPipeline.cpp Prefab/Spawnable/PrefabConverterStackProfileNames.h + Prefab/Spawnable/PrefabDocument.h + Prefab/Spawnable/PrefabDocument.cpp Prefab/Spawnable/ProcesedObjectStore.h Prefab/Spawnable/ProcesedObjectStore.cpp Prefab/Spawnable/PrefabProcessor.h diff --git a/Gems/Prefab/PrefabBuilder/PrefabBuilderComponent.cpp b/Gems/Prefab/PrefabBuilder/PrefabBuilderComponent.cpp index 6107226783..71464501ba 100644 --- a/Gems/Prefab/PrefabBuilder/PrefabBuilderComponent.cpp +++ b/Gems/Prefab/PrefabBuilder/PrefabBuilderComponent.cpp @@ -237,7 +237,7 @@ namespace AZ::Prefab bool PrefabBuilderComponent::ProcessPrefab( const AZ::PlatformTagSet& platformTags, const char* filePath, AZ::IO::PathView tempDirPath, const AZ::Uuid& sourceFileUuid, - AzToolsFramework::Prefab::PrefabDom& mutableRootDom, AZStd::vector& jobProducts) + AzToolsFramework::Prefab::PrefabDom&& rootDom, AZStd::vector& jobProducts) { AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext context(sourceFileUuid); AZStd::string rootPrefabName; @@ -247,7 +247,9 @@ namespace AZ::Prefab filePath); return false; } - context.AddPrefab(AZStd::move(rootPrefabName), AZStd::move(mutableRootDom)); + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabDocument rootDocument(AZStd::move(rootPrefabName)); + rootDocument.SetPrefabDom(AZStd::move(rootDom)); + context.AddPrefab(AZStd::move(rootDocument)); context.SetPlatformTags(AZStd::move(platformTags)); @@ -319,8 +321,8 @@ namespace AZ::Prefab }); if (ProcessPrefab( - platformTags, request.m_fullPath.c_str(), request.m_tempDirPath.c_str(), request.m_sourceFileUUID, mutableRootDom, - response.m_outputProducts)) + platformTags, request.m_fullPath.c_str(), request.m_tempDirPath.c_str(), request.m_sourceFileUUID, + AZStd::move(mutableRootDom), response.m_outputProducts)) { response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; } diff --git a/Gems/Prefab/PrefabBuilder/PrefabBuilderComponent.h b/Gems/Prefab/PrefabBuilder/PrefabBuilderComponent.h index 9ebdd690f5..73ef6b0426 100644 --- a/Gems/Prefab/PrefabBuilder/PrefabBuilderComponent.h +++ b/Gems/Prefab/PrefabBuilder/PrefabBuilderComponent.h @@ -53,7 +53,7 @@ namespace AZ::Prefab const AzToolsFramework::Prefab::PrefabDom& genericDocument); bool ProcessPrefab( const AZ::PlatformTagSet& platformTags, const char* filePath, AZ::IO::PathView tempDirPath, const AZ::Uuid& sourceFileUuid, - AzToolsFramework::Prefab::PrefabDom& mutableRootDom, + AzToolsFramework::Prefab::PrefabDom&& rootDom, AZStd::vector& jobProducts); protected: From 7b5868d19869e1a045a278b7cce0598dc8a3940c Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Wed, 15 Dec 2021 10:05:44 -0800 Subject: [PATCH 128/399] Added additional functions to edit prefabs during processing to PrefabDocument. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Prefab/Instance/Instance.cpp | 29 +++++++- .../Prefab/Instance/Instance.h | 7 ++ .../Prefab/Spawnable/EntityAliasTypes.h | 69 +++++++++++++++++++ .../Prefab/Spawnable/PrefabDocument.cpp | 52 +++++++++++--- .../Prefab/Spawnable/PrefabDocument.h | 19 +++++ .../Prefab/Spawnable/PrefabDocument.inl | 16 +++++ .../Prefab/Spawnable/PrefabProcessorContext.h | 51 +------------- .../Prefab/Spawnable/SpawnableUtils.cpp | 27 +------- .../Prefab/Spawnable/SpawnableUtils.h | 10 ++- .../aztoolsframework_files.cmake | 2 + 10 files changed, 193 insertions(+), 89 deletions(-) create mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EntityAliasTypes.h create mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.inl diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.cpp index c685735f40..03d62dff0a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.cpp @@ -608,6 +608,31 @@ namespace AzToolsFramework } AZ::EntityId Instance::GetEntityIdFromAliasPath(AliasPathView relativeAliasPath) const + { + return GetInstanceAndEntityIdFromAliasPath(relativeAliasPath).second; + } + + AZStd::pair Instance::GetInstanceAndEntityIdFromAliasPath(AliasPathView relativeAliasPath) + { + Instance* instance = this; + AliasPathView path = relativeAliasPath.ParentPath(); + for (auto it : path) + { + InstanceOptionalReference child = instance->FindNestedInstance(it.Native()); + if (child.has_value()) + { + instance = &(child->get()); + } + else + { + return AZStd::pair(nullptr, AZ::EntityId()); + } + } + + return AZStd::pair(instance, instance->GetEntityId(relativeAliasPath.Filename().Native())); + } + + AZStd::pair Instance::GetInstanceAndEntityIdFromAliasPath(AliasPathView relativeAliasPath) const { const Instance* instance = this; AliasPathView path = relativeAliasPath.ParentPath(); @@ -620,11 +645,11 @@ namespace AzToolsFramework } else { - return AZ::EntityId(); + return AZStd::pair(nullptr, AZ::EntityId()); } } - return instance->GetEntityId(relativeAliasPath.Filename().Native()); + return AZStd::pair(instance, instance->GetEntityId(relativeAliasPath.Filename().Native())); } AZStd::vector Instance::GetNestedInstanceAliases(TemplateId templateId) const diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h index 625357f485..b63eca309a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h @@ -169,6 +169,13 @@ namespace AzToolsFramework * @return entityId, invalid ID if not found */ AZ::EntityId GetEntityIdFromAliasPath(AliasPathView relativeAliasPath) const; + /** + * Retrieves the instance pointer and entity id from an alias path that's relative to this instance. + * + * @return A pair with the Instance and entity id. The Instance is set to null and entityId is set to invalid if not found. + */ + AZStd::pair GetInstanceAndEntityIdFromAliasPath(AliasPathView relativeAliasPath); + AZStd::pair GetInstanceAndEntityIdFromAliasPath(AliasPathView relativeAliasPath) const; /** diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EntityAliasTypes.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EntityAliasTypes.h new file mode 100644 index 0000000000..9ab1f9bbd1 --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EntityAliasTypes.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include +#include +#include + +namespace AzToolsFramework::Prefab::PrefabConversionUtils +{ + enum class EntityAliasType : uint8_t + { + Disable, //!< No alias is added. + OptionalReplace, //!< At runtime the entity might be replaced. If the alias is disabled the original entity will be spawned. + //!< The original entity will be left in the spawnable and a copy is returned. + Replace, //!< At runtime the entity will be replaced. If the alias is disabled nothing will be spawned. The original + //!< entity is returned and a blank entity is left. + Additional, //!< At runtime the alias entity will be added as an additional but unrelated entity with a new entity id. + //!< An empty entity will be returned. + Merge //!< At runtime the components in both entities will be merged. An empty entity will be returned. The added + //!< components may no conflict with the entities already in the root entity. + }; + + enum class EntityAliasSpawnableLoadBehavior : uint8_t + { + NoLoad, //!< Don't load the spawnable referenced in the entity alias. Loading will be up to the caller. + QueueLoad, //!< Queue the spawnable referenced in the entity alias for loading. This will be an async load because asset + //!< handlers aren't allowed to start a blocking load as this can lead to deadlocks. This option will allow + //!< to disable loading the referenced spawnable through the event fired from the spawnables asset handler. + DependentLoad //!< The spawnable referenced in the entity alias is made a dependency of the spawnable that holds the entity + //!< alias. This will cause the spawnable to be automatically loaded along with the owning spawnable. + }; + + struct EntityAliasSpawnableLink + { + EntityAliasSpawnableLink(AzFramework::Spawnable& spawnable, AZ::EntityId index); + + AzFramework::Spawnable& m_spawnable; + AZ::EntityId m_index; + }; + + struct EntityAliasPrefabLink + { + EntityAliasPrefabLink(AZStd::string prefabName, AzToolsFramework::Prefab::AliasPath alias); + + AZStd::string m_prefabName; + AzToolsFramework::Prefab::AliasPath m_alias; + }; + + struct EntityAliasStore + { + using LinkStore = AZStd::variant; + + LinkStore m_source; + LinkStore m_target; + uint32_t m_tag; + AzFramework::Spawnable::EntityAliasType m_aliasType; + EntityAliasSpawnableLoadBehavior m_loadBehavior; + }; +} // namespace AzToolsFramework::Prefab::PrefabConversionUtils diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp index 1f55e0df1a..c0eb5257b0 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp @@ -8,6 +8,7 @@ #include #include +#include namespace AzToolsFramework::Prefab::PrefabConversionUtils { @@ -68,6 +69,43 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils return AZStd::move(m_dom); } + void PrefabDocument::ListEntitiesWithComponentType( + AZ::TypeId componentType, const AZStd::function& callback) const + { + m_instance->GetAllEntitiesInHierarchyConst( + [this, &componentType, &callback](const AZ::Entity& entity) -> bool + { + if (entity.FindComponent(componentType)) + { + return callback(m_instance->GetAliasPathRelativeToInstance(entity.GetId())); + } + else + { + return true; + } + }); + } + + AZ::Entity* PrefabDocument::CreateEntityAlias( + PrefabDocument& source, + AzToolsFramework::Prefab::AliasPathView entity, + AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasType aliasType, + AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasSpawnableLoadBehavior loadBehavior, + uint32_t tag, + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context) + { + auto&& [sourceInstance, entityId] = source.m_instance->GetInstanceAndEntityIdFromAliasPath(entity); + if (sourceInstance != nullptr && entityId.IsValid()) + { + return SpawnableUtils::CreateEntityAlias( + source.m_name, *sourceInstance, m_name, *m_instance, entityId, aliasType, loadBehavior, tag, context); + } + else + { + return nullptr; + } + } + AzToolsFramework::Prefab::Instance& PrefabDocument::GetInstance() { // Assume that changes will be made to the instance. @@ -91,18 +129,16 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils } else { - AZStd::string errorMessage("Failed to construct Prefab instance from given PrefabDOM"); - +#ifdef AZ_ENABLE_TRACING + AZStd::string_view sourceName = m_name; PrefabDomValueConstReference sourceReference = PrefabDomUtils::FindPrefabDomValue(prefab, PrefabDomUtils::SourceName); if (sourceReference.has_value() && sourceReference->get().IsString() && sourceReference->get().GetStringLength() != 0) { - errorMessage += " (Source: "; - errorMessage += AZStd::string_view(sourceReference->get().GetString(), sourceReference->get().GetStringLength()); - errorMessage += ')'; + sourceName = AZStd::string_view(sourceReference->get().GetString(), sourceReference->get().GetStringLength()); } - - errorMessage += '.'; - AZ_Error("PrefabDocument", false, errorMessage.c_str()); + AZ_Error( + "PrefabDocument", false, "Failed to construct Prefab instance from given PrefabDOM '%.*s'.", AZ_STRING_ARG(sourceName)); +#endif return false; } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h index 804082b03b..215daf7f71 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h @@ -8,13 +8,18 @@ #pragma once +#include #include #include #include #include +#include +#include namespace AzToolsFramework::Prefab::PrefabConversionUtils { + class PrefabProcessorContext; + class PrefabDocument final { public: @@ -32,6 +37,18 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils const PrefabDom& GetDom() const; PrefabDom&& TakeDom(); + template + void ListEntitiesWithComponentType(const AZStd::function& callback) const; + void ListEntitiesWithComponentType( + AZ::TypeId componentType, const AZStd::function& callback) const; + AZ::Entity* CreateEntityAlias( + PrefabDocument& source, + AzToolsFramework::Prefab::AliasPathView entity, + AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasType aliasType, + AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasSpawnableLoadBehavior loadBehavior, + uint32_t tag, + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context); + // Where possible, prefer functions directly on the PrefabDocument Instead of using the Instance. AzToolsFramework::Prefab::Instance& GetInstance(); const AzToolsFramework::Prefab::Instance& GetInstance() const; @@ -45,3 +62,5 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils mutable bool m_isDirty{ false }; }; } // namespace AzToolsFramework::Prefab::PrefabConversionUtils + +#include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.inl b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.inl new file mode 100644 index 0000000000..37b1f1c127 --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.inl @@ -0,0 +1,16 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +namespace AzToolsFramework::Prefab::PrefabConversionUtils +{ + template + void PrefabDocument::ListEntitiesWithComponentType(const AZStd::function& callback) const + { + ListEntitiesWithComponentType(azrtti_typeid(), callback); + } +} // namespace AzToolsFramework::Prefab::PrefabConversionUtils diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h index 4c2dc73ed8..8dde89b9e1 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h @@ -21,61 +21,12 @@ #include #include #include +#include #include #include namespace AzToolsFramework::Prefab::PrefabConversionUtils { - enum class EntityAliasType : uint8_t - { - Disable, //!< No alias is added. - OptionalReplace, //!< At runtime the entity might be replaced. If the alias is disabled the original entity will be spawned. - //!< The original entity will be left in the spawnable and a copy is returned. - Replace, //!< At runtime the entity will be replaced. If the alias is disabled nothing will be spawned. The original - //!< entity is returned and a blank entity is left. - Additional, //!< At runtime the alias entity will be added as an additional but unrelated entity with a new entity id. - //!< An empty entity will be returned. - Merge //!< At runtime the components in both entities will be merged. An empty entity will be returned. The added - //!< components may no conflict with the entities already in the root entity. - }; - - enum class EntityAliasSpawnableLoadBehavior : uint8_t - { - NoLoad, //!< Don't load the spawnable referenced in the entity alias. Loading will be up to the caller. - QueueLoad, //!< Queue the spawnable referenced in the entity alias for loading. This will be an async load because asset - //!< handlers aren't allowed to start a blocking load as this can lead to deadlocks. This option will allow - //!< to disable loading the referenced spawnable through the event fired from the spawnables asset handler. - DependentLoad //!< The spawnable referenced in the entity alias is made a dependency of the spawnable that holds the entity - //!< alias. This will cause the spawnable to be automatically loaded along with the owning spawnable. - }; - - struct EntityAliasSpawnableLink - { - EntityAliasSpawnableLink(AzFramework::Spawnable& spawnable, AZ::EntityId index); - - AzFramework::Spawnable& m_spawnable; - AZ::EntityId m_index; - }; - - struct EntityAliasPrefabLink - { - EntityAliasPrefabLink(AZStd::string prefabName, AzToolsFramework::Prefab::AliasPath alias); - - AZStd::string m_prefabName; - AzToolsFramework::Prefab::AliasPath m_alias; - }; - - struct EntityAliasStore - { - using LinkStore = AZStd::variant; - - LinkStore m_source; - LinkStore m_target; - uint32_t m_tag; - AzFramework::Spawnable::EntityAliasType m_aliasType; - EntityAliasSpawnableLoadBehavior m_loadBehavior; - }; - struct AssetDependencyInfo { AZ::Data::AssetId m_assetId; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp index e30417324c..4f007f509e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp @@ -21,6 +21,7 @@ #include #include #include +#include namespace AzToolsFramework::Prefab::SpawnableUtils { @@ -222,32 +223,6 @@ namespace AzToolsFramework::Prefab::SpawnableUtils } } - void PatchParents(const AzToolsFramework::Prefab::Instance& source, AzToolsFramework::Prefab::Instance& target) - { - target.GetEntities( - [&source, &target](AZStd::unique_ptr& entity) - { - AzFramework::TransformComponent* transform = entity->FindComponent(); - if (transform) - { - if (transform->GetParentId().IsValid()) - { - AliasPath originalParentAlias = source.GetAliasPathRelativeToInstance(transform->GetParentId()); - if (!originalParentAlias.empty()) - { - AZ::EntityId targetParentId = target.GetEntityIdFromAliasPath(originalParentAlias); - if (targetParentId.IsValid()) - { - // If this is valid then the parent was moved to the target spawnable so adjust the entity id. - transform->SetParent(targetParentId); - } - } - } - } - return true; - }); - } - uint32_t FindEntityIndex(AZ::EntityId entity, const AzFramework::Spawnable& spawnable) { auto begin = spawnable.GetEntities().begin(); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h index ea33ca09cc..53d007c0c1 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include namespace AZ { @@ -24,6 +24,11 @@ namespace AzToolsFramework::Prefab class Instance; } +namespace AzToolsFramework::Prefab::PrefabConversionUtils +{ + class PrefabProcessorContext; +} + namespace AzToolsFramework::Prefab::SpawnableUtils { static constexpr uint32_t InvalidEntityIndex = AZStd::numeric_limits::max(); @@ -41,8 +46,7 @@ namespace AzToolsFramework::Prefab::SpawnableUtils AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasSpawnableLoadBehavior loadBehavior, uint32_t tag, AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context); - void PatchParents(const AzToolsFramework::Prefab::Instance& source, AzToolsFramework::Prefab::Instance& target); - + uint32_t FindEntityIndex(AZ::EntityId entity, const AzFramework::Spawnable& spawnable); void SortEntitiesByTransformHierarchy(AzFramework::Spawnable& spawnable); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index 4c23289805..05c07afecd 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -723,6 +723,7 @@ set(FILES Prefab/Spawnable/EditorOnlyEntityHandler/UiEditorOnlyEntityHandler.cpp Prefab/Spawnable/EditorOnlyEntityHandler/WorldEditorOnlyEntityHandler.h Prefab/Spawnable/EditorOnlyEntityHandler/WorldEditorOnlyEntityHandler.cpp + Prefab/Spawnable/EntityAliasTypes.h Prefab/Spawnable/InMemorySpawnableAssetContainer.h Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp Prefab/Spawnable/PrefabCatchmentProcessor.h @@ -731,6 +732,7 @@ set(FILES Prefab/Spawnable/PrefabConversionPipeline.cpp Prefab/Spawnable/PrefabConverterStackProfileNames.h Prefab/Spawnable/PrefabDocument.h + Prefab/Spawnable/PrefabDocument.inl Prefab/Spawnable/PrefabDocument.cpp Prefab/Spawnable/ProcesedObjectStore.h Prefab/Spawnable/ProcesedObjectStore.cpp From 43c42f63c642aa47a7aae56a9bb5f765ca55f4c2 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Wed, 15 Dec 2021 10:52:23 -0800 Subject: [PATCH 129/399] Cleaned up some unused code in the Prefab processor. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Components/TransformComponent.cpp | 25 ++++++++----------- .../Prefab/Spawnable/EditorInfoRemover.cpp | 4 +-- .../Spawnable/PrefabCatchmentProcessor.cpp | 10 ++++---- .../Spawnable/PrefabCatchmentProcessor.h | 3 +-- .../Spawnable/PrefabProcessorContext.cpp | 8 +++--- .../Prefab/Spawnable/PrefabProcessorContext.h | 4 +-- 6 files changed, 25 insertions(+), 29 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp index 2f3fc3cb8b..809f664a10 100644 --- a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp @@ -585,24 +585,21 @@ namespace AzFramework EBUS_EVENT_PTR(m_notificationBus, AZ::TransformNotificationBus, OnParentChanged, oldParent, parentId); m_parentChangedEvent.Signal(oldParent, parentId); - if (GetEntity() != nullptr) + if (oldParent != parentId) // Don't send removal notification while activating. { - if (oldParent != parentId) // Don't send removal notification while activating. + EBUS_EVENT_ID(oldParent, AZ::TransformNotificationBus, OnChildRemoved, GetEntityId()); + auto oldParentTransform = AZ::TransformBus::FindFirstHandler(oldParent); + if (oldParentTransform) { - EBUS_EVENT_ID(oldParent, AZ::TransformNotificationBus, OnChildRemoved, GetEntityId()); - auto oldParentTransform = AZ::TransformBus::FindFirstHandler(oldParent); - if (oldParentTransform) - { - oldParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Removed, GetEntityId()); - } + oldParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Removed, GetEntityId()); } + } - EBUS_EVENT_ID(parentId, AZ::TransformNotificationBus, OnChildAdded, GetEntityId()); - auto newParentTransform = AZ::TransformBus::FindFirstHandler(parentId); - if (newParentTransform) - { - newParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Added, GetEntityId()); - } + EBUS_EVENT_ID(parentId, AZ::TransformNotificationBus, OnChildAdded, GetEntityId()); + auto newParentTransform = AZ::TransformBus::FindFirstHandler(parentId); + if (newParentTransform) + { + newParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Added, GetEntityId()); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.cpp index 3f6d698bbe..9488b68ee8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.cpp @@ -37,13 +37,13 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils } prefabProcessorContext.ListPrefabs( - [this, &serializeContext, &prefabProcessorContext]([[maybe_unused]] AZStd::string_view prefabName, PrefabDocument& prefab) + [this, &serializeContext, &prefabProcessorContext](PrefabDocument& prefab) { auto result = RemoveEditorInfo(prefab, serializeContext, prefabProcessorContext); if (!result) { AZ_Error( - "Prefab", false, "Converting to runtime Prefab '%.*s' failed, Error: %s .", AZ_STRING_ARG(prefabName), + "Prefab", false, "Converting to runtime Prefab '%s' failed, Error: %s .", prefab.GetName().c_str(), result.GetError().c_str()); return; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp index 4658eea49f..40cd52cac8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp @@ -25,9 +25,9 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils { AZ::DataStream::StreamType serializationFormat = m_serializationFormat == SerializationFormats::Binary ? AZ::DataStream::StreamType::ST_BINARY : AZ::DataStream::StreamType::ST_XML; - context.ListPrefabs([&context, serializationFormat](AZStd::string_view prefabName, PrefabDocument& prefab) + context.ListPrefabs([&context, serializationFormat](PrefabDocument& prefab) { - ProcessPrefab(context, prefabName, prefab, serializationFormat); + ProcessPrefab(context, prefab, serializationFormat); }); } @@ -45,12 +45,12 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils } } - void PrefabCatchmentProcessor::ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDocument& prefab, + void PrefabCatchmentProcessor::ProcessPrefab(PrefabProcessorContext& context, PrefabDocument& prefab, AZ::DataStream::StreamType serializationFormat) { using namespace AzToolsFramework::Prefab::SpawnableUtils; - AZStd::string uniqueName = prefabName; + AZStd::string uniqueName = prefab.GetName(); uniqueName += AzFramework::Spawnable::DotFileExtension; auto serializer = [serializationFormat](AZStd::vector& output, const ProcessedObjectStore& object) -> bool @@ -67,7 +67,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils Instance& instance = prefab.GetInstance(); // Resolve entity aliases that store PrefabDOM information to use the spawnable instead. This is done before the entities are // moved from the instance as they'd otherwise can't be found. - context.ResolveSpawnableEntityAliases(prefabName, *spawnable, instance); + context.ResolveSpawnableEntityAliases(prefab.GetName(), *spawnable, instance); AzFramework::Spawnable::EntityList& entities = spawnable->GetEntities(); instance.DetachAllEntitiesInHierarchy( diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.h index a3556d73b7..39a94c86b8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.h @@ -40,8 +40,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils static void Reflect(AZ::ReflectContext* context); protected: - static void ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDocument& prefab, - AZ::DataStream::StreamType serializationFormat); + static void ProcessPrefab(PrefabProcessorContext& context, PrefabDocument& prefab, AZ::DataStream::StreamType serializationFormat); SerializationFormats m_serializationFormat{ SerializationFormats::Binary }; }; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp index 0fd428fa3b..2e8da9f9a1 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp @@ -45,12 +45,12 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils return false; } - void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) + void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) { m_isIterating = true; for (PrefabDocument& document : m_prefabs) { - callback(document.GetName(), document); + callback(document); } m_isIterating = false; @@ -60,11 +60,11 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils m_pendingPrefabAdditions.clear(); } - void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) const + void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) const { for (const PrefabDocument& document : m_prefabs) { - callback(document.GetName(), document); + callback(document); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h index 8dde89b9e1..d07761271b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h @@ -46,8 +46,8 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils virtual ~PrefabProcessorContext() = default; virtual bool AddPrefab(PrefabDocument&& document); - virtual void ListPrefabs(const AZStd::function& callback); - virtual void ListPrefabs(const AZStd::function& callback) const; + virtual void ListPrefabs(const AZStd::function& callback); + virtual void ListPrefabs(const AZStd::function& callback) const; virtual bool HasPrefabs() const; virtual bool RegisterSpawnableProductAssetDependency( From a964120b7ad8edcd1c47181d13f06237e241989e Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Wed, 15 Dec 2021 14:32:28 -0800 Subject: [PATCH 130/399] Updated the NetworkPrefabProcessor with the latest Prefab builder changes. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Pipeline/NetworkPrefabProcessor.cpp | 75 +++++++------------ .../Source/Pipeline/NetworkPrefabProcessor.h | 19 +++-- 2 files changed, 36 insertions(+), 58 deletions(-) diff --git a/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp b/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp index 2a6baed411..a797523bc0 100644 --- a/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp +++ b/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp @@ -20,11 +20,10 @@ namespace Multiplayer { - using AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessor; - using AzToolsFramework::Prefab::PrefabConversionUtils::ProcessedObjectStore; - - void NetworkPrefabProcessor::Process(PrefabProcessorContext& context) + void NetworkPrefabProcessor::Process(AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context) { + using AzToolsFramework::Prefab::PrefabConversionUtils::PrefabDocument; + IMultiplayerTools* mpTools = AZ::Interface::Get(); if (mpTools) { @@ -33,11 +32,17 @@ namespace Multiplayer AZ::DataStream::StreamType serializationFormat = GetAzSerializationFormat(); - context.ListPrefabs([&context, serializationFormat](AZStd::string_view prefabName, PrefabDom& prefab) { - ProcessPrefab(context, prefabName, prefab, serializationFormat); - }); + bool networkPrefabsAdded = false; + context.ListPrefabs( + [&networkPrefabsAdded, &context, serializationFormat](PrefabDocument& prefab) + { + if (ProcessPrefab(context, prefab, serializationFormat)) + { + networkPrefabsAdded = true; + } + }); - if (mpTools && !context.GetProcessedObjects().empty()) + if (mpTools && networkPrefabsAdded) { mpTools->SetDidProcessNetworkPrefabs(true); } @@ -59,28 +64,6 @@ namespace Multiplayer } } - static AZStd::unique_ptr LoadInstanceFromPrefab(const PrefabDom& prefab) - { - using namespace AzToolsFramework::Prefab; - - // convert Prefab DOM into Prefab Instance. - AZStd::unique_ptr sourceInstance(aznew Instance()); - if (!PrefabDomUtils::LoadInstanceFromPrefabDom(*sourceInstance, prefab, PrefabDomUtils::LoadFlags::AssignRandomEntityId)) - { - PrefabDomValueConstReference sourceReference = PrefabDomUtils::FindPrefabDomValue(prefab, PrefabDomUtils::SourceName); - - AZStd::string errorMessage("NetworkPrefabProcessor: Failed to Load Prefab Instance from given Prefab Dom."); - if (sourceReference.has_value() && sourceReference->get().IsString() && sourceReference->get().GetStringLength() != 0) - { - AZStd::string_view source(sourceReference->get().GetString(), sourceReference->get().GetStringLength()); - errorMessage += AZStd::string::format("Prefab Source: %.*s", AZ_STRING_ARG(source)); - } - AZ_Error("NetworkPrefabProcessor", false, errorMessage.c_str()); - return nullptr; - } - return sourceInstance; - } - static void GatherNetEntities( AzToolsFramework::Prefab::Instance* instance, AZStd::unordered_map& entityToInstanceMap, @@ -103,18 +86,15 @@ namespace Multiplayer }); } - void NetworkPrefabProcessor::ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDom& prefab, AZ::DataStream::StreamType serializationFormat) + bool NetworkPrefabProcessor::ProcessPrefab( + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context, + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabDocument& prefab, + AZ::DataStream::StreamType serializationFormat) { + using AzToolsFramework::Prefab::PrefabConversionUtils::ProcessedObjectStore; using namespace AzToolsFramework::Prefab; - // convert Prefab DOM into Prefab Instance. - AZStd::unique_ptr sourceInstance = LoadInstanceFromPrefab(prefab); - if (!sourceInstance) - { - return; - } - - AZStd::string uniqueName = prefabName; + AZStd::string uniqueName = prefab.GetName(); uniqueName += ".network.spawnable"; auto serializer = [serializationFormat](AZStd::vector& output, const ProcessedObjectStore& object) -> bool { @@ -127,15 +107,16 @@ namespace Multiplayer ProcessedObjectStore::Create(uniqueName, context.GetSourceUuid(), AZStd::move(serializer)); auto& netSpawnableEntities = networkSpawnable->GetEntities(); + Instance& sourceInstance = prefab.GetInstance(); // Grab all net entities with their corresponding Instances to handle nested prefabs correctly AZStd::unordered_map netEntityToInstanceMap; AZStd::vector prefabNetEntities; - GatherNetEntities(sourceInstance.get(), netEntityToInstanceMap, prefabNetEntities); + GatherNetEntities(&sourceInstance, netEntityToInstanceMap, prefabNetEntities); if (prefabNetEntities.empty()) { // No networked entities in the prefab, no need to do anything in this processor. - return; + return false; } // Sort the entities prior to processing. The entities will end up in the net spawnable in this order. @@ -182,7 +163,7 @@ namespace Multiplayer // Add net spawnable asset holder to the prefab root { - EntityOptionalReference containerEntityRef = sourceInstance->GetContainerEntity(); + EntityOptionalReference containerEntityRef = sourceInstance.GetContainerEntity(); if (containerEntityRef.has_value()) { auto* networkSpawnableHolderComponent = containerEntityRef.value().get().CreateComponent(); @@ -193,18 +174,12 @@ namespace Multiplayer AZ::Entity* networkSpawnableHolderEntity = aznew AZ::Entity(uniqueName); auto* networkSpawnableHolderComponent = networkSpawnableHolderEntity->CreateComponent(); networkSpawnableHolderComponent->SetNetworkSpawnableAsset(networkSpawnableAsset); - sourceInstance->AddEntity(*networkSpawnableHolderEntity); + sourceInstance.AddEntity(*networkSpawnableHolderEntity); } } - // save the final result in the target Prefab DOM. - if (!PrefabDomUtils::StoreInstanceInPrefabDom(*sourceInstance, prefab)) - { - AZ_Error("NetworkPrefabProcessor", false, "Saving exported Prefab Instance within a Prefab Dom failed."); - return; - } - context.GetProcessedObjects().push_back(AZStd::move(object)); + return true; } AZ::DataStream::StreamType NetworkPrefabProcessor::GetAzSerializationFormat() const diff --git a/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.h b/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.h index 0fd3529db7..ef8912467d 100644 --- a/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.h +++ b/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.h @@ -14,23 +14,23 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils { class PrefabProcessorContext; + class PrefabDocument; } namespace Multiplayer { - using AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessor; - using AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext; - using AzToolsFramework::Prefab::PrefabDom; - - class NetworkPrefabProcessor : public PrefabProcessor + class NetworkPrefabProcessor : public AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessor { public: AZ_CLASS_ALLOCATOR(NetworkPrefabProcessor, AZ::SystemAllocator, 0); - AZ_RTTI(Multiplayer::NetworkPrefabProcessor, "{AF6C36DA-CBB9-4DF4-AE2D-7BC6CCE65176}", PrefabProcessor); + AZ_RTTI( + Multiplayer::NetworkPrefabProcessor, + "{AF6C36DA-CBB9-4DF4-AE2D-7BC6CCE65176}", + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessor); ~NetworkPrefabProcessor() override = default; - void Process(PrefabProcessorContext& context) override; + void Process(AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context) override; static void Reflect(AZ::ReflectContext* context); @@ -44,7 +44,10 @@ namespace Multiplayer AZ::DataStream::StreamType GetAzSerializationFormat() const; protected: - static void ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDom& prefab, AZ::DataStream::StreamType serializationFormat); + static bool ProcessPrefab( + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context, + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabDocument& prefab, + AZ::DataStream::StreamType serializationFormat); SerializationFormats m_serializationFormat = SerializationFormats::Binary; }; From 02137e2219944987fc3879bbd931b5c4045a91c8 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Wed, 15 Dec 2021 16:11:51 -0800 Subject: [PATCH 131/399] Fixed existing tests for Prefab processing. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Prefab/SpawnableRemoveEditorInfoTestFixture.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Code/Framework/AzToolsFramework/Tests/Prefab/SpawnableRemoveEditorInfoTestFixture.cpp b/Code/Framework/AzToolsFramework/Tests/Prefab/SpawnableRemoveEditorInfoTestFixture.cpp index b8ce3c7c42..0d75227e38 100644 --- a/Code/Framework/AzToolsFramework/Tests/Prefab/SpawnableRemoveEditorInfoTestFixture.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Prefab/SpawnableRemoveEditorInfoTestFixture.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -201,15 +202,14 @@ namespace UnitTest { ConvertSourceEntitiesToPrefab(); + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabDocument prefab("Test"); + prefab.SetPrefabDom(m_prefabDom); const bool actualResult = - m_editorInfoRemover.RemoveEditorInfo(m_prefabDom, m_serializeContext, m_prefabProcessorContext).IsSuccess(); + m_editorInfoRemover.RemoveEditorInfo(prefab, m_serializeContext, m_prefabProcessorContext).IsSuccess(); EXPECT_EQ(expectedResult, actualResult); - AZStd::unique_ptr convertedInstance(aznew Instance()); - ASSERT_TRUE(AzToolsFramework::Prefab::PrefabDomUtils::LoadInstanceFromPrefabDom(*convertedInstance, m_prefabDom)); - - convertedInstance->DetachAllEntitiesInHierarchy( + prefab.GetInstance().DetachAllEntitiesInHierarchy( [this](AZStd::unique_ptr entity) { m_runtimeEntities.emplace_back(entity.release()); From 1efbb7216f4bef0e3fd904c7289ee67938bb31b9 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Thu, 16 Dec 2021 10:51:11 -0800 Subject: [PATCH 132/399] Addressed issues found in/by the Spawnables benchmarks and unit tests. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Spawnable/SpawnableEntitiesInterface.h | 3 +++ .../Spawnable/SpawnableEntitiesManager.cpp | 25 +++++-------------- .../SpawnableEntitiesManagerTests.cpp | 4 +-- .../Spawnable/SpawnAllEntitiesBenchmarks.cpp | 9 ++++--- .../Code/Source/PrefabInstanceSpawner.cpp | 2 +- 5 files changed, 17 insertions(+), 26 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesInterface.h b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesInterface.h index dc9c7b4538..66197ae8fc 100644 --- a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesInterface.h +++ b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesInterface.h @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -164,6 +165,8 @@ namespace AzFramework public: friend class SpawnableEntitiesDefinition; + AZ_CLASS_ALLOCATOR(AzFramework::EntitySpawnTicket, AZ::SystemAllocator, 0); + using Id = uint32_t; EntitySpawnTicket() = default; diff --git a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesManager.cpp b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesManager.cpp index 37570caec7..3406057fca 100644 --- a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesManager.cpp +++ b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesManager.cpp @@ -499,12 +499,8 @@ namespace AzFramework for (auto it = newEntitiesBegin; it != newEntitiesEnd; ++it) { AZ::Entity* clone = (*it); - // The entity component framework doesn't handle entities without TransformComponent safely. - if (!clone->GetComponents().empty()) - { - clone->SetSpawnTicketId(request.m_ticketId); - GameEntityContextRequestBus::Broadcast(&GameEntityContextRequestBus::Events::AddGameEntity, *it); - } + clone->SetSpawnTicketId(request.m_ticketId); + GameEntityContextRequestBus::Broadcast(&GameEntityContextRequestBus::Events::AddGameEntity, clone); } // Let other systems know about newly spawned entities for any post-processing after adding to the scene/game context. @@ -636,12 +632,8 @@ namespace AzFramework for (auto it = ticket.m_spawnedEntities.begin() + spawnedEntitiesInitialCount; it != ticket.m_spawnedEntities.end(); ++it) { AZ::Entity* clone = (*it); - // The entity component framework doesn't handle entities without TransformComponent safely. - if (!clone->GetComponents().empty()) - { - clone->SetSpawnTicketId(request.m_ticketId); - GameEntityContextRequestBus::Broadcast(&GameEntityContextRequestBus::Events::AddGameEntity, *it); - } + clone->SetSpawnTicketId(request.m_ticketId); + GameEntityContextRequestBus::Broadcast(&GameEntityContextRequestBus::Events::AddGameEntity, *it); } if (request.m_completionCallback) @@ -668,7 +660,7 @@ namespace AzFramework { if (entity != nullptr) { - // Setting it to 0 is needed to avoid the infite loop between GameEntityContext and SpawnableEntitiesManager. + // Setting it to 0 is needed to avoid the infinite loop between GameEntityContext and SpawnableEntitiesManager. entity->SetSpawnTicketId(0); GameEntityContextRequestBus::Broadcast( &GameEntityContextRequestBus::Events::DestroyGameEntity, entity->GetId()); @@ -702,7 +694,7 @@ namespace AzFramework { if (*entityIterator != nullptr && (*entityIterator)->GetId() == request.m_entityId) { - // Setting it to 0 is needed to avoid the infite loop between GameEntityContext and SpawnableEntitiesManager. + // Setting it to 0 is needed to avoid the infinite loop between GameEntityContext and SpawnableEntitiesManager. (*entityIterator)->SetSpawnTicketId(0); GameEntityContextRequestBus::Broadcast( &GameEntityContextRequestBus::Events::DestroyGameEntity, (*entityIterator)->GetId()); @@ -949,11 +941,6 @@ namespace AzFramework GameEntityContextRequestBus::Broadcast( &GameEntityContextRequestBus::Events::DestroyGameEntity, entity->GetId()); } - else - { - // Entities without components wouldn't have been send to the GameEntityContext. - delete entity; - } } delete request.m_ticket; diff --git a/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp b/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp index 0dc00f81dd..d39bfed1e2 100644 --- a/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp +++ b/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp @@ -111,7 +111,7 @@ namespace UnitTest m_spawnable = aznew AzFramework::Spawnable( AZ::Data::AssetId::CreateString("{EB2E8A2B-F253-4A90-BBF4-55F2EED786B8}:0"), AZ::Data::AssetData::AssetStatus::Ready); m_spawnableAsset = new AZ::Data::Asset(m_spawnable, AZ::Data::AssetLoadBehavior::Default); - m_ticket = new AzFramework::EntitySpawnTicket(*m_spawnableAsset); + m_ticket = aznew AzFramework::EntitySpawnTicket(*m_spawnableAsset); auto managerInterface = AzFramework::SpawnableEntitiesInterface::Get(); m_manager = azrtti_cast(managerInterface); @@ -516,7 +516,7 @@ namespace UnitTest // Make sure we start with a fresh ticket each time, or else each iteration through this loop would continue to build up // more and more entities. delete m_ticket; - m_ticket = new AzFramework::EntitySpawnTicket(*m_spawnableAsset); + m_ticket = aznew AzFramework::EntitySpawnTicket(*m_spawnableAsset); constexpr size_t NumEntities = 4; FillSpawnable(NumEntities); diff --git a/Code/Framework/AzToolsFramework/Tests/Prefab/Benchmark/Spawnable/SpawnAllEntitiesBenchmarks.cpp b/Code/Framework/AzToolsFramework/Tests/Prefab/Benchmark/Spawnable/SpawnAllEntitiesBenchmarks.cpp index ecbbe10c39..ba0c3a4838 100644 --- a/Code/Framework/AzToolsFramework/Tests/Prefab/Benchmark/Spawnable/SpawnAllEntitiesBenchmarks.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Prefab/Benchmark/Spawnable/SpawnAllEntitiesBenchmarks.cpp @@ -25,7 +25,7 @@ namespace Benchmark for (auto _ : state) { state.PauseTiming(); - m_spawnTicket = new AzFramework::EntitySpawnTicket(m_spawnableAsset); + m_spawnTicket = aznew AzFramework::EntitySpawnTicket(m_spawnableAsset); state.ResumeTiming(); for (uint64_t spwanableCounter = 0; spwanableCounter < spawnAllEntitiesCallCount; spwanableCounter++) @@ -62,7 +62,7 @@ namespace Benchmark for (auto _ : state) { state.PauseTiming(); - m_spawnTicket = new AzFramework::EntitySpawnTicket(m_spawnableAsset); + m_spawnTicket = aznew AzFramework::EntitySpawnTicket(m_spawnableAsset); state.ResumeTiming(); AzFramework::SpawnableEntitiesInterface::Get()->SpawnAllEntities(*m_spawnTicket); @@ -93,15 +93,16 @@ namespace Benchmark SetUpSpawnableAsset(entityCountInSpawnable); + auto spawner = AzFramework::SpawnableEntitiesInterface::Get(); for (auto _ : state) { state.PauseTiming(); - m_spawnTicket = new AzFramework::EntitySpawnTicket(m_spawnableAsset); + m_spawnTicket = aznew AzFramework::EntitySpawnTicket(m_spawnableAsset); state.ResumeTiming(); for (uint64_t spawnCallCounter = 0; spawnCallCounter < spawnCallCount; spawnCallCounter++) { - AzFramework::SpawnableEntitiesInterface::Get()->SpawnAllEntities(*m_spawnTicket); + spawner->SpawnAllEntities(*m_spawnTicket); } m_rootSpawnableInterface->ProcessSpawnableQueue(); diff --git a/Gems/Vegetation/Code/Source/PrefabInstanceSpawner.cpp b/Gems/Vegetation/Code/Source/PrefabInstanceSpawner.cpp index b386f17cab..c7c0ef5d3d 100644 --- a/Gems/Vegetation/Code/Source/PrefabInstanceSpawner.cpp +++ b/Gems/Vegetation/Code/Source/PrefabInstanceSpawner.cpp @@ -342,7 +342,7 @@ namespace Vegetation // Create the EntitySpawnTicket here. This pointer is going to get handed off to the vegetation system as opaque instance data, // where it will be tracked and held onto for the lifetime of the vegetation instance. The vegetation system will pass it back // in to DestroyInstance at the end of the lifetime, so that's the one place where we will delete the ticket pointers. - AzFramework::EntitySpawnTicket* ticket = new AzFramework::EntitySpawnTicket(m_spawnableAsset); + AzFramework::EntitySpawnTicket* ticket = aznew AzFramework::EntitySpawnTicket(m_spawnableAsset); if (ticket->IsValid()) { // Track the ticket that we've created. From e8366040dfb25515bf2f007377171cb40c55bf60 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Thu, 16 Dec 2021 15:30:36 -0800 Subject: [PATCH 133/399] Added unit test to cover the updates to the Spawnable Entities Aliases. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../SpawnableEntitiesManagerTests.cpp | 152 +++++++++++++++--- 1 file changed, 134 insertions(+), 18 deletions(-) diff --git a/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp b/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp index d39bfed1e2..1a483a7851 100644 --- a/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp +++ b/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp @@ -77,6 +77,12 @@ namespace UnitTest public: AZ_COMPONENT(TargetSpawnableComponent, "{B4041561-63A7-4E1E-80F1-78C08D497960}"); + TargetSpawnableComponent() = default; + explicit TargetSpawnableComponent(AZ::EntityId parent) + : m_parent(parent) + { + } + void Activate() override {} void Deactivate() override {} @@ -84,9 +90,12 @@ namespace UnitTest { if (auto* serializeContext = azrtti_cast(reflection)) { - serializeContext->Class(); + serializeContext->Class() + ->Field("Parent", &TargetSpawnableComponent::m_parent); } } + + AZ::EntityId m_parent; }; class SpawnableEntitiesManagerTest : public AllocatorsFixture @@ -147,22 +156,43 @@ namespace UnitTest { auto entry = AZStd::make_unique(); entry->AddComponent(aznew SourceSpawnableComponent()); + entry->SetId(AZ::EntityId(40 + i)); entities.push_back(AZStd::move(entry)); } } - AZ::Data::Asset CreateTargetSpawnable(size_t numElements) + AZ::Data::Asset CreateTargetSpawnable(size_t numElements, bool requiresMatchingEntityIds) { auto target = aznew AzFramework::Spawnable( AZ::Data::AssetId(AZ::Uuid("{716CD8C3-0BA8-4F32-B579-0EC7C967796F}")), AZ::Data::AssetData::AssetStatus::Ready); AzFramework::Spawnable::EntityList& entities = target->GetEntities(); entities.reserve(numElements); - for (size_t i = 0; i < numElements; ++i) + if (requiresMatchingEntityIds) { - auto entry = AZStd::make_unique(); - entry->AddComponent(aznew TargetSpawnableComponent()); - entities.push_back(AZStd::move(entry)); + for (size_t i = 0; i < numElements; ++i) + { + auto entry = AZStd::make_unique(); + if (i != 0) + { + entry->AddComponent(aznew TargetSpawnableComponent(AZ::EntityId(40 + i - 1))); + } + else + { + entry->AddComponent(aznew TargetSpawnableComponent()); + } + entry->SetId(AZ::EntityId(40 + i)); + entities.push_back(AZStd::move(entry)); + } + } + else + { + for (size_t i = 0; i < numElements; ++i) + { + auto entry = AZStd::make_unique(); + entry->AddComponent(aznew TargetSpawnableComponent()); + entities.push_back(AZStd::move(entry)); + } } return AZ::Data::Asset(target, AZ::Data::AssetLoadBehavior::NoLoad); @@ -212,6 +242,38 @@ namespace UnitTest return true; } + static bool DoParentEntityIdsMatch(AzFramework::SpawnableConstEntityContainerView entities) + { + if (entities.empty()) + { + return false; + } + + const AZ::Entity* previous = nullptr; + for (const AZ::Entity* entity : entities) + { + if (entity) + { + if (previous) + { + if (TargetSpawnableComponent* link = entity->FindComponent(); link != nullptr) + { + if (link->m_parent != previous->GetId()) + { + return false; + } + } + previous = entity; + } + } + else + { + return false; + } + } + return true; + } + static bool IsEveryOtherEntityAReplacement(AzFramework::SpawnableConstEntityContainerView entities) { bool onAlternative = true; @@ -599,7 +661,8 @@ namespace UnitTest using namespace AzFramework; static constexpr size_t NumEntities = 4; FillSpawnable(NumEntities); - AZ::Data::Asset target = CreateTargetSpawnable(4); + constexpr bool requiresMatchingEntityIds = true; + AZ::Data::Asset target = CreateTargetSpawnable(4, requiresMatchingEntityIds); InsertEntityAliases<4>( { 0, 1, 2, 3 }, { 0, 1, 2, 3 }, { Spawnable::EntityAliasType::Replace, Spawnable::EntityAliasType::Replace, Spawnable::EntityAliasType::Replace, @@ -608,11 +671,13 @@ namespace UnitTest size_t spawnedEntitiesCount = 0; bool allReplaced = false; - auto callback = [&spawnedEntitiesCount, &allReplaced]( + bool allEntityIdsPatched = false; + auto callback = [&spawnedEntitiesCount, &allReplaced, &allEntityIdsPatched]( AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableConstEntityContainerView entities) { spawnedEntitiesCount += entities.size(); allReplaced = AreAllEntitiesReplaced(entities); + allEntityIdsPatched = DoParentEntityIdsMatch(entities); }; AzFramework::SpawnAllEntitiesOptionalArgs optionalArgs; optionalArgs.m_completionCallback = AZStd::move(callback); @@ -621,6 +686,7 @@ namespace UnitTest EXPECT_EQ(4, spawnedEntitiesCount); EXPECT_TRUE(allReplaced); + EXPECT_TRUE(allEntityIdsPatched); } TEST_F(SpawnableEntitiesManagerTest, SpawnAllEntities_AllAliasesWithAdditional_SourceAndTargetComponentsMerged) @@ -628,7 +694,8 @@ namespace UnitTest using namespace AzFramework; static constexpr size_t NumEntities = 4; FillSpawnable(NumEntities); - AZ::Data::Asset target = CreateTargetSpawnable(4); + constexpr bool requiresMatchingEntityIds = false; + AZ::Data::Asset target = CreateTargetSpawnable(4, requiresMatchingEntityIds); InsertEntityAliases<4>( { 0, 1, 2, 3 }, { 0, 1, 2, 3 }, { Spawnable::EntityAliasType::Additional, Spawnable::EntityAliasType::Additional, Spawnable::EntityAliasType::Additional, @@ -637,11 +704,13 @@ namespace UnitTest size_t spawnedEntitiesCount = 0; bool allAdded = false; - auto callback = [&spawnedEntitiesCount, &allAdded]( + bool allEntityIdsPatched = false; + auto callback = [&spawnedEntitiesCount, &allAdded, &allEntityIdsPatched]( AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableConstEntityContainerView entities) { spawnedEntitiesCount += entities.size(); allAdded = IsEveryOtherEntityAReplacement(entities); + allEntityIdsPatched = DoParentEntityIdsMatch(entities); }; AzFramework::SpawnAllEntitiesOptionalArgs optionalArgs; optionalArgs.m_completionCallback = AZStd::move(callback); @@ -650,6 +719,7 @@ namespace UnitTest EXPECT_EQ(8, spawnedEntitiesCount); EXPECT_TRUE(allAdded); + EXPECT_TRUE(allEntityIdsPatched); } TEST_F(SpawnableEntitiesManagerTest, SpawnAllEntities_AllAliasesWithMerge_SourceAndTargetComponentsMerged) @@ -657,7 +727,8 @@ namespace UnitTest using namespace AzFramework; static constexpr size_t NumEntities = 4; FillSpawnable(NumEntities); - AZ::Data::Asset target = CreateTargetSpawnable(4); + constexpr bool requiresMatchingEntityIds = true; + AZ::Data::Asset target = CreateTargetSpawnable(4, requiresMatchingEntityIds); InsertEntityAliases<4>( { 0, 1, 2, 3 }, { 0, 1, 2, 3 }, { Spawnable::EntityAliasType::Merge, Spawnable::EntityAliasType::Merge, Spawnable::EntityAliasType::Merge, @@ -666,11 +737,13 @@ namespace UnitTest size_t spawnedEntitiesCount = 0; bool allMerged = false; - auto callback = [&spawnedEntitiesCount, &allMerged]( + bool allEntityIdsPatched = false; + auto callback = [&spawnedEntitiesCount, &allMerged, &allEntityIdsPatched]( AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableConstEntityContainerView entities) { spawnedEntitiesCount += entities.size(); allMerged = AreAllMerged(entities); + allEntityIdsPatched = DoParentEntityIdsMatch(entities); }; AzFramework::SpawnAllEntitiesOptionalArgs optionalArgs; optionalArgs.m_completionCallback = AZStd::move(callback); @@ -679,6 +752,7 @@ namespace UnitTest EXPECT_EQ(4, spawnedEntitiesCount); EXPECT_TRUE(allMerged); + EXPECT_TRUE(allEntityIdsPatched); } // @@ -1095,7 +1169,8 @@ namespace UnitTest using namespace AzFramework; static constexpr size_t NumEntities = 4; FillSpawnable(NumEntities); - AZ::Data::Asset target = CreateTargetSpawnable(4); + constexpr bool requiresMatchingEntityIds = true; + AZ::Data::Asset target = CreateTargetSpawnable(4, requiresMatchingEntityIds); InsertEntityAliases<4>( { 0, 1, 2, 3 }, { 0, 1, 2, 3 }, { Spawnable::EntityAliasType::Replace, Spawnable::EntityAliasType::Replace, Spawnable::EntityAliasType::Replace, @@ -1106,11 +1181,13 @@ namespace UnitTest size_t spawnedEntitiesCount = 0; bool allReplaced = false; - auto callback = [&spawnedEntitiesCount, &allReplaced]( + bool allEntityIdsPatched = false; + auto callback = [&spawnedEntitiesCount, &allReplaced, &allEntityIdsPatched]( AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableConstEntityContainerView entities) { spawnedEntitiesCount += entities.size(); allReplaced = AreAllEntitiesReplaced(entities); + allEntityIdsPatched = DoParentEntityIdsMatch(entities); }; AzFramework::SpawnEntitiesOptionalArgs optionalArgs; optionalArgs.m_completionCallback = AZStd::move(callback); @@ -1119,6 +1196,7 @@ namespace UnitTest EXPECT_EQ(4, spawnedEntitiesCount); EXPECT_TRUE(allReplaced); + EXPECT_TRUE(allEntityIdsPatched); } TEST_F(SpawnableEntitiesManagerTest, SpawnEntities_AllAliasesWithAdditional_SourceAndTargetComponentsMerged) @@ -1126,7 +1204,8 @@ namespace UnitTest using namespace AzFramework; static constexpr size_t NumEntities = 4; FillSpawnable(NumEntities); - AZ::Data::Asset target = CreateTargetSpawnable(4); + constexpr bool requiresMatchingEntityIds = false; + AZ::Data::Asset target = CreateTargetSpawnable(4, requiresMatchingEntityIds); InsertEntityAliases<4>( { 0, 1, 2, 3 }, { 0, 1, 2, 3 }, { Spawnable::EntityAliasType::Additional, Spawnable::EntityAliasType::Additional, Spawnable::EntityAliasType::Additional, @@ -1137,12 +1216,14 @@ namespace UnitTest size_t spawnedEntitiesCount = 0; bool allAdded = false; + bool allEntityIdsPatched = false; auto callback = - [&spawnedEntitiesCount, &allAdded]( + [&spawnedEntitiesCount, &allAdded, &allEntityIdsPatched]( AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableConstEntityContainerView entities) { spawnedEntitiesCount += entities.size(); allAdded = IsEveryOtherEntityAReplacement(entities); + allEntityIdsPatched = DoParentEntityIdsMatch(entities); }; AzFramework::SpawnEntitiesOptionalArgs optionalArgs; optionalArgs.m_completionCallback = AZStd::move(callback); @@ -1151,6 +1232,7 @@ namespace UnitTest EXPECT_EQ(8, spawnedEntitiesCount); EXPECT_TRUE(allAdded); + EXPECT_TRUE(allEntityIdsPatched); } TEST_F(SpawnableEntitiesManagerTest, SpawnEntities_AllAliasesWithMerge_SourceAndTargetComponentsMerged) @@ -1158,7 +1240,8 @@ namespace UnitTest using namespace AzFramework; static constexpr size_t NumEntities = 4; FillSpawnable(NumEntities); - AZ::Data::Asset target = CreateTargetSpawnable(4); + constexpr bool requiresMatchingEntityIds = true; + AZ::Data::Asset target = CreateTargetSpawnable(4, requiresMatchingEntityIds); InsertEntityAliases<4>( { 0, 1, 2, 3 }, { 0, 1, 2, 3 }, { Spawnable::EntityAliasType::Merge, Spawnable::EntityAliasType::Merge, Spawnable::EntityAliasType::Merge, @@ -1169,11 +1252,13 @@ namespace UnitTest size_t spawnedEntitiesCount = 0; bool allMerged = false; - auto callback = [&spawnedEntitiesCount, &allMerged]( + bool allEntityIdsPatched = false; + auto callback = [&spawnedEntitiesCount, &allMerged, &allEntityIdsPatched]( AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableConstEntityContainerView entities) { spawnedEntitiesCount += entities.size(); allMerged = AreAllMerged(entities); + allEntityIdsPatched = DoParentEntityIdsMatch(entities); }; AzFramework::SpawnEntitiesOptionalArgs optionalArgs; optionalArgs.m_completionCallback = AZStd::move(callback); @@ -1182,6 +1267,7 @@ namespace UnitTest EXPECT_EQ(4, spawnedEntitiesCount); EXPECT_TRUE(allMerged); + EXPECT_TRUE(allEntityIdsPatched); } // @@ -1302,6 +1388,36 @@ namespace UnitTest // ClaimEntities // + TEST_F(SpawnableEntitiesManagerTest, ClaimEntities_Call_AllEntitiesWereClaimedAndNotDeleted) + { + static constexpr size_t NumEntities = 4; + FillSpawnable(NumEntities); + + AZStd::vector claimedEntities; + auto callback = [&claimedEntities](AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableEntityContainerView container) + { + for (AZ::Entity* entity : container) + { + claimedEntities.push_back(entity); + } + }; + + { + AzFramework::EntitySpawnTicket ticket(*m_spawnableAsset); + m_manager->SpawnAllEntities(ticket); + m_manager->ClaimEntities(ticket, AZStd::move(callback)); + m_manager->ProcessQueue(AzFramework::SpawnableEntitiesManager::CommandQueuePriority::Regular); + } + + EXPECT_EQ(NumEntities, claimedEntities.size()); + + // If these calls fail it means that the ticket has still deleted the entities, so they weren't properly claimed. + for (AZ::Entity* entity : claimedEntities) + { + delete entity; + } + } + TEST_F(SpawnableEntitiesManagerTest, ClaimEntities_DeleteTicketBeforeCall_NoCrash) { auto callback = [](AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableEntityContainerView) {}; From c7c96d8bafa63c80f43aeb16a1ad425e27b900be Mon Sep 17 00:00:00 2001 From: lsemp3d <58790905+lsemp3d@users.noreply.github.com> Date: Thu, 16 Dec 2021 17:20:37 -0800 Subject: [PATCH 134/399] Code maintenance, improved OnCatalogLoaded logic and track additions and removals Signed-off-by: lsemp3d <58790905+lsemp3d@users.noreply.github.com> --- Gems/GraphCanvas/Code/Source/GraphCanvas.cpp | 48 +++++++++++--------- Gems/GraphCanvas/Code/Source/GraphCanvas.h | 7 +-- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/Gems/GraphCanvas/Code/Source/GraphCanvas.cpp b/Gems/GraphCanvas/Code/Source/GraphCanvas.cpp index ebc15023cc..75306969f2 100644 --- a/Gems/GraphCanvas/Code/Source/GraphCanvas.cpp +++ b/Gems/GraphCanvas/Code/Source/GraphCanvas.cpp @@ -227,7 +227,6 @@ namespace GraphCanvas AzFramework::AssetCatalogEventBus::Handler::BusDisconnect(); Styling::PseudoElementFactoryRequestBus::Handler::BusDisconnect(); GraphCanvasRequestBus::Handler::BusDisconnect(); - AZ::Data::AssetBus::MultiHandler::BusDisconnect(); m_translationAssetWorker.Deactivate(); UnregisterAssetHandler(); @@ -369,26 +368,46 @@ namespace GraphCanvas void GraphCanvasSystemComponent::OnCatalogLoaded(const char* /*catalogFile*/) { - auto postEnumerateCb = [this]() + AZStd::vector translationAssets; + auto postEnumerateCb = [&translationAssets]() { - PopulateTranslationDatabase(); + for (const AZ::Data::AssetId& assetId : translationAssets) + { + AZ::Data::AssetManager::Instance().GetAsset(assetId, AZ::Data::AssetLoadBehavior::Default); + } }; // Find any TranslationAsset files that may have translation database key/values - AZ::Data::AssetCatalogRequests::AssetEnumerationCB collectAssetsCb = [this](const AZ::Data::AssetId assetId, const AZ::Data::AssetInfo& assetInfo) + AZ::Data::AssetCatalogRequests::AssetEnumerationCB collectAssetsCb = [&translationAssets](const AZ::Data::AssetId assetId, const AZ::Data::AssetInfo& assetInfo) { if (AZ::StringFunc::EndsWith(assetInfo.m_relativePath, ".names", false)) { - m_translationAssets.push_back(assetId); + translationAssets.push_back(assetId); } }; - m_translationAssets.clear(); - AZ::Data::AssetCatalogRequestBus::Broadcast(&AZ::Data::AssetCatalogRequestBus::Events::EnumerateAssets, nullptr, collectAssetsCb, postEnumerateCb); } + void GraphCanvasSystemComponent::OnCatalogAssetRemoved(const AZ::Data::AssetId& /*assetId*/, const AZ::Data::AssetInfo& assetInfo) + { + if (assetInfo.m_assetType == azrtti_typeid()) + { + GraphCanvas::TranslationRequestBus::Broadcast(&GraphCanvas::TranslationRequests::Restore); + } + } + + void GraphCanvasSystemComponent::OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) + { + ReloadDatabase(assetId); + } + void GraphCanvasSystemComponent::OnCatalogAssetChanged(const AZ::Data::AssetId& assetId) + { + ReloadDatabase(assetId); + } + + void GraphCanvasSystemComponent::ReloadDatabase(const AZ::Data::AssetId& assetId) { AZ::Data::AssetInfo assetInfo; AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetInfoById, assetId); @@ -405,20 +424,5 @@ namespace GraphCanvas AZ::Data::AssetManager::Instance().UnregisterHandler(m_assetHandler.get()); m_assetHandler.reset(); } - - for (const AZ::Data::AssetId& assetId : m_translationAssets) - { - AZ::Data::AssetBus::MultiHandler::BusDisconnect(assetId); - } - m_translationAssets.clear(); - } - - void GraphCanvasSystemComponent::PopulateTranslationDatabase() - { - for (const AZ::Data::AssetId& assetId : m_translationAssets) - { - AZ::Data::AssetBus::MultiHandler::BusConnect(assetId); - AZ::Data::AssetManager::Instance().GetAsset(assetId, AZ::Data::AssetLoadBehavior::Default); - } } } diff --git a/Gems/GraphCanvas/Code/Source/GraphCanvas.h b/Gems/GraphCanvas/Code/Source/GraphCanvas.h index 0b47e9010a..37bf064203 100644 --- a/Gems/GraphCanvas/Code/Source/GraphCanvas.h +++ b/Gems/GraphCanvas/Code/Source/GraphCanvas.h @@ -25,7 +25,6 @@ namespace GraphCanvas , private GraphCanvasRequestBus::Handler , protected Styling::PseudoElementFactoryRequestBus::Handler , protected AzFramework::AssetCatalogEventBus::Handler - , protected AZ::Data::AssetBus::MultiHandler { public: @@ -80,15 +79,17 @@ namespace GraphCanvas // AzFramework::AssetCatalogEventBus::Handler void OnCatalogLoaded(const char* /*catalogFile*/) override; void OnCatalogAssetChanged(const AZ::Data::AssetId&) override; + void OnCatalogAssetAdded(const AZ::Data::AssetId&) override; + void OnCatalogAssetRemoved(const AZ::Data::AssetId& /*assetId*/, const AZ::Data::AssetInfo& /*assetInfo*/) override; //// + void ReloadDatabase(const AZ::Data::AssetId&); + AZStd::unique_ptr m_assetHandler; void RegisterTranslationBuilder(); void UnregisterAssetHandler(); TranslationAssetWorker m_translationAssetWorker; - AZStd::vector m_translationAssets; - void PopulateTranslationDatabase(); TranslationDatabase m_translationDatabase; }; From 34edd4d0c011cb184ffe8ba7a5734708d6540d08 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Thu, 16 Dec 2021 18:06:25 -0800 Subject: [PATCH 135/399] Fixed post rebase Spawnable issues. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp index 553ad8ece4..dc5cd299b8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp @@ -112,9 +112,9 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils // Use a random uuid as this is only a temporary source. PrefabConversionUtils::PrefabProcessorContext context(AZ::Uuid::CreateRandom()); - PrefabDom copy; - copy.CopyFrom(templateReference->get().GetPrefabDom(), copy.GetAllocator(), false); - context.AddPrefab(spawnableName, AZStd::move(copy)); + PrefabDocument document(spawnableName); + document.SetPrefabDom(templateReference->get().GetPrefabDom()); + context.AddPrefab(AZStd::move(document)); m_converter.ProcessPrefab(context); if (!context.HasCompletedSuccessfully() || context.GetProcessedObjects().empty()) From 9b5dcf82b5972037daf9f114e79dee6618de88e7 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Thu, 16 Dec 2021 20:46:12 -0800 Subject: [PATCH 136/399] updates extend editor_entity_utils.py functionality Signed-off-by: Scott Murray --- .../editor_entity_utils.py | 200 +++++++++++++++--- 1 file changed, 172 insertions(+), 28 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index 72530325e0..b9f7576f1c 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -29,6 +29,11 @@ class EditorComponent: which also assigns self.id and self.type_id to the EditorComponent object. """ + def __init__(self, type_id): + self.type_id = type_id + self.id = None + self.property_tree = None + def get_component_name(self) -> str: """ Used to get name of component @@ -50,6 +55,9 @@ class EditorComponent: 7. prop_tree.get_container_item(path, key) :return: Property tree object of a component """ + if self.property_tree is not None: + return self.property_tree + build_prop_tree_outcome = editor.EditorComponentAPIBus( bus.Broadcast, "BuildComponentPropertyTreeEditor", self.id ) @@ -58,7 +66,114 @@ class EditorComponent: ), f"Failure: Could not build property tree of component: '{self.get_component_name()}'" prop_tree = build_prop_tree_outcome.GetValue() Report.info(prop_tree.build_paths_list()) - return prop_tree + self.property_tree = prop_tree + return self.property_tree + + def is_property_container(self, component_property_path: str) -> bool: + """ + + """ + if self.property_tree is None: + self.get_property_tree() + result = self.property_tree.is_container(component_property_path) + if not result: + Report.info(f"{self.get_component_name()}: '{component_property_path}' is not a container") + return result + + def get_container_count(self, component_property_path: str) -> int: + """ + Used to get the count of items in the container. + :param component_property_path: String of component property. (e.g. 'Settings|Visible') + :return: Count of items in the container as unsigned integer + """ + if self.is_property_container(component_property_path): + container_count_outcome = self.property_tree.get_container_count(component_property_path) + assert ( + container_count_outcome.IsSuccess() + ), f"Failure: get_container_count did not return success for '{component_property_path}'" + return container_count_outcome.GetValue() + + def reset_container(self, component_property_path: str) -> bool: + """ + Used to rest a container to empty + :param component_property_path: String of component property. (e.g. 'Settings|Visible') + :return: Boolean success + """ + if self.is_property_container(component_property_path): + reset_outcome = self.property_tree.reset_container(component_property_path) + return reset_outcome.IsSuccess() + else: + return False + + def append_container_item(self, component_property_path: str, value: any) -> bool: + """ + Used to append a container item without providing an index key. + :param component_property_path: String of component property. (e.g. 'Settings|Visible') + :param value: Value to be set + :return: Boolean success + """ + if self.is_property_container(component_property_path): + append_outcome = self.property_tree.append_container_item(component_property_path, value) + return append_outcome.IsSuccess() + else: + return False + + def add_container_item(self, component_property_path: str, key: any, value: any) -> bool: + """ + Used to add a container item at a specified key. In practice key should be an integer index. + :param component_property_path: String of component property. (e.g. 'Settings|Visible') + :param key: Zero index integer key, although this could be any unique unused key value + :param value: Value to be set + :return: Boolean success + """ + if self.is_property_container(component_property_path): + add_outcome = self.property_tree.add_container_item(component_property_path, key, value) + return add_outcome.IsSuccess() + else: + return False + + def get_container_item(self, component_property_path: str, key: any) -> any: + """ + Used to retrieve a container item value at the specified key. In practice key should be an integer index. + :param component_property_path: String of component property. (e.g. 'Settings|Visible') + :param key: Zero index integer key + :return: Value stored at the key specified + """ + if self.is_property_container(component_property_path): + get_outcome = self.property_tree.get_container_item(component_property_path, key) + assert ( + get_outcome.IsSuccess() + ), f"Failure: could not get a value for {self.get_component_name()}: '{component_property_path}' [{key}]" + return get_outcome.GetValue() + else: + return None + + def remove_container_item(self, component_property_path: str, key: any) -> bool: + """ + Used to remove a container item value at the specified key. In practice key should be an integer index. + :param component_property_path: String of component property. (e.g. 'Settings|Visible') + :param key: Zero index integer key + :return: Boolean success + """ + if self.is_property_container(component_property_path): + remove_outcome = self.property_tree.remove_container_item(component_property_path, key) + return remove_outcome.IsSuccess() + else: + return False + + def update_container_item(self, component_property_path: str, key: any, value: any): + """ + Used to update a container item at a specified key. In practice key should be an integer index. + :param component_property_path: String of component property. (e.g. 'Settings|Visible') + :param key: Zero index integer key + :param value: Value to be set + :return: Boolean success + """ + if self.is_property_container(component_property_path): + update_outcome = self.property_tree.update_container_item(component_property_path, key, value) + return update_outcome.IsSuccess() + else: + return False def get_component_property_value(self, component_property_path: str): """ @@ -101,16 +216,25 @@ class EditorComponent: """ editor.EditorComponentAPIBus(bus.Broadcast, "DisableComponents", [self.id]) + def enable_component(self): + """ + used to enable the componet using its id value + """ + editor.EditorComponentAPIBus(bus.Broadcast, "EnabledComponents", [self.id]) + @staticmethod - def get_type_ids(component_names: list) -> list: + def get_type_ids(component_names: list, entity_type: str ='Game') -> list: """ Used to get type ids of given components list :param: component_names: List of components to get type ids :return: List of type ids of given components. """ + if entity_type.lower() == 'level': + entity_type = azlmbr.entity.EntityType().Level + else: + entity_type = azlmbr.entity.EntityType().Game type_ids = editor.EditorComponentAPIBus( - bus.Broadcast, "FindComponentTypeIdsByEntityType", component_names, azlmbr.entity.EntityType().Game - ) + bus.Broadcast, "FindComponentTypeIdsByEntityType", component_names, entity_type) return type_ids @@ -278,8 +402,7 @@ class EditorEntity: components = [] type_ids = EditorComponent.get_type_ids(component_names) for type_id in type_ids: - new_comp = EditorComponent() - new_comp.type_id = type_id + new_comp = EditorComponent(type_id) add_component_outcome = editor.EditorComponentAPIBus( bus.Broadcast, "AddComponentsOfType", self.id, [type_id] ) @@ -291,6 +414,27 @@ class EditorEntity: self.components.append(new_comp) return components + def remove_component(self, component_name: str) -> None: + """ + Used to remove a component from Entity + :param component_name: String of component name to remove + :return: None + """ + self.remove_components([component_name]) + + def remove_components(self, component_names: list): + """ + Used to remove a list of components from Entity + :param component_names: List of component names to remove + :return: None + """ + type_ids = EditorComponent.get_type_ids(component_names) + for type_id in type_ids: + remove_outcome = editor.EditorComponentAPIBus(bus.Broadcast, "RemoveComponents", self.id, [type_id]) + assert ( + remove_outcome.IsSuccess() + ), f"Failure: could not remove component from '{self.get_name()}'" + def get_components_of_type(self, component_names: list) -> List[EditorComponent]: """ Used to get components of type component_name that already exists on Entity @@ -300,8 +444,7 @@ class EditorEntity: component_list = [] type_ids = EditorComponent.get_type_ids(component_names) for type_id in type_ids: - component = EditorComponent() - component.type_id = type_id + component = EditorComponent(type_id) get_component_of_type_outcome = editor.EditorComponentAPIBus( bus.Broadcast, "GetComponentOfType", self.id, type_id ) @@ -359,6 +502,21 @@ class EditorEntity: set_status = self.get_start_status() assert set_status == status_to_set, f"Failed to set start status of {desired_start_status} to {self.get_name}" + def is_locked(self) -> bool: + """ + Used to get the locked status of the entity + :return: Boolean True if locked False if not locked + """ + return editor.EditorEntityInfoRequestBus(bus.Event, "IsLocked", self.id) + + def set_lock_state(self, is_locked: bool) -> None: + """ + Sets the lock state on the object to locked or not locked. + :param is_locked: True for locking, False to unlock. + :return: None + """ + editor.EditorEntityAPIBus(bus.Event, "SetLockState", self.id, is_locked) + def delete(self) -> None: """ Used to delete the Entity. @@ -488,18 +646,6 @@ class EditorLevelEntity: EditorLevelComponentAPIBus requests. """ - @staticmethod - def get_type_ids(component_names: list) -> list: - """ - Used to get type ids of given components list for EntityType Level - :param: component_names: List of components to get type ids - :return: List of type ids of given components. - """ - type_ids = editor.EditorComponentAPIBus( - bus.Broadcast, "FindComponentTypeIdsByEntityType", component_names, azlmbr.entity.EntityType().Level - ) - return type_ids - @staticmethod def add_component(component_name: str) -> EditorComponent: """ @@ -518,10 +664,9 @@ class EditorLevelEntity: :return: List of newly added components to the level """ components = [] - type_ids = EditorLevelEntity.get_type_ids(component_names) + type_ids = EditorComponent.get_type_ids(component_names, 'level') for type_id in type_ids: - new_comp = EditorComponent() - new_comp.type_id = type_id + new_comp = EditorComponent(type_id) add_component_outcome = editor.EditorLevelComponentAPIBus( bus.Broadcast, "AddComponentsOfType", [type_id] ) @@ -540,10 +685,9 @@ class EditorLevelEntity: :return: List of Level Component objects of given component name """ component_list = [] - type_ids = EditorLevelEntity.get_type_ids(component_names) + type_ids = EditorComponent.get_type_ids(component_names, 'level') for type_id in type_ids: - component = EditorComponent() - component.type_id = type_id + component = EditorComponent(type_id) get_component_of_type_outcome = editor.EditorLevelComponentAPIBus( bus.Broadcast, "GetComponentOfType", type_id ) @@ -562,7 +706,7 @@ class EditorLevelEntity: :param component_name: Name of component to check for :return: True, if level has specified component. Else, False """ - type_ids = EditorLevelEntity.get_type_ids([component_name]) + type_ids = EditorComponent.get_type_ids([component_name], 'level') return editor.EditorLevelComponentAPIBus(bus.Broadcast, "HasComponentOfType", type_ids[0]) @staticmethod @@ -572,5 +716,5 @@ class EditorLevelEntity: :param component_name: Name of component to check for :return: integer count of occurences of level component attached to level or zero if none are present """ - type_ids = EditorLevelEntity.get_type_ids([component_name]) + type_ids = EditorComponent.get_type_ids([component_name], 'level') return editor.EditorLevelComponentAPIBus(bus.Broadcast, "CountComponentsOfType", type_ids[0]) From 291e172f9e13285f4e5c6a90eea7740a804ab88a Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Thu, 16 Dec 2021 21:01:39 -0800 Subject: [PATCH 137/399] fixing some docstrings Signed-off-by: Scott Murray --- .../editor_python_test_tools/editor_entity_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index b9f7576f1c..58d9e30f81 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -71,7 +71,9 @@ class EditorComponent: def is_property_container(self, component_property_path: str) -> bool: """ - + Used to determine if a component property is a container. Containers are similar to a dictionary with int keys. + :param component_property_path: String of component property. (e.g. 'Settings|Visible') + :return: Boolean True if the property is a container False if it is not. """ if self.property_tree is None: self.get_property_tree() @@ -255,7 +257,7 @@ class EditorEntity: """ Entity class is used to create and interact with Editor Entities. Example: To create Editor Entity, Use the code: - test_entity = Entity.create_editor_entity("TestEntity") + test_entity = EditorEntity.create_editor_entity("TestEntity") # This creates a python object with 'test_entity' linked to entity name "TestEntity" in Editor. # To add component, use: test_entity.add_component() From bf8422152ba9ca3fc951bfb3ef10ed1b00aa5274 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Fri, 17 Dec 2021 00:12:21 -0800 Subject: [PATCH 138/399] Turn off stdout buffering when connecting to editor-server so that the editor properly gets all the server-logging without having to first fill up a buffer. Allows the logs to pipe instantly for easier debugging, and also fixes a problem where the logs wont reach the editor because the buffer doesn't fill Signed-off-by: Gene Walters --- .../AutoComponent_RPC.scriptcanvas | 2339 ++++++++++++++++- .../Editor/MultiplayerEditorConnection.cpp | 5 +- 2 files changed, 2325 insertions(+), 19 deletions(-) diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas index 72cc980550..c1c77b14fe 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas @@ -5,7 +5,7 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 8702689999760 + "id": 2816238339133127497 }, "Name": "AutoComponent_RPC", "Components": { @@ -582,6 +582,1158 @@ { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" } @@ -968,6 +2120,1158 @@ { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" } @@ -2311,23 +4615,6 @@ }, "m_variableCounter": 1, "GraphCanvasData": [ - { - "Key": { - "id": 8702689999760 - }, - "Value": { - "ComponentData": { - "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { - "$type": "SceneComponentSaveData", - "ViewParams": { - "Scale": 0.9240486637125038, - "AnchorX": 1429.578369140625, - "AnchorY": -71.42481231689453 - } - } - } - } - }, { "Key": { "id": 8706984967056 @@ -2663,6 +4950,22 @@ } } } + }, + { + "Key": { + "id": 2816238339133127497 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "AnchorX": 260.0, + "AnchorY": 479.0 + } + } + } + } } ], "StatisticsHelper": { diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp index 11615137ca..f7882d7bf9 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp @@ -41,7 +41,10 @@ namespace Multiplayer // Automated testing listens for these logs if (editorsv_isDedicated) { - // Server logs piped to the editor. Change the buffering policy to ensure every write to stdout is flushed. + // Server logs will be piped to the editor so turn off buffering, + // otherwise it'll take a lot of logs to fill up the buffer before stdout is finally flushed. + // This isn't optimal, but will only affect + // Note: _IOLBF (flush on newlines) won't work for Automated Testing which uses a headless server app and will fall back to _IOFBF (full buffering) setvbuf(stdout, NULL, _IONBF, 0); // If the settings registry is not available at this point, From 2ddf55474e8f8c20fe79f396d5bbf06acf422e37 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Fri, 17 Dec 2021 05:26:31 -0800 Subject: [PATCH 139/399] chore: remove "using namespace " from AZCore Memory (#6373) * chore: remove "using namespace " from AZCore Memory REF: https://github.com/o3de/o3de/issues/6281 Signed-off-by: Michael Pollind * chore: fix formatting Signed-off-by: Michael Pollind * chore: fix indentation for AllocatorBase.cpp Signed-off-by: Michael Pollind * chore: fix formatting Signed-off-by: Michael Pollind * chore: address minor checkstyle problems Signed-off-by: Michael Pollind --- .../AzCore/Memory/AllocationRecords.cpp | 813 +++---- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 279 +-- .../Memory/BestFitExternalMapAllocator.cpp | 330 ++- .../Memory/BestFitExternalMapAllocator.h | 7 +- .../Memory/BestFitExternalMapSchema.cpp | 311 +-- .../AzCore/Memory/BestFitExternalMapSchema.h | 8 +- .../AzCore/AzCore/Memory/PoolSchema.cpp | 2038 +++++++++-------- .../AzCore/AzCore/Memory/PoolSchema.h | 8 +- .../AzCore/AzCore/Memory/SystemAllocator.cpp | 438 ++-- .../AzCore/AzCore/Memory/SystemAllocator.h | 5 +- 10 files changed, 2123 insertions(+), 2114 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocationRecords.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocationRecords.cpp index 680d93501a..2b2f752b06 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocationRecords.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocationRecords.cpp @@ -16,438 +16,421 @@ #include -using namespace AZ; -using namespace AZ::Debug; - -// Many PC tools break with alloc/free size mismatches when the memory guard is enabled. Disable for now -//#define ENABLE_MEMORY_GUARD - -//========================================================================= -// AllocationRecords -// [9/16/2009] -//========================================================================= -AllocationRecords::AllocationRecords(unsigned char stackRecordLevels, [[maybe_unused]] bool isMemoryGuard, bool isMarkUnallocatedMemory, const char* allocatorName) - : m_mode(AllocatorManager::Instance().m_defaultTrackingRecordMode) - , m_isAutoIntegrityCheck(false) - , m_isMarkUnallocatedMemory(isMarkUnallocatedMemory) - , m_saveNames(false) - , m_decodeImmediately(false) - , m_numStackLevels(stackRecordLevels) +namespace AZ::Debug +{ + // Many PC tools break with alloc/free size mismatches when the memory guard is enabled. Disable for now + //#define ENABLE_MEMORY_GUARD + + //========================================================================= + // AllocationRecords + // [9/16/2009] + //========================================================================= + AllocationRecords::AllocationRecords( + unsigned char stackRecordLevels, [[maybe_unused]] bool isMemoryGuard, bool isMarkUnallocatedMemory, const char* allocatorName) + : m_mode(AllocatorManager::Instance().m_defaultTrackingRecordMode) + , m_isAutoIntegrityCheck(false) + , m_isMarkUnallocatedMemory(isMarkUnallocatedMemory) + , m_saveNames(false) + , m_decodeImmediately(false) + , m_numStackLevels(stackRecordLevels) #if defined(ENABLE_MEMORY_GUARD) - , m_memoryGuardSize(isMemoryGuard ? sizeof(Debug::GuardValue) : 0) + , m_memoryGuardSize(isMemoryGuard ? sizeof(Debug::GuardValue) : 0) #else - , m_memoryGuardSize(0) + , m_memoryGuardSize(0) #endif - , m_requestedAllocs(0) - , m_requestedBytes(0) - , m_requestedBytesPeak(0) - , m_allocatorName(allocatorName) -{ - -} - -//========================================================================= -// ~AllocationRecords -// [9/16/2009] -//========================================================================= -AllocationRecords::~AllocationRecords() -{ - if (!AllocatorManager::Instance().m_isAllocatorLeaking) - { - // dump all allocation (we should not have any at this point). - bool includeNameAndFilename = (m_saveNames || m_mode == RECORD_FULL); - EnumerateAllocations(PrintAllocationsCB(true, includeNameAndFilename)); - AZ_Error("Memory", m_records.empty(), "We still have %d allocations on record! They must be freed prior to destroy!", m_records.size()); - } -} - -//========================================================================= -// lock -// [9/16/2009] -//========================================================================= -void -AllocationRecords::lock() -{ - m_recordsMutex.lock(); -} - -//========================================================================= -// try_lock -// [9/16/2009] -//========================================================================= -bool AllocationRecords::try_lock() -{ - return m_recordsMutex.try_lock(); -} - -//========================================================================= -// unlock -// [9/16/2009] -//========================================================================= -void -AllocationRecords::unlock() -{ - m_recordsMutex.unlock(); -} - -//========================================================================= -// RegisterAllocation -// [9/11/2009] -//========================================================================= -const AllocationInfo* -AllocationRecords::RegisterAllocation(void* address, size_t byteSize, size_t alignment, const char* name, const char* fileName, int lineNum, unsigned int stackSuppressCount) -{ - (void)stackSuppressCount; - if (m_mode == RECORD_NO_RECORDS) + , m_requestedAllocs(0) + , m_requestedBytes(0) + , m_requestedBytesPeak(0) + , m_allocatorName(allocatorName) { - return nullptr; - } - if (address == nullptr) - { - return nullptr; } - // memory guard - if (m_memoryGuardSize == sizeof(Debug::GuardValue)) + //========================================================================= + // ~AllocationRecords + // [9/16/2009] + //========================================================================= + AllocationRecords::~AllocationRecords() { - if (m_isAutoIntegrityCheck) + if (!AllocatorManager::Instance().m_isAllocatorLeaking) { - IntegrityCheck(); + // dump all allocation (we should not have any at this point). + bool includeNameAndFilename = (m_saveNames || m_mode == RECORD_FULL); + EnumerateAllocations(PrintAllocationsCB(true, includeNameAndFilename)); + AZ_Error( + "Memory", m_records.empty(), "We still have %d allocations on record! They must be freed prior to destroy!", + m_records.size()); } - - AZ_Assert(byteSize>sizeof(Debug::GuardValue), "Did you forget to add the extra MemoryGuardSize() bytes?"); - byteSize -= sizeof(Debug::GuardValue); - new(reinterpret_cast(address)+byteSize) Debug::GuardValue(); } - Debug::AllocationRecordsType::pair_iter_bool iterBool; + //========================================================================= + // lock + // [9/16/2009] + //========================================================================= + void AllocationRecords::lock() { - AZStd::scoped_lock lock(m_recordsMutex); - iterBool = m_records.insert_key(address); - } - - if (!iterBool.second) - { - // If that memory address was already registered, print the stack trace of the previous registration - PrintAllocationsCB(true, (m_saveNames || m_mode == RECORD_FULL))(address, iterBool.first->second, m_numStackLevels); - AZ_Assert(iterBool.second, "Memory address 0x%p is already allocated and in the records!", address); + m_recordsMutex.lock(); } - Debug::AllocationInfo& ai = iterBool.first->second; - ai.m_byteSize = byteSize; - ai.m_alignment = static_cast(alignment); - if ((m_saveNames || m_mode == RECORD_FULL) && name && fileName) + //========================================================================= + // try_lock + // [9/16/2009] + //========================================================================= + bool AllocationRecords::try_lock() { - // In RECORD_FULL mode or when specifically enabled in app descriptor with - // m_allocationRecordsSaveNames, we allocate our own memory to save off name and fileName. - // When testing for memory leaks, on process shutdown AllocationRecords::~AllocationRecords - // gets called to enumerate the remaining (leaked) allocations. Unfortunately, any names - // referenced in dynamic module memory whose modules are unloaded won't be valid - // references anymore and we won't get useful information from the enumeration print. - // This code block ensures we keep our name/fileName valid for when we need it. - const size_t nameLength = strlen(name); - const size_t fileNameLength = strlen(fileName); - const size_t totalLength = nameLength + fileNameLength + 2; // + 2 for terminating null characters - ai.m_namesBlock = m_records.get_allocator().allocate(totalLength, 1); - ai.m_namesBlockSize = totalLength; - char* savedName = reinterpret_cast(ai.m_namesBlock); - char* savedFileName = savedName + nameLength + 1; - memcpy(reinterpret_cast(savedName), reinterpret_cast(name), nameLength + 1); - memcpy(reinterpret_cast(savedFileName), reinterpret_cast(fileName), fileNameLength + 1); - ai.m_name = savedName; - ai.m_fileName = savedFileName; + return m_recordsMutex.try_lock(); } - else + + //========================================================================= + // unlock + // [9/16/2009] + //========================================================================= + void AllocationRecords::unlock() { - ai.m_name = name; - ai.m_fileName = fileName; - ai.m_namesBlock = nullptr; - ai.m_namesBlockSize = 0; + m_recordsMutex.unlock(); } - ai.m_lineNum = lineNum; - ai.m_timeStamp = AZStd::GetTimeNowMicroSecond(); - // if we don't have a fileName,lineNum record the stack or if the user requested it. - if ((fileName == nullptr && m_mode == RECORD_STACK_IF_NO_FILE_LINE) || m_mode == RECORD_FULL) + //========================================================================= + // RegisterAllocation + // [9/11/2009] + //========================================================================= + const AllocationInfo* AllocationRecords::RegisterAllocation( + void* address, + size_t byteSize, + size_t alignment, + const char* name, + const char* fileName, + int lineNum, + unsigned int stackSuppressCount) { - ai.m_stackFrames = m_numStackLevels ? reinterpret_cast(m_records.get_allocator().allocate(sizeof(AZ::Debug::StackFrame)*m_numStackLevels, 1)) : nullptr; - if (ai.m_stackFrames) + (void)stackSuppressCount; + if (m_mode == RECORD_NO_RECORDS) + { + return nullptr; + } + if (address == nullptr) + { + return nullptr; + } + + // memory guard + if (m_memoryGuardSize == sizeof(Debug::GuardValue)) + { + if (m_isAutoIntegrityCheck) + { + IntegrityCheck(); + } + + AZ_Assert(byteSize > sizeof(Debug::GuardValue), "Did you forget to add the extra MemoryGuardSize() bytes?"); + byteSize -= sizeof(Debug::GuardValue); + new (reinterpret_cast(address) + byteSize) Debug::GuardValue(); + } + + Debug::AllocationRecordsType::pair_iter_bool iterBool; + { + AZStd::scoped_lock lock(m_recordsMutex); + iterBool = m_records.insert_key(address); + } + + if (!iterBool.second) + { + // If that memory address was already registered, print the stack trace of the previous registration + PrintAllocationsCB(true, (m_saveNames || m_mode == RECORD_FULL))(address, iterBool.first->second, m_numStackLevels); + AZ_Assert(iterBool.second, "Memory address 0x%p is already allocated and in the records!", address); + } + + Debug::AllocationInfo& ai = iterBool.first->second; + ai.m_byteSize = byteSize; + ai.m_alignment = static_cast(alignment); + if ((m_saveNames || m_mode == RECORD_FULL) && name && fileName) + { + // In RECORD_FULL mode or when specifically enabled in app descriptor with + // m_allocationRecordsSaveNames, we allocate our own memory to save off name and fileName. + // When testing for memory leaks, on process shutdown AllocationRecords::~AllocationRecords + // gets called to enumerate the remaining (leaked) allocations. Unfortunately, any names + // referenced in dynamic module memory whose modules are unloaded won't be valid + // references anymore and we won't get useful information from the enumeration print. + // This code block ensures we keep our name/fileName valid for when we need it. + const size_t nameLength = strlen(name); + const size_t fileNameLength = strlen(fileName); + const size_t totalLength = nameLength + fileNameLength + 2; // + 2 for terminating null characters + ai.m_namesBlock = m_records.get_allocator().allocate(totalLength, 1); + ai.m_namesBlockSize = totalLength; + char* savedName = reinterpret_cast(ai.m_namesBlock); + char* savedFileName = savedName + nameLength + 1; + memcpy(reinterpret_cast(savedName), reinterpret_cast(name), nameLength + 1); + memcpy(reinterpret_cast(savedFileName), reinterpret_cast(fileName), fileNameLength + 1); + ai.m_name = savedName; + ai.m_fileName = savedFileName; + } + else { - Debug::StackRecorder::Record(ai.m_stackFrames, m_numStackLevels, stackSuppressCount + 1); + ai.m_name = name; + ai.m_fileName = fileName; + ai.m_namesBlock = nullptr; + ai.m_namesBlockSize = 0; + } + ai.m_lineNum = lineNum; + ai.m_timeStamp = AZStd::GetTimeNowMicroSecond(); - if (m_decodeImmediately) + // if we don't have a fileName,lineNum record the stack or if the user requested it. + if ((fileName == nullptr && m_mode == RECORD_STACK_IF_NO_FILE_LINE) || m_mode == RECORD_FULL) + { + ai.m_stackFrames = m_numStackLevels ? reinterpret_cast(m_records.get_allocator().allocate( + sizeof(AZ::Debug::StackFrame) * m_numStackLevels, 1)) + : nullptr; + if (ai.m_stackFrames) { - // OPTIONAL DEBUGGING CODE - enable in app descriptor m_allocationRecordsAttemptDecodeImmediately - // This is optionally-enabled code for tracking down memory allocations - // that fail to be decoded. DecodeFrames() typically runs at the end of - // your application when leaks were found. Sometimes you have stack prints - // full of "(module-name not available)" and "(function-name not available)" - // that are not actionable. If you have those, enable this code. It'll slow - // down your process significantly because for every allocation recorded - // we get the stack trace on the spot. Put a breakpoint in DecodeFrames() - // at the "(module-name not available)" and "(function-name not available)" - // locations and now at the moment those allocations happen you'll have the - // full stack trace available and the ability to debug what could be causing it + Debug::StackRecorder::Record(ai.m_stackFrames, m_numStackLevels, stackSuppressCount + 1); + + if (m_decodeImmediately) { - const unsigned char decodeStep = 40; - Debug::SymbolStorage::StackLine lines[decodeStep]; - unsigned char iFrame = 0; - unsigned char numStackLevels = m_numStackLevels; - while (numStackLevels > 0) + // OPTIONAL DEBUGGING CODE - enable in app descriptor m_allocationRecordsAttemptDecodeImmediately + // This is optionally-enabled code for tracking down memory allocations + // that fail to be decoded. DecodeFrames() typically runs at the end of + // your application when leaks were found. Sometimes you have stack prints + // full of "(module-name not available)" and "(function-name not available)" + // that are not actionable. If you have those, enable this code. It'll slow + // down your process significantly because for every allocation recorded + // we get the stack trace on the spot. Put a breakpoint in DecodeFrames() + // at the "(module-name not available)" and "(function-name not available)" + // locations and now at the moment those allocations happen you'll have the + // full stack trace available and the ability to debug what could be causing it { - unsigned char numToDecode = AZStd::GetMin(decodeStep, numStackLevels); - Debug::SymbolStorage::DecodeFrames(&ai.m_stackFrames[iFrame], numToDecode, lines); - numStackLevels -= numToDecode; - iFrame += numToDecode; + const unsigned char decodeStep = 40; + Debug::SymbolStorage::StackLine lines[decodeStep]; + unsigned char iFrame = 0; + unsigned char numStackLevels = m_numStackLevels; + while (numStackLevels > 0) + { + unsigned char numToDecode = AZStd::GetMin(decodeStep, numStackLevels); + Debug::SymbolStorage::DecodeFrames(&ai.m_stackFrames[iFrame], numToDecode, lines); + numStackLevels -= numToDecode; + iFrame += numToDecode; + } } } } } - } - - AllocatorManager::Instance().DebugBreak(address, ai); - // statistics - m_requestedBytes += byteSize; + AllocatorManager::Instance().DebugBreak(address, ai); - size_t currentRequestedBytePeak; - size_t newRequestedBytePeak; - do - { - currentRequestedBytePeak = m_requestedBytesPeak.load(std::memory_order::memory_order_relaxed); - newRequestedBytePeak = AZStd::GetMax(currentRequestedBytePeak, m_requestedBytes.load(std::memory_order::memory_order_relaxed)); - } while (!m_requestedBytesPeak.compare_exchange_weak(currentRequestedBytePeak, newRequestedBytePeak)); + // statistics + m_requestedBytes += byteSize; - ++m_requestedAllocs; + size_t currentRequestedBytePeak; + size_t newRequestedBytePeak; + do + { + currentRequestedBytePeak = m_requestedBytesPeak.load(std::memory_order::memory_order_relaxed); + newRequestedBytePeak = AZStd::GetMax(currentRequestedBytePeak, m_requestedBytes.load(std::memory_order::memory_order_relaxed)); + } while (!m_requestedBytesPeak.compare_exchange_weak(currentRequestedBytePeak, newRequestedBytePeak)); - return &ai; -} + ++m_requestedAllocs; -//========================================================================= -// UnregisterAllocation -// [9/11/2009] -//========================================================================= -void AllocationRecords::UnregisterAllocation(void* address, size_t byteSize, size_t alignment, AllocationInfo* info) -{ - if (m_mode == RECORD_NO_RECORDS) - { - return; - } - if (address == nullptr) - { - return; + return &ai; } - AllocationInfo allocationInfo; + //========================================================================= + // UnregisterAllocation + // [9/11/2009] + //========================================================================= + void AllocationRecords::UnregisterAllocation(void* address, size_t byteSize, size_t alignment, AllocationInfo* info) { - AZStd::scoped_lock lock(m_recordsMutex); - Debug::AllocationRecordsType::iterator iter = m_records.find(address); - // We cannot assert if an allocation does not exist because allocations may have been made before tracking was enabled. - // It is currently impossible to actually track all allocations that happen before a certain point - // AZ_Assert(iter!=m_records.end(), "Could not find address 0x%p in the allocator!", address); - if (iter == m_records.end()) + if (m_mode == RECORD_NO_RECORDS) + { + return; + } + if (address == nullptr) { return; } - allocationInfo = iter->second; - m_records.erase(iter); - // try to be more aggressive and keep the memory footprint low. - // \todo store the load factor at the last rehash to avoid unnecessary rehash - if (m_records.load_factor() < 0.9f) + AllocationInfo allocationInfo; { - m_records.rehash(0); + AZStd::scoped_lock lock(m_recordsMutex); + Debug::AllocationRecordsType::iterator iter = m_records.find(address); + // We cannot assert if an allocation does not exist because allocations may have been made before tracking was enabled. + // It is currently impossible to actually track all allocations that happen before a certain point + // AZ_Assert(iter!=m_records.end(), "Could not find address 0x%p in the allocator!", address); + if (iter == m_records.end()) + { + return; + } + allocationInfo = iter->second; + m_records.erase(iter); + + // try to be more aggressive and keep the memory footprint low. + // \todo store the load factor at the last rehash to avoid unnecessary rehash + if (m_records.load_factor() < 0.9f) + { + m_records.rehash(0); + } } - } - - AllocatorManager::Instance().DebugBreak(address, allocationInfo); + AllocatorManager::Instance().DebugBreak(address, allocationInfo); - (void)byteSize; - (void)alignment; - AZ_Assert(byteSize==0||byteSize==allocationInfo.m_byteSize, "Mismatched byteSize at deallocation! You supplied an invalid value!"); - AZ_Assert(alignment==0||alignment==allocationInfo.m_alignment, "Mismatched alignment at deallocation! You supplied an invalid value!"); + (void)byteSize; + (void)alignment; + AZ_Assert( + byteSize == 0 || byteSize == allocationInfo.m_byteSize, "Mismatched byteSize at deallocation! You supplied an invalid value!"); + AZ_Assert( + alignment == 0 || alignment == allocationInfo.m_alignment, + "Mismatched alignment at deallocation! You supplied an invalid value!"); + + // statistics + m_requestedBytes -= allocationInfo.m_byteSize; - // statistics - m_requestedBytes -= allocationInfo.m_byteSize; - #if defined(ENABLE_MEMORY_GUARD) - // memory guard - if (m_memoryGuardSize == sizeof(Debug::GuardValue)) - { - if (m_isAutoIntegrityCheck) - { - // full integrity check - IntegrityCheck(); - } - else + // memory guard + if (m_memoryGuardSize == sizeof(Debug::GuardValue)) { - // check current allocation - char* guardAddress = reinterpret_cast(address)+allocationInfo.m_byteSize; - Debug::GuardValue* guard = reinterpret_cast(guardAddress); - if (!guard->Validate()) + if (m_isAutoIntegrityCheck) + { + // full integrity check + IntegrityCheck(); + } + else { - AZ_Printf("Memory", "Memory stomp located at address %p, part of allocation:", guardAddress); - PrintAllocationsCB printAlloc(true); - printAlloc(address, allocationInfo, m_numStackLevels); - AZ_Assert(false, "MEMORY STOMP DETECTED!!!"); + // check current allocation + char* guardAddress = reinterpret_cast(address) + allocationInfo.m_byteSize; + Debug::GuardValue* guard = reinterpret_cast(guardAddress); + if (!guard->Validate()) + { + AZ_Printf("Memory", "Memory stomp located at address %p, part of allocation:", guardAddress); + PrintAllocationsCB printAlloc(true); + printAlloc(address, allocationInfo, m_numStackLevels); + AZ_Assert(false, "MEMORY STOMP DETECTED!!!"); + } + guard->~GuardValue(); } - guard->~GuardValue(); } - } #endif - // delete allocation record - if (allocationInfo.m_namesBlock) - { - m_records.get_allocator().deallocate(allocationInfo.m_namesBlock, allocationInfo.m_namesBlockSize, 1); - allocationInfo.m_namesBlock = nullptr; - allocationInfo.m_namesBlockSize = 0; - allocationInfo.m_name = nullptr; - allocationInfo.m_fileName = nullptr; - } - if (allocationInfo.m_stackFrames) - { - m_records.get_allocator().deallocate(allocationInfo.m_stackFrames, sizeof(AZ::Debug::StackFrame)*m_numStackLevels, 1); - allocationInfo.m_stackFrames = nullptr; - } - - if (info) - { - *info = allocationInfo; - } - + // delete allocation record + if (allocationInfo.m_namesBlock) + { + m_records.get_allocator().deallocate(allocationInfo.m_namesBlock, allocationInfo.m_namesBlockSize, 1); + allocationInfo.m_namesBlock = nullptr; + allocationInfo.m_namesBlockSize = 0; + allocationInfo.m_name = nullptr; + allocationInfo.m_fileName = nullptr; + } + if (allocationInfo.m_stackFrames) + { + m_records.get_allocator().deallocate(allocationInfo.m_stackFrames, sizeof(AZ::Debug::StackFrame) * m_numStackLevels, 1); + allocationInfo.m_stackFrames = nullptr; + } + if (info) + { + *info = allocationInfo; + } - // if requested set memory to a specific value. - if (m_isMarkUnallocatedMemory) - { - memset(address, GetUnallocatedMarkValue(), byteSize); - } -} - -//========================================================================= -// ResizeAllocation -// [9/20/2009] -//========================================================================= -void -AllocationRecords::ResizeAllocation(void* address, size_t newSize) -{ - if (m_mode == RECORD_NO_RECORDS) - { - return; + // if requested set memory to a specific value. + if (m_isMarkUnallocatedMemory) + { + memset(address, GetUnallocatedMarkValue(), byteSize); + } } - AllocationInfo* allocationInfo; - { - AZStd::scoped_lock lock(m_recordsMutex); - Debug::AllocationRecordsType::iterator iter = m_records.find(address); - AZ_Assert(iter != m_records.end(), "Could not find address 0x%p in the allocator!", address); - allocationInfo = &iter->second; - } - AllocatorManager::Instance().DebugBreak(address, *allocationInfo); - -#if defined(ENABLE_MEMORY_GUARD) - if (m_memoryGuardSize == sizeof(Debug::GuardValue)) + //========================================================================= + // ResizeAllocation + // [9/20/2009] + //========================================================================= + void AllocationRecords::ResizeAllocation(void* address, size_t newSize) { - if (m_isAutoIntegrityCheck) + if (m_mode == RECORD_NO_RECORDS) { - // full integrity check - IntegrityCheck(); + return; } - else + + AllocationInfo* allocationInfo; + { + AZStd::scoped_lock lock(m_recordsMutex); + Debug::AllocationRecordsType::iterator iter = m_records.find(address); + AZ_Assert(iter != m_records.end(), "Could not find address 0x%p in the allocator!", address); + allocationInfo = &iter->second; + } + AllocatorManager::Instance().DebugBreak(address, *allocationInfo); + +#if defined(ENABLE_MEMORY_GUARD) + if (m_memoryGuardSize == sizeof(Debug::GuardValue)) { - // check memory guard - char* guardAddress = reinterpret_cast(address) + allocationInfo->m_byteSize; - Debug::GuardValue* guard = reinterpret_cast(guardAddress); - if (!guard->Validate()) + if (m_isAutoIntegrityCheck) + { + // full integrity check + IntegrityCheck(); + } + else { - AZ_Printf("Memory", "Memory stomp located at address %p, part of allocation:", guardAddress); - PrintAllocationsCB printAlloc(true); - printAlloc(address, iter->second, m_numStackLevels); - AZ_Assert(false, "MEMORY STOMP DETECTED!!!"); + // check memory guard + char* guardAddress = reinterpret_cast(address) + allocationInfo->m_byteSize; + Debug::GuardValue* guard = reinterpret_cast(guardAddress); + if (!guard->Validate()) + { + AZ_Printf("Memory", "Memory stomp located at address %p, part of allocation:", guardAddress); + PrintAllocationsCB printAlloc(true); + printAlloc(address, iter->second, m_numStackLevels); + AZ_Assert(false, "MEMORY STOMP DETECTED!!!"); + } + guard->~GuardValue(); } - guard->~GuardValue(); + // init the new memory guard + newSize -= sizeof(Debug::GuardValue); + new (reinterpret_cast(address) + newSize) Debug::GuardValue(); } - // init the new memory guard - newSize -= sizeof(Debug::GuardValue); - new(reinterpret_cast(address)+newSize) Debug::GuardValue(); - } #endif - // statistics - m_requestedBytes -= allocationInfo->m_byteSize; - m_requestedBytes += newSize; - size_t currentRequestedBytePeak; - size_t newRequestedBytePeak; - do - { - currentRequestedBytePeak = m_requestedBytesPeak.load(std::memory_order::memory_order_relaxed); - newRequestedBytePeak = AZStd::GetMax(currentRequestedBytePeak, m_requestedBytes.load(std::memory_order::memory_order_relaxed)); - } while (!m_requestedBytesPeak.compare_exchange_weak(currentRequestedBytePeak, newRequestedBytePeak)); - ++m_requestedAllocs; - - // update allocation size - allocationInfo->m_byteSize = newSize; -} - -//========================================================================= -// EnumerateAllocations -// [9/29/2009] -//========================================================================= -void -AllocationRecords::SetMode(Mode mode) -{ - if (mode == RECORD_NO_RECORDS) - { + // statistics + m_requestedBytes -= allocationInfo->m_byteSize; + m_requestedBytes += newSize; + size_t currentRequestedBytePeak; + size_t newRequestedBytePeak; + do { - AZStd::scoped_lock lock(m_recordsMutex); - m_records.clear(); - } - m_requestedBytes = 0; - m_requestedBytesPeak = 0; - m_requestedAllocs = 0; - } - - AZ_Warning("Memory", m_mode != RECORD_NO_RECORDS || mode == RECORD_NO_RECORDS, "Records recording was disabled and now it's enabled! You might get assert when you free memory, if a you have allocations which were not recorded!"); - - m_mode = mode; -} + currentRequestedBytePeak = m_requestedBytesPeak.load(std::memory_order::memory_order_relaxed); + newRequestedBytePeak = AZStd::GetMax(currentRequestedBytePeak, m_requestedBytes.load(std::memory_order::memory_order_relaxed)); + } while (!m_requestedBytesPeak.compare_exchange_weak(currentRequestedBytePeak, newRequestedBytePeak)); + ++m_requestedAllocs; -//========================================================================= -// EnumerateAllocations -// [9/29/2009] -//========================================================================= -void -AllocationRecords::EnumerateAllocations(AllocationInfoCBType cb) -{ - // enumerate all allocations and stop if requested. - // Since allocations can change during the iteration (code that prints out the records could allocate, which will - // mutate m_records), we are going to make a copy and iterate the copy. - Debug::AllocationRecordsType recordsCopy; - { - AZStd::scoped_lock lock(m_recordsMutex); - recordsCopy = m_records; + // update allocation size + allocationInfo->m_byteSize = newSize; } - for (Debug::AllocationRecordsType::const_iterator iter = recordsCopy.begin(); iter != recordsCopy.end(); ++iter) + + //========================================================================= + // EnumerateAllocations + // [9/29/2009] + //========================================================================= + void AllocationRecords::SetMode(Mode mode) { - if (!cb(iter->first, iter->second, m_numStackLevels)) + if (mode == RECORD_NO_RECORDS) { - break; + { + AZStd::scoped_lock lock(m_recordsMutex); + m_records.clear(); + } + m_requestedBytes = 0; + m_requestedBytesPeak = 0; + m_requestedAllocs = 0; } + + AZ_Warning( + "Memory", m_mode != RECORD_NO_RECORDS || mode == RECORD_NO_RECORDS, + "Records recording was disabled and now it's enabled! You might get assert when you free memory, if a you have allocations " + "which were not recorded!"); + + m_mode = mode; } -} - -//========================================================================= -// IntegrityCheck -// [9/9/2011] -//========================================================================= -void -AllocationRecords::IntegrityCheck() const -{ -#if defined(ENABLE_MEMORY_GUARD) - if (m_memoryGuardSize == sizeof(Debug::GuardValue)) + + //========================================================================= + // EnumerateAllocations + // [9/29/2009] + //========================================================================= + void AllocationRecords::EnumerateAllocations(AllocationInfoCBType cb) { + // enumerate all allocations and stop if requested. + // Since allocations can change during the iteration (code that prints out the records could allocate, which will + // mutate m_records), we are going to make a copy and iterate the copy. Debug::AllocationRecordsType recordsCopy; { AZStd::scoped_lock lock(m_recordsMutex); @@ -455,67 +438,93 @@ AllocationRecords::IntegrityCheck() const } for (Debug::AllocationRecordsType::const_iterator iter = recordsCopy.begin(); iter != recordsCopy.end(); ++iter) { - // check memory guard - const char* guardAddress = reinterpret_cast(iter->first)+ iter->second.m_byteSize; - if (!reinterpret_cast(guardAddress)->Validate()) + if (!cb(iter->first, iter->second, m_numStackLevels)) { - // We have to turn off the integrity check at this point if we want to succesfully report the memory - // stomp we just found. If we don't turn this off, the printf just winds off the stack as each memory - // allocation done therein recurses this same code. - *const_cast(&m_isAutoIntegrityCheck) = false; - AZ_Printf("Memory", "Memory stomp located at address %p, part of allocation:", guardAddress); - PrintAllocationsCB printAlloc(true); - printAlloc(iter->first, iter->second, m_numStackLevels); - AZ_Error("Memory", false, "MEMORY STOMP DETECTED!!!"); + break; } } } -#endif -} - -//========================================================================= -// operator() -// [9/29/2009] -//========================================================================= -bool -PrintAllocationsCB::operator()(void* address, const AllocationInfo& info, unsigned char numStackLevels) -{ - if (m_includeNameAndFilename && info.m_name) - { - AZ_Printf("Memory", "Allocation Name: \"%s\" Addr: 0%p Size: %d Alignment: %d\n", info.m_name, address, info.m_byteSize, info.m_alignment); - } - else + + //========================================================================= + // IntegrityCheck + // [9/9/2011] + //========================================================================= + void AllocationRecords::IntegrityCheck() const { - AZ_Printf("Memory", "Allocation Addr: 0%p Size: %d Alignment: %d\n", address, info.m_byteSize, info.m_alignment); +#if defined(ENABLE_MEMORY_GUARD) + if (m_memoryGuardSize == sizeof(Debug::GuardValue)) + { + Debug::AllocationRecordsType recordsCopy; + { + AZStd::scoped_lock lock(m_recordsMutex); + recordsCopy = m_records; + } + for (Debug::AllocationRecordsType::const_iterator iter = recordsCopy.begin(); iter != recordsCopy.end(); ++iter) + { + // check memory guard + const char* guardAddress = reinterpret_cast(iter->first) + iter->second.m_byteSize; + if (!reinterpret_cast(guardAddress)->Validate()) + { + // We have to turn off the integrity check at this point if we want to succesfully report the memory + // stomp we just found. If we don't turn this off, the printf just winds off the stack as each memory + // allocation done therein recurses this same code. + *const_cast(&m_isAutoIntegrityCheck) = false; + AZ_Printf("Memory", "Memory stomp located at address %p, part of allocation:", guardAddress); + PrintAllocationsCB printAlloc(true); + printAlloc(iter->first, iter->second, m_numStackLevels); + AZ_Error("Memory", false, "MEMORY STOMP DETECTED!!!"); + } + } + } +#endif } - if (m_isDetailed) + //========================================================================= + // operator() + // [9/29/2009] + //========================================================================= + bool PrintAllocationsCB::operator()(void* address, const AllocationInfo& info, unsigned char numStackLevels) { - if (!info.m_stackFrames) + if (m_includeNameAndFilename && info.m_name) { - AZ_Printf("Memory", " %s (%d)\n", info.m_fileName, info.m_lineNum); + AZ_Printf( + "Memory", "Allocation Name: \"%s\" Addr: 0%p Size: %d Alignment: %d\n", info.m_name, address, info.m_byteSize, + info.m_alignment); } else { - // Allocation callstack - const unsigned char decodeStep = 40; - Debug::SymbolStorage::StackLine lines[decodeStep]; - unsigned char iFrame = 0; - while (numStackLevels>0) + AZ_Printf("Memory", "Allocation Addr: 0%p Size: %d Alignment: %d\n", address, info.m_byteSize, info.m_alignment); + } + + if (m_isDetailed) + { + if (!info.m_stackFrames) + { + AZ_Printf("Memory", " %s (%d)\n", info.m_fileName, info.m_lineNum); + } + else { - unsigned char numToDecode = AZStd::GetMin(decodeStep, numStackLevels); - Debug::SymbolStorage::DecodeFrames(&info.m_stackFrames[iFrame], numToDecode, lines); - for (unsigned char i = 0; i < numToDecode; ++i) + // Allocation callstack + const unsigned char decodeStep = 40; + Debug::SymbolStorage::StackLine lines[decodeStep]; + unsigned char iFrame = 0; + while (numStackLevels > 0) { - if (info.m_stackFrames[iFrame+i].IsValid()) + unsigned char numToDecode = AZStd::GetMin(decodeStep, numStackLevels); + Debug::SymbolStorage::DecodeFrames(&info.m_stackFrames[iFrame], numToDecode, lines); + for (unsigned char i = 0; i < numToDecode; ++i) { - AZ_Printf("Memory", " %s\n", lines[i]); + if (info.m_stackFrames[iFrame + i].IsValid()) + { + AZ_Printf("Memory", " %s\n", lines[i]); + } } + numStackLevels -= numToDecode; + iFrame += numToDecode; } - numStackLevels -= numToDecode; - iFrame += numToDecode; } } + return true; // continue enumerating } - return true; // continue enumerating -} + +} // namespace AZ::Debug diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index 61e883bb4e..5c510f67c1 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -6,194 +6,203 @@ * */ -#include #include +#include -using namespace AZ; - -AllocatorBase::AllocatorBase(IAllocatorAllocate* allocationSource, const char* name, const char* desc) : - IAllocator(allocationSource), - m_name(name), - m_desc(desc) +namespace AZ { -} + AllocatorBase::AllocatorBase(IAllocatorAllocate* allocationSource, const char* name, const char* desc) + : IAllocator(allocationSource) + , m_name(name) + , m_desc(desc) + { + } -AllocatorBase::~AllocatorBase() -{ - AZ_Assert(!m_isReady, "Allocator %s (%s) is being destructed without first having gone through proper calls to PreDestroy() and Destroy(). Use AllocatorInstance<> for global allocators or AllocatorWrapper<> for local allocators.", m_name, m_desc); -} + AllocatorBase::~AllocatorBase() + { + AZ_Assert( + !m_isReady, + "Allocator %s (%s) is being destructed without first having gone through proper calls to PreDestroy() and Destroy(). Use " + "AllocatorInstance<> for global allocators or AllocatorWrapper<> for local allocators.", + m_name, m_desc); + } -const char* AllocatorBase::GetName() const -{ - return m_name; -} + const char* AllocatorBase::GetName() const + { + return m_name; + } -const char* AllocatorBase::GetDescription() const -{ - return m_desc; -} + const char* AllocatorBase::GetDescription() const + { + return m_desc; + } -IAllocatorAllocate* AllocatorBase::GetSchema() -{ - return nullptr; -} + IAllocatorAllocate* AllocatorBase::GetSchema() + { + return nullptr; + } -Debug::AllocationRecords* AllocatorBase::GetRecords() -{ - return m_records; -} + Debug::AllocationRecords* AllocatorBase::GetRecords() + { + return m_records; + } -void AllocatorBase::SetRecords(Debug::AllocationRecords* records) -{ - m_records = records; - m_memoryGuardSize = records ? records->MemoryGuardSize() : 0; -} + void AllocatorBase::SetRecords(Debug::AllocationRecords* records) + { + m_records = records; + m_memoryGuardSize = records ? records->MemoryGuardSize() : 0; + } -bool AllocatorBase::IsReady() const -{ - return m_isReady; -} + bool AllocatorBase::IsReady() const + { + return m_isReady; + } -bool AllocatorBase::CanBeOverridden() const -{ - return m_canBeOverridden; -} + bool AllocatorBase::CanBeOverridden() const + { + return m_canBeOverridden; + } -void AllocatorBase::PostCreate() -{ - if (m_registrationEnabled) + void AllocatorBase::PostCreate() { - if (AZ::Environment::IsReady()) + if (m_registrationEnabled) { - AllocatorManager::Instance().RegisterAllocator(this); + if (AZ::Environment::IsReady()) + { + AllocatorManager::Instance().RegisterAllocator(this); + } + else + { + AllocatorManager::PreRegisterAllocator(this); + } } - else + + const auto debugConfig = GetDebugConfig(); + if (!debugConfig.m_excludeFromDebugging) { - AllocatorManager::PreRegisterAllocator(this); + SetRecords(aznew Debug::AllocationRecords( + (unsigned char)debugConfig.m_stackRecordLevels, debugConfig.m_usesMemoryGuards, debugConfig.m_marksUnallocatedMemory, + GetName())); } + + m_isReady = true; } - const auto debugConfig = GetDebugConfig(); - if (!debugConfig.m_excludeFromDebugging) + void AllocatorBase::PreDestroy() { - SetRecords(aznew Debug::AllocationRecords((unsigned char)debugConfig.m_stackRecordLevels, debugConfig.m_usesMemoryGuards, debugConfig.m_marksUnallocatedMemory, GetName())); - } + Debug::AllocationRecords* allocatorRecords = GetRecords(); + if (allocatorRecords) + { + delete allocatorRecords; + SetRecords(nullptr); + } - m_isReady = true; -} + if (m_registrationEnabled && AZ::AllocatorManager::IsReady()) + { + AllocatorManager::Instance().UnRegisterAllocator(this); + } -void AllocatorBase::PreDestroy() -{ - Debug::AllocationRecords* allocatorRecords = GetRecords(); - if(allocatorRecords) - { - delete allocatorRecords; - SetRecords(nullptr); + m_isReady = false; } - if (m_registrationEnabled && AZ::AllocatorManager::IsReady()) + void AllocatorBase::SetLazilyCreated(bool lazy) { - AllocatorManager::Instance().UnRegisterAllocator(this); + m_isLazilyCreated = lazy; } - m_isReady = false; -} - -void AllocatorBase::SetLazilyCreated(bool lazy) -{ - m_isLazilyCreated = lazy; -} - -bool AllocatorBase::IsLazilyCreated() const -{ - return m_isLazilyCreated; -} + bool AllocatorBase::IsLazilyCreated() const + { + return m_isLazilyCreated; + } -void AllocatorBase::SetProfilingActive(bool active) -{ - m_isProfilingActive = active; -} + void AllocatorBase::SetProfilingActive(bool active) + { + m_isProfilingActive = active; + } -bool AllocatorBase::IsProfilingActive() const -{ - return m_isProfilingActive; -} + bool AllocatorBase::IsProfilingActive() const + { + return m_isProfilingActive; + } -void AllocatorBase::DisableOverriding() -{ - m_canBeOverridden = false; -} + void AllocatorBase::DisableOverriding() + { + m_canBeOverridden = false; + } -void AllocatorBase::DisableRegistration() -{ - m_registrationEnabled = false; -} + void AllocatorBase::DisableRegistration() + { + m_registrationEnabled = false; + } -void AllocatorBase::ProfileAllocation(void* ptr, size_t byteSize, size_t alignment, const char* name, const char* fileName, int lineNum, int suppressStackRecord) -{ + void AllocatorBase::ProfileAllocation( + void* ptr, size_t byteSize, size_t alignment, const char* name, const char* fileName, int lineNum, int suppressStackRecord) + { #if defined(AZ_HAS_VARIADIC_TEMPLATES) && defined(AZ_DEBUG_BUILD) - ++suppressStackRecord; // one more for the fact the ebus is a function + ++suppressStackRecord; // one more for the fact the ebus is a function #endif // AZ_HAS_VARIADIC_TEMPLATES - if (m_isProfilingActive) - { - auto records = GetRecords(); - if (records) + if (m_isProfilingActive) { - records->RegisterAllocation(ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1); + auto records = GetRecords(); + if (records) + { + records->RegisterAllocation(ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1); + } } } -} -void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t alignment, Debug::AllocationInfo* info) -{ - if (m_isProfilingActive) + void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t alignment, Debug::AllocationInfo* info) { - auto records = GetRecords(); - if (records) + if (m_isProfilingActive) { - records->UnregisterAllocation(ptr, byteSize, alignment, info); + auto records = GetRecords(); + if (records) + { + records->UnregisterAllocation(ptr, byteSize, alignment, info); + } } } -} -void AllocatorBase::ProfileReallocationBegin([[maybe_unused]] void* ptr, [[maybe_unused]] size_t newSize) -{ -} + void AllocatorBase::ProfileReallocationBegin([[maybe_unused]] void* ptr, [[maybe_unused]] size_t newSize) + { + } -void AllocatorBase::ProfileReallocationEnd(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) -{ - if (m_isProfilingActive) + void AllocatorBase::ProfileReallocationEnd(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) { - Debug::AllocationInfo info; - ProfileDeallocation(ptr, 0, 0, &info); - ProfileAllocation(newPtr, newSize, newAlignment, info.m_name, info.m_fileName, info.m_lineNum, 0); + if (m_isProfilingActive) + { + Debug::AllocationInfo info; + ProfileDeallocation(ptr, 0, 0, &info); + ProfileAllocation(newPtr, newSize, newAlignment, info.m_name, info.m_fileName, info.m_lineNum, 0); + } } -} -void AllocatorBase::ProfileReallocation(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) -{ - ProfileReallocationEnd(ptr, newPtr, newSize, newAlignment); -} + void AllocatorBase::ProfileReallocation(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) + { + ProfileReallocationEnd(ptr, newPtr, newSize, newAlignment); + } -void AllocatorBase::ProfileResize(void* ptr, size_t newSize) -{ - if (newSize && m_isProfilingActive) + void AllocatorBase::ProfileResize(void* ptr, size_t newSize) { - auto records = GetRecords(); - if (records) + if (newSize && m_isProfilingActive) { - records->ResizeAllocation(ptr, newSize); + auto records = GetRecords(); + if (records) + { + records->ResizeAllocation(ptr, newSize); + } } } -} -bool AllocatorBase::OnOutOfMemory(size_t byteSize, size_t alignment, int flags, const char* name, const char* fileName, int lineNum) -{ - if (AllocatorManager::IsReady() && AllocatorManager::Instance().m_outOfMemoryListener) + bool AllocatorBase::OnOutOfMemory(size_t byteSize, size_t alignment, int flags, const char* name, const char* fileName, int lineNum) { - AllocatorManager::Instance().m_outOfMemoryListener(this, byteSize, alignment, flags, name, fileName, lineNum); - return true; + if (AllocatorManager::IsReady() && AllocatorManager::Instance().m_outOfMemoryListener) + { + AllocatorManager::Instance().m_outOfMemoryListener(this, byteSize, alignment, flags, name, fileName, lineNum); + return true; + } + return false; } - return false; -} + +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp index 30b0b78fe5..d55ca8b695 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp @@ -13,186 +13,182 @@ #include -using namespace AZ; - -//========================================================================= -// BestFitExternalMapAllocator -// [1/28/2011] -//========================================================================= -BestFitExternalMapAllocator::BestFitExternalMapAllocator() - : AllocatorBase(this, "BestFitExternalMapAllocator", "Best fit allocator with external tracking storage!") - , m_schema(nullptr) -{} - -//========================================================================= -// Create -// [1/28/2011] -//========================================================================= -bool -BestFitExternalMapAllocator::Create(const Descriptor& desc) +namespace AZ { - AZ_Assert(IsReady() == false, "BestFitExternalMapAllocator was already created!"); - if (IsReady()) + //========================================================================= + // BestFitExternalMapAllocator + // [1/28/2011] + //========================================================================= + BestFitExternalMapAllocator::BestFitExternalMapAllocator() + : AllocatorBase(this, "BestFitExternalMapAllocator", "Best fit allocator with external tracking storage!") + , m_schema(nullptr) { - return false; } - bool isReady = true; + //========================================================================= + // Create + // [1/28/2011] + //========================================================================= + bool BestFitExternalMapAllocator::Create(const Descriptor& desc) + { + AZ_Assert(IsReady() == false, "BestFitExternalMapAllocator was already created!"); + if (IsReady()) + { + return false; + } + + bool isReady = true; + + m_desc = desc; + BestFitExternalMapSchema::Descriptor schemaDesc; + schemaDesc.m_mapAllocator = desc.m_mapAllocator; + schemaDesc.m_memoryBlock = desc.m_memoryBlock; + schemaDesc.m_memoryBlockByteSize = desc.m_memoryBlockByteSize; + + m_schema = azcreate(BestFitExternalMapSchema, (schemaDesc), SystemAllocator); + if (m_schema == nullptr) + { + isReady = false; + } + + return isReady; + } - m_desc = desc; - BestFitExternalMapSchema::Descriptor schemaDesc; - schemaDesc.m_mapAllocator = desc.m_mapAllocator; - schemaDesc.m_memoryBlock = desc.m_memoryBlock; - schemaDesc.m_memoryBlockByteSize = desc.m_memoryBlockByteSize; + //========================================================================= + // Destroy + // [1/28/2011] + //========================================================================= + void BestFitExternalMapAllocator::Destroy() + { + azdestroy(m_schema, SystemAllocator); + m_schema = nullptr; + } - m_schema = azcreate(BestFitExternalMapSchema, (schemaDesc), SystemAllocator); - if (m_schema == nullptr) + AllocatorDebugConfig BestFitExternalMapAllocator::GetDebugConfig() { - isReady = false; + return AllocatorDebugConfig() + .ExcludeFromDebugging(!m_desc.m_allocationRecords) + .StackRecordLevels(m_desc.m_stackRecordLevels) + .MarksUnallocatedMemory(false) + .UsesMemoryGuards(false); } - return isReady; -} + //========================================================================= + // Allocate + // [1/28/2011] + //========================================================================= + BestFitExternalMapAllocator::pointer_type BestFitExternalMapAllocator::Allocate( + size_type byteSize, + size_type alignment, + int flags, + [[maybe_unused]] const char* name, + [[maybe_unused]] const char* fileName, + [[maybe_unused]] int lineNum, + unsigned int suppressStackRecord) + { + (void)suppressStackRecord; -//========================================================================= -// Destroy -// [1/28/2011] -//========================================================================= -void -BestFitExternalMapAllocator::Destroy() -{ - azdestroy(m_schema, SystemAllocator); - m_schema = nullptr; -} + AZ_Assert(byteSize > 0, "You can not allocate 0 bytes!"); + AZ_Assert((alignment & (alignment - 1)) == 0, "Alignment must be power of 2!"); + byteSize = MemorySizeAdjustedUp(byteSize); -AllocatorDebugConfig BestFitExternalMapAllocator::GetDebugConfig() -{ - return AllocatorDebugConfig() - .ExcludeFromDebugging(!m_desc.m_allocationRecords) - .StackRecordLevels(m_desc.m_stackRecordLevels) - .MarksUnallocatedMemory(false) - .UsesMemoryGuards(false); -} - -//========================================================================= -// Allocate -// [1/28/2011] -//========================================================================= -BestFitExternalMapAllocator::pointer_type BestFitExternalMapAllocator::Allocate( - size_type byteSize, - size_type alignment, - int flags, - [[maybe_unused]] const char* name, - [[maybe_unused]] const char* fileName, - [[maybe_unused]] int lineNum, - unsigned int suppressStackRecord) -{ - (void)suppressStackRecord; + BestFitExternalMapAllocator::pointer_type address = m_schema->Allocate(byteSize, alignment, flags); + AZ_Assert( + address != nullptr, "BestFitExternalMapAllocator: Failed to allocate %d bytes aligned on %d (flags: 0x%08x) %s : %s (%d)!", + byteSize, alignment, flags, name ? name : "(no name)", fileName ? fileName : "(no file name)", lineNum); + AZ_MEMORY_PROFILE(ProfileAllocation(address, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1)); - AZ_Assert(byteSize > 0, "You can not allocate 0 bytes!"); - AZ_Assert((alignment & (alignment - 1)) == 0, "Alignment must be power of 2!"); - byteSize = MemorySizeAdjustedUp(byteSize); + return address; + } - BestFitExternalMapAllocator::pointer_type address = m_schema->Allocate(byteSize, alignment, flags); - AZ_Assert(address != nullptr, "BestFitExternalMapAllocator: Failed to allocate %d bytes aligned on %d (flags: 0x%08x) %s : %s (%d)!", byteSize, alignment, flags, name ? name : "(no name)", fileName ? fileName : "(no file name)", lineNum); - AZ_MEMORY_PROFILE(ProfileAllocation(address, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1)); + //========================================================================= + // DeAllocate + // [1/28/2011] + //========================================================================= + void BestFitExternalMapAllocator::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) + { + byteSize = MemorySizeAdjustedUp(byteSize); + AZ_MEMORY_PROFILE(ProfileDeallocation(ptr, byteSize, alignment, nullptr)); - return address; -} + (void)byteSize; + (void)alignment; + m_schema->DeAllocate(ptr); + } -//========================================================================= -// DeAllocate -// [1/28/2011] -//========================================================================= -void -BestFitExternalMapAllocator::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) -{ - byteSize = MemorySizeAdjustedUp(byteSize); - AZ_MEMORY_PROFILE(ProfileDeallocation(ptr, byteSize, alignment, nullptr)); - - (void)byteSize; - (void)alignment; - m_schema->DeAllocate(ptr); -} - -//========================================================================= -// Resize -// [1/28/2011] -//========================================================================= -BestFitExternalMapAllocator::size_type -BestFitExternalMapAllocator::Resize(pointer_type ptr, size_type newSize) -{ - (void)ptr; - (void)newSize; - /* todo */ - return 0; -} - -//========================================================================= -// ReAllocate -// [9/13/2011] -//========================================================================= -BestFitExternalMapAllocator::pointer_type -BestFitExternalMapAllocator::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) -{ - (void)ptr; - (void)newSize; - (void)newAlignment; - AZ_Assert(false, "Not supported!"); - return nullptr; -} - -//========================================================================= -// AllocationSize -// [1/28/2011] -//========================================================================= -BestFitExternalMapAllocator::size_type -BestFitExternalMapAllocator::AllocationSize(pointer_type ptr) -{ - return MemorySizeAdjustedDown(m_schema->AllocationSize(ptr)); -} - -//========================================================================= -// NumAllocatedBytes -// [1/28/2011] -//========================================================================= -BestFitExternalMapAllocator::size_type -BestFitExternalMapAllocator::NumAllocatedBytes() const -{ - return m_schema->NumAllocatedBytes(); -} - -//========================================================================= -// Capacity -// [1/28/2011] -//========================================================================= -BestFitExternalMapAllocator::size_type -BestFitExternalMapAllocator::Capacity() const -{ - return m_schema->Capacity(); -} - -//========================================================================= -// GetMaxAllocationSize -// [1/28/2011] -//========================================================================= -BestFitExternalMapAllocator::size_type -BestFitExternalMapAllocator::GetMaxAllocationSize() const -{ - return m_schema->GetMaxAllocationSize(); -} + //========================================================================= + // Resize + // [1/28/2011] + //========================================================================= + BestFitExternalMapAllocator::size_type BestFitExternalMapAllocator::Resize(pointer_type ptr, size_type newSize) + { + (void)ptr; + (void)newSize; + /* todo */ + return 0; + } -auto BestFitExternalMapAllocator::GetMaxContiguousAllocationSize() const -> size_type -{ - return m_schema->GetMaxContiguousAllocationSize(); -} - -//========================================================================= -// GetSubAllocator -// [1/28/2011] -//========================================================================= -IAllocatorAllocate* -BestFitExternalMapAllocator::GetSubAllocator() -{ - return m_schema->GetSubAllocator(); -} + //========================================================================= + // ReAllocate + // [9/13/2011] + //========================================================================= + BestFitExternalMapAllocator::pointer_type BestFitExternalMapAllocator::ReAllocate( + pointer_type ptr, size_type newSize, size_type newAlignment) + { + (void)ptr; + (void)newSize; + (void)newAlignment; + AZ_Assert(false, "Not supported!"); + return nullptr; + } + + //========================================================================= + // AllocationSize + // [1/28/2011] + //========================================================================= + BestFitExternalMapAllocator::size_type BestFitExternalMapAllocator::AllocationSize(pointer_type ptr) + { + return MemorySizeAdjustedDown(m_schema->AllocationSize(ptr)); + } + + //========================================================================= + // NumAllocatedBytes + // [1/28/2011] + //========================================================================= + BestFitExternalMapAllocator::size_type BestFitExternalMapAllocator::NumAllocatedBytes() const + { + return m_schema->NumAllocatedBytes(); + } + + //========================================================================= + // Capacity + // [1/28/2011] + //========================================================================= + BestFitExternalMapAllocator::size_type BestFitExternalMapAllocator::Capacity() const + { + return m_schema->Capacity(); + } + + //========================================================================= + // GetMaxAllocationSize + // [1/28/2011] + //========================================================================= + BestFitExternalMapAllocator::size_type BestFitExternalMapAllocator::GetMaxAllocationSize() const + { + return m_schema->GetMaxAllocationSize(); + } + + auto BestFitExternalMapAllocator::GetMaxContiguousAllocationSize() const -> size_type + { + return m_schema->GetMaxContiguousAllocationSize(); + } + + //========================================================================= + // GetSubAllocator + // [1/28/2011] + //========================================================================= + IAllocatorAllocate* BestFitExternalMapAllocator::GetSubAllocator() + { + return m_schema->GetSubAllocator(); + } + +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h index 17425625b7..90e2056d65 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h @@ -5,8 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef AZ_BEST_FIT_EXT_MAP_ALLOCATOR_H -#define AZ_BEST_FIT_EXT_MAP_ALLOCATOR_H +#pragma once #include @@ -76,7 +75,3 @@ namespace AZ }; } -#endif // AZ_BEST_FIT_EXT_MAP_ALLOCATOR_H -#pragma once - - diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp index 715ecd221e..841f36f58a 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp @@ -9,194 +9,199 @@ #include #include -using namespace AZ; - -//========================================================================= -// BestFitExternalMapSchema -// [1/28/2011] -//========================================================================= -BestFitExternalMapSchema::BestFitExternalMapSchema(const Descriptor& desc) - : m_desc(desc) - , m_used(0) - , m_freeChunksMap(FreeMapType::key_compare(), AZStdIAllocator(desc.m_mapAllocator != nullptr ? desc.m_mapAllocator : &AllocatorInstance::Get())) - , m_allocChunksMap(AllocMapType::hasher(), AllocMapType::key_eq(), AZStdIAllocator(desc.m_mapAllocator != nullptr ? desc.m_mapAllocator : &AllocatorInstance::Get())) +namespace AZ { - if (m_desc.m_mapAllocator == nullptr) + //========================================================================= + // BestFitExternalMapSchema + // [1/28/2011] + //========================================================================= + BestFitExternalMapSchema::BestFitExternalMapSchema(const Descriptor& desc) + : m_desc(desc) + , m_used(0) + , m_freeChunksMap( + FreeMapType::key_compare(), + AZStdIAllocator(desc.m_mapAllocator != nullptr ? desc.m_mapAllocator : &AllocatorInstance::Get())) + , m_allocChunksMap( + AllocMapType::hasher(), + AllocMapType::key_eq(), + AZStdIAllocator(desc.m_mapAllocator != nullptr ? desc.m_mapAllocator : &AllocatorInstance::Get())) { - m_desc.m_mapAllocator = &AllocatorInstance::Get(); // used as our sub allocator + if (m_desc.m_mapAllocator == nullptr) + { + m_desc.m_mapAllocator = &AllocatorInstance::Get(); // used as our sub allocator + } + AZ_Assert(m_desc.m_memoryBlockByteSize > 0, "You must provide memory block size!"); + AZ_Assert(m_desc.m_memoryBlock != nullptr, "You must provide memory block allocated as you with!"); + // if( m_desc.m_memoryBlock == NULL) there is no point to automate this cause we need to flag this memory special, otherwise there + // is no point to use this allocator at all + // m_desc.m_memoryBlock = azmalloc(SystemAllocator,m_desc.m_memoryBlockByteSize,16); + m_freeChunksMap.insert(AZStd::make_pair(m_desc.m_memoryBlockByteSize, reinterpret_cast(m_desc.m_memoryBlock))); } - AZ_Assert(m_desc.m_memoryBlockByteSize > 0, "You must provide memory block size!"); - AZ_Assert(m_desc.m_memoryBlock != nullptr, "You must provide memory block allocated as you with!"); - //if( m_desc.m_memoryBlock == NULL) there is no point to automate this cause we need to flag this memory special, otherwise there is no point to use this allocator at all - // m_desc.m_memoryBlock = azmalloc(SystemAllocator,m_desc.m_memoryBlockByteSize,16); - m_freeChunksMap.insert(AZStd::make_pair(m_desc.m_memoryBlockByteSize, reinterpret_cast(m_desc.m_memoryBlock))); -} -//========================================================================= -// Allocate -// [1/28/2011] -//========================================================================= -BestFitExternalMapSchema::pointer_type -BestFitExternalMapSchema::Allocate(size_type byteSize, size_type alignment, int flags) -{ - (void)flags; - char* address = nullptr; - AZ_Assert(alignment > 0 && (alignment & (alignment - 1)) == 0, "Alignment must be >0 and power of 2!"); - for (int i = 0; i < 2; ++i) // max 2 attempts to allocate + //========================================================================= + // Allocate + // [1/28/2011] + //========================================================================= + BestFitExternalMapSchema::pointer_type BestFitExternalMapSchema::Allocate(size_type byteSize, size_type alignment, int flags) { - FreeMapType::iterator iter = m_freeChunksMap.find(byteSize); - size_t blockSize = 0; - char* blockAddress = nullptr; - size_t preAllocBlockSize = 0; - while (iter != m_freeChunksMap.end()) + (void)flags; + char* address = nullptr; + AZ_Assert(alignment > 0 && (alignment & (alignment - 1)) == 0, "Alignment must be >0 and power of 2!"); + for (int i = 0; i < 2; ++i) // max 2 attempts to allocate { - blockSize = iter->first; - blockAddress = iter->second; - char* alignedAddr = PointerAlignUp(blockAddress, alignment); - preAllocBlockSize = alignedAddr - blockAddress; - if (preAllocBlockSize + byteSize <= blockSize) + FreeMapType::iterator iter = m_freeChunksMap.find(byteSize); + size_t blockSize = 0; + char* blockAddress = nullptr; + size_t preAllocBlockSize = 0; + while (iter != m_freeChunksMap.end()) { - m_freeChunksMap.erase(iter); // we have our allocation - m_used += byteSize; - address = alignedAddr; - m_allocChunksMap.insert(AZStd::make_pair(address, byteSize)); - break; + blockSize = iter->first; + blockAddress = iter->second; + char* alignedAddr = PointerAlignUp(blockAddress, alignment); + preAllocBlockSize = alignedAddr - blockAddress; + if (preAllocBlockSize + byteSize <= blockSize) + { + m_freeChunksMap.erase(iter); // we have our allocation + m_used += byteSize; + address = alignedAddr; + m_allocChunksMap.insert(AZStd::make_pair(address, byteSize)); + break; + } + ++iter; } - ++iter; - } - if (address != nullptr) - { - // split blocks - if (preAllocBlockSize) // if we have a block before the alignment + if (address != nullptr) { - m_freeChunksMap.insert(AZStd::make_pair(preAllocBlockSize, blockAddress)); + // split blocks + if (preAllocBlockSize) // if we have a block before the alignment + { + m_freeChunksMap.insert(AZStd::make_pair(preAllocBlockSize, blockAddress)); + } + size_t postAllocBlockSize = blockSize - preAllocBlockSize - byteSize; + if (postAllocBlockSize) + { + m_freeChunksMap.insert(AZStd::make_pair(postAllocBlockSize, address + byteSize)); + } + + break; } - size_t postAllocBlockSize = blockSize - preAllocBlockSize - byteSize; - if (postAllocBlockSize) + else { - m_freeChunksMap.insert(AZStd::make_pair(postAllocBlockSize, address + byteSize)); + GarbageCollect(); } + } + return address; + } - break; + //========================================================================= + // DeAllocate + // [1/28/2011] + //========================================================================= + void BestFitExternalMapSchema::DeAllocate(pointer_type ptr) + { + if (ptr == nullptr) + { + return; } - else + AllocMapType::iterator iter = m_allocChunksMap.find(reinterpret_cast(ptr)); + if (iter != m_allocChunksMap.end()) { - GarbageCollect(); + m_used -= iter->second; + m_freeChunksMap.insert(AZStd::make_pair(iter->second, iter->first)); + m_allocChunksMap.erase(iter); } } - return address; -} -//========================================================================= -// DeAllocate -// [1/28/2011] -//========================================================================= -void -BestFitExternalMapSchema::DeAllocate(pointer_type ptr) -{ - if (ptr == nullptr) + //========================================================================= + // AllocationSize + // [1/28/2011] + //========================================================================= + BestFitExternalMapSchema::size_type BestFitExternalMapSchema::AllocationSize(pointer_type ptr) { - return; - } - AllocMapType::iterator iter = m_allocChunksMap.find(reinterpret_cast(ptr)); - if (iter != m_allocChunksMap.end()) - { - m_used -= iter->second; - m_freeChunksMap.insert(AZStd::make_pair(iter->second, iter->first)); - m_allocChunksMap.erase(iter); + AllocMapType::iterator iter = m_allocChunksMap.find(reinterpret_cast(ptr)); + if (iter != m_allocChunksMap.end()) + { + return iter->second; + } + return 0; } -} -//========================================================================= -// AllocationSize -// [1/28/2011] -//========================================================================= -BestFitExternalMapSchema::size_type -BestFitExternalMapSchema::AllocationSize(pointer_type ptr) -{ - AllocMapType::iterator iter = m_allocChunksMap.find(reinterpret_cast(ptr)); - if (iter != m_allocChunksMap.end()) + //========================================================================= + // GetMaxAllocationSize + // [1/28/2011] + //========================================================================= + BestFitExternalMapSchema::size_type BestFitExternalMapSchema::GetMaxAllocationSize() const { - return iter->second; + if (!m_freeChunksMap.empty()) + { + return m_freeChunksMap.rbegin()->first; + } + return 0; } - return 0; -} -//========================================================================= -// GetMaxAllocationSize -// [1/28/2011] -//========================================================================= -BestFitExternalMapSchema::size_type -BestFitExternalMapSchema::GetMaxAllocationSize() const -{ - if (!m_freeChunksMap.empty()) + auto BestFitExternalMapSchema::GetMaxContiguousAllocationSize() const -> size_type { - return m_freeChunksMap.rbegin()->first; + // Return the maximum size of any single allocation + return AZ_CORE_MAX_ALLOCATOR_SIZE; } - return 0; -} -auto BestFitExternalMapSchema::GetMaxContiguousAllocationSize() const -> size_type -{ - // Return the maximum size of any single allocation - return AZ_CORE_MAX_ALLOCATOR_SIZE; -} - -//========================================================================= -// GarbageCollect -// [1/28/2011] -//========================================================================= -void -BestFitExternalMapSchema::GarbageCollect() -{ - for (FreeMapType::iterator curBlock = m_freeChunksMap.begin(); curBlock != m_freeChunksMap.end(); ) + //========================================================================= + // GarbageCollect + // [1/28/2011] + //========================================================================= + void BestFitExternalMapSchema::GarbageCollect() { - char* curStart = curBlock->second; - char* curEnd = curStart + curBlock->first; - bool isMerge = false; - for (FreeMapType::iterator nextBlock = curBlock++; nextBlock != m_freeChunksMap.end(); ) + for (FreeMapType::iterator curBlock = m_freeChunksMap.begin(); curBlock != m_freeChunksMap.end();) { - char* nextStart = nextBlock->second; - char* nextEnd = nextStart + nextBlock->first; - if (curStart == nextEnd) + char* curStart = curBlock->second; + char* curEnd = curStart + curBlock->first; + bool isMerge = false; + for (FreeMapType::iterator nextBlock = curBlock++; nextBlock != m_freeChunksMap.end();) { - // merge - size_t newBlockSize = curBlock->first + nextBlock->first; - char* newBlockAddress = nextStart; - m_freeChunksMap.erase(nextBlock); - FreeMapType::iterator toErase = curBlock; - ++curBlock; - m_freeChunksMap.erase(toErase); - FreeMapType::iterator newBlock = m_freeChunksMap.insert(AZStd::make_pair(newBlockSize, newBlockAddress)).first; - if (curBlock != m_freeChunksMap.end() && newBlockSize < curBlock->first) // if the newBlock in before the next in the list, update next in the list to current + char* nextStart = nextBlock->second; + char* nextEnd = nextStart + nextBlock->first; + if (curStart == nextEnd) { - curBlock = newBlock; + // merge + size_t newBlockSize = curBlock->first + nextBlock->first; + char* newBlockAddress = nextStart; + m_freeChunksMap.erase(nextBlock); + FreeMapType::iterator toErase = curBlock; + ++curBlock; + m_freeChunksMap.erase(toErase); + FreeMapType::iterator newBlock = m_freeChunksMap.insert(AZStd::make_pair(newBlockSize, newBlockAddress)).first; + // if the newBlock in before the next in the list, update next in the list to current + if (curBlock != m_freeChunksMap.end() && newBlockSize < curBlock->first) + { + curBlock = newBlock; + } + isMerge = true; + break; } - isMerge = true; - break; + else if (curEnd == nextStart) + { + // merge + size_t newBlockSize = curBlock->first + nextBlock->first; + char* newBlockAddress = curStart; + m_freeChunksMap.erase(nextBlock); + FreeMapType::iterator toErase = curBlock; + ++curBlock; + m_freeChunksMap.erase(toErase); + FreeMapType::iterator newBlock = m_freeChunksMap.insert(AZStd::make_pair(newBlockSize, newBlockAddress)).first; + // if the newBlock in before the next in the list, update next in the list to current + if (curBlock != m_freeChunksMap.end() && newBlockSize < curBlock->first) + { + curBlock = newBlock; + } + isMerge = true; + break; + } + ++nextBlock; } - else if (curEnd == nextStart) + if (!isMerge) { - // merge - size_t newBlockSize = curBlock->first + nextBlock->first; - char* newBlockAddress = curStart; - m_freeChunksMap.erase(nextBlock); - FreeMapType::iterator toErase = curBlock; ++curBlock; - m_freeChunksMap.erase(toErase); - FreeMapType::iterator newBlock = m_freeChunksMap.insert(AZStd::make_pair(newBlockSize, newBlockAddress)).first; - if (curBlock != m_freeChunksMap.end() && newBlockSize < curBlock->first) // if the newBlock in before the next in the list, update next in the list to current - { - curBlock = newBlock; - } - isMerge = true; - break; } - ++nextBlock; - } - if (!isMerge) - { - ++curBlock; } } -} + +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h index eaab614593..0055a86ee2 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h @@ -5,8 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef AZ_BEST_FIT_EXT_MAP_ALLOCATION_SCHEME_H -#define AZ_BEST_FIT_EXT_MAP_ALLOCATION_SCHEME_H +#pragma once #include #include @@ -77,8 +76,3 @@ namespace AZ AllocMapType m_allocChunksMap; }; } - -#endif // AZ_BEST_FIT_EXT_MAP_ALLOCATION_SCHEME_H -#pragma once - - diff --git a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp index 9167864450..c57cfea222 100644 --- a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp @@ -27,8 +27,8 @@ namespace AZ ////////////////////////////////////////////////////////////////////////// // Pool Allocation algorithm /** - * Pool Allocation algorithm implementation. Used in both PoolAllocator and ThreadPoolAllocator. - */ + * Pool Allocation algorithm implementation. Used in both PoolAllocator and ThreadPoolAllocator. + */ template class PoolAllocation { @@ -41,20 +41,20 @@ namespace AZ PoolAllocation(Allocator* alloc, size_t pageSize, size_t minAllocationSize, size_t maxAllocationSize); virtual ~PoolAllocation(); - void* Allocate(size_t byteSize, size_t alignment); - void DeAllocate(void* ptr); - size_t AllocationSize(void* ptr); + void* Allocate(size_t byteSize, size_t alignment); + void DeAllocate(void* ptr); + size_t AllocationSize(void* ptr); // if isForceFreeAllPages is true we will free all pages even if they have allocations in them. - void GarbageCollect(bool isForceFreeAllPages = false); - - Allocator* m_allocator; - size_t m_pageSize; - size_t m_minAllocationShift; - size_t m_minAllocationSize; - size_t m_maxAllocationSize; - size_t m_numBuckets; - BucketType* m_buckets; - size_t m_numBytesAllocated; + void GarbageCollect(bool isForceFreeAllPages = false); + + Allocator* m_allocator; + size_t m_pageSize; + size_t m_minAllocationShift; + size_t m_minAllocationSize; + size_t m_maxAllocationSize; + size_t m_numBuckets; + BucketType* m_buckets; + size_t m_numBytesAllocated; }; /** @@ -68,23 +68,22 @@ namespace AZ PoolSchemaImpl(const PoolSchema::Descriptor& desc); ~PoolSchemaImpl(); - PoolSchema::pointer_type Allocate(PoolSchema::size_type byteSize, PoolSchema::size_type alignment, int flags = 0); - void DeAllocate(PoolSchema::pointer_type ptr); - PoolSchema::size_type AllocationSize(PoolSchema::pointer_type ptr); + PoolSchema::pointer_type Allocate(PoolSchema::size_type byteSize, PoolSchema::size_type alignment, int flags = 0); + void DeAllocate(PoolSchema::pointer_type ptr); + PoolSchema::size_type AllocationSize(PoolSchema::pointer_type ptr); /** - * We allocate memory for pools in pages. Page is a information struct - * located at the end of the allocated page. When it's in the at the end - * we can usually hide it's size in the free bytes left from the pagesize/poolsize. - * \note IMPORTANT pages are aligned on the page size, this way can find quickly which - * pool the pointer belongs to. - */ - struct Page - : public AZStd::intrusive_list_node + * We allocate memory for pools in pages. Page is a information struct + * located at the end of the allocated page. When it's in the at the end + * we can usually hide it's size in the free bytes left from the pagesize/poolsize. + * \note IMPORTANT pages are aligned on the page size, this way can find quickly which + * pool the pointer belongs to. + */ + struct Page : public AZStd::intrusive_list_node { - struct FakeNode - : public AZStd::intrusive_slist_node - {}; + struct FakeNode : public AZStd::intrusive_slist_node + { + }; void SetupFreeList(size_t elementSize, size_t pageDataBlockSize); @@ -99,22 +98,22 @@ namespace AZ }; /** - * A bucket has a list of pages used with the specific pool size. - */ + * A bucket has a list of pages used with the specific pool size. + */ struct Bucket { using PageListType = AZStd::intrusive_list>; - PageListType m_pages; + PageListType m_pages; }; // Functions used by PoolAllocation template AZ_INLINE Page* PopFreePage(); - AZ_INLINE void PushFreePage(Page* page); - void GarbageCollect(); - inline bool IsInStaticBlock(Page* page) + AZ_INLINE void PushFreePage(Page* page); + void GarbageCollect(); + inline bool IsInStaticBlock(Page* page) { const char* staticBlockStart = reinterpret_cast(m_staticDataBlock); - const char* staticBlockEnd = staticBlockStart + m_numStaticPages*m_pageSize; + const char* staticBlockEnd = staticBlockStart + m_numStaticPages * m_pageSize; const char* pageAddress = reinterpret_cast(page); // all pages are the same size so we either in or out, no need to check the pageAddressEnd if (pageAddress >= staticBlockStart && pageAddress < staticBlockEnd) @@ -126,21 +125,22 @@ namespace AZ return false; } } - inline Page* ConstructPage(size_t elementSize) + inline Page* ConstructPage(size_t elementSize) { AZ_Assert(m_isDynamic, "We run out of static pages (%d) and this is a static allocator!", m_numStaticPages); // We store the page struct at the end of the block char* memBlock; - memBlock = reinterpret_cast(m_pageAllocator->Allocate(m_pageSize, m_pageSize, 0, "AZSystem::PoolSchemaImpl::ConstructPage", __FILE__, __LINE__)); + memBlock = reinterpret_cast( + m_pageAllocator->Allocate(m_pageSize, m_pageSize, 0, "AZSystem::PoolSchemaImpl::ConstructPage", __FILE__, __LINE__)); size_t pageDataSize = m_pageSize - sizeof(Page); - Page* page = new(memBlock+pageDataSize)Page(); + Page* page = new (memBlock + pageDataSize) Page(); page->SetupFreeList(elementSize, pageDataSize); page->m_elementSize = static_cast(elementSize); page->m_maxNumElements = static_cast(pageDataSize / elementSize); return page; } - inline void FreePage(Page* page) + inline void FreePage(Page* page) { // TODO: It's optional if we want to check the guard value for corruption, since we are not going // to use this memory. Yet it might be useful to catch bugs. @@ -150,9 +150,9 @@ namespace AZ m_pageAllocator->DeAllocate(memBlock); } - inline Page* PageFromAddress(void* address) + inline Page* PageFromAddress(void* address) { - char* memBlock = reinterpret_cast(reinterpret_cast(address) & ~(m_pageSize-1)); + char* memBlock = reinterpret_cast(reinterpret_cast(address) & ~(m_pageSize - 1)); memBlock += m_pageSize - sizeof(Page); Page* page = reinterpret_cast(memBlock); if (!page->m_magic.Validate()) @@ -163,18 +163,18 @@ namespace AZ } using AllocatorType = PoolAllocation; - IAllocatorAllocate* m_pageAllocator; - AllocatorType m_allocator; - void* m_staticDataBlock; - unsigned int m_numStaticPages; - bool m_isDynamic; - size_t m_pageSize; - Bucket::PageListType m_freePages; + IAllocatorAllocate* m_pageAllocator; + AllocatorType m_allocator; + void* m_staticDataBlock; + unsigned int m_numStaticPages; + bool m_isDynamic; + size_t m_pageSize; + Bucket::PageListType m_freePages; }; /** - * Thread safe pool allocator. - */ + * Thread safe pool allocator. + */ class ThreadPoolSchemaImpl { public: @@ -183,18 +183,20 @@ namespace AZ /** * Specialized \ref PoolAllocator::Page page for lock free allocator. */ - struct Page - : public AZStd::intrusive_list_node + struct Page : public AZStd::intrusive_list_node { Page(ThreadPoolData* threadData) - : m_threadData(threadData) {} + : m_threadData(threadData) + { + } - struct FakeNode - : public AZStd::intrusive_slist_node - {}; + struct FakeNode : public AZStd::intrusive_slist_node + { + }; // Fake Lock Free node used when we delete an element from another thread. - struct FakeNodeLF - : public AZStd::lock_free_intrusive_stack_node{}; + struct FakeNodeLF : public AZStd::lock_free_intrusive_stack_node + { + }; void SetupFreeList(size_t elementSize, size_t pageDataBlockSize); @@ -202,8 +204,8 @@ namespace AZ using FreeListType = AZStd::intrusive_slist>; FreeListType m_freeList; - AZStd::lock_free_intrusive_stack_node m_lfStack; ///< Lock Free stack node - struct ThreadPoolData* m_threadData; ///< The thread data that own's the page. + AZStd::lock_free_intrusive_stack_node m_lfStack; ///< Lock Free stack node + struct ThreadPoolData* m_threadData; ///< The thread data that own's the page. u32 m_bin; Debug::Magic32 m_magic; u32 m_elementSize; @@ -211,31 +213,34 @@ namespace AZ }; /** - * A bucket has a list of pages used with the specific pool size. - */ + * A bucket has a list of pages used with the specific pool size. + */ struct Bucket { using PageListType = AZStd::intrusive_list>; - PageListType m_pages; + PageListType m_pages; }; - ThreadPoolSchemaImpl(const ThreadPoolSchema::Descriptor& desc, ThreadPoolSchema::GetThreadPoolData threadPoolGetter, ThreadPoolSchema::SetThreadPoolData threadPoolSetter); + ThreadPoolSchemaImpl( + const ThreadPoolSchema::Descriptor& desc, + ThreadPoolSchema::GetThreadPoolData threadPoolGetter, + ThreadPoolSchema::SetThreadPoolData threadPoolSetter); ~ThreadPoolSchemaImpl(); - ThreadPoolSchema::pointer_type Allocate(ThreadPoolSchema::size_type byteSize, ThreadPoolSchema::size_type alignment, int flags = 0); - void DeAllocate(ThreadPoolSchema::pointer_type ptr); - ThreadPoolSchema::size_type AllocationSize(ThreadPoolSchema::pointer_type ptr); + ThreadPoolSchema::pointer_type Allocate(ThreadPoolSchema::size_type byteSize, ThreadPoolSchema::size_type alignment, int flags = 0); + void DeAllocate(ThreadPoolSchema::pointer_type ptr); + ThreadPoolSchema::size_type AllocationSize(ThreadPoolSchema::pointer_type ptr); /// Return unused memory to the OS. Don't call this too often because you will force unnecessary allocations. - void GarbageCollect(); + void GarbageCollect(); ////////////////////////////////////////////////////////////////////////// // Functions used by PoolAllocation template AZ_INLINE Page* PopFreePage(); - AZ_INLINE void PushFreePage(Page* page); - inline bool IsInStaticBlock(Page* page) + AZ_INLINE void PushFreePage(Page* page); + inline bool IsInStaticBlock(Page* page) { const char* staticBlockStart = reinterpret_cast(m_staticDataBlock); - const char* staticBlockEnd = staticBlockStart + m_numStaticPages*m_pageSize; + const char* staticBlockEnd = staticBlockStart + m_numStaticPages * m_pageSize; const char* pageAddress = reinterpret_cast(page); // all pages are the same size so we either in or out, no need to check the pageAddressEnd if (pageAddress > staticBlockStart && pageAddress < staticBlockEnd) @@ -247,33 +252,34 @@ namespace AZ return false; } } - inline Page* ConstructPage(size_t elementSize) + inline Page* ConstructPage(size_t elementSize) { AZ_Assert(m_isDynamic, "We run out of static pages (%d) and this is a static allocator!", m_numStaticPages); // We store the page struct at the end of the block char* memBlock; - memBlock = reinterpret_cast(m_pageAllocator->Allocate(m_pageSize, m_pageSize, 0, "AZSystem::ThreadPoolSchema::ConstructPage", __FILE__, __LINE__)); + memBlock = reinterpret_cast( + m_pageAllocator->Allocate(m_pageSize, m_pageSize, 0, "AZSystem::ThreadPoolSchema::ConstructPage", __FILE__, __LINE__)); size_t pageDataSize = m_pageSize - sizeof(Page); - Page* page = new(memBlock+pageDataSize)Page(m_threadPoolGetter()); + Page* page = new (memBlock + pageDataSize) Page(m_threadPoolGetter()); page->SetupFreeList(elementSize, pageDataSize); page->m_elementSize = static_cast(elementSize); page->m_maxNumElements = static_cast(pageDataSize / elementSize); return page; } - inline void FreePage(Page* page) + inline void FreePage(Page* page) { // TODO: It's optional if we want to check the guard value for corruption, since we are not going // to use this memory. Yet it might be useful to catch bugs. // We store the page struct at the end of the block char* memBlock = reinterpret_cast(page) - m_pageSize + sizeof(Page); - page->~Page(); // destroy the page + page->~Page(); // destroy the page m_pageAllocator->DeAllocate(memBlock); } - inline Page* PageFromAddress(void* address) + inline Page* PageFromAddress(void* address) { - char* memBlock = reinterpret_cast(reinterpret_cast(address) & ~static_cast(m_pageSize-1)); + char* memBlock = reinterpret_cast(reinterpret_cast(address) & ~static_cast(m_pageSize - 1)); memBlock += m_pageSize - sizeof(Page); Page* page = reinterpret_cast(memBlock); if (!page->m_magic.Validate()) @@ -292,18 +298,18 @@ namespace AZ // Fox X64 we push/pop pages using the m_mutex to sync. Pages are using FreePagesType = Bucket::PageListType; - FreePagesType m_freePages; - AZStd::vector m_threads; ///< Array with all separate thread data. Used to traverse end free elements. - - IAllocatorAllocate* m_pageAllocator; - void* m_staticDataBlock; - size_t m_numStaticPages; - size_t m_pageSize; - size_t m_minAllocationSize; - size_t m_maxAllocationSize; - bool m_isDynamic; + FreePagesType m_freePages; + AZStd::vector m_threads; ///< Array with all separate thread data. Used to traverse end free elements. + + IAllocatorAllocate* m_pageAllocator; + void* m_staticDataBlock; + size_t m_numStaticPages; + size_t m_pageSize; + size_t m_minAllocationSize; + size_t m_maxAllocationSize; + bool m_isDynamic; // TODO rbbaklov Changed to recursive_mutex from mutex for Linux support. - AZStd::recursive_mutex m_mutex; + AZStd::recursive_mutex m_mutex; }; struct ThreadPoolData @@ -315,1090 +321,1088 @@ namespace AZ using AllocatorType = PoolAllocation; /** - * Stack with freed elements from other threads. We don't need stamped stack since the ABA problem can not - * happen here. We push from many threads and pop from only one (we don't push from it). - */ - using FreedElementsStack = AZStd::lock_free_intrusive_stack>; + * Stack with freed elements from other threads. We don't need stamped stack since the ABA problem can not + * happen here. We push from many threads and pop from only one (we don't push from it). + */ + using FreedElementsStack = AZStd::lock_free_intrusive_stack< + ThreadPoolSchemaImpl::Page::FakeNodeLF, + AZStd::lock_free_intrusive_stack_base_hook>; - AllocatorType m_allocator; - FreedElementsStack m_freedElements; + AllocatorType m_allocator; + FreedElementsStack m_freedElements; }; -} - -using namespace AZ; - -//========================================================================= -// PoolAllocation -// [9/09/2009] -//========================================================================= -template -PoolAllocation::PoolAllocation(Allocator* alloc, size_t pageSize, size_t minAllocationSize, size_t maxAllocationSize) - : m_allocator(alloc) - , m_pageSize(pageSize) - , m_numBytesAllocated(0) -{ - AZ_Assert(alloc->m_pageAllocator, "We need the page allocator setup!"); - AZ_Assert(pageSize >= maxAllocationSize * 4, "We need to fit at least 4 objects in a pool! Increase your page size! Page %d MaxAllocationSize %d",pageSize,maxAllocationSize); - AZ_Assert(minAllocationSize == maxAllocationSize || ((minAllocationSize)&(minAllocationSize - 1)) == 0, "Min allocation should be either equal to max allocation size or power of two"); - - m_minAllocationSize = AZ::GetMax(minAllocationSize, size_t(8)); - m_maxAllocationSize = AZ::GetMax(maxAllocationSize, minAllocationSize); +} // namespace AZ - m_minAllocationShift = 0; - for (size_t i = 1; i < sizeof(unsigned int)*8; i++) +namespace AZ +{ + //========================================================================= + // PoolAllocation + // [9/09/2009] + //========================================================================= + template + PoolAllocation::PoolAllocation(Allocator* alloc, size_t pageSize, size_t minAllocationSize, size_t maxAllocationSize) + : m_allocator(alloc) + , m_pageSize(pageSize) + , m_numBytesAllocated(0) { - if (m_minAllocationSize >> i == 0) + AZ_Assert(alloc->m_pageAllocator, "We need the page allocator setup!"); + AZ_Assert( + pageSize >= maxAllocationSize * 4, + "We need to fit at least 4 objects in a pool! Increase your page size! Page %d MaxAllocationSize %d", pageSize, + maxAllocationSize); + AZ_Assert( + minAllocationSize == maxAllocationSize || ((minAllocationSize) & (minAllocationSize - 1)) == 0, + "Min allocation should be either equal to max allocation size or power of two"); + + m_minAllocationSize = AZ::GetMax(minAllocationSize, size_t(8)); + m_maxAllocationSize = AZ::GetMax(maxAllocationSize, minAllocationSize); + + m_minAllocationShift = 0; + for (size_t i = 1; i < sizeof(unsigned int) * 8; i++) { - m_minAllocationShift = i-1; - break; + if (m_minAllocationSize >> i == 0) + { + m_minAllocationShift = i - 1; + break; + } + } + + AZ_Assert( + m_maxAllocationSize % m_minAllocationSize == 0, + "You need to be able to divide m_maxAllocationSize (%d) / m_minAllocationSize (%d) without fraction!", m_maxAllocationSize, + m_minAllocationSize); + m_numBuckets = m_maxAllocationSize / m_minAllocationSize; + AZ_Assert(m_numBuckets <= 0xffff, "You can't have more than 65535 number of buckets! We need to increase the index size!"); + m_buckets = reinterpret_cast( + alloc->m_pageAllocator->Allocate(sizeof(BucketType) * m_numBuckets, AZStd::alignment_of::value)); + for (size_t i = 0; i < m_numBuckets; ++i) + { + new (m_buckets + i) BucketType(); } } - AZ_Assert(m_maxAllocationSize % m_minAllocationSize == 0, "You need to be able to divide m_maxAllocationSize (%d) / m_minAllocationSize (%d) without fraction!", m_maxAllocationSize, m_minAllocationSize); - m_numBuckets = m_maxAllocationSize / m_minAllocationSize; - AZ_Assert(m_numBuckets <= 0xffff, "You can't have more than 65535 number of buckets! We need to increase the index size!"); - m_buckets = reinterpret_cast(alloc->m_pageAllocator->Allocate(sizeof(BucketType)*m_numBuckets, AZStd::alignment_of::value)); - for (size_t i = 0; i < m_numBuckets; ++i) + //========================================================================= + // ~PoolAllocation + // [9/09/2009] + //========================================================================= + template + PoolAllocation::~PoolAllocation() { - new(m_buckets + i)BucketType(); + GarbageCollect(true); + + for (size_t i = 0; i < m_numBuckets; ++i) + { + m_buckets[i].~BucketType(); + } + m_allocator->m_pageAllocator->DeAllocate(m_buckets, sizeof(BucketType) * m_numBuckets); } -} - -//========================================================================= -// ~PoolAllocation -// [9/09/2009] -//========================================================================= -template -PoolAllocation::~PoolAllocation() -{ - GarbageCollect(true); - for (size_t i = 0; i < m_numBuckets; ++i) + //========================================================================= + // Allocate + // [9/09/2009] + //========================================================================= + template + AZ_INLINE void* PoolAllocation::Allocate(size_t byteSize, size_t alignment) { - m_buckets[i].~BucketType(); - } - m_allocator->m_pageAllocator->DeAllocate(m_buckets, sizeof(BucketType) * m_numBuckets); -} - -//========================================================================= -// Allocate -// [9/09/2009] -//========================================================================= -template -AZ_INLINE void* -PoolAllocation::Allocate(size_t byteSize, size_t alignment) -{ - AZ_Assert(byteSize>0, "You can not allocate 0 bytes!"); - AZ_Assert(alignment>0&&(alignment&(alignment-1))==0, "Alignment must be >0 and power of 2!"); + AZ_Assert(byteSize > 0, "You can not allocate 0 bytes!"); + AZ_Assert(alignment > 0 && (alignment & (alignment - 1)) == 0, "Alignment must be >0 and power of 2!"); - // pad the size to the min allocation size. - byteSize = AZ::SizeAlignUp(byteSize, m_minAllocationSize); - byteSize = AZ::SizeAlignUp(byteSize, alignment); + // pad the size to the min allocation size. + byteSize = AZ::SizeAlignUp(byteSize, m_minAllocationSize); + byteSize = AZ::SizeAlignUp(byteSize, alignment); - if (byteSize > m_maxAllocationSize) - { - AZ_Assert(false, "Allocation size (%d) is too big (max: %d) for pools!", byteSize, m_maxAllocationSize); - return nullptr; + if (byteSize > m_maxAllocationSize) + { + AZ_Assert(false, "Allocation size (%d) is too big (max: %d) for pools!", byteSize, m_maxAllocationSize); + return nullptr; + } + + u32 bucketIndex = static_cast((byteSize >> m_minAllocationShift) - 1); + BucketType& bucket = m_buckets[bucketIndex]; + PageType* page = nullptr; + if (!bucket.m_pages.empty()) + { + page = &bucket.m_pages.front(); + + // check if we have free slot in the page + if (page->m_freeList.empty()) + { + page = nullptr; + } + else if (page->m_freeList.size() == 1) + { + // if we have only 1 free slot this allocation will + // fill the page, so put in on the back + bucket.m_pages.pop_front(); + bucket.m_pages.push_back(*page); + } + } + if (!page) + { + page = m_allocator->PopFreePage(); + if (page) + { + // We have any pages available on free page stack. + if (page->m_bin != bucketIndex) // if this page was used the same bucket we are ready to roll. + { + size_t elementSize = byteSize; + size_t pageDataSize = m_pageSize - sizeof(PageType); + page->SetupFreeList(elementSize, pageDataSize); + page->m_bin = bucketIndex; + page->m_elementSize = static_cast(elementSize); + page->m_maxNumElements = static_cast(pageDataSize / elementSize); + } + } + else + { + // We need to align each page on it's size, this way we can quickly find which page the pointer belongs to. + page = m_allocator->ConstructPage(byteSize); + page->m_bin = bucketIndex; + } + bucket.m_pages.push_front(*page); + } + + // The data address and the fake node address are shared. + void* address = &page->m_freeList.front(); + page->m_freeList.pop_front(); + + m_numBytesAllocated += byteSize; + + return address; } - u32 bucketIndex = static_cast((byteSize >> m_minAllocationShift)-1); - BucketType& bucket = m_buckets[bucketIndex]; - PageType* page = nullptr; - if (!bucket.m_pages.empty()) + //========================================================================= + // DeAllocate + // [9/09/2009] + //========================================================================= + template + AZ_INLINE void PoolAllocation::DeAllocate(void* ptr) { - page = &bucket.m_pages.front(); + PageType* page = m_allocator->PageFromAddress(ptr); + if (page == nullptr) + { + AZ_Error("Memory", false, "Address 0x%08x is not in the ThreadPool!", ptr); + return; + } - // check if we have free slot in the page - if (page->m_freeList.empty()) + // (pageSize - info struct at the end) / (element size) + size_t maxElementsPerBucket = page->m_maxNumElements; + + size_t numFreeNodes = page->m_freeList.size(); + typename PageType::FakeNode* node = new (ptr) typename PageType::FakeNode(); + page->m_freeList.push_front(*node); + + if (numFreeNodes == 0) { - page = nullptr; + // if the page was full before sort at the front + BucketType& bucket = m_buckets[page->m_bin]; + bucket.m_pages.erase(*page); + bucket.m_pages.push_front(*page); } - else if (page->m_freeList.size()==1) + else if (numFreeNodes == maxElementsPerBucket - 1) { - // if we have only 1 free slot this allocation will - // fill the page, so put in on the back - bucket.m_pages.pop_front(); - bucket.m_pages.push_back(*page); + // push to the list of free pages + BucketType& bucket = m_buckets[page->m_bin]; + PageType* frontPage = &bucket.m_pages.front(); + if (frontPage != page) + { + bucket.m_pages.erase(*page); + // check if the front page is full if so push the free page to the front otherwise push + // push it on the free pages list so it can be reused by other bins. + if (frontPage->m_freeList.empty()) + { + bucket.m_pages.push_front(*page); + } + else + { + m_allocator->PushFreePage(page); + } + } + else if (frontPage->m_next != nullptr) + { + // if the next page has free slots free the current page + if (frontPage->m_next->m_freeList.size() < maxElementsPerBucket) + { + bucket.m_pages.erase(*page); + m_allocator->PushFreePage(page); + } + } } + + m_numBytesAllocated -= page->m_elementSize; } - if (!page) + + //========================================================================= + // AllocationSize + // [11/22/2010] + //========================================================================= + template + AZ_INLINE size_t PoolAllocation::AllocationSize(void* ptr) { - page = m_allocator->PopFreePage(); + PageType* page = m_allocator->PageFromAddress(ptr); + size_t elementSize; if (page) { - // We have any pages available on free page stack. - if (page->m_bin != bucketIndex) // if this page was used the same bucket we are ready to roll. + elementSize = page->m_elementSize; + } + else + { + elementSize = 0; + } + + return elementSize; + } + + //========================================================================= + // GarbageCollect + // [3/1/2012] + //========================================================================= + template + AZ_INLINE void PoolAllocation::GarbageCollect(bool isForceFreeAllPages) + { + // Free empty pages in the buckets (or better be empty) + for (unsigned int i = 0; i < (unsigned int)m_numBuckets; ++i) + { + // (pageSize - info struct at the end) / (element size) + size_t maxElementsPerBucket = (m_pageSize - sizeof(PageType)) / ((i + 1) << m_minAllocationShift); + + typename BucketType::PageListType& pages = m_buckets[i].m_pages; + while (!pages.empty()) { - size_t elementSize = byteSize; - size_t pageDataSize = m_pageSize - sizeof(PageType); - page->SetupFreeList(elementSize, pageDataSize); - page->m_bin = bucketIndex; - page->m_elementSize = static_cast(elementSize); - page->m_maxNumElements = static_cast(pageDataSize / elementSize); + PageType& page = pages.front(); + pages.pop_front(); + if (page.m_freeList.size() == maxElementsPerBucket || isForceFreeAllPages) + { + if (!m_allocator->IsInStaticBlock(&page)) + { + m_allocator->FreePage(&page); + } + else + { + m_allocator->PushFreePage(&page); + } + } } } - else + } + + ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////// + // PollAllocator + ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////// + + //========================================================================= + // PoolSchema + // [9/15/2009] + //========================================================================= + PoolSchema::PoolSchema(const Descriptor& desc) + : m_impl(nullptr) + { + (void)desc; // ignored here, applied in Create() + } + + //========================================================================= + // ~PoolSchema + // [9/15/2009] + //========================================================================= + PoolSchema::~PoolSchema() + { + AZ_Assert(m_impl == nullptr, "You did not destroy the pool schema!"); + delete m_impl; + } + + //========================================================================= + // Create + // [9/15/2009] + //========================================================================= + bool PoolSchema::Create(const Descriptor& desc) + { + AZ_Assert(m_impl == nullptr, "PoolSchema already created!"); + if (m_impl == nullptr) { - // We need to align each page on it's size, this way we can quickly find which page the pointer belongs to. - page = m_allocator->ConstructPage(byteSize); - page->m_bin = bucketIndex; + m_impl = aznew PoolSchemaImpl(desc); } - bucket.m_pages.push_front(*page); + return (m_impl != nullptr); } - // The data address and the fake node address are shared. - void* address = &page->m_freeList.front(); - page->m_freeList.pop_front(); + //========================================================================= + // ~Destroy + // [9/15/2009] + //========================================================================= + bool PoolSchema::Destroy() + { + delete m_impl; + m_impl = nullptr; + return true; + } - m_numBytesAllocated += byteSize; + //========================================================================= + // Allocate + // [9/15/2009] + //========================================================================= + PoolSchema::pointer_type PoolSchema::Allocate( + size_type byteSize, + size_type alignment, + int flags, + const char* name, + const char* fileName, + int lineNum, + unsigned int suppressStackRecord) + { + (void)flags; + (void)name; + (void)fileName; + (void)lineNum; + (void)suppressStackRecord; + return m_impl->Allocate(byteSize, alignment); + } - return address; -} + //========================================================================= + // DeAllocate + // [9/15/2009] + //========================================================================= + void PoolSchema::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) + { + (void)byteSize; + (void)alignment; + m_impl->DeAllocate(ptr); + } -//========================================================================= -// DeAllocate -// [9/09/2009] -//========================================================================= -template -AZ_INLINE void -PoolAllocation::DeAllocate(void* ptr) -{ - PageType* page = m_allocator->PageFromAddress(ptr); - if (page==nullptr) + //========================================================================= + // Resize + // [10/14/2018] + //========================================================================= + PoolSchema::size_type PoolSchema::Resize(pointer_type ptr, size_type newSize) { - AZ_Error("Memory", false, "Address 0x%08x is not in the ThreadPool!", ptr); - return; + (void)ptr; + (void)newSize; + return 0; // unsupported } - // (pageSize - info struct at the end) / (element size) - size_t maxElementsPerBucket = page->m_maxNumElements; + //========================================================================= + // ReAllocate + // [10/14/2018] + //========================================================================= + PoolSchema::pointer_type PoolSchema::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) + { + (void)ptr; + (void)newSize; + (void)newAlignment; + AZ_Assert(false, "unsupported"); - size_t numFreeNodes = page->m_freeList.size(); - typename PageType::FakeNode* node = new(ptr) typename PageType::FakeNode(); - page->m_freeList.push_front(*node); + return ptr; + } - if (numFreeNodes==0) + //========================================================================= + // AllocationSize + // [11/22/2010] + //========================================================================= + PoolSchema::size_type PoolSchema::AllocationSize(pointer_type ptr) { - // if the page was full before sort at the front - BucketType& bucket = m_buckets[page->m_bin]; - bucket.m_pages.erase(*page); - bucket.m_pages.push_front(*page); + return m_impl->AllocationSize(ptr); } - else if (numFreeNodes == maxElementsPerBucket-1) + + //========================================================================= + // DeAllocate + // [9/15/2009] + //========================================================================= + void PoolSchema::GarbageCollect() { - // push to the list of free pages - BucketType& bucket = m_buckets[page->m_bin]; - PageType* frontPage = &bucket.m_pages.front(); - if (frontPage != page) + // External requests for garbage collection may come from any thread, and the + // garbage collection operation isn't threadsafe, which can lead to crashes. + // + // Due to the low memory consumption of this allocator in practice on Dragonfly + // (~3kb) it makes sense to not bother with garbage collection and leave it to + // occur exclusively in the destruction of the allocator. + // + // TODO: A better solution needs to be found for integrating back into mainline + // Open 3D Engine. + // m_impl->GarbageCollect(); + } + + auto PoolSchema::GetMaxContiguousAllocationSize() const -> size_type + { + return m_impl->m_allocator.m_maxAllocationSize; + } + + //========================================================================= + // NumAllocatedBytes + // [11/1/2010] + //========================================================================= + PoolSchema::size_type PoolSchema::NumAllocatedBytes() const + { + return m_impl->m_allocator.m_numBytesAllocated; + } + + //========================================================================= + // Capacity + // [11/1/2010] + //========================================================================= + PoolSchema::size_type PoolSchema::Capacity() const + { + return m_impl->m_numStaticPages * m_impl->m_pageSize; + } + + //========================================================================= + // GetPageAllocator + // [11/17/2010] + //========================================================================= + IAllocatorAllocate* PoolSchema::GetSubAllocator() + { + return m_impl->m_pageAllocator; + } + + ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////// + // PollAllocator Implementation + ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////// + + //========================================================================= + // PoolSchemaImpl + // [9/15/2009] + //========================================================================= + PoolSchemaImpl::PoolSchemaImpl(const PoolSchema::Descriptor& desc) + : m_pageAllocator(desc.m_pageAllocator ? desc.m_pageAllocator : &AllocatorInstance::Get()) + , m_allocator(this, desc.m_pageSize, desc.m_minAllocationSize, desc.m_maxAllocationSize) + , m_staticDataBlock(nullptr) + , m_numStaticPages(desc.m_numStaticPages) + , m_isDynamic(desc.m_isDynamic) + , m_pageSize(desc.m_pageSize) + { + if (m_numStaticPages) { - bucket.m_pages.erase(*page); - // check if the front page is full if so push the free page to the front otherwise push - // push it on the free pages list so it can be reused by other bins. - if (frontPage->m_freeList.empty()) - { - bucket.m_pages.push_front(*page); - } - else + // We store the page struct at the end of the block + char* memBlock = reinterpret_cast(m_pageAllocator->Allocate( + m_pageSize * m_numStaticPages, m_pageSize, 0, "AZSystem::PoolAllocation::Page static array", __FILE__, __LINE__)); + m_staticDataBlock = memBlock; + size_t pageDataSize = m_pageSize - sizeof(Page); + for (unsigned int i = 0; i < m_numStaticPages; ++i) { - m_allocator->PushFreePage(page); + Page* page = new (memBlock + pageDataSize) Page(); + page->m_bin = 0xffffffff; + page->m_elementSize = 0; + page->m_maxNumElements = 0; + PushFreePage(page); + memBlock += m_pageSize; } } - else if (frontPage->m_next != nullptr) + } + + //========================================================================= + // ~PoolSchemaImpl + // [9/15/2009] + //========================================================================= + PoolSchemaImpl::~PoolSchemaImpl() + { + // Force free all pages + m_allocator.GarbageCollect(true); + + // Free all unused memory + GarbageCollect(); + + if (m_staticDataBlock) { - // if the next page has free slots free the current page - if (frontPage->m_next->m_freeList.size() < maxElementsPerBucket) + while (!m_freePages.empty()) { - bucket.m_pages.erase(*page); - m_allocator->PushFreePage(page); + Page* page = &m_freePages.front(); + (void)page; + m_freePages.pop_front(); + AZ_Assert(IsInStaticBlock(page), "All dynamic pages should be deleted by now!"); + }; + + char* memBlock = reinterpret_cast(m_staticDataBlock); + size_t pageDataSize = m_pageSize - sizeof(Page); + for (unsigned int i = 0; i < m_numStaticPages; ++i) + { + Page* page = reinterpret_cast(memBlock + pageDataSize); + page->~Page(); + memBlock += m_pageSize; } + m_pageAllocator->DeAllocate(m_staticDataBlock); } } - m_numBytesAllocated -= page->m_elementSize; -} + //========================================================================= + // Allocate + // [9/15/2009] + //========================================================================= + PoolSchema::pointer_type PoolSchemaImpl::Allocate(PoolSchema::size_type byteSize, PoolSchema::size_type alignment, int flags) + { + // AZ_Warning("Memory",m_ownerThread==AZStd::this_thread::get_id(),"You can't allocation from a different context/thread, use + // ThreadPoolAllocator!"); + (void)flags; + void* address = m_allocator.Allocate(byteSize, alignment); + return address; + } -//========================================================================= -// AllocationSize -// [11/22/2010] -//========================================================================= -template -AZ_INLINE size_t -PoolAllocation::AllocationSize(void* ptr) -{ - PageType* page = m_allocator->PageFromAddress(ptr); - size_t elementSize; - if (page) + //========================================================================= + // DeAllocate + // [9/15/2009] + //========================================================================= + void PoolSchemaImpl::DeAllocate(PoolSchema::pointer_type ptr) { - elementSize = page->m_elementSize; + // AZ_Warning("Memory",m_ownerThread==AZStd::this_thread::get_id(),"You can't deallocate from a different context/thread, use + // ThreadPoolAllocator!"); + m_allocator.DeAllocate(ptr); } - else + + //========================================================================= + // AllocationSize + // [11/22/2010] + //========================================================================= + PoolSchema::size_type PoolSchemaImpl::AllocationSize(PoolSchema::pointer_type ptr) { - elementSize = 0; + // AZ_Warning("Memory",m_ownerThread==AZStd::this_thread::get_id(),"You can't use PoolAllocator from a different context/thread, use + // ThreadPoolAllocator!"); + return m_allocator.AllocationSize(ptr); } - return elementSize; -} + //========================================================================= + // Pop + // [9/15/2009] + //========================================================================= + AZ_FORCE_INLINE PoolSchemaImpl::Page* PoolSchemaImpl::PopFreePage() + { + Page* page = nullptr; + if (!m_freePages.empty()) + { + page = &m_freePages.front(); + m_freePages.pop_front(); + } + return page; + } -//========================================================================= -// GarbageCollect -// [3/1/2012] -//========================================================================= -template -AZ_INLINE void -PoolAllocation::GarbageCollect(bool isForceFreeAllPages) -{ - // Free empty pages in the buckets (or better be empty) - for (unsigned int i = 0; i < (unsigned int)m_numBuckets; ++i) + //========================================================================= + // Push + // [9/15/2009] + //========================================================================= + AZ_INLINE void PoolSchemaImpl::PushFreePage(Page* page) { - // (pageSize - info struct at the end) / (element size) - size_t maxElementsPerBucket = (m_pageSize - sizeof(PageType)) / ((i+1) << m_minAllocationShift); + m_freePages.push_front(*page); + } - typename BucketType::PageListType& pages = m_buckets[i].m_pages; - while (!pages.empty()) + //========================================================================= + // PurgePages + // [9/11/2009] + //========================================================================= + void PoolSchemaImpl::GarbageCollect() + { + // if( m_ownerThread == AZStd::this_thread::get_id() ) { - PageType& page = pages.front(); - pages.pop_front(); - if (page.m_freeList.size()==maxElementsPerBucket || isForceFreeAllPages) + if (m_isDynamic) { - if (!m_allocator->IsInStaticBlock(&page)) + m_allocator.GarbageCollect(); + + Bucket::PageListType staticPages; + while (!m_freePages.empty()) { - m_allocator->FreePage(&page); + Page* page = &m_freePages.front(); + m_freePages.pop_front(); + if (IsInStaticBlock(page)) + { + staticPages.push_front(*page); + } + else + { + FreePage(page); + } } - else + + while (!staticPages.empty()) { - m_allocator->PushFreePage(&page); + Page* page = &staticPages.front(); + staticPages.pop_front(); + m_freePages.push_front(*page); } } } } -} - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -// PollAllocator -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - -//========================================================================= -// PoolSchema -// [9/15/2009] -//========================================================================= -PoolSchema::PoolSchema(const Descriptor& desc) - : m_impl(nullptr) -{ - (void)desc; // ignored here, applied in Create() -} - -//========================================================================= -// ~PoolSchema -// [9/15/2009] -//========================================================================= -PoolSchema::~PoolSchema() -{ - AZ_Assert(m_impl==nullptr, "You did not destroy the pool schema!"); - delete m_impl; -} - -//========================================================================= -// Create -// [9/15/2009] -//========================================================================= -bool PoolSchema::Create(const Descriptor& desc) -{ - AZ_Assert(m_impl==nullptr, "PoolSchema already created!"); - if (m_impl == nullptr) - { - m_impl = aznew PoolSchemaImpl(desc); - } - return (m_impl!=nullptr); -} - -//========================================================================= -// ~Destroy -// [9/15/2009] -//========================================================================= -bool PoolSchema::Destroy() -{ - delete m_impl; - m_impl = nullptr; - return true; -} - -//========================================================================= -// Allocate -// [9/15/2009] -//========================================================================= -PoolSchema::pointer_type -PoolSchema::Allocate(size_type byteSize, size_type alignment, int flags, const char* name, const char* fileName, int lineNum, unsigned int suppressStackRecord) -{ - (void)flags; - (void)name; - (void)fileName; - (void)lineNum; - (void)suppressStackRecord; - return m_impl->Allocate(byteSize, alignment); -} - -//========================================================================= -// DeAllocate -// [9/15/2009] -//========================================================================= -void -PoolSchema::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) -{ - (void)byteSize; - (void)alignment; - m_impl->DeAllocate(ptr); -} - -//========================================================================= -// Resize -// [10/14/2018] -//========================================================================= -PoolSchema::size_type -PoolSchema::Resize(pointer_type ptr, size_type newSize) -{ - (void)ptr; - (void)newSize; - return 0; // unsupported -} - -//========================================================================= -// ReAllocate -// [10/14/2018] -//========================================================================= -PoolSchema::pointer_type -PoolSchema::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) -{ - (void)ptr; - (void)newSize; - (void)newAlignment; - AZ_Assert(false, "unsupported"); - - return ptr; -} - -//========================================================================= -// AllocationSize -// [11/22/2010] -//========================================================================= -PoolSchema::size_type -PoolSchema::AllocationSize(pointer_type ptr) -{ - return m_impl->AllocationSize(ptr); -} - -//========================================================================= -// DeAllocate -// [9/15/2009] -//========================================================================= -void -PoolSchema::GarbageCollect() -{ - // External requests for garbage collection may come from any thread, and the - // garbage collection operation isn't threadsafe, which can lead to crashes. - // - // Due to the low memory consumption of this allocator in practice on Dragonfly - // (~3kb) it makes sense to not bother with garbage collection and leave it to - // occur exclusively in the destruction of the allocator. - // - // TODO: A better solution needs to be found for integrating back into mainline - // Open 3D Engine. - //m_impl->GarbageCollect(); -} - -auto PoolSchema::GetMaxContiguousAllocationSize() const -> size_type -{ - return m_impl->m_allocator.m_maxAllocationSize; -} - -//========================================================================= -// NumAllocatedBytes -// [11/1/2010] -//========================================================================= -PoolSchema::size_type -PoolSchema::NumAllocatedBytes() const -{ - return m_impl->m_allocator.m_numBytesAllocated; -} - -//========================================================================= -// Capacity -// [11/1/2010] -//========================================================================= -PoolSchema::size_type -PoolSchema::Capacity() const -{ - return m_impl->m_numStaticPages * m_impl->m_pageSize; -} - -//========================================================================= -// GetPageAllocator -// [11/17/2010] -//========================================================================= -IAllocatorAllocate* -PoolSchema::GetSubAllocator() -{ - return m_impl->m_pageAllocator; -} - - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -// PollAllocator Implementation -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - -//========================================================================= -// PoolSchemaImpl -// [9/15/2009] -//========================================================================= -PoolSchemaImpl::PoolSchemaImpl(const PoolSchema::Descriptor& desc) - : m_pageAllocator(desc.m_pageAllocator ? desc.m_pageAllocator : &AllocatorInstance::Get()) - , m_allocator(this, desc.m_pageSize, desc.m_minAllocationSize, desc.m_maxAllocationSize) - , m_staticDataBlock(nullptr) - , m_numStaticPages(desc.m_numStaticPages) - , m_isDynamic(desc.m_isDynamic) - , m_pageSize(desc.m_pageSize) -{ - if (m_numStaticPages) + + //========================================================================= + // SetupFreeList + // [9/09/2009] + //========================================================================= + AZ_FORCE_INLINE void PoolSchemaImpl::Page::SetupFreeList(size_t elementSize, size_t pageDataBlockSize) { - // We store the page struct at the end of the block - char* memBlock = reinterpret_cast(m_pageAllocator->Allocate(m_pageSize*m_numStaticPages, m_pageSize, 0, "AZSystem::PoolAllocation::Page static array", __FILE__, __LINE__)); - m_staticDataBlock = memBlock; - size_t pageDataSize = m_pageSize - sizeof(Page); - for (unsigned int i = 0; i < m_numStaticPages; ++i) + char* pageData = reinterpret_cast(this) - pageDataBlockSize; + m_freeList.clear(); + // setup free list + size_t numElements = pageDataBlockSize / elementSize; + for (unsigned int i = 0; i < numElements; ++i) { - Page* page = new(memBlock+pageDataSize)Page(); - page->m_bin = 0xffffffff; - page->m_elementSize = 0; - page->m_maxNumElements = 0; - PushFreePage(page); - memBlock += m_pageSize; + char* address = pageData + i * elementSize; + Page::FakeNode* node = new (address) Page::FakeNode(); + m_freeList.push_back(*node); } } -} -//========================================================================= -// ~PoolSchemaImpl -// [9/15/2009] -//========================================================================= -PoolSchemaImpl::~PoolSchemaImpl() -{ - // Force free all pages - m_allocator.GarbageCollect(true); + ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////// + // ThreadPoolSchema + ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////// - // Free all unused memory - GarbageCollect(); + //========================================================================= + // ThreadPoolSchema + // [9/15/2009] + //========================================================================= + ThreadPoolSchema::ThreadPoolSchema(GetThreadPoolData getThreadPoolData, SetThreadPoolData setThreadPoolData) + : m_impl(nullptr) + , m_threadPoolGetter(getThreadPoolData) + , m_threadPoolSetter(setThreadPoolData) + { + } - if (m_staticDataBlock) + //========================================================================= + // ~ThreadPoolSchema + // [9/15/2009] + //========================================================================= + ThreadPoolSchema::~ThreadPoolSchema() { - while (!m_freePages.empty()) - { - Page* page = &m_freePages.front(); - (void)page; - m_freePages.pop_front(); - AZ_Assert(IsInStaticBlock(page), "All dynamic pages should be deleted by now!"); - } - ; + AZ_Assert(m_impl == nullptr, "You did not destroy the thread pool schema!"); + delete m_impl; + } - char* memBlock = reinterpret_cast(m_staticDataBlock); - size_t pageDataSize = m_pageSize - sizeof(Page); - for (unsigned int i = 0; i < m_numStaticPages; ++i) + //========================================================================= + // Create + // [9/15/2009] + //========================================================================= + bool ThreadPoolSchema::Create(const Descriptor& desc) + { + AZ_Assert(m_impl == nullptr, "PoolSchema already created!"); + if (m_impl == nullptr) { - Page* page = reinterpret_cast(memBlock+pageDataSize); - page->~Page(); - memBlock += m_pageSize; + m_impl = aznew ThreadPoolSchemaImpl(desc, m_threadPoolGetter, m_threadPoolSetter); } - m_pageAllocator->DeAllocate(m_staticDataBlock); + return (m_impl != nullptr); } -} - -//========================================================================= -// Allocate -// [9/15/2009] -//========================================================================= -PoolSchema::pointer_type -PoolSchemaImpl::Allocate(PoolSchema::size_type byteSize, PoolSchema::size_type alignment, int flags) -{ - //AZ_Warning("Memory",m_ownerThread==AZStd::this_thread::get_id(),"You can't allocation from a different context/thread, use ThreadPoolAllocator!"); - (void)flags; - void* address = m_allocator.Allocate(byteSize, alignment); - return address; -} - -//========================================================================= -// DeAllocate -// [9/15/2009] -//========================================================================= -void -PoolSchemaImpl::DeAllocate(PoolSchema::pointer_type ptr) -{ - //AZ_Warning("Memory",m_ownerThread==AZStd::this_thread::get_id(),"You can't deallocate from a different context/thread, use ThreadPoolAllocator!"); - m_allocator.DeAllocate(ptr); -} - -//========================================================================= -// AllocationSize -// [11/22/2010] -//========================================================================= -PoolSchema::size_type -PoolSchemaImpl::AllocationSize(PoolSchema::pointer_type ptr) -{ - //AZ_Warning("Memory",m_ownerThread==AZStd::this_thread::get_id(),"You can't use PoolAllocator from a different context/thread, use ThreadPoolAllocator!"); - return m_allocator.AllocationSize(ptr); -} - -//========================================================================= -// Pop -// [9/15/2009] -//========================================================================= -AZ_FORCE_INLINE PoolSchemaImpl::Page* -PoolSchemaImpl::PopFreePage() -{ - Page* page = nullptr; - if (!m_freePages.empty()) + + //========================================================================= + // Destroy + // [9/15/2009] + //========================================================================= + bool ThreadPoolSchema::Destroy() { - page = &m_freePages.front(); - m_freePages.pop_front(); + delete m_impl; + m_impl = nullptr; + return true; } - return page; -} - -//========================================================================= -// Push -// [9/15/2009] -//========================================================================= -AZ_INLINE void -PoolSchemaImpl::PushFreePage(Page* page) -{ - m_freePages.push_front(*page); -} - -//========================================================================= -// PurgePages -// [9/11/2009] -//========================================================================= -void -PoolSchemaImpl::GarbageCollect() -{ - //if( m_ownerThread == AZStd::this_thread::get_id() ) + //========================================================================= + // Allocate + // [9/15/2009] + //========================================================================= + ThreadPoolSchema::pointer_type ThreadPoolSchema::Allocate( + size_type byteSize, + size_type alignment, + int flags, + const char* name, + const char* fileName, + int lineNum, + unsigned int suppressStackRecord) { - if (m_isDynamic) - { - m_allocator.GarbageCollect(); + (void)flags; + (void)name; + (void)fileName; + (void)lineNum; + (void)suppressStackRecord; + return m_impl->Allocate(byteSize, alignment); + } - Bucket::PageListType staticPages; - while (!m_freePages.empty()) - { - Page* page = &m_freePages.front(); - m_freePages.pop_front(); - if (IsInStaticBlock(page)) - { - staticPages.push_front(*page); - } - else - { - FreePage(page); - } - } + //========================================================================= + // DeAllocate + // [9/15/2009] + //========================================================================= + void ThreadPoolSchema::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) + { + (void)byteSize; + (void)alignment; + m_impl->DeAllocate(ptr); + } - while (!staticPages.empty()) - { - Page* page = &staticPages.front(); - staticPages.pop_front(); - m_freePages.push_front(*page); - } - } + //========================================================================= + // Resize + // [10/14/2018] + //========================================================================= + ThreadPoolSchema::size_type ThreadPoolSchema::Resize(pointer_type ptr, size_type newSize) + { + (void)ptr; + (void)newSize; + return 0; // unsupported } -} - -//========================================================================= -// SetupFreeList -// [9/09/2009] -//========================================================================= -AZ_FORCE_INLINE void -PoolSchemaImpl::Page::SetupFreeList(size_t elementSize, size_t pageDataBlockSize) -{ - char* pageData = reinterpret_cast(this) - pageDataBlockSize; - m_freeList.clear(); - // setup free list - size_t numElements = pageDataBlockSize / elementSize; - for (unsigned int i = 0; i < numElements; ++i) + + //========================================================================= + // ReAllocate + // [10/14/2018] + //========================================================================= + ThreadPoolSchema::pointer_type ThreadPoolSchema::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) { - char* address = pageData+i*elementSize; - Page::FakeNode* node = new(address) Page::FakeNode(); - m_freeList.push_back(*node); + (void)ptr; + (void)newSize; + (void)newAlignment; + AZ_Assert(false, "unsupported"); + + return ptr; } -} - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -// ThreadPoolSchema -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - -//========================================================================= -// ThreadPoolSchema -// [9/15/2009] -//========================================================================= -ThreadPoolSchema::ThreadPoolSchema(GetThreadPoolData getThreadPoolData, SetThreadPoolData setThreadPoolData) - : m_impl(nullptr) - , m_threadPoolGetter(getThreadPoolData) - , m_threadPoolSetter(setThreadPoolData) -{ -} -//========================================================================= -// ~ThreadPoolSchema -// [9/15/2009] -//========================================================================= -ThreadPoolSchema::~ThreadPoolSchema() -{ - AZ_Assert(m_impl==nullptr, "You did not destroy the thread pool schema!"); - delete m_impl; -} - -//========================================================================= -// Create -// [9/15/2009] -//========================================================================= -bool ThreadPoolSchema::Create(const Descriptor& desc) -{ - AZ_Assert(m_impl==nullptr, "PoolSchema already created!"); - if (m_impl == nullptr) + //========================================================================= + // AllocationSize + // [11/22/2010] + //========================================================================= + ThreadPoolSchema::size_type ThreadPoolSchema::AllocationSize(pointer_type ptr) { - m_impl = aznew ThreadPoolSchemaImpl(desc, m_threadPoolGetter, m_threadPoolSetter); + return m_impl->AllocationSize(ptr); } - return (m_impl!=nullptr); -} - -//========================================================================= -// Destroy -// [9/15/2009] -//========================================================================= -bool ThreadPoolSchema::Destroy() -{ - delete m_impl; - m_impl = nullptr; - return true; -} -//========================================================================= -// Allocate -// [9/15/2009] -//========================================================================= -ThreadPoolSchema::pointer_type -ThreadPoolSchema::Allocate(size_type byteSize, size_type alignment, int flags, const char* name, const char* fileName, int lineNum, unsigned int suppressStackRecord) -{ - (void)flags; - (void)name; - (void)fileName; - (void)lineNum; - (void)suppressStackRecord; - return m_impl->Allocate(byteSize, alignment); -} - -//========================================================================= -// DeAllocate -// [9/15/2009] -//========================================================================= -void -ThreadPoolSchema::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) -{ - (void)byteSize; - (void)alignment; - m_impl->DeAllocate(ptr); -} - -//========================================================================= -// Resize -// [10/14/2018] -//========================================================================= -ThreadPoolSchema::size_type -ThreadPoolSchema::Resize(pointer_type ptr, size_type newSize) -{ - (void)ptr; - (void)newSize; - return 0; // unsupported -} - -//========================================================================= -// ReAllocate -// [10/14/2018] -//========================================================================= -ThreadPoolSchema::pointer_type -ThreadPoolSchema::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) -{ - (void)ptr; - (void)newSize; - (void)newAlignment; - AZ_Assert(false, "unsupported"); - - return ptr; -} - -//========================================================================= -// AllocationSize -// [11/22/2010] -//========================================================================= -ThreadPoolSchema::size_type -ThreadPoolSchema::AllocationSize(pointer_type ptr) -{ - return m_impl->AllocationSize(ptr); -} - -//========================================================================= -// DeAllocate -// [9/15/2009] -//========================================================================= -void -ThreadPoolSchema::GarbageCollect() -{ - m_impl->GarbageCollect(); -} -auto ThreadPoolSchema::GetMaxContiguousAllocationSize() const -> size_type -{ - return m_impl->m_maxAllocationSize; -} - -//========================================================================= -// NumAllocatedBytes -// [11/1/2010] -//========================================================================= -ThreadPoolSchema::size_type -ThreadPoolSchema::NumAllocatedBytes() const -{ - size_type bytesAllocated = 0; + //========================================================================= + // DeAllocate + // [9/15/2009] + //========================================================================= + void ThreadPoolSchema::GarbageCollect() { - AZStd::lock_guard lock(m_impl->m_mutex); - for (size_t i = 0; i < m_impl->m_threads.size(); ++i) - { - bytesAllocated += m_impl->m_threads[i]->m_allocator.m_numBytesAllocated; - } + m_impl->GarbageCollect(); } - return bytesAllocated; -} - -//========================================================================= -// Capacity -// [11/1/2010] -//========================================================================= -ThreadPoolSchema::size_type -ThreadPoolSchema::Capacity() const -{ - return m_impl->m_numStaticPages * m_impl->m_pageSize; -} - -//========================================================================= -// GetPageAllocator -// [11/17/2010] -//========================================================================= -IAllocatorAllocate* -ThreadPoolSchema::GetSubAllocator() -{ - return m_impl->m_pageAllocator; -} - - -//========================================================================= -// ThreadPoolSchemaImpl -// [9/15/2009] -//========================================================================= -ThreadPoolSchemaImpl::ThreadPoolSchemaImpl(const ThreadPoolSchema::Descriptor& desc, ThreadPoolSchema::GetThreadPoolData threadPoolGetter, ThreadPoolSchema::SetThreadPoolData threadPoolSetter) - : m_threadPoolGetter(threadPoolGetter) - , m_threadPoolSetter(threadPoolSetter) - , m_pageAllocator(desc.m_pageAllocator) - , m_staticDataBlock(nullptr) - , m_numStaticPages(desc.m_numStaticPages) - , m_pageSize(desc.m_pageSize) - , m_minAllocationSize(desc.m_minAllocationSize) - , m_maxAllocationSize(desc.m_maxAllocationSize) - , m_isDynamic(desc.m_isDynamic) -{ -# if AZ_TRAIT_OS_HAS_CRITICAL_SECTION_SPIN_COUNT - // In memory allocation case (usually tools) we might have high contention, - // using spin lock will improve performance. - SetCriticalSectionSpinCount(m_mutex.native_handle(), 4000); -# endif - if (m_pageAllocator == nullptr) + auto ThreadPoolSchema::GetMaxContiguousAllocationSize() const -> size_type { - m_pageAllocator = &AllocatorInstance::Get(); // use the SystemAllocator if no page allocator is provided + return m_impl->m_maxAllocationSize; } - if (m_numStaticPages) + + //========================================================================= + // NumAllocatedBytes + // [11/1/2010] + //========================================================================= + ThreadPoolSchema::size_type ThreadPoolSchema::NumAllocatedBytes() const { - // We store the page struct at the end of the block - char* memBlock = reinterpret_cast(m_pageAllocator->Allocate(m_pageSize*m_numStaticPages, m_pageSize, 0, "AZSystem::ThreadPoolSchemaImpl::Page static array", __FILE__, __LINE__)); - m_staticDataBlock = memBlock; - size_t pageDataSize = m_pageSize - sizeof(Page); - for (unsigned int i = 0; i < m_numStaticPages; ++i) + size_type bytesAllocated = 0; { - Page* page = new(memBlock+pageDataSize)Page(m_threadPoolGetter()); - page->m_bin = 0xffffffff; - PushFreePage(page); - memBlock += m_pageSize; + AZStd::lock_guard lock(m_impl->m_mutex); + for (size_t i = 0; i < m_impl->m_threads.size(); ++i) + { + bytesAllocated += m_impl->m_threads[i]->m_allocator.m_numBytesAllocated; + } } + return bytesAllocated; } -} -//========================================================================= -// ~ThreadPoolSchemaImpl -// [9/15/2009] -//========================================================================= -ThreadPoolSchemaImpl::~ThreadPoolSchemaImpl() -{ - // clean up all the thread data. - // IMPORTANT: We assume/rely that all threads (except the calling one) are or will - // destroyed before you create another instance of the pool allocation. - // This should generally be ok since the all allocators are singletons. + //========================================================================= + // Capacity + // [11/1/2010] + //========================================================================= + ThreadPoolSchema::size_type ThreadPoolSchema::Capacity() const { - AZStd::lock_guard lock(m_mutex); - if (!m_threads.empty()) + return m_impl->m_numStaticPages * m_impl->m_pageSize; + } + + //========================================================================= + // GetPageAllocator + // [11/17/2010] + //========================================================================= + IAllocatorAllocate* ThreadPoolSchema::GetSubAllocator() + { + return m_impl->m_pageAllocator; + } + + //========================================================================= + // ThreadPoolSchemaImpl + // [9/15/2009] + //========================================================================= + ThreadPoolSchemaImpl::ThreadPoolSchemaImpl( + const ThreadPoolSchema::Descriptor& desc, + ThreadPoolSchema::GetThreadPoolData threadPoolGetter, + ThreadPoolSchema::SetThreadPoolData threadPoolSetter) + : m_threadPoolGetter(threadPoolGetter) + , m_threadPoolSetter(threadPoolSetter) + , m_pageAllocator(desc.m_pageAllocator) + , m_staticDataBlock(nullptr) + , m_numStaticPages(desc.m_numStaticPages) + , m_pageSize(desc.m_pageSize) + , m_minAllocationSize(desc.m_minAllocationSize) + , m_maxAllocationSize(desc.m_maxAllocationSize) + , m_isDynamic(desc.m_isDynamic) + { +#if AZ_TRAIT_OS_HAS_CRITICAL_SECTION_SPIN_COUNT + // In memory allocation case (usually tools) we might have high contention, + // using spin lock will improve performance. + SetCriticalSectionSpinCount(m_mutex.native_handle(), 4000); +#endif + + if (m_pageAllocator == nullptr) { - for (size_t i = 0; i < m_threads.size(); ++i) + m_pageAllocator = &AllocatorInstance::Get(); // use the SystemAllocator if no page allocator is provided + } + if (m_numStaticPages) + { + // We store the page struct at the end of the block + char* memBlock = reinterpret_cast(m_pageAllocator->Allocate( + m_pageSize * m_numStaticPages, m_pageSize, 0, "AZSystem::ThreadPoolSchemaImpl::Page static array", __FILE__, __LINE__)); + m_staticDataBlock = memBlock; + size_t pageDataSize = m_pageSize - sizeof(Page); + for (unsigned int i = 0; i < m_numStaticPages; ++i) { - if (m_threads[i]) - { - // Force free all pages - delete m_threads[i]; - } + Page* page = new (memBlock + pageDataSize) Page(m_threadPoolGetter()); + page->m_bin = 0xffffffff; + PushFreePage(page); + memBlock += m_pageSize; } - - /// reset the variable for the owner thread. - m_threadPoolSetter(nullptr); } } - GarbageCollect(); - - if (m_staticDataBlock) + //========================================================================= + // ~ThreadPoolSchemaImpl + // [9/15/2009] + //========================================================================= + ThreadPoolSchemaImpl::~ThreadPoolSchemaImpl() { - Page* page; + // clean up all the thread data. + // IMPORTANT: We assume/rely that all threads (except the calling one) are or will + // destroyed before you create another instance of the pool allocation. + // This should generally be ok since the all allocators are singletons. { AZStd::lock_guard lock(m_mutex); - while (!m_freePages.empty()) + if (!m_threads.empty()) { - page = &m_freePages.front(); - m_freePages.pop_front(); - AZ_Assert(IsInStaticBlock(page), "All dynamic pages should be free by now!"); + for (size_t i = 0; i < m_threads.size(); ++i) + { + if (m_threads[i]) + { + // Force free all pages + delete m_threads[i]; + } + } + + /// reset the variable for the owner thread. + m_threadPoolSetter(nullptr); } } - char* memBlock = reinterpret_cast(m_staticDataBlock); - size_t pageDataSize = m_pageSize - sizeof(Page); - for (unsigned int i = 0; i < m_numStaticPages; ++i) + GarbageCollect(); + + if (m_staticDataBlock) { - page = reinterpret_cast(memBlock+pageDataSize); - page->~Page(); - memBlock += m_pageSize; + Page* page; + { + AZStd::lock_guard lock(m_mutex); + while (!m_freePages.empty()) + { + page = &m_freePages.front(); + m_freePages.pop_front(); + AZ_Assert(IsInStaticBlock(page), "All dynamic pages should be free by now!"); + } + } + + char* memBlock = reinterpret_cast(m_staticDataBlock); + size_t pageDataSize = m_pageSize - sizeof(Page); + for (unsigned int i = 0; i < m_numStaticPages; ++i) + { + page = reinterpret_cast(memBlock + pageDataSize); + page->~Page(); + memBlock += m_pageSize; + } + m_pageAllocator->DeAllocate(m_staticDataBlock); } - m_pageAllocator->DeAllocate(m_staticDataBlock); } -} - -//========================================================================= -// Allocate -// [9/15/2009] -//========================================================================= -ThreadPoolSchema::pointer_type -ThreadPoolSchemaImpl::Allocate(ThreadPoolSchema::size_type byteSize, ThreadPoolSchema::size_type alignment, int flags) -{ - (void)flags; - - ThreadPoolData* threadData = m_threadPoolGetter(); - if (threadData == nullptr) + //========================================================================= + // Allocate + // [9/15/2009] + //========================================================================= + ThreadPoolSchema::pointer_type ThreadPoolSchemaImpl::Allocate( + ThreadPoolSchema::size_type byteSize, ThreadPoolSchema::size_type alignment, int flags) { - threadData = aznew ThreadPoolData(this, m_pageSize, m_minAllocationSize, m_maxAllocationSize); - m_threadPoolSetter(threadData); + (void)flags; + + ThreadPoolData* threadData = m_threadPoolGetter(); + + if (threadData == nullptr) { - AZStd::lock_guard lock(m_mutex); - m_threads.push_back(threadData); + threadData = aznew ThreadPoolData(this, m_pageSize, m_minAllocationSize, m_maxAllocationSize); + m_threadPoolSetter(threadData); + { + AZStd::lock_guard lock(m_mutex); + m_threads.push_back(threadData); + } } - } - else - { - // deallocate elements if they were freed from other threads - Page::FakeNodeLF* fakeLFNode; - while ((fakeLFNode = threadData->m_freedElements.pop())!=nullptr) + else { - threadData->m_allocator.DeAllocate(fakeLFNode); + // deallocate elements if they were freed from other threads + Page::FakeNodeLF* fakeLFNode; + while ((fakeLFNode = threadData->m_freedElements.pop()) != nullptr) + { + threadData->m_allocator.DeAllocate(fakeLFNode); + } } - } - return threadData->m_allocator.Allocate(byteSize, alignment); -} - -//========================================================================= -// DeAllocate -// [9/15/2009] -//========================================================================= -void -ThreadPoolSchemaImpl::DeAllocate(ThreadPoolSchema::pointer_type ptr) -{ - Page* page = PageFromAddress(ptr); - if (page==nullptr) - { - AZ_Error("Memory", false, "Address 0x%08x is not in the ThreadPool!", ptr); - return; + return threadData->m_allocator.Allocate(byteSize, alignment); } - AZ_Assert(page->m_threadData!=nullptr, ("We must have valid page thread data for the page!")); - ThreadPoolData* threadData = m_threadPoolGetter(); - if (threadData == page->m_threadData) - { - // we can free here - threadData->m_allocator.DeAllocate(ptr); - } - else + + //========================================================================= + // DeAllocate + // [9/15/2009] + //========================================================================= + void ThreadPoolSchemaImpl::DeAllocate(ThreadPoolSchema::pointer_type ptr) { - // push this element to be deleted from it's own thread! - // cast the pointer to a fake lock free node - Page::FakeNodeLF* fakeLFNode = reinterpret_cast(ptr); + Page* page = PageFromAddress(ptr); + if (page == nullptr) + { + AZ_Error("Memory", false, "Address 0x%08x is not in the ThreadPool!", ptr); + return; + } + AZ_Assert(page->m_threadData != nullptr, ("We must have valid page thread data for the page!")); + ThreadPoolData* threadData = m_threadPoolGetter(); + if (threadData == page->m_threadData) + { + // we can free here + threadData->m_allocator.DeAllocate(ptr); + } + else + { + // push this element to be deleted from it's own thread! + // cast the pointer to a fake lock free node + Page::FakeNodeLF* fakeLFNode = reinterpret_cast(ptr); #ifdef AZ_DEBUG_BUILD - // we need to reset the fakeLFNode because we share the memory. - // otherwise we will assert the node is in the list - fakeLFNode->m_next = 0; + // we need to reset the fakeLFNode because we share the memory. + // otherwise we will assert the node is in the list + fakeLFNode->m_next = 0; #endif - page->m_threadData->m_freedElements.push(*fakeLFNode); + page->m_threadData->m_freedElements.push(*fakeLFNode); + } } -} - -//========================================================================= -// AllocationSize -// [11/22/2010] -//========================================================================= -ThreadPoolSchema::size_type -ThreadPoolSchemaImpl::AllocationSize(ThreadPoolSchema::pointer_type ptr) -{ - Page* page = PageFromAddress(ptr); - if (page==nullptr) + + //========================================================================= + // AllocationSize + // [11/22/2010] + //========================================================================= + ThreadPoolSchema::size_type ThreadPoolSchemaImpl::AllocationSize(ThreadPoolSchema::pointer_type ptr) { - return 0; + Page* page = PageFromAddress(ptr); + if (page == nullptr) + { + return 0; + } + AZ_Assert(page->m_threadData != nullptr, ("We must have valid page thread data for the page!")); + return page->m_threadData->m_allocator.AllocationSize(ptr); } - AZ_Assert(page->m_threadData!=nullptr, ("We must have valid page thread data for the page!")); - return page->m_threadData->m_allocator.AllocationSize(ptr); -} - -//========================================================================= -// PopFreePage -// [9/15/2009] -//========================================================================= -AZ_INLINE ThreadPoolSchemaImpl::Page* -ThreadPoolSchemaImpl::PopFreePage() -{ - Page* page; + + //========================================================================= + // PopFreePage + // [9/15/2009] + //========================================================================= + AZ_INLINE ThreadPoolSchemaImpl::Page* ThreadPoolSchemaImpl::PopFreePage() { - AZStd::lock_guard lock(m_mutex); - if (m_freePages.empty()) + Page* page; { - page = nullptr; + AZStd::lock_guard lock(m_mutex); + if (m_freePages.empty()) + { + page = nullptr; + } + else + { + page = &m_freePages.front(); + m_freePages.pop_front(); + } } - else + if (page) { - page = &m_freePages.front(); - m_freePages.pop_front(); +#ifdef AZ_DEBUG_BUILD + AZ_Assert(page->m_threadData == 0, "If we stored the free page properly we should have null here!"); +#endif + // store the current thread data, used when we free elements + page->m_threadData = m_threadPoolGetter(); } + return page; } - if (page) + + //========================================================================= + // PushFreePage + // [9/15/2009] + //========================================================================= + AZ_INLINE void ThreadPoolSchemaImpl::PushFreePage(Page* page) { -# ifdef AZ_DEBUG_BUILD - AZ_Assert(page->m_threadData == 0, "If we stored the free page properly we should have null here!"); -# endif - // store the current thread data, used when we free elements - page->m_threadData = m_threadPoolGetter(); - } - return page; -} - -//========================================================================= -// PushFreePage -// [9/15/2009] -//========================================================================= -AZ_INLINE void -ThreadPoolSchemaImpl::PushFreePage(Page* page) -{ #ifdef AZ_DEBUG_BUILD - page->m_threadData = 0; + page->m_threadData = 0; #endif - { - AZStd::lock_guard lock(m_mutex); - m_freePages.push_front(*page); - } -} - -//========================================================================= -// GarbageCollect -// [9/15/2009] -//========================================================================= -void -ThreadPoolSchemaImpl::GarbageCollect() -{ - if (!m_isDynamic) - { - return; // we have the memory statically allocated, can't collect garbage. + { + AZStd::lock_guard lock(m_mutex); + m_freePages.push_front(*page); + } } - FreePagesType staticPages; - AZStd::lock_guard lock(m_mutex); - while (!m_freePages.empty()) + //========================================================================= + // GarbageCollect + // [9/15/2009] + //========================================================================= + void ThreadPoolSchemaImpl::GarbageCollect() { - Page* page = &m_freePages.front(); - m_freePages.pop_front(); - if (IsInStaticBlock(page)) + if (!m_isDynamic) { - staticPages.push_front(*page); + return; // we have the memory statically allocated, can't collect garbage. } - else + + FreePagesType staticPages; + AZStd::lock_guard lock(m_mutex); + while (!m_freePages.empty()) + { + Page* page = &m_freePages.front(); + m_freePages.pop_front(); + if (IsInStaticBlock(page)) + { + staticPages.push_front(*page); + } + else + { + FreePage(page); + } + } + while (!staticPages.empty()) { - FreePage(page); + Page* page = &staticPages.front(); + staticPages.pop_front(); + m_freePages.push_front(*page); } } - while (!staticPages.empty()) + + //========================================================================= + // SetupFreeList + // [9/15/2009] + //========================================================================= + inline void ThreadPoolSchemaImpl::Page::SetupFreeList(size_t elementSize, size_t pageDataBlockSize) { - Page* page = &staticPages.front(); - staticPages.pop_front(); - m_freePages.push_front(*page); + char* pageData = reinterpret_cast(this) - pageDataBlockSize; + m_freeList.clear(); + // setup free list + size_t numElements = pageDataBlockSize / elementSize; + for (size_t i = 0; i < numElements; ++i) + { + char* address = pageData + i * elementSize; + Page::FakeNode* node = new (address) Page::FakeNode(); + m_freeList.push_back(*node); + } } -} - -//========================================================================= -// SetupFreeList -// [9/15/2009] -//========================================================================= -inline void -ThreadPoolSchemaImpl::Page::SetupFreeList(size_t elementSize, size_t pageDataBlockSize) -{ - char* pageData = reinterpret_cast(this) - pageDataBlockSize; - m_freeList.clear(); - // setup free list - size_t numElements = pageDataBlockSize / elementSize; - for (size_t i = 0; i < numElements; ++i) + + //========================================================================= + // ThreadPoolData::ThreadPoolData + // [9/15/2009] + //========================================================================= + ThreadPoolData::ThreadPoolData(ThreadPoolSchemaImpl* alloc, size_t pageSize, size_t minAllocationSize, size_t maxAllocationSize) + : m_allocator(alloc, pageSize, minAllocationSize, maxAllocationSize) { - char* address = pageData+i*elementSize; - Page::FakeNode* node = new(address) Page::FakeNode(); - m_freeList.push_back(*node); } -} - -//========================================================================= -// ThreadPoolData::ThreadPoolData -// [9/15/2009] -//========================================================================= -ThreadPoolData::ThreadPoolData(ThreadPoolSchemaImpl* alloc, size_t pageSize, size_t minAllocationSize, size_t maxAllocationSize) - : m_allocator(alloc, pageSize, minAllocationSize, maxAllocationSize) -{} - -//========================================================================= -// ThreadPoolData::~ThreadPoolData -// [9/15/2009] -//========================================================================= -ThreadPoolData::~ThreadPoolData() -{ - // deallocate elements if they were freed from other threads - ThreadPoolSchemaImpl::Page::FakeNodeLF* fakeLFNode; - while ((fakeLFNode = m_freedElements.pop())!=nullptr) + + //========================================================================= + // ThreadPoolData::~ThreadPoolData + // [9/15/2009] + //========================================================================= + ThreadPoolData::~ThreadPoolData() { - m_allocator.DeAllocate(fakeLFNode); + // deallocate elements if they were freed from other threads + ThreadPoolSchemaImpl::Page::FakeNodeLF* fakeLFNode; + while ((fakeLFNode = m_freedElements.pop()) != nullptr) + { + m_allocator.DeAllocate(fakeLFNode); + } } -} + +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h index cfc5e3ea07..ef38dcf24f 100644 --- a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h @@ -5,8 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef AZ_POOL_ALLOCATION_SCHEME_H -#define AZ_POOL_ALLOCATION_SCHEME_H +#pragma once #include @@ -164,8 +163,3 @@ namespace AZ template AZ_THREAD_LOCAL ThreadPoolData* ThreadPoolSchemaHelper::m_threadData = 0; } - -#endif // AZ_POOL_ALLOCATION_SCHEME_H -#pragma once - - diff --git a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp index ddcc046b8e..15cf5de8bc 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp @@ -21,8 +21,8 @@ #define AZCORE_SYSTEM_ALLOCATOR_HEAP 3 #if !defined(AZCORE_SYSTEM_ALLOCATOR) - // define the default - #define AZCORE_SYSTEM_ALLOCATOR AZCORE_SYSTEM_ALLOCATOR_HPHA +// define the default +#define AZCORE_SYSTEM_ALLOCATOR AZCORE_SYSTEM_ALLOCATOR_HPHA #endif #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA @@ -35,12 +35,11 @@ #error "Invalid allocator selected for SystemAllocator" #endif - -using namespace AZ; - -////////////////////////////////////////////////////////////////////////// -// Globals - we use global storage for the first memory schema, since we can't use dynamic memory! -static bool g_isSystemSchemaUsed = false; +namespace AZ +{ + ////////////////////////////////////////////////////////////////////////// + // Globals - we use global storage for the first memory schema, since we can't use dynamic memory! + static bool g_isSystemSchemaUsed = false; #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA static AZStd::aligned_storage::value>::type g_systemSchema; #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC @@ -49,268 +48,275 @@ static bool g_isSystemSchemaUsed = false; static AZStd::aligned_storage::value>::type g_systemSchema; #endif -////////////////////////////////////////////////////////////////////////// - -//========================================================================= -// SystemAllocator -// [9/2/2009] -//========================================================================= -SystemAllocator::SystemAllocator() - : AllocatorBase(this, "SystemAllocator", "Fundamental generic memory allocator") - , m_isCustom(false) - , m_allocator(nullptr) - , m_ownsOSAllocator(false) -{ -} - -//========================================================================= -// ~SystemAllocator -//========================================================================= -SystemAllocator::~SystemAllocator() -{ - if (IsReady()) + ////////////////////////////////////////////////////////////////////////// + + //========================================================================= + // SystemAllocator + // [9/2/2009] + //========================================================================= + SystemAllocator::SystemAllocator() + : AllocatorBase(this, "SystemAllocator", "Fundamental generic memory allocator") + , m_isCustom(false) + , m_allocator(nullptr) + , m_ownsOSAllocator(false) { - Destroy(); - } -} - -//========================================================================= -// ~Create -// [9/2/2009] -//========================================================================= -bool -SystemAllocator::Create(const Descriptor& desc) -{ - AZ_Assert(IsReady() == false, "System allocator was already created!"); - if (IsReady()) - { - return false; } - m_desc = desc; - - if (!AllocatorInstance::IsReady()) + //========================================================================= + // ~SystemAllocator + //========================================================================= + SystemAllocator::~SystemAllocator() { - m_ownsOSAllocator = true; - AllocatorInstance::Create(); - } - bool isReady = false; - if (desc.m_custom) - { - m_isCustom = true; - m_allocator = desc.m_custom; - isReady = true; + if (IsReady()) + { + Destroy(); + } } - else + + //========================================================================= + // ~Create + // [9/2/2009] + //========================================================================= + bool SystemAllocator::Create(const Descriptor& desc) { - m_isCustom = false; -#if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - HphaSchema::Descriptor heapDesc; - heapDesc.m_pageSize = desc.m_heap.m_pageSize; - heapDesc.m_poolPageSize = desc.m_heap.m_poolPageSize; - AZ_Assert(desc.m_heap.m_numFixedMemoryBlocks <= 1, "We support max1 memory block at the moment!"); - if (desc.m_heap.m_numFixedMemoryBlocks > 0) + AZ_Assert(IsReady() == false, "System allocator was already created!"); + if (IsReady()) { - heapDesc.m_fixedMemoryBlock = desc.m_heap.m_fixedMemoryBlocks[0]; - heapDesc.m_fixedMemoryBlockByteSize = desc.m_heap.m_fixedMemoryBlocksByteSize[0]; + return false; } - heapDesc.m_subAllocator = desc.m_heap.m_subAllocator; - heapDesc.m_isPoolAllocations = desc.m_heap.m_isPoolAllocations; - // Fix SystemAllocator from growing in small chunks - heapDesc.m_systemChunkSize = desc.m_heap.m_systemChunkSize; -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - MallocSchema::Descriptor heapDesc; -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - HeapSchema::Descriptor heapDesc; - memcpy(heapDesc.m_memoryBlocks, desc.m_heap.m_memoryBlocks, sizeof(heapDesc.m_memoryBlocks)); - memcpy(heapDesc.m_memoryBlocksByteSize, desc.m_heap.m_memoryBlocksByteSize, sizeof(heapDesc.m_memoryBlocksByteSize)); - heapDesc.m_numMemoryBlocks = desc.m_heap.m_numMemoryBlocks; -#endif - if (&AllocatorInstance::Get() == this) // if we are the system allocator - { - AZ_Assert(!g_isSystemSchemaUsed, "AZ::SystemAllocator MUST be created first! It's the source of all allocations!"); -#if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - m_allocator = new(&g_systemSchema)HphaSchema(heapDesc); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - m_allocator = new(&g_systemSchema)MallocSchema(heapDesc); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - m_allocator = new(&g_systemSchema)HeapSchema(heapDesc); -#endif - g_isSystemSchemaUsed = true; + m_desc = desc; + + if (!AllocatorInstance::IsReady()) + { + m_ownsOSAllocator = true; + AllocatorInstance::Create(); + } + bool isReady = false; + if (desc.m_custom) + { + m_isCustom = true; + m_allocator = desc.m_custom; isReady = true; } else { - // this class should be inheriting from SystemAllocator - AZ_Assert(AllocatorInstance::IsReady(), "System allocator must be created before any other allocator! They allocate from it."); - + m_isCustom = false; #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - m_allocator = azcreate(HphaSchema, (heapDesc), SystemAllocator); + HphaSchema::Descriptor heapDesc; + heapDesc.m_pageSize = desc.m_heap.m_pageSize; + heapDesc.m_poolPageSize = desc.m_heap.m_poolPageSize; + AZ_Assert(desc.m_heap.m_numFixedMemoryBlocks <= 1, "We support max1 memory block at the moment!"); + if (desc.m_heap.m_numFixedMemoryBlocks > 0) + { + heapDesc.m_fixedMemoryBlock = desc.m_heap.m_fixedMemoryBlocks[0]; + heapDesc.m_fixedMemoryBlockByteSize = desc.m_heap.m_fixedMemoryBlocksByteSize[0]; + } + heapDesc.m_subAllocator = desc.m_heap.m_subAllocator; + heapDesc.m_isPoolAllocations = desc.m_heap.m_isPoolAllocations; + // Fix SystemAllocator from growing in small chunks + heapDesc.m_systemChunkSize = desc.m_heap.m_systemChunkSize; #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - m_allocator = azcreate(MallocSchema, (heapDesc), SystemAllocator); + MallocSchema::Descriptor heapDesc; #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - m_allocator = azcreate(HeapSchema, (heapDesc), SystemAllocator); + HeapSchema::Descriptor heapDesc; + memcpy(heapDesc.m_memoryBlocks, desc.m_heap.m_memoryBlocks, sizeof(heapDesc.m_memoryBlocks)); + memcpy(heapDesc.m_memoryBlocksByteSize, desc.m_heap.m_memoryBlocksByteSize, sizeof(heapDesc.m_memoryBlocksByteSize)); + heapDesc.m_numMemoryBlocks = desc.m_heap.m_numMemoryBlocks; #endif - if (m_allocator == nullptr) + if (&AllocatorInstance::Get() == this) // if we are the system allocator { - isReady = false; + AZ_Assert(!g_isSystemSchemaUsed, "AZ::SystemAllocator MUST be created first! It's the source of all allocations!"); + +#if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA + m_allocator = new (&g_systemSchema) HphaSchema(heapDesc); +#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC + m_allocator = new (&g_systemSchema) MallocSchema(heapDesc); +#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP + m_allocator = new (&g_systemSchema) HeapSchema(heapDesc); +#endif + g_isSystemSchemaUsed = true; + isReady = true; } else { - isReady = true; + // this class should be inheriting from SystemAllocator + AZ_Assert( + AllocatorInstance::IsReady(), + "System allocator must be created before any other allocator! They allocate from it."); + +#if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA + m_allocator = azcreate(HphaSchema, (heapDesc), SystemAllocator); +#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC + m_allocator = azcreate(MallocSchema, (heapDesc), SystemAllocator); +#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP + m_allocator = azcreate(HeapSchema, (heapDesc), SystemAllocator); +#endif + if (m_allocator == nullptr) + { + isReady = false; + } + else + { + isReady = true; + } } } - } - - return isReady; -} -//========================================================================= -// Allocate -// [9/2/2009] -//========================================================================= -void -SystemAllocator::Destroy() -{ - if (g_isSystemSchemaUsed) - { - int dummy; - (void)dummy; + return isReady; } - if (!m_isCustom) + //========================================================================= + // Allocate + // [9/2/2009] + //========================================================================= + void SystemAllocator::Destroy() { - if ((void*)m_allocator == (void*)&g_systemSchema) + if (g_isSystemSchemaUsed) { + int dummy; + (void)dummy; + } + + if (!m_isCustom) + { + if ((void*)m_allocator == (void*)&g_systemSchema) + { #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - static_cast(m_allocator)->~HphaSchema(); + static_cast(m_allocator)->~HphaSchema(); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - static_cast(m_allocator)->~MallocSchema(); + static_cast(m_allocator)->~MallocSchema(); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - static_cast(m_allocator)->~HeapSchema(); + static_cast(m_allocator)->~HeapSchema(); #endif - g_isSystemSchemaUsed = false; + g_isSystemSchemaUsed = false; + } + else + { + azdestroy(m_allocator); + } } - else + + if (m_ownsOSAllocator) { - azdestroy(m_allocator); + AllocatorInstance::Destroy(); + m_ownsOSAllocator = false; } } - if (m_ownsOSAllocator) + AllocatorDebugConfig SystemAllocator::GetDebugConfig() { - AllocatorInstance::Destroy(); - m_ownsOSAllocator = false; + return AllocatorDebugConfig() + .StackRecordLevels(m_desc.m_stackRecordLevels) + .UsesMemoryGuards(!m_isCustom) + .MarksUnallocatedMemory(!m_isCustom) + .ExcludeFromDebugging(!m_desc.m_allocationRecords); } -} -AllocatorDebugConfig SystemAllocator::GetDebugConfig() -{ - return AllocatorDebugConfig() - .StackRecordLevels(m_desc.m_stackRecordLevels) - .UsesMemoryGuards(!m_isCustom) - .MarksUnallocatedMemory(!m_isCustom) - .ExcludeFromDebugging(!m_desc.m_allocationRecords); -} - -IAllocatorAllocate* SystemAllocator::GetSchema() -{ - return m_allocator; -} - -//========================================================================= -// Allocate -// [9/2/2009] -//========================================================================= -SystemAllocator::pointer_type -SystemAllocator::Allocate(size_type byteSize, size_type alignment, int flags, const char* name, const char* fileName, int lineNum, unsigned int suppressStackRecord) -{ - if (byteSize == 0) + IAllocatorAllocate* SystemAllocator::GetSchema() { - return nullptr; + return m_allocator; } - AZ_Assert(byteSize > 0, "You can not allocate 0 bytes!"); - AZ_Assert((alignment & (alignment - 1)) == 0, "Alignment must be power of 2!"); - - byteSize = MemorySizeAdjustedUp(byteSize); - SystemAllocator::pointer_type address = m_allocator->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); - if (address == nullptr) + //========================================================================= + // Allocate + // [9/2/2009] + //========================================================================= + SystemAllocator::pointer_type SystemAllocator::Allocate( + size_type byteSize, + size_type alignment, + int flags, + const char* name, + const char* fileName, + int lineNum, + unsigned int suppressStackRecord) { - // Free all memory we can and try again! - AllocatorManager::Instance().GarbageCollect(); + if (byteSize == 0) + { + return nullptr; + } + AZ_Assert(byteSize > 0, "You can not allocate 0 bytes!"); + AZ_Assert((alignment & (alignment - 1)) == 0, "Alignment must be power of 2!"); - address = m_allocator->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); + byteSize = MemorySizeAdjustedUp(byteSize); + SystemAllocator::pointer_type address = + m_allocator->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); + + if (address == nullptr) + { + // Free all memory we can and try again! + AllocatorManager::Instance().GarbageCollect(); + + address = m_allocator->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); + } + + if (address == nullptr) + { + byteSize = MemorySizeAdjustedDown(byteSize); // restore original size + } + + AZ_Assert( + address != nullptr, "SystemAllocator: Failed to allocate %d bytes aligned on %d (flags: 0x%08x) %s : %s (%d)!", byteSize, + alignment, flags, name ? name : "(no name)", fileName ? fileName : "(no file name)", lineNum); + + AZ_PROFILE_MEMORY_ALLOC_EX(MemoryReserved, fileName, lineNum, address, byteSize, name); + AZ_MEMORY_PROFILE(ProfileAllocation(address, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1)); + + return address; } - if (address == nullptr) + //========================================================================= + // DeAllocate + // [9/2/2009] + //========================================================================= + void SystemAllocator::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) { - byteSize = MemorySizeAdjustedDown(byteSize); // restore original size + byteSize = MemorySizeAdjustedUp(byteSize); + AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); + AZ_MEMORY_PROFILE(ProfileDeallocation(ptr, byteSize, alignment, nullptr)); + m_allocator->DeAllocate(ptr, byteSize, alignment); } - AZ_Assert(address != nullptr, "SystemAllocator: Failed to allocate %d bytes aligned on %d (flags: 0x%08x) %s : %s (%d)!", byteSize, alignment, flags, name ? name : "(no name)", fileName ? fileName : "(no file name)", lineNum); + //========================================================================= + // ReAllocate + // [9/13/2011] + //========================================================================= + SystemAllocator::pointer_type SystemAllocator::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) + { + newSize = MemorySizeAdjustedUp(newSize); - AZ_PROFILE_MEMORY_ALLOC_EX(MemoryReserved, fileName, lineNum, address, byteSize, name); - AZ_MEMORY_PROFILE(ProfileAllocation(address, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1)); + AZ_MEMORY_PROFILE(ProfileReallocationBegin(ptr, newSize)); + AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); + pointer_type newAddress = m_allocator->ReAllocate(ptr, newSize, newAlignment); + AZ_PROFILE_MEMORY_ALLOC(MemoryReserved, newAddress, newSize, "SystemAllocator realloc"); + AZ_MEMORY_PROFILE(ProfileReallocationEnd(ptr, newAddress, newSize, newAlignment)); - return address; -} + return newAddress; + } -//========================================================================= -// DeAllocate -// [9/2/2009] -//========================================================================= -void -SystemAllocator::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) -{ - byteSize = MemorySizeAdjustedUp(byteSize); - AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); - AZ_MEMORY_PROFILE(ProfileDeallocation(ptr, byteSize, alignment, nullptr)); - m_allocator->DeAllocate(ptr, byteSize, alignment); -} - -//========================================================================= -// ReAllocate -// [9/13/2011] -//========================================================================= -SystemAllocator::pointer_type -SystemAllocator::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) -{ - newSize = MemorySizeAdjustedUp(newSize); - - AZ_MEMORY_PROFILE(ProfileReallocationBegin(ptr, newSize)); - AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); - pointer_type newAddress = m_allocator->ReAllocate(ptr, newSize, newAlignment); - AZ_PROFILE_MEMORY_ALLOC(MemoryReserved, newAddress, newSize, "SystemAllocator realloc"); - AZ_MEMORY_PROFILE(ProfileReallocationEnd(ptr, newAddress, newSize, newAlignment)); - - return newAddress; -} - -//========================================================================= -// Resize -// [8/12/2011] -//========================================================================= -SystemAllocator::size_type -SystemAllocator::Resize(pointer_type ptr, size_type newSize) -{ - newSize = MemorySizeAdjustedUp(newSize); - size_type resizedSize = m_allocator->Resize(ptr, newSize); + //========================================================================= + // Resize + // [8/12/2011] + //========================================================================= + SystemAllocator::size_type SystemAllocator::Resize(pointer_type ptr, size_type newSize) + { + newSize = MemorySizeAdjustedUp(newSize); + size_type resizedSize = m_allocator->Resize(ptr, newSize); - AZ_MEMORY_PROFILE(ProfileResize(ptr, resizedSize)); + AZ_MEMORY_PROFILE(ProfileResize(ptr, resizedSize)); - return MemorySizeAdjustedDown(resizedSize); -} + return MemorySizeAdjustedDown(resizedSize); + } -//========================================================================= -// -// [8/12/2011] -//========================================================================= -SystemAllocator::size_type -SystemAllocator::AllocationSize(pointer_type ptr) -{ - size_type allocSize = MemorySizeAdjustedDown(m_allocator->AllocationSize(ptr)); + //========================================================================= + // + // [8/12/2011] + //========================================================================= + SystemAllocator::size_type SystemAllocator::AllocationSize(pointer_type ptr) + { + size_type allocSize = MemorySizeAdjustedDown(m_allocator->AllocationSize(ptr)); + + return allocSize; + } - return allocSize; -} +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h index c02ada5843..c730b8dde6 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h @@ -5,8 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef AZCORE_SYS_ALLOCATOR_H -#define AZCORE_SYS_ALLOCATOR_H +#pragma once #include @@ -120,7 +119,5 @@ namespace AZ }; } -#endif // AZCORE_SYS_ALLOCATOR_H -#pragma once From b2c9c01622c6171050027717db67093d3e66c9c1 Mon Sep 17 00:00:00 2001 From: chiyenteng <82238204+chiyenteng@users.noreply.github.com> Date: Fri, 17 Dec 2021 05:44:18 -0800 Subject: [PATCH 140/399] Remove incorrect comment Signed-off-by: chiyenteng <82238204+chiyenteng@users.noreply.github.com> --- .../assetpipeline/ap_fixtures/clear_moveoutput_fixture.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py index 17da43a5b9..4b23f52006 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py @@ -3,8 +3,6 @@ Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. SPDX-License-Identifier: Apache-2.0 OR MIT - -Fixture for clearing out 'MoveOutput' folders from \\dev and \\dev\\PROJECT """ # Import builtin libraries From 1be475c81a8e98c2afe128676cad2f8d16845df3 Mon Sep 17 00:00:00 2001 From: Maxim Ivanov Date: Fri, 17 Dec 2021 14:53:54 +0300 Subject: [PATCH 141/399] [AudioSystem] ACE: Added Ctrl-R shortcut for the "File->Reload" action. Signed-off-by: Maxim Ivanov --- .../Code/Source/Editor/AudioControlsEditorMainWindow.ui | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui index 549e746de6..352e1bdf78 100644 --- a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui +++ b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui @@ -166,6 +166,9 @@ Reload + + Ctrl+R + From d9e1e59af703eb6c4d852bf62542c38afd8a0dba Mon Sep 17 00:00:00 2001 From: Maxim Ivanov Date: Fri, 17 Dec 2021 15:42:05 +0300 Subject: [PATCH 142/399] [AudioSystem] ACE: Added "File -> Refresh Audio System" action (same as "Game -> Refresh Audio") with "Ctrl-Shift-R" shortcut. Signed-off-by: Maxim Ivanov --- .../Editor/AudioControlsEditorMainWindow.ui | 25 +++++++++++++++++++ .../Editor/AudioControlsEditorWindow.cpp | 24 +++++++++++------- .../Source/Editor/AudioControlsEditorWindow.h | 1 + 3 files changed, 41 insertions(+), 9 deletions(-) diff --git a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui index 352e1bdf78..7a1f4793b8 100644 --- a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui +++ b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui @@ -143,6 +143,7 @@ + @@ -170,6 +171,14 @@ Ctrl+R + + + Refresh Audio System + + + Ctrl+Shift+R + + @@ -207,6 +216,22 @@ + + actionRefreshAudioSystem + triggered() + MainWindow + RefreshAudioSystem() + + + -1 + -1 + + + 485 + 336 + + + CurrentControlNameChanged(QString) diff --git a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.cpp b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.cpp index 5f870d06d4..35b1f3f2c8 100644 --- a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.cpp +++ b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.cpp @@ -198,6 +198,20 @@ namespace AudioControls } } + //-------------------------------------------------------------------------------------------// + void CAudioControlsEditorWindow::RefreshAudioSystem() + { + QString sLevelName = GetIEditor()->GetLevelName(); + + if (QString::compare(sLevelName, "Untitled", Qt::CaseInsensitive) == 0) + { + // Rather pass empty QString to indicate that no level is loaded! + sLevelName = QString(); + } + + Audio::AudioSystemRequestBus::Broadcast(&Audio::AudioSystemRequestBus::Events::RefreshAudioSystem, sLevelName.toUtf8().data()); + } + //-------------------------------------------------------------------------------------------// void CAudioControlsEditorWindow::Save() { @@ -215,15 +229,7 @@ namespace AudioControls messageBox.setWindowTitle("Audio Controls Editor"); if (messageBox.exec() == QMessageBox::Yes) { - QString sLevelName = GetIEditor()->GetLevelName(); - - if (QString::compare(sLevelName, "Untitled", Qt::CaseInsensitive) == 0) - { - // Rather pass empty QString to indicate that no level is loaded! - sLevelName = QString(); - } - - Audio::AudioSystemRequestBus::Broadcast(&Audio::AudioSystemRequestBus::Events::RefreshAudioSystem, sLevelName.toUtf8().data()); + RefreshAudioSystem(); } } m_pATLModel->ClearDirtyFlags(); diff --git a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.h b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.h index 00ffabfbe9..43d0ed8c8e 100644 --- a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.h +++ b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.h @@ -61,6 +61,7 @@ namespace AudioControls void UpdateInspector(); void FilterControlType(EACEControlType type, bool bShow); void Update(); + void RefreshAudioSystem(); protected: void closeEvent(QCloseEvent* pEvent) override; From 3ecf622804474af37cab528eba371a57f605ee00 Mon Sep 17 00:00:00 2001 From: Maxim Ivanov Date: Fri, 17 Dec 2021 16:06:44 +0300 Subject: [PATCH 143/399] [AudioSystem] ACE: Panels now can be resized horizontally by dragging the boundary between them. Signed-off-by: Maxim Ivanov --- .../Editor/AudioControlsEditorMainWindow.ui | 188 +++++++++--------- 1 file changed, 96 insertions(+), 92 deletions(-) diff --git a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui index 7a1f4793b8..b375f5e174 100644 --- a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui +++ b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui @@ -28,101 +28,105 @@ - - - - 1 - 0 - + + + Qt::Horizontal - - QDockWidget::NoDockWidgetFeatures - - - ATL Controls + + false - - - - 4 - - - 9 - - - 4 - - - 9 - - + + + + 1 + 0 + + + + QDockWidget::NoDockWidgetFeatures + + + ATL Controls + + + + + 4 + + + 9 + + + 4 + + + 9 + + + - - - - - - - 2 - 1 - - - - QDockWidget::NoDockWidgetFeatures - - - Inspector - - - - - 4 - - - 9 - - - 4 - - - 9 - - + + + + 2 + 1 + + + + QDockWidget::NoDockWidgetFeatures + + + Inspector + + + + + 4 + + + 9 + + + 4 + + + 9 + + + - - - - - - - 1 - 0 - - - - false - - - QDockWidget::NoDockWidgetFeatures - - - Audio Middleware Controls - - - - - 4 - - - 9 - - - 4 - - - 9 - - + + + + 1 + 0 + + + + false + + + QDockWidget::NoDockWidgetFeatures + + + Audio Middleware Controls + + + + + 4 + + + 9 + + + 4 + + + 9 + + + @@ -134,7 +138,7 @@ 0 0 972 - 21 + 26 From 9c7a558ccb0597e6ffe014266b3ded0f9aa708d3 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Fri, 17 Dec 2021 12:36:05 -0800 Subject: [PATCH 144/399] basic refactor of assets (#6467) Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilderWorker.h | 2 +- .../ScriptCanvasBuilderWorkerUtility.cpp | 4 +- .../EditorScriptCanvasComponent.cpp | 1 + .../Framework/ScriptCanvasGraphUtilities.inl | 14 ++-- .../Code/Editor/Nodes/NodeDisplayUtils.cpp | 2 +- .../ScriptCanvasNodePaletteDockWidget.cpp | 6 +- .../ScriptCanvas/Asset/RuntimeAsset.cpp | 8 +- .../Include/ScriptCanvas/Asset/RuntimeAsset.h | 74 +++---------------- .../Asset/RuntimeAssetHandler.cpp | 10 ++- .../Asset/SubgraphInterfaceAssetHandler.cpp | 9 ++- .../Code/Include/ScriptCanvas/Core/Core.cpp | 6 ++ .../Code/Include/ScriptCanvas/Core/Core.h | 4 + .../Execution/ExecutionContext.cpp | 2 +- .../ScriptCanvas/Execution/ExecutionState.cpp | 2 +- .../Interpreted/ExecutionInterpretedAPI.cpp | 4 +- .../Interpreted/ExecutionStateInterpreted.cpp | 20 ++--- .../Execution/RuntimeComponent.cpp | 2 +- .../Libraries/Core/FunctionCallNode.cpp | 10 +-- .../Code/Tests/ScriptCanvasBuilderTests.cpp | 5 +- 19 files changed, 75 insertions(+), 110 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index d0196d5f5c..142886f98c 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -59,7 +59,7 @@ namespace ScriptCanvasBuilder CorrectGraphVariableVersion, ReflectEntityIdNodes, FixExecutionStateNodeableConstruction, - + SwitchAssetsToBinary, // add new entries above Current, }; diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp index fb4bb0a386..64e73de9b9 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp @@ -521,7 +521,7 @@ namespace ScriptCanvasBuilder { AZ::Data::Asset runtimeAsset; runtimeAsset.Create(AZ::Data::AssetId(input.assetID.m_guid, AZ_CRC("SubgraphInterface", 0xdfe6dc72))); - runtimeAsset.Get()->SetData(subgraphInterface); + runtimeAsset.Get()->m_interfaceData = subgraphInterface; AZStd::vector byteBuffer; AZ::IO::ByteContainerStream byteStream(&byteBuffer); @@ -557,7 +557,7 @@ namespace ScriptCanvasBuilder { AZ::Data::Asset runtimeAsset; runtimeAsset.Create(AZ::Data::AssetId(input.assetID.m_guid, AZ_CRC("RuntimeData", 0x163310ae))); - runtimeAsset.Get()->SetData(runtimeData); + runtimeAsset.Get()->m_runtimeData = runtimeData; AZStd::vector byteBuffer; AZ::IO::ByteContainerStream byteStream(&byteBuffer); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index bb9e829bf5..0a0dbfc160 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -41,6 +41,7 @@ namespace EditorScriptCanvasComponentCpp PrefabIntegration = 10, InternalDev, AddSourceHandle, + RefactorAssets, // add description above Current }; diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl index 51fef7efcf..f4e97600bc 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl @@ -30,8 +30,8 @@ namespace ScriptCanvasEditor // over to the override data to simulate build step that does this when building prefabs AZ_INLINE void CopyAssetEntityIdsToOverrides(RuntimeDataOverrides& runtimeDataOverrides) { - runtimeDataOverrides.m_entityIds.reserve(runtimeDataOverrides.m_runtimeAsset->GetData().m_input.m_entityIds.size()); - for (auto& varEntityPar : runtimeDataOverrides.m_runtimeAsset->GetData().m_input.m_entityIds) + runtimeDataOverrides.m_entityIds.reserve(runtimeDataOverrides.m_runtimeAsset->m_runtimeData.m_input.m_entityIds.size()); + for (auto& varEntityPar : runtimeDataOverrides.m_runtimeAsset->m_runtimeData.m_input.m_entityIds) { runtimeDataOverrides.m_entityIds.push_back(varEntityPar.second); } @@ -281,14 +281,14 @@ namespace ScriptCanvasEditor #endif ////////////////////////////////////////////////////////////////////////////////////// loadResult.m_scriptAsset = luaAssetResult.m_scriptAsset; - loadResult.m_runtimeAsset.Get()->GetData().m_script = loadResult.m_scriptAsset; - loadResult.m_runtimeAsset.Get()->GetData().m_input = luaAssetResult.m_runtimeInputs; - loadResult.m_runtimeAsset.Get()->GetData().m_debugMap = luaAssetResult.m_debugMap; + loadResult.m_runtimeAsset.Get()->m_runtimeData.m_script = loadResult.m_scriptAsset; + loadResult.m_runtimeAsset.Get()->m_runtimeData.m_input = luaAssetResult.m_runtimeInputs; + loadResult.m_runtimeAsset.Get()->m_runtimeData.m_debugMap = luaAssetResult.m_debugMap; loadResult.m_runtimeComponent = loadResult.m_entity->CreateComponent(); CopyAssetEntityIdsToOverrides(runtimeDataOverrides); loadResult.m_runtimeComponent->TakeRuntimeDataOverrides(AZStd::move(runtimeDataOverrides)); - Execution::Context::InitializeActivationData(loadResult.m_runtimeAsset->GetData()); - Execution::InitializeInterpretedStatics(loadResult.m_runtimeAsset->GetData()); + Execution::Context::InitializeActivationData(loadResult.m_runtimeAsset->m_runtimeData); + Execution::InitializeInterpretedStatics(loadResult.m_runtimeAsset->m_runtimeData); } else { diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp index 8e273fd2fc..31d012fd4a 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp @@ -932,7 +932,7 @@ namespace ScriptCanvasEditor::Nodes if (asset) { - GraphCanvas::NodeTitleRequestBus::Event(graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::SetTitle, asset->GetData().m_name); + GraphCanvas::NodeTitleRequestBus::Event(graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::SetTitle, asset->m_interfaceData.m_name); } GraphCanvas::NodeTitleRequestBus::Event(graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::SetPaletteOverride, "MethodNodeTitlePalette"); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp index 25f38afbae..60d903d748 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp @@ -456,7 +456,7 @@ namespace ScriptCanvasEditor return; } - if (!data->m_runtimeData.m_interface.HasAnyFunctionality()) + if (!data->m_interfaceData.m_interface.HasAnyFunctionality()) { // check for deleting the old entry return; @@ -517,7 +517,7 @@ namespace ScriptCanvasEditor return; } - const ScriptCanvas::Grammar::SubgraphInterface& graphInterface = data->m_runtimeData.m_interface; + const ScriptCanvas::Grammar::SubgraphInterface& graphInterface = data->m_interfaceData.m_interface; if (!graphInterface.HasAnyFunctionality()) { return; @@ -566,7 +566,7 @@ namespace ScriptCanvasEditor return; } - const ScriptCanvas::Grammar::SubgraphInterface& graphInterface = data->m_runtimeData.m_interface; + const ScriptCanvas::Grammar::SubgraphInterface& graphInterface = data->m_interfaceData.m_interface; if (!graphInterface.HasAnyFunctionality()) { return; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.cpp index d55fcf7838..faa1d06b63 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.cpp @@ -11,7 +11,7 @@ #include #include -namespace ScriptCanvasRuntimeAssetCpp +namespace DoNotVersionRuntimeAssetsBumpTheBuilderVersionInstead { enum class RuntimeDataVersion { @@ -72,7 +72,7 @@ namespace ScriptCanvas if (auto serializeContext = azrtti_cast(reflectContext)) { serializeContext->Class() - ->Version(static_cast(ScriptCanvasRuntimeAssetCpp::RuntimeDataVersion::Current)) + ->Version(static_cast(DoNotVersionRuntimeAssetsBumpTheBuilderVersionInstead::RuntimeDataVersion::Current)) ->Field("input", &RuntimeData::m_input) ->Field("debugMap", &RuntimeData::m_debugMap) ->Field("script", &RuntimeData::m_script) @@ -146,7 +146,7 @@ namespace ScriptCanvas if (auto serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(static_cast(ScriptCanvasRuntimeAssetCpp::RuntimeDataOverridesVersion::Current)) + ->Version(static_cast(DoNotVersionRuntimeAssetsBumpTheBuilderVersionInstead::RuntimeDataOverridesVersion::Current)) ->Field("runtimeAsset", &RuntimeDataOverrides::m_runtimeAsset) ->Field("variables", &RuntimeDataOverrides::m_variables) ->Field("variableIndices", &RuntimeDataOverrides::m_variableIndices) @@ -195,7 +195,7 @@ namespace ScriptCanvas if (auto serializeContext = azrtti_cast(reflectContext)) { serializeContext->Class() - ->Version(static_cast(ScriptCanvasRuntimeAssetCpp::FunctionRuntimeDataVersion::Current)) + ->Version(static_cast(DoNotVersionRuntimeAssetsBumpTheBuilderVersionInstead::FunctionRuntimeDataVersion::Current)) ->Field("name", &SubgraphInterfaceData::m_name) ->Field("interface", &SubgraphInterfaceData::m_interface) ; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.h index 8c5da5ac07..ad6f7c07b4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.h @@ -106,65 +106,20 @@ namespace ScriptCanvas void EnforcePreloadBehavior(); }; - class RuntimeAssetBase + class RuntimeAsset : public AZ::Data::AssetData { public: - - AZ_RTTI(RuntimeAssetBase, "{19BAD220-E505-4443-AA95-743106748F37}", AZ::Data::AssetData); - AZ_CLASS_ALLOCATOR(RuntimeAssetBase, AZ::SystemAllocator, 0); - RuntimeAssetBase(const AZ::Data::AssetId& assetId = AZ::Data::AssetId(), AZ::Data::AssetData::AssetStatus status = AZ::Data::AssetData::AssetStatus::NotLoaded) - : AZ::Data::AssetData(assetId, status) - { - - } - }; - template - class RuntimeAssetTyped - : public RuntimeAssetBase - { - public: - AZ_RTTI(RuntimeAssetBase, "{C925213E-A1FA-4487-831F-9551A984700E}", RuntimeAssetBase); - AZ_CLASS_ALLOCATOR(RuntimeAssetBase, AZ::SystemAllocator, 0); - - RuntimeAssetTyped(const AZ::Data::AssetId& assetId = AZ::Data::AssetId(), AZ::Data::AssetData::AssetStatus status = AZ::Data::AssetData::AssetStatus::NotLoaded) - : RuntimeAssetBase(assetId, status) - { - - } + AZ_RTTI(RuntimeAsset, "{3E2AC8CD-713F-453E-967F-29517F331784}", AZ::Data::AssetData); static const char* GetFileExtension() { return "scriptcanvas_compiled"; } static const char* GetFileFilter() { return "*.scriptcanvas_compiled"; } - const DataType& GetData() const { return m_runtimeData; } - DataType& GetData() { return m_runtimeData; } - void SetData(const DataType& runtimeData) - { - m_runtimeData = runtimeData; - // When setting data instead of serializing, immediately mark the asset as ready. - m_status = AZ::Data::AssetData::AssetStatus::Ready; - } - - DataType m_runtimeData; - - protected: - friend class RuntimeAssetHandler; - RuntimeAssetTyped(const RuntimeAssetTyped&) = delete; - - }; - - class RuntimeAsset : public RuntimeAssetTyped - { - public: - - AZ_RTTI(RuntimeAsset, "{3E2AC8CD-713F-453E-967F-29517F331784}", RuntimeAssetTyped); + RuntimeData m_runtimeData; RuntimeAsset(const AZ::Data::AssetId& assetId = AZ::Data::AssetId(), AZ::Data::AssetData::AssetStatus status = AZ::Data::AssetData::AssetStatus::NotLoaded) - : RuntimeAssetTyped(assetId, status) - { - - } - + : AZ::Data::AssetData(assetId, status) + {} }; class SubgraphInterfaceAsset; @@ -212,24 +167,19 @@ namespace ScriptCanvas }; class SubgraphInterfaceAsset - : public RuntimeAssetTyped + : public AZ::Data::AssetData { public: - AZ_RTTI(SubgraphInterfaceAsset, "{E22967AC-7673-4778-9125-AF49D82CAF9F}", RuntimeAssetTyped); + AZ_RTTI(SubgraphInterfaceAsset, "{E22967AC-7673-4778-9125-AF49D82CAF9F}", AZ::Data::AssetData); AZ_CLASS_ALLOCATOR(SubgraphInterfaceAsset, AZ::SystemAllocator, 0); - SubgraphInterfaceAsset(const AZ::Data::AssetId& assetId = AZ::Data::AssetId(), AZ::Data::AssetData::AssetStatus status = AZ::Data::AssetData::AssetStatus::NotLoaded) - : RuntimeAssetTyped(assetId, status) - {} - - void SetData(const SubgraphInterfaceData& runtimeData) - { - m_runtimeData = runtimeData; - } - static const char* GetFileExtension() { return "scriptcanvas_fn_compiled"; } static const char* GetFileFilter() { return "*.scriptcanvas_fn_compiled"; } - friend class SubgraphInterfaceAssetHandler; + SubgraphInterfaceData m_interfaceData; + + SubgraphInterfaceAsset(const AZ::Data::AssetId& assetId = AZ::Data::AssetId(), AZ::Data::AssetData::AssetStatus status = AZ::Data::AssetData::AssetStatus::NotLoaded) + : AZ::Data::AssetData(assetId, status) + {} }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAssetHandler.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAssetHandler.cpp index 05b6f4397b..0b94fb370a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAssetHandler.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAssetHandler.cpp @@ -81,7 +81,6 @@ namespace ScriptCanvas { (void)type; AZ_Assert(type == AZ::AzTypeInfo::Uuid(), "This handler deals only with the Script Canvas Runtime Asset type!"); - return aznew RuntimeAsset(id); } @@ -93,7 +92,7 @@ namespace ScriptCanvas { RuntimeAsset* runtimeAsset = asset.GetAs(); AZ_Assert(runtimeAsset, "RuntimeAssetHandler::InitAsset This should be a Script Canvas runtime asset, as this is the only type this handler processes!"); - Execution::Context::InitializeActivationData(runtimeAsset->GetData()); + Execution::Context::InitializeActivationData(runtimeAsset->m_runtimeData); } } @@ -116,7 +115,10 @@ namespace ScriptCanvas AZ_Assert(runtimeAsset, "This should be a Script Canvas runtime asset, as this is the only type we process!"); if (runtimeAsset && m_serializeContext) { - AZ::ObjectStream* binaryObjStream = AZ::ObjectStream::Create(stream, *m_serializeContext, AZ::ObjectStream::ST_XML); + AZ::ObjectStream* binaryObjStream = AZ::ObjectStream::Create(stream, *m_serializeContext + , g_saveRuntimeAssetsAsPlainTextForDebug + ? AZ::ObjectStream::ST_XML + : AZ::ObjectStream::ST_BINARY); bool graphSaved = binaryObjStream->WriteClass(&runtimeAsset->m_runtimeData); binaryObjStream->Finalize(); return graphSaved; @@ -128,7 +130,7 @@ namespace ScriptCanvas void RuntimeAssetHandler::DestroyAsset(AZ::Data::AssetPtr ptr) { RuntimeAsset* runtimeAsset = azrtti_cast(ptr); - Execution::Context::UnloadData(runtimeAsset->GetData()); + Execution::Context::UnloadData(runtimeAsset->m_runtimeData); delete ptr; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/SubgraphInterfaceAssetHandler.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/SubgraphInterfaceAssetHandler.cpp index 451e0dfc47..d0371bb88f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/SubgraphInterfaceAssetHandler.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/SubgraphInterfaceAssetHandler.cpp @@ -93,7 +93,7 @@ namespace ScriptCanvas if (runtimeFunctionAsset && m_serializeContext) { stream->Seek(0U, AZ::IO::GenericStream::ST_SEEK_BEGIN); - bool loadSuccess = AZ::Utils::LoadObjectFromStreamInPlace(*stream, runtimeFunctionAsset->m_runtimeData, m_serializeContext, AZ::ObjectStream::FilterDescriptor(assetLoadFilterCB)); + bool loadSuccess = AZ::Utils::LoadObjectFromStreamInPlace(*stream, runtimeFunctionAsset->m_interfaceData, m_serializeContext, AZ::ObjectStream::FilterDescriptor(assetLoadFilterCB)); return loadSuccess ? AZ::Data::AssetHandler::LoadResult::LoadComplete : AZ::Data::AssetHandler::LoadResult::Error; } return AZ::Data::AssetHandler::LoadResult::Error; @@ -105,8 +105,11 @@ namespace ScriptCanvas AZ_Assert(runtimeFunctionAsset, "This should be a Script Canvas runtime asset, as this is the only type we process!"); if (runtimeFunctionAsset && m_serializeContext) { - AZ::ObjectStream* binaryObjStream = AZ::ObjectStream::Create(stream, *m_serializeContext, AZ::ObjectStream::ST_XML); - bool graphSaved = binaryObjStream->WriteClass(&runtimeFunctionAsset->m_runtimeData); + AZ::ObjectStream* binaryObjStream = AZ::ObjectStream::Create(stream, *m_serializeContext + , ScriptCanvas::g_saveEditorAssetsAsPlainTextForDebug + ? AZ::ObjectStream::ST_XML + : AZ::ObjectStream::ST_BINARY); + bool graphSaved = binaryObjStream->WriteClass(&runtimeFunctionAsset->m_interfaceData); binaryObjStream->Finalize(); return graphSaved; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 4a1d5d94c1..1e00e70075 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -20,6 +20,12 @@ namespace ScriptCanvas { + AZ_CVAR(bool, g_saveRuntimeAssetsAsPlainTextForDebug, false, {}, AZ::ConsoleFunctorFlags::Null + , "Save runtime assets as plain text rather than binary for debug purposes."); + + AZ_CVAR(bool, g_saveEditorAssetsAsPlainTextForDebug, false, {}, AZ::ConsoleFunctorFlags::Null + , "Save editor assets as plain text rather than binary for debug purposes."); + ScopedAuxiliaryEntityHandler::ScopedAuxiliaryEntityHandler(AZ::Entity* buildEntity) : m_buildEntity(buildEntity) , m_wasAdded(false) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 1a644d312e..c29a648eca 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -24,6 +24,7 @@ #include #include #include +#include #define OBJECT_STREAM_EDITOR_ASSET_LOADING_SUPPORT_ENABLED @@ -42,6 +43,9 @@ namespace AZ namespace ScriptCanvas { + AZ_CVAR_EXTERNED(bool, g_saveRuntimeAssetsAsPlainTextForDebug); + AZ_CVAR_EXTERNED(bool, g_saveEditorAssetsAsPlainTextForDebug); + // A place holder identifier for the AZ::Entity that owns the graph. // The actual value in each location initialized to GraphOwnerId is populated with the owning entity at editor-time, Asset Processor-time, or runtime, as soon as the owning entity is known. using GraphOwnerIdType = AZ::EntityId; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp index f7ae4a931e..8c3c3d6da2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp @@ -41,7 +41,7 @@ namespace ScriptCanvas { ActivationData::ActivationData(const RuntimeDataOverrides& variableOverrides, ActivationInputArray& storage) : variableOverrides(variableOverrides) - , runtimeData(variableOverrides.m_runtimeAsset->GetData()) + , runtimeData(variableOverrides.m_runtimeAsset->m_runtimeData) , storage(storage) {} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp index 81f0528b45..882003e7a4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp @@ -22,7 +22,7 @@ namespace ScriptCanvas ExecutionStateConfig::ExecutionStateConfig(AZ::Data::Asset runtimeAsset, RuntimeComponent& component) : asset(runtimeAsset) , component(component) - , runtimeData(runtimeAsset.Get()->GetData()) + , runtimeData(runtimeAsset.Get()->m_runtimeData) {} ExecutionState::ExecutionState(const ExecutionStateConfig& config) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp index 561708dea1..eb856963f7 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp @@ -509,9 +509,9 @@ namespace ScriptCanvas for (auto& dependency : runtimeData.m_requiredAssets) { - if (!dependency.Get()->GetData().m_areStaticsInitialized) + if (!dependency.Get()->m_runtimeData.m_areStaticsInitialized) { - InitializeInterpretedStatics(dependency.Get()->GetData()); + InitializeInterpretedStatics(dependency.Get()->m_runtimeData); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp index 3b963317ec..f0288fb279 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp @@ -49,9 +49,9 @@ namespace ScriptCanvas , config.asset.GetId().ToString().data()); #endif - if (!runtimeAsset->GetData().m_areStaticsInitialized) + if (!runtimeAsset->m_runtimeData.m_areStaticsInitialized) { - Execution::InitializeInterpretedStatics(runtimeAsset->GetData()); + Execution::InitializeInterpretedStatics(runtimeAsset->m_runtimeData); } } @@ -70,8 +70,8 @@ namespace ScriptCanvas const Grammar::DebugExecution* ExecutionStateInterpreted::GetDebugSymbolIn(size_t index, const AZ::Data::AssetId& id) const { auto asset = ExecutionStateInterpretedCpp::GetSubgraphAssetForDebug(id); - return asset && asset.Get() && index < asset.Get()->GetData().m_debugMap.m_ins.size() - ? &(asset.Get()->GetData().m_debugMap.m_ins[index]) + return asset && asset.Get() && index < asset.Get()->m_runtimeData.m_debugMap.m_ins.size() + ? &(asset.Get()->m_runtimeData.m_debugMap.m_ins[index]) : nullptr; } @@ -85,8 +85,8 @@ namespace ScriptCanvas const Grammar::DebugExecution* ExecutionStateInterpreted::GetDebugSymbolOut(size_t index, const AZ::Data::AssetId& id) const { auto asset = ExecutionStateInterpretedCpp::GetSubgraphAssetForDebug(id); - return asset && asset.Get() && index < asset.Get()->GetData().m_debugMap.m_outs.size() - ? &(asset.Get()->GetData().m_debugMap.m_outs[index]) + return asset && asset.Get() && index < asset.Get()->m_runtimeData.m_debugMap.m_outs.size() + ? &(asset.Get()->m_runtimeData.m_debugMap.m_outs[index]) : nullptr; } @@ -100,8 +100,8 @@ namespace ScriptCanvas const Grammar::DebugExecution* ExecutionStateInterpreted::GetDebugSymbolReturn(size_t index, const AZ::Data::AssetId& id) const { auto asset = ExecutionStateInterpretedCpp::GetSubgraphAssetForDebug(id); - return asset && asset.Get() && index < asset.Get()->GetData().m_debugMap.m_returns.size() - ? &(asset.Get()->GetData().m_debugMap.m_returns[index]) + return asset && asset.Get() && index < asset.Get()->m_runtimeData.m_debugMap.m_returns.size() + ? &(asset.Get()->m_runtimeData.m_debugMap.m_returns[index]) : nullptr; } @@ -115,8 +115,8 @@ namespace ScriptCanvas const Grammar::DebugDataSource* ExecutionStateInterpreted::GetDebugSymbolVariableChange(size_t index, const AZ::Data::AssetId& id) const { auto asset = ExecutionStateInterpretedCpp::GetSubgraphAssetForDebug(id); - return asset && asset.Get() && index < asset.Get()->GetData().m_debugMap.m_variables.size() - ? &(asset.Get()->GetData().m_debugMap.m_variables[index]) + return asset && asset.Get() && index < asset.Get()->m_runtimeData.m_debugMap.m_variables.size() + ? &(asset.Get()->m_runtimeData.m_debugMap.m_variables[index]) : nullptr; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp index 930b84abe4..23eba22524 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp @@ -71,7 +71,7 @@ namespace ScriptCanvas const RuntimeData& RuntimeComponent::GetRuntimeAssetData() const { - return m_runtimeOverrides.m_runtimeAsset->GetData(); + return m_runtimeOverrides.m_runtimeAsset->m_runtimeData; } ExecutionMode RuntimeComponent::GetExecutionMode() const diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp index 225949d833..551b9b4002 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp @@ -261,11 +261,11 @@ namespace ScriptCanvas , const ScriptCanvas::Grammar::FunctionSourceId& sourceId , const SlotExecution::Map& previousMap) { - const Grammar::SubgraphInterface& subgraphInterface = runtimeAsset.Get()->m_runtimeData.m_interface; + const Grammar::SubgraphInterface& subgraphInterface = runtimeAsset.Get()->m_interfaceData.m_interface; if (subgraphInterface.IsUserNodeable() && Grammar::IsFunctionSourceIdNodeable(sourceId) && subgraphInterface.HasIn(sourceId)) { - m_prettyName = runtimeAsset.Get()->m_runtimeData.m_name; + m_prettyName = runtimeAsset.Get()->m_interfaceData.m_name; BuildUserNodeableNode(subgraphInterface, previousMap); } else if ((!Grammar::IsFunctionSourceIdNodeable(sourceId)) && subgraphInterface.HasIn(sourceId)) @@ -477,7 +477,7 @@ namespace ScriptCanvas return true; } - const Grammar::SubgraphInterface* latestAssetInterface = asset ? &asset.Get()->GetData().m_interface : nullptr; + const Grammar::SubgraphInterface* latestAssetInterface = asset ? &asset.Get()->m_interfaceData.m_interface : nullptr; if (!latestAssetInterface) { AZ_Warning("ScriptCanvas", false, "FunctionCallNode %s failed to load latest interface from the source asset.", m_prettyName.data()); @@ -517,7 +517,7 @@ namespace ScriptCanvas DataSlotMap dataSlotMap; if (m_slotExecutionMap.IsEmpty()) { - const Grammar::SubgraphInterface& subgraphInterface = assetData.Get()->m_runtimeData.m_interface; + const Grammar::SubgraphInterface& subgraphInterface = assetData.Get()->m_interfaceData.m_interface; RemoveInsFromInterface(subgraphInterface.GetIns(), executionSlotMap, dataSlotMap, k_DoNotRemoveConnections, k_DoNotWarnOnMissingDataSlots); RemoveOutsFromInterface(subgraphInterface.GetLatentOuts(), executionSlotMap, dataSlotMap, k_DoNotRemoveConnections, k_DoNotWarnOnMissingDataSlots); } @@ -806,7 +806,7 @@ namespace ScriptCanvas return; } - m_prettyName = assetData.Get()->m_runtimeData.m_name; + m_prettyName = assetData.Get()->m_interfaceData.m_name; } } } diff --git a/Gems/ScriptCanvas/Code/Tests/ScriptCanvasBuilderTests.cpp b/Gems/ScriptCanvas/Code/Tests/ScriptCanvasBuilderTests.cpp index 33982bbcd7..cac26eff95 100644 --- a/Gems/ScriptCanvas/Code/Tests/ScriptCanvasBuilderTests.cpp +++ b/Gems/ScriptCanvas/Code/Tests/ScriptCanvasBuilderTests.cpp @@ -153,11 +153,10 @@ TEST_F(ScriptCanvasBuilderTests, ScriptCanvasWithAssetReference_GatherProductDep graphEntity->AddComponent(assetComponent); ScriptCanvas::RuntimeData runtimeData; - //runtimeData.m_graphData.m_nodes.emplace(graphEntity); - + AZ::Data::Asset runtimeAsset; runtimeAsset.Create(AZ::Uuid::CreateRandom()); - runtimeAsset.Get()->SetData(runtimeData); + runtimeAsset.Get()->m_runtimeData = runtimeData; AZStd::vector productDependencies; AssetBuilderSDK::ProductPathDependencySet productPathDependencySet; From 18ce01ba7c3832b8fcc15899834cd0b9d74a9e1f Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Fri, 17 Dec 2021 15:08:43 -0600 Subject: [PATCH 145/399] Add 2 performance testing levels (#6463) First a level with approximately 10K cubes with various PBR materials Second a level with a vegetation system set up to spawn between 10K - 30K instances of cubes with various PBR materials Plus ancillary data files these levels need. Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- .../10KEntityCpuPerfTest.prefab | 1032 + .../Performance/10KEntityCpuPerfTest/tags.txt | 12 + .../10KVegInstancesTest.prefab | 4216 + .../Performance/10kVegInstancesTest/tags.txt | 12 + .../TestData/Graphics/AtomCubeWall.prefab | 102345 +++++++++++++++ .../Graphics/CubeAluminumPolishedPBR.prefab | 156 + .../Graphics/CubeBrassPolishedPBR.prefab | 156 + .../Graphics/CubeChromePolishedPBR.prefab | 156 + .../Graphics/CubeCobaltPolishedPBR.prefab | 156 + .../Graphics/CubeCopperPolishedPBR.prefab | 156 + .../Graphics/CubeGoldPolishedPBR.prefab | 156 + .../Graphics/CubeIronPolishedPBR.prefab | 156 + .../TestData/Graphics/CubeMercuryPBR.prefab | 156 + .../Graphics/CubeNickelPolishedPBR.prefab | 156 + .../Graphics/CubePalladiumPolishedPBR.prefab | 156 + .../Graphics/CubePlatinumPolishedPBR.prefab | 156 + .../Graphics/CubeSilverPolishedPBR.prefab | 156 + .../Graphics/CubeTitaniumPolishedPBR.prefab | 156 + 18 files changed, 109645 insertions(+) create mode 100644 AutomatedTesting/Levels/Performance/10KEntityCpuPerfTest/10KEntityCpuPerfTest.prefab create mode 100644 AutomatedTesting/Levels/Performance/10KEntityCpuPerfTest/tags.txt create mode 100644 AutomatedTesting/Levels/Performance/10kVegInstancesTest/10KVegInstancesTest.prefab create mode 100644 AutomatedTesting/Levels/Performance/10kVegInstancesTest/tags.txt create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/AtomCubeWall.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeAluminumPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeBrassPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeChromePolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeCobaltPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeCopperPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeGoldPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeIronPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeMercuryPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeNickelPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubePalladiumPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubePlatinumPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeSilverPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeTitaniumPolishedPBR.prefab diff --git a/AutomatedTesting/Levels/Performance/10KEntityCpuPerfTest/10KEntityCpuPerfTest.prefab b/AutomatedTesting/Levels/Performance/10KEntityCpuPerfTest/10KEntityCpuPerfTest.prefab new file mode 100644 index 0000000000..5024ca9192 --- /dev/null +++ b/AutomatedTesting/Levels/Performance/10KEntityCpuPerfTest/10KEntityCpuPerfTest.prefab @@ -0,0 +1,1032 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Instance_[470615713748]/ContainerEntity", + "Instance_[62786296211412]/ContainerEntity", + "Instance_[513945563413]/ContainerEntity", + "Instance_[612729811221]/ContainerEntity", + "Instance_[745873797397]/ContainerEntity" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 4792520350429473643 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[12198510776899974386]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 12198510776899974386, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + } + }, + "Instances": { + "Instance_[470615713748]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[513945563413]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 10.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[612729811221]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 15.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[62786296211412]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 5.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873797397]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 20.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873797497]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 25.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873797597]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 30.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873797697]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 35.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873797797]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 40.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873797897]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 45.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873797997]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798097]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 55.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798197]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 60.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798297]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 65.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798397]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 70.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798497]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 75.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798597]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 80.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798697]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 85.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798797]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 90.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798897]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 95.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798997]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 100.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873799097]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 105.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Performance/10KEntityCpuPerfTest/tags.txt b/AutomatedTesting/Levels/Performance/10KEntityCpuPerfTest/tags.txt new file mode 100644 index 0000000000..0d6c1880e7 --- /dev/null +++ b/AutomatedTesting/Levels/Performance/10KEntityCpuPerfTest/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 diff --git a/AutomatedTesting/Levels/Performance/10kVegInstancesTest/10KVegInstancesTest.prefab b/AutomatedTesting/Levels/Performance/10kVegInstancesTest/10KVegInstancesTest.prefab new file mode 100644 index 0000000000..4e6b17de73 --- /dev/null +++ b/AutomatedTesting/Levels/Performance/10kVegInstancesTest/10KVegInstancesTest.prefab @@ -0,0 +1,4216 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Entity_[655472831242]", + "Entity_[659767798538]" + ] + }, + "Component_[14900044899939389494]": { + "$type": "EditorDebugComponent", + "Id": 14900044899939389494, + "Configuration": { + "ShowDebugStats": true + } + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[16599802339219703605]": { + "$type": "EditorLevelSettingsComponent", + "Id": 16599802339219703605, + "Configuration": { + "AreaSystemConfig": { + "ViewRectangleSize": 25, + "SectorDensity": 2, + "SectorSizeInMeters": 10 + } + } + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 17772187112516355261 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1172344194419]": { + "Id": "Entity_[1172344194419]", + "Name": "Shader Ball", + "Components": { + "Component_[10789351944715265527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10789351944715265527 + }, + "Component_[12037033284781049225]": { + "$type": "EditorEntitySortComponent", + "Id": 12037033284781049225 + }, + "Component_[13759153306105970079]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13759153306105970079 + }, + "Component_[14135560884830586279]": { + "$type": "EditorInspectorComponent", + "Id": 14135560884830586279 + }, + "Component_[16247165675903986673]": { + "$type": "EditorVisibilityComponent", + "Id": 16247165675903986673 + }, + "Component_[18082433625958885247]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18082433625958885247 + }, + "Component_[6472623349872972660]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6472623349872972660, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Rotate": [ + 0.0, + 0.10000000149011612, + 180.0 + ] + } + }, + "Component_[6495255223970673916]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 6495255223970673916, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}", + "subId": 281415304 + }, + "assetHint": "objects/shaderball/shaderball_default_1m.azmodel" + } + } + } + }, + "Component_[8056625192494070973]": { + "$type": "SelectionComponent", + "Id": 8056625192494070973 + }, + "Component_[8550141614185782969]": { + "$type": "EditorEntityIconComponent", + "Id": 8550141614185782969 + }, + "Component_[9439770997198325425]": { + "$type": "EditorLockComponent", + "Id": 9439770997198325425 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1172344194419]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + }, + "Entity_[2994134174757065]": { + "Id": "Entity_[2994134174757065]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 31.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994138469724361]": { + "Id": "Entity_[2994138469724361]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 33.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994142764691657]": { + "Id": "Entity_[2994142764691657]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 29.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994147059658953]": { + "Id": "Entity_[2994147059658953]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 27.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994151354626249]": { + "Id": "Entity_[2994151354626249]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 19.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994155649593545]": { + "Id": "Entity_[2994155649593545]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 25.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994159944560841]": { + "Id": "Entity_[2994159944560841]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 37.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994164239528137]": { + "Id": "Entity_[2994164239528137]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 35.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994168534495433]": { + "Id": "Entity_[2994168534495433]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 21.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994172829462729]": { + "Id": "Entity_[2994172829462729]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 23.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446213842399433]": { + "Id": "Entity_[3446213842399433]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 49.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446218137366729]": { + "Id": "Entity_[3446218137366729]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 41.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446222432334025]": { + "Id": "Entity_[3446222432334025]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 45.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446226727301321]": { + "Id": "Entity_[3446226727301321]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 57.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446231022268617]": { + "Id": "Entity_[3446231022268617]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 53.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446235317235913]": { + "Id": "Entity_[3446235317235913]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 43.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446239612203209]": { + "Id": "Entity_[3446239612203209]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 51.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446243907170505]": { + "Id": "Entity_[3446243907170505]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 47.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446248202137801]": { + "Id": "Entity_[3446248202137801]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 39.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446252497105097]": { + "Id": "Entity_[3446252497105097]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 55.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073064319250633]": { + "Id": "Entity_[4073064319250633]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 72.24310302734375 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073068614217929]": { + "Id": "Entity_[4073068614217929]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 60.243099212646484 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073072909185225]": { + "Id": "Entity_[4073072909185225]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 78.24310302734375 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073077204152521]": { + "Id": "Entity_[4073077204152521]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 68.24310302734375 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073081499119817]": { + "Id": "Entity_[4073081499119817]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 62.243099212646484 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073085794087113]": { + "Id": "Entity_[4073085794087113]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 76.24310302734375 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073090089054409]": { + "Id": "Entity_[4073090089054409]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 70.24310302734375 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073094384021705]": { + "Id": "Entity_[4073094384021705]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 64.24310302734375 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073098678989001]": { + "Id": "Entity_[4073098678989001]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 66.24310302734375 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073102973956297]": { + "Id": "Entity_[4073102973956297]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 74.24310302734375 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[612523158282]": { + "Id": "Entity_[612523158282]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 0.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[616818125578]": { + "Id": "Entity_[616818125578]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 18.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[621113092874]": { + "Id": "Entity_[621113092874]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 2.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[625408060170]": { + "Id": "Entity_[625408060170]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 16.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[629703027466]": { + "Id": "Entity_[629703027466]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 14.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[633997994762]": { + "Id": "Entity_[633997994762]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 12.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[638292962058]": { + "Id": "Entity_[638292962058]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 4.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[642587929354]": { + "Id": "Entity_[642587929354]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 10.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[646882896650]": { + "Id": "Entity_[646882896650]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 8.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[651177863946]": { + "Id": "Entity_[651177863946]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 6.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[655472831242]": { + "Id": "Entity_[655472831242]", + "Name": "Surfaces", + "Components": { + "Component_[11463830567025741777]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11463830567025741777, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 25.139535903930664, + 43.94798278808594, + 0.0 + ] + } + }, + "Component_[16576383876931487287]": { + "$type": "EditorLockComponent", + "Id": 16576383876931487287 + }, + "Component_[17475328349202721984]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 17475328349202721984 + }, + "Component_[2693664693208376125]": { + "$type": "EditorVisibilityComponent", + "Id": 2693664693208376125 + }, + "Component_[3772848404212958248]": { + "$type": "EditorInspectorComponent", + "Id": 3772848404212958248 + }, + "Component_[3891212684133169478]": { + "$type": "SelectionComponent", + "Id": 3891212684133169478 + }, + "Component_[4930031329153667734]": { + "$type": "EditorEntityIconComponent", + "Id": 4930031329153667734 + }, + "Component_[5015604486311198963]": { + "$type": "EditorEntitySortComponent", + "Id": 5015604486311198963, + "Child Entity Order": [ + "Entity_[612523158282]", + "Entity_[621113092874]", + "Entity_[638292962058]", + "Entity_[651177863946]", + "Entity_[646882896650]", + "Entity_[642587929354]", + "Entity_[633997994762]", + "Entity_[629703027466]", + "Entity_[625408060170]", + "Entity_[616818125578]", + "Entity_[2994164239528137]", + "Entity_[2994155649593545]", + "Entity_[2994134174757065]", + "Entity_[2994142764691657]", + "Entity_[2994138469724361]", + "Entity_[2994159944560841]", + "Entity_[2994151354626249]", + "Entity_[2994147059658953]", + "Entity_[2994172829462729]", + "Entity_[2994168534495433]", + "Entity_[3446243907170505]", + "Entity_[3446213842399433]", + "Entity_[3446239612203209]", + "Entity_[3446226727301321]", + "Entity_[3446218137366729]", + "Entity_[3446231022268617]", + "Entity_[3446222432334025]", + "Entity_[3446252497105097]", + "Entity_[3446248202137801]", + "Entity_[3446235317235913]", + "Entity_[4073090089054409]", + "Entity_[4073064319250633]", + "Entity_[4073077204152521]", + "Entity_[4073068614217929]", + "Entity_[4073072909185225]", + "Entity_[4073081499119817]", + "Entity_[4073085794087113]", + "Entity_[4073102973956297]", + "Entity_[4073094384021705]", + "Entity_[4073098678989001]" + ] + }, + "Component_[7096718211285552582]": { + "$type": "EditorOnlyEntityComponent", + "Id": 7096718211285552582 + }, + "Component_[8091190759736241533]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8091190759736241533 + } + } + }, + "Entity_[659767798538]": { + "Id": "Entity_[659767798538]", + "Name": "VegArea", + "Components": { + "Component_[10457867987348570858]": { + "$type": "EditorInspectorComponent", + "Id": 10457867987348570858 + }, + "Component_[1229363445910756890]": { + "$type": "{DD96FD51-A86B-48BC-A6AB-89183B538269} EditorSpawnerComponent", + "Id": 1229363445910756890, + "PreviewEntity": "Entity_[659767798538]" + }, + "Component_[12481711086985445589]": { + "$type": "EditorVisibilityComponent", + "Id": 12481711086985445589 + }, + "Component_[14421356574908560819]": { + "$type": "EditorAxisAlignedBoxShapeComponent", + "Id": 14421356574908560819, + "Visible": false, + "DisplayFilled": false, + "AxisAlignedBoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 200.0 + ] + } + } + }, + "Component_[14627293932927606859]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 14627293932927606859, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 25.139535903930664, + 43.94798278808594, + 0.0 + ] + } + }, + "Component_[16742116787858765489]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16742116787858765489 + }, + "Component_[17369607211365211528]": { + "$type": "EditorEntitySortComponent", + "Id": 17369607211365211528, + "Child Entity Order": [ + "Instance_[919926567113]/ContainerEntity", + "Instance_[1031595716809]/ContainerEntity", + "Instance_[1160444735689]/ContainerEntity", + "Instance_[1306473623753]/ContainerEntity", + "Instance_[1469682381001]/ContainerEntity", + "Instance_[1650071007433]/ContainerEntity", + "Instance_[1847639503049]/ContainerEntity", + "Instance_[2062387867849]/ContainerEntity", + "Instance_[2294316101833]/ContainerEntity", + "Instance_[2543424205001]/ContainerEntity", + "Instance_[2809712177353]/ContainerEntity", + "Instance_[3093180018889]/ContainerEntity", + "Instance_[3398122696905]/ContainerEntity" + ] + }, + "Component_[17539394596964090620]": { + "$type": "EditorDescriptorListComponent", + "Id": 17539394596964090620, + "Configuration": { + "Descriptors": [ + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{60CF6C60-8620-5173-814C-ED8B0C395BA7}", + "subId": 1611714993 + }, + "assetHint": "prefabs/testdata/graphics/cubealuminumpolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{B030470B-92ED-5673-B108-5BD3C31A3795}", + "subId": 2910987375 + }, + "assetHint": "prefabs/testdata/graphics/cubebrasspolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{D4AC76BB-BA32-5787-A862-3C6296503126}", + "subId": 1351414441 + }, + "assetHint": "prefabs/testdata/graphics/cubechromepolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{6E0DF0BD-2B50-5353-A063-88AAEEBED799}", + "subId": 1382904365 + }, + "assetHint": "prefabs/testdata/graphics/cubecobaltpolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{CB9E61C4-1122-56D8-8906-2FF8FC4D1876}", + "subId": 3884585917 + }, + "assetHint": "prefabs/testdata/graphics/cubecopperpolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{9105AA91-FE70-56C2-BA83-E08F268C333F}", + "subId": 2449326585 + }, + "assetHint": "prefabs/testdata/graphics/cubegoldpolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{7DB86E6D-05C1-5B3C-88B4-DC9039005E1F}", + "subId": 932993536 + }, + "assetHint": "prefabs/testdata/graphics/cubeironpolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{D8EEB566-07A9-5F39-9B89-66492858F178}", + "subId": 2937511027 + }, + "assetHint": "prefabs/testdata/graphics/cubemercurypbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{7988D594-BA33-5843-886B-9E23FD9B1B3F}", + "subId": 3637668335 + }, + "assetHint": "prefabs/testdata/graphics/cubenickelpolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{CDDFE051-9910-5CD5-BD62-6FC729910CE5}", + "subId": 3334536131 + }, + "assetHint": "prefabs/testdata/graphics/cubepalladiumpolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{F336F1A7-7FDF-5972-A48E-58DC83D152A4}", + "subId": 610633662 + }, + "assetHint": "prefabs/testdata/graphics/cubeplatinumpolishedpbr.spawnable" + } + }, + "Advanced": true + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{32B00E51-BC05-5F03-A9AA-2D7AFE680EAC}", + "subId": 3534297619 + }, + "assetHint": "prefabs/testdata/graphics/cubesilverpolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{BBAB8640-03D2-5138-B52F-D031F29AF8C9}", + "subId": 923463205 + }, + "assetHint": "prefabs/testdata/graphics/cubetitaniumpolishedpbr.spawnable" + } + } + } + ] + } + }, + "Component_[2434532182352640072]": { + "$type": "EditorLockComponent", + "Id": 2434532182352640072 + }, + "Component_[6884260241620821202]": { + "$type": "SelectionComponent", + "Id": 6884260241620821202 + }, + "Component_[7575363224499024733]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7575363224499024733 + }, + "Component_[9440481613501976688]": { + "$type": "EditorEntityIconComponent", + "Id": 9440481613501976688 + }, + "Component_[9636552512161785427]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9636552512161785427 + } + } + } + }, + "Instances": { + "Instance_[1031595716809]": { + "Source": "Prefabs/TestData/Graphics/CubeAluminumPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[1006636009791072742]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[1006636009791072742]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[1006636009791072742]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[1160444735689]": { + "Source": "Prefabs/TestData/Graphics/CubeBrassPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[17333992135029064645]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[17333992135029064645]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[17333992135029064645]/Transform Data/Translate/1", + "value": 1.4970321655273438 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[17333992135029064645]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[1306473623753]": { + "Source": "Prefabs/TestData/Graphics/CubeChromePolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[15205683346512266293]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[15205683346512266293]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[15205683346512266293]/Transform Data/Translate/1", + "value": 3.06375503540039 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[15205683346512266293]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[1469682381001]": { + "Source": "Prefabs/TestData/Graphics/CubeCobaltPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[12811832964126776693]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[12811832964126776693]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[12811832964126776693]/Transform Data/Translate/1", + "value": 4.512233734130859 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[12811832964126776693]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[1650071007433]": { + "Source": "Prefabs/TestData/Graphics/CubeCopperPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5749675910289562089]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5749675910289562089]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5749675910289562089]/Transform Data/Translate/1", + "value": 5.966960906982422 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5749675910289562089]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[1847639503049]": { + "Source": "Prefabs/TestData/Graphics/CubeGoldPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[11570676153379582500]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[11570676153379582500]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[11570676153379582500]/Transform Data/Translate/1", + "value": 7.424510955810547 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[11570676153379582500]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[2062387867849]": { + "Source": "Prefabs/TestData/Graphics/CubeIronPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[17506200912680653288]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[17506200912680653288]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[17506200912680653288]/Transform Data/Translate/1", + "value": 8.888202667236328 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[17506200912680653288]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[2294316101833]": { + "Source": "Prefabs/TestData/Graphics/CubeNickelPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[12821987693261496174]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[12821987693261496174]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[12821987693261496174]/Transform Data/Translate/1", + "value": 10.4295654296875 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[12821987693261496174]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[2543424205001]": { + "Source": "Prefabs/TestData/Graphics/CubePalladiumPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[16012620721047170064]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[16012620721047170064]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[16012620721047170064]/Transform Data/Translate/1", + "value": 12.071407318115234 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[16012620721047170064]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[2809712177353]": { + "Source": "Prefabs/TestData/Graphics/CubePlatinumPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[1499102502234135899]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[1499102502234135899]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[1499102502234135899]/Transform Data/Translate/1", + "value": 13.582500457763672 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[1499102502234135899]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[3093180018889]": { + "Source": "Prefabs/TestData/Graphics/CubeSilverPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[18049054501916401618]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[18049054501916401618]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[18049054501916401618]/Transform Data/Translate/1", + "value": 15.026111602783203 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[18049054501916401618]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[3398122696905]": { + "Source": "Prefabs/TestData/Graphics/CubeTitaniumPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[14924371629431224666]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[14924371629431224666]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[14924371629431224666]/Transform Data/Translate/1", + "value": 16.513294219970703 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[14924371629431224666]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[919926567113]": { + "Source": "Prefabs/TestData/Graphics/CubeMercuryPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[2268958959705742396]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[2268958959705742396]/Transform Data/Translate/0", + "value": -270.14752197265625 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[2268958959705742396]/Transform Data/Translate/1", + "value": 10.24942398071289 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[2268958959705742396]/Transform Data/Translate/2", + "value": 1.0 + } + ] + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Performance/10kVegInstancesTest/tags.txt b/AutomatedTesting/Levels/Performance/10kVegInstancesTest/tags.txt new file mode 100644 index 0000000000..0d6c1880e7 --- /dev/null +++ b/AutomatedTesting/Levels/Performance/10kVegInstancesTest/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/AtomCubeWall.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/AtomCubeWall.prefab new file mode 100644 index 0000000000..eda62c6f52 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/AtomCubeWall.prefab @@ -0,0 +1,102345 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "AtomCubeWall", + "Components": { + "Component_[1378762968271397696]": { + "$type": "EditorPrefabComponent", + "Id": 1378762968271397696 + }, + "Component_[15861901244881316506]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15861901244881316506 + }, + "Component_[1667542861598358689]": { + "$type": "EditorVisibilityComponent", + "Id": 1667542861598358689 + }, + "Component_[2970248835877935836]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2970248835877935836 + }, + "Component_[3475481110579263685]": { + "$type": "EditorEntityIconComponent", + "Id": 3475481110579263685 + }, + "Component_[4960733274366718926]": { + "$type": "EditorOnlyEntityComponent", + "Id": 4960733274366718926 + }, + "Component_[5052757994340238524]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5052757994340238524, + "Parent Entity": "" + }, + "Component_[5847627832229774671]": { + "$type": "SelectionComponent", + "Id": 5847627832229774671 + }, + "Component_[686142448804056059]": { + "$type": "EditorInspectorComponent", + "Id": 686142448804056059 + }, + "Component_[8743584510936460932]": { + "$type": "EditorLockComponent", + "Id": 8743584510936460932 + }, + "Component_[9497718940671573904]": { + "$type": "EditorEntitySortComponent", + "Id": 9497718940671573904, + "Child Entity Order": [ + "Entity_[728313751508]", + "Entity_[3017531320276]", + "Entity_[2149947926484]", + "Entity_[3236574652372]", + "Entity_[2618099361748]", + "Entity_[1922314659796]", + "Entity_[2493545310164]", + "Entity_[887227541460]", + "Entity_[1458458191828]", + "Entity_[1638846818260]", + "Entity_[479205648340]", + "Entity_[2850027595732]", + "Entity_[947357083604]", + "Entity_[3640301578196]", + "Entity_[3094840731604]", + "Entity_[483500615636]", + "Entity_[4327496345556]", + "Entity_[2880092366804]", + "Entity_[487795582932]", + "Entity_[3348243802068]", + "Entity_[3983898961876]", + "Entity_[3429848180692]", + "Entity_[1497112897492]", + "Entity_[2295976814548]", + "Entity_[504975452116]", + "Entity_[2351811389396]", + "Entity_[3507157592020]", + "Entity_[646709372884]", + "Entity_[577989896148]", + "Entity_[2545084917716]", + "Entity_[2609509427156]", + "Entity_[3919474452436]", + "Entity_[3305294129108]", + "Entity_[3030416222164]", + "Entity_[1973854267348]", + "Entity_[4275956738004]", + "Entity_[2892977268692]", + "Entity_[2390466095060]", + "Entity_[3790625433556]", + "Entity_[3185035044820]", + "Entity_[492090550228]", + "Entity_[2781308118996]", + "Entity_[1230824925140]", + "Entity_[3399783409620]", + "Entity_[2098408318932]", + "Entity_[1862185117652]", + "Entity_[3090545764308]", + "Entity_[1600192112596]", + "Entity_[762673489876]", + "Entity_[2029688842196]", + "Entity_[917292312532]", + "Entity_[706838915028]", + "Entity_[745493620692]", + "Entity_[2562264786900]", + "Entity_[2141357991892]", + "Entity_[556515059668]", + "Entity_[2575149688788]", + "Entity_[535040223188]", + "Entity_[530745255892]", + "Entity_[496385517524]", + "Entity_[3043301124052]", + "Entity_[2635279230932]", + "Entity_[2777013151700]", + "Entity_[3425553213396]", + "Entity_[2716883609556]", + "Entity_[1909429757908]", + "Entity_[3524337461204]", + "Entity_[3116315568084]", + "Entity_[4495000070100]", + "Entity_[865752704980]", + "Entity_[831392966612]", + "Entity_[2373286225876]", + "Entity_[3876524779476]", + "Entity_[500680484820]", + "Entity_[509270419412]", + "Entity_[513565386708]", + "Entity_[2953106810836]", + "Entity_[4125632882644]", + "Entity_[3756265695188]", + "Entity_[2025393874900]", + "Entity_[3159265241044]", + "Entity_[2003919038420]", + "Entity_[1385443747796]", + "Entity_[719723816916]", + "Entity_[2476365440980]", + "Entity_[3296704194516]", + "Entity_[4314611443668]", + "Entity_[1329609172948]", + "Entity_[517860354004]", + "Entity_[4245891966932]", + "Entity_[1540062570452]", + "Entity_[522155321300]", + "Entity_[1814940477396]", + "Entity_[1093385971668]", + "Entity_[4215827195860]", + "Entity_[3966719092692]", + "Entity_[771263424468]", + "Entity_[526450288596]", + "Entity_[681069111252]", + "Entity_[1205055121364]", + "Entity_[2368991258580]", + "Entity_[3258049488852]", + "Entity_[4104158046164]", + "Entity_[912997345236]", + "Entity_[1282364532692]", + "Entity_[1617371981780]", + "Entity_[4357561116628]", + "Entity_[629529503700]", + "Entity_[2845732628436]", + "Entity_[2557969819604]", + "Entity_[2210077468628]", + "Entity_[1411213551572]", + "Entity_[1634551850964]", + "Entity_[552220092372]", + "Entity_[1905134790612]", + "Entity_[1552947472340]", + "Entity_[2317451651028]", + "Entity_[1278069565396]", + "Entity_[3142085371860]", + "Entity_[1123450742740]", + "Entity_[539335190484]", + "Entity_[3416963278804]", + "Entity_[1136335644628]", + "Entity_[1677501523924]", + "Entity_[3180740077524]", + "Entity_[2630984263636]", + "Entity_[638119438292]", + "Entity_[754083555284]", + "Entity_[1771990804436]", + "Entity_[981716821972]", + "Entity_[844277868500]", + "Entity_[543630157780]", + "Entity_[1733336098772]", + "Entity_[3283819292628]", + "Entity_[1007486625748]", + "Entity_[4013963732948]", + "Entity_[1673206556628]", + "Entity_[2940221908948]", + "Entity_[595169765332]", + "Entity_[3897999615956]", + "Entity_[1325314205652]", + "Entity_[547925125076]", + "Entity_[2424825833428]", + "Entity_[2347516422100]", + "Entity_[612349634516]", + "Entity_[1918019692500]", + "Entity_[1754810935252]", + "Entity_[4301726541780]", + "Entity_[3584467003348]", + "Entity_[560810026964]", + "Entity_[2832847726548]", + "Entity_[2016803940308]", + "Entity_[3915179485140]", + "Entity_[4585194383316]", + "Entity_[569399961556]", + "Entity_[3520042493908]", + "Entity_[3859344910292]", + "Entity_[2463480539092]", + "Entity_[4039733536724]", + "Entity_[779853359060]", + "Entity_[2983171581908]", + "Entity_[1832120346580]", + "Entity_[2334631520212]", + "Entity_[603759699924]", + "Entity_[1342494074836]", + "Entity_[2673933936596]", + "Entity_[565104994260]", + "Entity_[3279524325332]", + "Entity_[573694928852]", + "Entity_[3601646872532]", + "Entity_[582284863444]", + "Entity_[4443460462548]", + "Entity_[1879364986836]", + "Entity_[1750515967956]", + "Entity_[4082683209684]", + "Entity_[620939569108]", + "Entity_[973126887380]", + "Entity_[1179285317588]", + "Entity_[1406918584276]", + "Entity_[2330336552916]", + "Entity_[2253027141588]", + "Entity_[1802055575508]", + "Entity_[3992488896468]", + "Entity_[1359673944020]", + "Entity_[1424098453460]", + "Entity_[1720451196884]", + "Entity_[3545812297684]", + "Entity_[4482115168212]", + "Entity_[4589489350612]", + "Entity_[3906589550548]", + "Entity_[4224417130452]", + "Entity_[3412668311508]", + "Entity_[3812100270036]", + "Entity_[3447028049876]", + "Entity_[2068343547860]", + "Entity_[1887954921428]", + "Entity_[4546539677652]", + "Entity_[4147107719124]", + "Entity_[1196465186772]", + "Entity_[2987466549204]", + "Entity_[2695408773076]", + "Entity_[2691113805780]", + "Entity_[4202942293972]", + "Entity_[2171422762964]", + "Entity_[1501407864788]", + "Entity_[4563719546836]", + "Entity_[4417690658772]", + "Entity_[3683251251156]", + "Entity_[2046868711380]", + "Entity_[4529359808468]", + "Entity_[3837870073812]", + "Entity_[3163560208340]", + "Entity_[2785603086292]", + "Entity_[3073365895124]", + "Entity_[2523610081236]", + "Entity_[4159992621012]", + "Entity_[1978149234644]", + "Entity_[4035438569428]", + "Entity_[1759105902548]", + "Entity_[2145652959188]", + "Entity_[934472181716]", + "Entity_[3975309027284]", + "Entity_[3721905956820]", + "Entity_[2918747072468]", + "Entity_[3666071381972]", + "Entity_[3893704648660]", + "Entity_[2313156683732]", + "Entity_[2510725179348]", + "Entity_[1059026233300]", + "Entity_[2403350996948]", + "Entity_[1286659499988]", + "Entity_[3356833736660]", + "Entity_[2497840277460]", + "Entity_[2648164132820]", + "Entity_[3605941839828]", + "Entity_[741198653396]", + "Entity_[2579444656084]", + "Entity_[1840710281172]", + "Entity_[1960969365460]", + "Entity_[2764128249812]", + "Entity_[4469230266324]", + "Entity_[4022553667540]", + "Entity_[4336086280148]", + "Entity_[1471343093716]", + "Entity_[2837142693844]", + "Entity_[2703998707668]", + "Entity_[4409100724180]", + "Entity_[4237302032340]", + "Entity_[3039006156756]", + "Entity_[4430575560660]", + "Entity_[3335358900180]", + "Entity_[2923042039764]", + "Entity_[4593784317908]", + "Entity_[1213645055956]", + "Entity_[4344676214740]", + "Entity_[827097999316]", + "Entity_[951652050900]", + "Entity_[4413395691476]", + "Entity_[4207237261268]", + "Entity_[4056913405908]", + "Entity_[2721178576852]", + "Entity_[2081228449748]", + "Entity_[3794920400852]", + "Entity_[4194352359380]", + "Entity_[2965991712724]", + "Entity_[1415508518868]", + "Entity_[4031143602132]", + "Entity_[3197919946708]", + "Entity_[3099135698900]", + "Entity_[1570127341524]", + "Entity_[4516474906580]", + "Entity_[3438438115284]", + "Entity_[4172877522900]", + "Entity_[2433415768020]", + "Entity_[4473525233620]", + "Entity_[3760560662484]", + "Entity_[4052618438612]", + "Entity_[1643141785556]", + "Entity_[1368263878612]", + "Entity_[3240869619668]", + "Entity_[4572309481428]", + "Entity_[2798487988180]", + "Entity_[1101975906260]", + "Entity_[1518587733972]", + "Entity_[3962424125396]", + "Entity_[4267366803412]", + "Entity_[4095568111572]", + "Entity_[1557242439636]", + "Entity_[3936654321620]", + "Entity_[2665344002004]", + "Entity_[4044028504020]", + "Entity_[4447755429844]", + "Entity_[1243709827028]", + "Entity_[977421854676]", + "Entity_[2901567203284]", + "Entity_[642414405588]", + "Entity_[4323201378260]", + "Entity_[1767695837140]", + "Entity_[3691841185748]", + "Entity_[1492817930196]", + "Entity_[3674661316564]", + "Entity_[3515747526612]", + "Entity_[2871502432212]", + "Entity_[2506430212052]", + "Entity_[3777740531668]", + "Entity_[2386171127764]", + "Entity_[1265184663508]", + "Entity_[586579830740]", + "Entity_[3120610535380]", + "Entity_[2420530866132]", + "Entity_[2725473544148]", + "Entity_[1252299761620]", + "Entity_[2321746618324]", + "Entity_[3820690204628]", + "Entity_[3979603994580]", + "Entity_[3318179030996]", + "Entity_[1505702832084]", + "Entity_[1428393420756]", + "Entity_[3678956283860]", + "Entity_[1338199107540]", + "Entity_[895817476052]", + "Entity_[1660321654740]", + "Entity_[4525064841172]", + "Entity_[698248980436]", + "Entity_[4134222817236]", + "Entity_[2265912043476]", + "Entity_[1312429303764]", + "Entity_[4254481901524]", + "Entity_[4499295037396]", + "Entity_[3000351451092]", + "Entity_[3988193929172]", + "Entity_[655299307476]", + "Entity_[1346789042132]", + "Entity_[3769150597076]", + "Entity_[2480660408276]", + "Entity_[1866480084948]", + "Entity_[2214372435924]", + "Entity_[1046141331412]", + "Entity_[2261617076180]", + "Entity_[2042573744084]", + "Entity_[1183580284884]", + "Entity_[861457737684]", + "Entity_[1033256429524]", + "Entity_[711133882324]", + "Entity_[3928064387028]", + "Entity_[1316724271060]", + "Entity_[1003191658452]", + "Entity_[2218667403220]", + "Entity_[2991761516500]", + "Entity_[4452050397140]", + "Entity_[2291681847252]", + "Entity_[2751243347924]", + "Entity_[1784875706324]", + "Entity_[3176445110228]", + "Entity_[2815667857364]", + "Entity_[4533654775764]", + "Entity_[3610236807124]", + "Entity_[3880819746772]", + "Entity_[3124905502676]", + "Entity_[3494272690132]", + "Entity_[835687933908]", + "Entity_[1363968911316]", + "Entity_[3378308573140]", + "Entity_[1703271327700]", + "Entity_[3636006610900]", + "Entity_[2180012697556]", + "Entity_[1389738715092]", + "Entity_[4580899416020]", + "Entity_[3322473998292]", + "Entity_[878637606868]", + "Entity_[3550107264980]", + "Entity_[1166400415700]", + "Entity_[4370446018516]", + "Entity_[2240142239700]", + "Entity_[2399056029652]", + "Entity_[2729768511444]", + "Entity_[4310316476372]", + "Entity_[3189330012116]", + "Entity_[3047596091348]", + "Entity_[3867934844884]", + "Entity_[2867207464916]", + "Entity_[3575877068756]", + "Entity_[2446300669908]", + "Entity_[2536494983124]", + "Entity_[3262344456148]", + "Entity_[4486410135508]", + "Entity_[2519315113940]", + "Entity_[1724746164180]", + "Entity_[4048323471316]", + "Entity_[3051891058644]", + "Entity_[1419803486164]", + "Entity_[797033228244]", + "Entity_[1041846364116]", + "Entity_[4460640331732]", + "Entity_[3833575106516]", + "Entity_[3464207919060]", + "Entity_[1651731720148]", + "Entity_[1162105448404]", + "Entity_[663889242068]", + "Entity_[2755538315220]", + "Entity_[4507884971988]", + "Entity_[1522882701268]", + "Entity_[4151402686420]", + "Entity_[1144925579220]", + "Entity_[3850754975700]", + "Entity_[1467048126420]", + "Entity_[3945244256212]", + "Entity_[3958129158100]", + "Entity_[4061208373204]", + "Entity_[4555129612244]", + "Entity_[1299544401876]", + "Entity_[2897272235988]", + "Entity_[882932574164]", + "Entity_[4396215822292]", + "Entity_[1106270873556]", + "Entity_[2188602632148]", + "Entity_[2807077922772]", + "Entity_[998896691156]", + "Entity_[4331791312852]", + "Entity_[2197192566740]", + "Entity_[2738358446036]", + "Entity_[986011789268]", + "Entity_[4138517784532]", + "Entity_[1239414859732]", + "Entity_[1273774598100]", + "Entity_[2338926487508]", + "Entity_[2450595637204]", + "Entity_[784148326356]", + "Entity_[3704726087636]", + "Entity_[689659045844]", + "Entity_[3571582101460]", + "Entity_[1900839823316]", + "Entity_[1114860808148]", + "Entity_[4426280593364]", + "Entity_[4280251705300]", + "Entity_[4108453013460]", + "Entity_[1793465640916]", + "Entity_[4404805756884]", + "Entity_[2394761062356]", + "Entity_[2175717730260]", + "Entity_[3532927395796]", + "Entity_[3459912951764]", + "Entity_[1217940023252]", + "Entity_[1097680938964]", + "Entity_[3751970727892]", + "Entity_[1028961462228]", + "Entity_[3747675760596]", + "Entity_[4220122163156]", + "Entity_[3717610989524]", + "Entity_[3288114259924]", + "Entity_[1595897145300]", + "Entity_[1149220546516]", + "Entity_[599464732628]", + "Entity_[2583739623380]", + "Entity_[1436983355348]", + "Entity_[1913724725204]", + "Entity_[2935926941652]", + "Entity_[1690386425812]", + "Entity_[3206509881300]", + "Entity_[2137063024596]", + "Entity_[1054731266004]", + "Entity_[3842165041108]", + "Entity_[4001078831060]", + "Entity_[4348971182036]", + "Entity_[4293136607188]", + "Entity_[1222234990548]", + "Entity_[968831920084]", + "Entity_[4391920854996]", + "Entity_[2592329557972]", + "Entity_[870047672276]", + "Entity_[1711861262292]", + "Entity_[1608782047188]", + "Entity_[4306021509076]", + "Entity_[1999624071124]", + "Entity_[1269479630804]", + "Entity_[1140630611924]", + "Entity_[2227257337812]", + "Entity_[3339653867476]", + "Entity_[2854322563028]", + "Entity_[1024666494932]", + "Entity_[2686818838484]", + "Entity_[2300271781844]", + "Entity_[4361856083924]", + "Entity_[1527177668564]", + "Entity_[1372558845908]", + "Entity_[1514292766676]", + "Entity_[1943789496276]", + "Entity_[4340381247444]", + "Entity_[1737631066068]", + "Entity_[3996783863764]", + "Entity_[1574422308820]", + "Entity_[2059753613268]", + "Entity_[4009668765652]", + "Entity_[3713316022228]", + "Entity_[3846460008404]", + "Entity_[2553674852308]", + "Entity_[1321019238356]", + "Entity_[3167855175636]", + "Entity_[2961696745428]", + "Entity_[788443293652]", + "Entity_[4250186934228]", + "Entity_[4074093275092]", + "Entity_[3537222363092]", + "Entity_[4318906410964]", + "Entity_[1664616622036]", + "Entity_[4297431574484]", + "Entity_[4065503340500]", + "Entity_[994601723860]", + "Entity_[4142812751828]", + "Entity_[1333904140244]", + "Entity_[4117042948052]", + "Entity_[2996056483796]", + "Entity_[4263071836116]", + "Entity_[3940949288916]", + "Entity_[1351084009428]", + "Entity_[2094113351636]", + "Entity_[1797760608212]", + "Entity_[4241596999636]", + "Entity_[857162770388]", + "Entity_[3855049942996]", + "Entity_[2742653413332]", + "Entity_[2416235898836]", + "Entity_[3472797853652]", + "Entity_[3644596545492]", + "Entity_[2759833282516]", + "Entity_[4185762424788]", + "Entity_[3077660862420]", + "Entity_[2154242893780]", + "Entity_[2794193020884]", + "Entity_[1819235444692]", + "Entity_[3004646418388]", + "Entity_[1810645510100]", + "Entity_[4078388242388]", + "Entity_[4503590004692]", + "Entity_[2270207010772]", + "Entity_[3902294583252]", + "Entity_[3270934390740]", + "Entity_[1780580739028]", + "Entity_[3567287134164]", + "Entity_[3511452559316]", + "Entity_[4190057392084]", + "Entity_[1355378976724]", + "Entity_[3249459554260]", + "Entity_[3137790404564]", + "Entity_[4129927849940]", + "Entity_[2235847272404]", + "Entity_[4086978176980]", + "Entity_[3657481447380]", + "Entity_[2841437661140]", + "Entity_[2862912497620]", + "Entity_[4005373798356]", + "Entity_[3786330466260]", + "Entity_[814213097428]", + "Entity_[1308134336468]", + "Entity_[1707566294996]", + "Entity_[2356106356692]", + "Entity_[3889409681364]", + "Entity_[1153515513812]", + "Entity_[4542244710356]", + "Entity_[3614531774420]", + "Entity_[4434870527956]", + "Entity_[3202214914004]", + "Entity_[616644601812]", + "Entity_[2978876614612]", + "Entity_[3421258246100]", + "Entity_[4177172490196]", + "Entity_[2119883155412]", + "Entity_[1986739169236]", + "Entity_[2661049034708]", + "Entity_[3648891512788]", + "Entity_[4026848634836]", + "Entity_[2283091912660]", + "Entity_[1020371527636]", + "Entity_[990306756564]", + "Entity_[3498567657428]", + "Entity_[964536952788]", + "Entity_[2605214459860]", + "Entity_[2802782955476]", + "Entity_[2162832828372]", + "Entity_[2639574198228]", + "Entity_[4353266149332]", + "Entity_[4550834644948]", + "Entity_[2888682301396]", + "Entity_[3726200924116]", + "Entity_[2326041585620]", + "Entity_[1303839369172]", + "Entity_[3227984717780]", + "Entity_[1462753159124]", + "Entity_[2278796945364]", + "Entity_[1698976360404]", + "Entity_[4464935299028]", + "Entity_[2669638969300]", + "Entity_[801328195540]", + "Entity_[1565832374228]", + "Entity_[2377581193172]", + "Entity_[2970286680020]", + "Entity_[4387625887700]", + "Entity_[1763400869844]", + "Entity_[1789170673620]", + "Entity_[3021826287572]", + "Entity_[1982444201940]", + "Entity_[1625961916372]", + "Entity_[2613804394452]", + "Entity_[4211532228564]", + "Entity_[3807805302740]", + "Entity_[3502862624724]", + "Entity_[775558391764]", + "Entity_[3326768965588]", + "Entity_[2532200015828]", + "Entity_[3154970273748]", + "Entity_[3872229812180]", + "Entity_[3382603540436]", + "Entity_[1991034136532]", + "Entity_[1119155775444]", + "Entity_[2699703740372]", + "Entity_[2515020146644]", + "Entity_[1952379430868]", + "Entity_[1011781593044]", + "Entity_[4421985626068]", + "Entity_[1402623616980]", + "Entity_[4568014514132]", + "Entity_[4576604448724]", + "Entity_[3253754521556]", + "Entity_[1630256883668]", + "Entity_[2222962370516]", + "Entity_[3219394783188]", + "Entity_[3232279685076]", + "Entity_[3107725633492]", + "Entity_[633824470996]", + "Entity_[1896544856020]", + "Entity_[724018784212]", + "Entity_[1531472635860]", + "Entity_[2588034590676]", + "Entity_[3408373344212]", + "Entity_[852867803092]", + "Entity_[904407410644]", + "Entity_[2489250342868]", + "Entity_[3554402232276]", + "Entity_[921587279828]", + "Entity_[1827825379284]", + "Entity_[1295249434580]", + "Entity_[2540789950420]", + "Entity_[4271661770708]", + "Entity_[3442733082580]", + "Entity_[2527905048532]", + "Entity_[1544357537748]", + "Entity_[608054667220]", + "Entity_[2734063478740]", + "Entity_[4477820200916]", + "Entity_[693954013140]", + "Entity_[2931631974356]", + "Entity_[2111293220820]", + "Entity_[736903686100]", + "Entity_[1170695382996]", + "Entity_[3597351905236]", + "Entity_[2033983809492]", + "Entity_[839982901204]", + "Entity_[3562992166868]", + "Entity_[2914452105172]", + "Entity_[766968457172]", + "Entity_[848572835796]", + "Entity_[2132768057300]", + "Entity_[3395488442324]", + "Entity_[1883659954132]", + "Entity_[1484227995604]", + "Entity_[1849300215764]", + "Entity_[3343948834772]", + "Entity_[1587307210708]", + "Entity_[2467775506388]", + "Entity_[3971014059988]", + "Entity_[874342639572]", + "Entity_[1187875252180]", + "Entity_[1995329103828]", + "Entity_[3485682755540]", + "Entity_[2910157137876]", + "Entity_[4228712097748]", + "Entity_[3064775960532]", + "Entity_[2102703286228]", + "Entity_[3150675306452]", + "Entity_[2051163678676]", + "Entity_[2643869165524]", + "Entity_[1591602178004]", + "Entity_[2244437206996]", + "Entity_[2746948380628]", + "Entity_[1256594728916]", + "Entity_[1248004794324]", + "Entity_[3215099815892]", + "Entity_[2626689296340]", + "Entity_[672479176660]", + "Entity_[891522508756]", + "Entity_[1965264332756]", + "Entity_[1260889696212]", + "Entity_[955947018196]", + "Entity_[1445573289940]", + "Entity_[3653186480084]", + "Entity_[2459185571796]", + "Entity_[3588761970644]", + "Entity_[2304566749140]", + "Entity_[2948811843540]", + "Entity_[1080501069780]", + "Entity_[3829280139220]", + "Entity_[1127745710036]", + "Entity_[685364078548]", + "Entity_[3060480993236]", + "Entity_[2549379885012]", + "Entity_[3700431120340]", + "Entity_[2201487534036]", + "Entity_[3365423671252]", + "Entity_[925882247124]", + "Entity_[3361128703956]", + "Entity_[2308861716436]", + "Entity_[3086250797012]", + "Entity_[1686091458516]", + "Entity_[3623121709012]", + "Entity_[1776285771732]", + "Entity_[1376853813204]", + "Entity_[960241985492]", + "Entity_[3309589096404]", + "Entity_[1449868257236]", + "Entity_[3013236352980]", + "Entity_[2600919492564]", + "Entity_[3172150142932]", + "Entity_[2205782501332]", + "Entity_[4258776868820]", + "Entity_[2927337007060]", + "Entity_[1969559300052]", + "Entity_[1488522962900]", + "Entity_[809918130132]", + "Entity_[3558697199572]", + "Entity_[4383330920404]", + "Entity_[1381148780500]", + "Entity_[4233007065044]", + "Entity_[3292409227220]", + "Entity_[3910884517844]", + "Entity_[1935199561684]", + "Entity_[2076933482452]", + "Entity_[900112443348]", + "Entity_[2274501978068]", + "Entity_[1089091004372]", + "Entity_[3193624979412]", + "Entity_[1892249888724]", + "Entity_[1209350088660]", + "Entity_[3885114714068]", + "Entity_[2957401778132]", + "Entity_[2231552305108]", + "Entity_[2192897599444]", + "Entity_[943062116308]", + "Entity_[2974581647316]", + "Entity_[3580172036052]", + "Entity_[3627416676308]", + "Entity_[4559424579540]", + "Entity_[2454890604500]", + "Entity_[1475638061012]", + "Entity_[2824257791956]", + "Entity_[4198647326676]", + "Entity_[4520769873876]", + "Entity_[1479933028308]", + "Entity_[2566559754196]", + "Entity_[1604487079892]", + "Entity_[1561537406932]", + "Entity_[3331063932884]", + "Entity_[1729041131476]", + "Entity_[676774143956]", + "Entity_[2158537861076]", + "Entity_[1948084463572]", + "Entity_[4112747980756]", + "Entity_[1132040677332]", + "Entity_[1870775052244]", + "Entity_[3468502886356]", + "Entity_[1174990350292]", + "Entity_[715428849620]", + "Entity_[590874798036]", + "Entity_[3773445564372]", + "Entity_[1716156229588]", + "Entity_[3803510335444]", + "Entity_[1441278322644]", + "Entity_[2248732174292]", + "Entity_[4284546672596]", + "Entity_[3369718638548]", + "Entity_[4598079285204]", + "Entity_[659594274772]", + "Entity_[2381876160468]", + "Entity_[2115588188116]", + "Entity_[3764855629780]", + "Entity_[2811372890068]", + "Entity_[1746221000660]", + "Entity_[3034711189460]", + "Entity_[4366151051220]", + "Entity_[1157810481108]", + "Entity_[651004340180]", + "Entity_[2875797399508]", + "Entity_[2257322108884]", + "Entity_[3223689750484]", + "Entity_[2570854721492]", + "Entity_[4456345364436]", + "Entity_[1578717276116]", + "Entity_[2656754067412]", + "Entity_[1926609627092]", + "Entity_[2772718184404]", + "Entity_[1647436752852]", + "Entity_[3210804848596]", + "Entity_[818508064724]", + "Entity_[4537949743060]", + "Entity_[4018258700244]", + "Entity_[2768423217108]", + "Entity_[1432688388052]", + "Entity_[2360401323988]", + "Entity_[2343221454804]", + "Entity_[2622394329044]", + "Entity_[792738260948]", + "Entity_[1694681393108]", + "Entity_[2038278776788]", + "Entity_[3266639423444]", + "Entity_[4155697653716]", + "Entity_[3313884063700]", + "Entity_[2442005702612]", + "Entity_[1084796037076]", + "Entity_[1535767603156]", + "Entity_[3391193475028]", + "Entity_[3923769419732]", + "Entity_[3782035498964]", + "Entity_[3953834190804]", + "Entity_[625234536404]", + "Entity_[4512179939284]", + "Entity_[3081955829716]", + "Entity_[3275229358036]", + "Entity_[4091273144276]", + "Entity_[2858617530324]", + "Entity_[1235119892436]", + "Entity_[3300999161812]", + "Entity_[2021098907604]", + "Entity_[2596624525268]", + "Entity_[3069070927828]", + "Entity_[2905862170580]", + "Entity_[3734790858708]", + "Entity_[3008941385684]", + "Entity_[4490705102804]", + "Entity_[822803032020]", + "Entity_[3709021054932]", + "Entity_[2484955375572]", + "Entity_[2502135244756]", + "Entity_[3404078376916]", + "Entity_[3687546218452]", + "Entity_[3112020600788]", + "Entity_[3056186025940]", + "Entity_[749788587988]", + "Entity_[4379035953108]", + "Entity_[1067616167892]", + "Entity_[3352538769364]", + "Entity_[4099863078868]", + "Entity_[2411940931540]", + "Entity_[1656026687444]", + "Entity_[3932359354324]", + "Entity_[1741926033364]", + "Entity_[4168582555604]", + "Entity_[2064048580564]", + "Entity_[758378522580]", + "Entity_[2678228903892]", + "Entity_[3631711643604]", + "Entity_[2287386879956]", + "Entity_[1845005248468]", + "Entity_[3477092820948]", + "Entity_[2089818384340]", + "Entity_[1037551396820]", + "Entity_[702543947732]", + "Entity_[1681796491220]", + "Entity_[908702377940]", + "Entity_[2106998253524]", + "Entity_[3129200469972]", + "Entity_[3863639877588]", + "Entity_[1050436298708]", + "Entity_[2012508973012]", + "Entity_[3618826741716]", + "Entity_[3386898507732]", + "Entity_[3434143147988]", + "Entity_[2437710735316]", + "Entity_[4288841639892]", + "Entity_[1875070019540]", + "Entity_[2128473090004]", + "Entity_[3949539223508]", + "Entity_[3489977722836]", + "Entity_[1668911589332]", + "Entity_[1398328649684]", + "Entity_[3541517330388]", + "Entity_[1806350542804]", + "Entity_[2085523417044]", + "Entity_[732608718804]", + "Entity_[4439165495252]", + "Entity_[3528632428500]", + "Entity_[2407645964244]", + "Entity_[1930904594388]", + "Entity_[4374740985812]", + "Entity_[1509997799380]", + "Entity_[1290954467284]", + "Entity_[2819962824660]", + "Entity_[2944516876244]", + "Entity_[1583012243412]", + "Entity_[1613077014484]", + "Entity_[3451323017172]", + "Entity_[938767149012]", + "Entity_[3739085826004]", + "Entity_[1192170219476]", + "Entity_[3824985171924]", + "Entity_[1956674398164]", + "Entity_[2789898053588]", + "Entity_[3146380339156]", + "Entity_[3670366349268]", + "Entity_[2429120800724]", + "Entity_[1076206102484]", + "Entity_[1394033682388]", + "Entity_[3455617984468]", + "Entity_[2712588642260]", + "Entity_[4181467457492]", + "Entity_[3103430666196]", + "Entity_[1200760154068]", + "Entity_[4121337915348]", + "Entity_[2652459100116]", + "Entity_[1621666949076]", + "Entity_[1063321200596]", + "Entity_[1823530411988]", + "Entity_[2682523871188]", + "Entity_[3696136153044]", + "Entity_[3816395237332]", + "Entity_[1939494528980]", + "Entity_[2884387334100]", + "Entity_[2124178122708]", + "Entity_[3026121254868]", + "Entity_[1853595183060]", + "Entity_[2828552759252]", + "Entity_[2364696291284]", + "Entity_[2072638515156]", + "Entity_[2008214005716]", + "Entity_[930177214420]", + "Entity_[2472070473684]", + "Entity_[3133495437268]", + "Entity_[668184209364]", + "Entity_[3593056937940]", + "Entity_[3481387788244]", + "Entity_[1016076560340]", + "Entity_[3730495891412]", + "Entity_[2055458645972]", + "Entity_[1454163224532]", + "Entity_[2167127795668]", + "Entity_[2184307664852]", + "Entity_[1836415313876]", + "Entity_[3374013605844]", + "Entity_[2708293674964]", + "Entity_[3743380793300]", + "Entity_[3661776414676]", + "Entity_[805623162836]", + "Entity_[4400510789588]", + "Entity_[1071911135188]", + "Entity_[1857890150356]", + "Entity_[3245164586964]", + "Entity_[1226529957844]", + "Entity_[1548652505044]", + "Entity_[1110565840852]", + "Entity_[3799215368148]", + "Entity_[4164287588308]", + "Entity_[4069798307796]" + ] + } + } + }, + "Entities": { + "Entity_[1003191658452]": { + "Id": "Entity_[1003191658452]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1007486625748]": { + "Id": "Entity_[1007486625748]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1011781593044]": { + "Id": "Entity_[1011781593044]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1016076560340]": { + "Id": "Entity_[1016076560340]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1020371527636]": { + "Id": "Entity_[1020371527636]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1024666494932]": { + "Id": "Entity_[1024666494932]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1028961462228]": { + "Id": "Entity_[1028961462228]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1033256429524]": { + "Id": "Entity_[1033256429524]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1037551396820]": { + "Id": "Entity_[1037551396820]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1041846364116]": { + "Id": "Entity_[1041846364116]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1046141331412]": { + "Id": "Entity_[1046141331412]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1050436298708]": { + "Id": "Entity_[1050436298708]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1054731266004]": { + "Id": "Entity_[1054731266004]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1059026233300]": { + "Id": "Entity_[1059026233300]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1063321200596]": { + "Id": "Entity_[1063321200596]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1067616167892]": { + "Id": "Entity_[1067616167892]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1071911135188]": { + "Id": "Entity_[1071911135188]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1076206102484]": { + "Id": "Entity_[1076206102484]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1080501069780]": { + "Id": "Entity_[1080501069780]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1084796037076]": { + "Id": "Entity_[1084796037076]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1089091004372]": { + "Id": "Entity_[1089091004372]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1093385971668]": { + "Id": "Entity_[1093385971668]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1097680938964]": { + "Id": "Entity_[1097680938964]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1101975906260]": { + "Id": "Entity_[1101975906260]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1106270873556]": { + "Id": "Entity_[1106270873556]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1110565840852]": { + "Id": "Entity_[1110565840852]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1114860808148]": { + "Id": "Entity_[1114860808148]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1119155775444]": { + "Id": "Entity_[1119155775444]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1123450742740]": { + "Id": "Entity_[1123450742740]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1127745710036]": { + "Id": "Entity_[1127745710036]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1132040677332]": { + "Id": "Entity_[1132040677332]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1136335644628]": { + "Id": "Entity_[1136335644628]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1140630611924]": { + "Id": "Entity_[1140630611924]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1144925579220]": { + "Id": "Entity_[1144925579220]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1149220546516]": { + "Id": "Entity_[1149220546516]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1153515513812]": { + "Id": "Entity_[1153515513812]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1157810481108]": { + "Id": "Entity_[1157810481108]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1162105448404]": { + "Id": "Entity_[1162105448404]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1166400415700]": { + "Id": "Entity_[1166400415700]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1170695382996]": { + "Id": "Entity_[1170695382996]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1174990350292]": { + "Id": "Entity_[1174990350292]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1179285317588]": { + "Id": "Entity_[1179285317588]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1183580284884]": { + "Id": "Entity_[1183580284884]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1187875252180]": { + "Id": "Entity_[1187875252180]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1192170219476]": { + "Id": "Entity_[1192170219476]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1196465186772]": { + "Id": "Entity_[1196465186772]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1200760154068]": { + "Id": "Entity_[1200760154068]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1205055121364]": { + "Id": "Entity_[1205055121364]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1209350088660]": { + "Id": "Entity_[1209350088660]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1213645055956]": { + "Id": "Entity_[1213645055956]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1217940023252]": { + "Id": "Entity_[1217940023252]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1222234990548]": { + "Id": "Entity_[1222234990548]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1226529957844]": { + "Id": "Entity_[1226529957844]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1230824925140]": { + "Id": "Entity_[1230824925140]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1235119892436]": { + "Id": "Entity_[1235119892436]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1239414859732]": { + "Id": "Entity_[1239414859732]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1243709827028]": { + "Id": "Entity_[1243709827028]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1248004794324]": { + "Id": "Entity_[1248004794324]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1252299761620]": { + "Id": "Entity_[1252299761620]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1256594728916]": { + "Id": "Entity_[1256594728916]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1260889696212]": { + "Id": "Entity_[1260889696212]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1265184663508]": { + "Id": "Entity_[1265184663508]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1269479630804]": { + "Id": "Entity_[1269479630804]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1273774598100]": { + "Id": "Entity_[1273774598100]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1278069565396]": { + "Id": "Entity_[1278069565396]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1282364532692]": { + "Id": "Entity_[1282364532692]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1286659499988]": { + "Id": "Entity_[1286659499988]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1290954467284]": { + "Id": "Entity_[1290954467284]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1295249434580]": { + "Id": "Entity_[1295249434580]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1299544401876]": { + "Id": "Entity_[1299544401876]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1303839369172]": { + "Id": "Entity_[1303839369172]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1308134336468]": { + "Id": "Entity_[1308134336468]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1312429303764]": { + "Id": "Entity_[1312429303764]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1316724271060]": { + "Id": "Entity_[1316724271060]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1321019238356]": { + "Id": "Entity_[1321019238356]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1325314205652]": { + "Id": "Entity_[1325314205652]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1329609172948]": { + "Id": "Entity_[1329609172948]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1333904140244]": { + "Id": "Entity_[1333904140244]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1338199107540]": { + "Id": "Entity_[1338199107540]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1342494074836]": { + "Id": "Entity_[1342494074836]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1346789042132]": { + "Id": "Entity_[1346789042132]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1351084009428]": { + "Id": "Entity_[1351084009428]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1355378976724]": { + "Id": "Entity_[1355378976724]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1359673944020]": { + "Id": "Entity_[1359673944020]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1363968911316]": { + "Id": "Entity_[1363968911316]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1368263878612]": { + "Id": "Entity_[1368263878612]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1372558845908]": { + "Id": "Entity_[1372558845908]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1376853813204]": { + "Id": "Entity_[1376853813204]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1381148780500]": { + "Id": "Entity_[1381148780500]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1385443747796]": { + "Id": "Entity_[1385443747796]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1389738715092]": { + "Id": "Entity_[1389738715092]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1394033682388]": { + "Id": "Entity_[1394033682388]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1398328649684]": { + "Id": "Entity_[1398328649684]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1402623616980]": { + "Id": "Entity_[1402623616980]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1406918584276]": { + "Id": "Entity_[1406918584276]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1411213551572]": { + "Id": "Entity_[1411213551572]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1415508518868]": { + "Id": "Entity_[1415508518868]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1419803486164]": { + "Id": "Entity_[1419803486164]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1424098453460]": { + "Id": "Entity_[1424098453460]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1428393420756]": { + "Id": "Entity_[1428393420756]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1432688388052]": { + "Id": "Entity_[1432688388052]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1436983355348]": { + "Id": "Entity_[1436983355348]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1441278322644]": { + "Id": "Entity_[1441278322644]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1445573289940]": { + "Id": "Entity_[1445573289940]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1449868257236]": { + "Id": "Entity_[1449868257236]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1454163224532]": { + "Id": "Entity_[1454163224532]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1458458191828]": { + "Id": "Entity_[1458458191828]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1462753159124]": { + "Id": "Entity_[1462753159124]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1467048126420]": { + "Id": "Entity_[1467048126420]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1471343093716]": { + "Id": "Entity_[1471343093716]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1475638061012]": { + "Id": "Entity_[1475638061012]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1479933028308]": { + "Id": "Entity_[1479933028308]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1484227995604]": { + "Id": "Entity_[1484227995604]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1488522962900]": { + "Id": "Entity_[1488522962900]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1492817930196]": { + "Id": "Entity_[1492817930196]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1497112897492]": { + "Id": "Entity_[1497112897492]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1501407864788]": { + "Id": "Entity_[1501407864788]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1505702832084]": { + "Id": "Entity_[1505702832084]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1509997799380]": { + "Id": "Entity_[1509997799380]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1514292766676]": { + "Id": "Entity_[1514292766676]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1518587733972]": { + "Id": "Entity_[1518587733972]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1522882701268]": { + "Id": "Entity_[1522882701268]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1527177668564]": { + "Id": "Entity_[1527177668564]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1531472635860]": { + "Id": "Entity_[1531472635860]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1535767603156]": { + "Id": "Entity_[1535767603156]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1540062570452]": { + "Id": "Entity_[1540062570452]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1544357537748]": { + "Id": "Entity_[1544357537748]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1548652505044]": { + "Id": "Entity_[1548652505044]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1552947472340]": { + "Id": "Entity_[1552947472340]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1557242439636]": { + "Id": "Entity_[1557242439636]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1561537406932]": { + "Id": "Entity_[1561537406932]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 54.6579704284668 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1565832374228]": { + "Id": "Entity_[1565832374228]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1570127341524]": { + "Id": "Entity_[1570127341524]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1574422308820]": { + "Id": "Entity_[1574422308820]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1578717276116]": { + "Id": "Entity_[1578717276116]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1583012243412]": { + "Id": "Entity_[1583012243412]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1587307210708]": { + "Id": "Entity_[1587307210708]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1591602178004]": { + "Id": "Entity_[1591602178004]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1595897145300]": { + "Id": "Entity_[1595897145300]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1600192112596]": { + "Id": "Entity_[1600192112596]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1604487079892]": { + "Id": "Entity_[1604487079892]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1608782047188]": { + "Id": "Entity_[1608782047188]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1613077014484]": { + "Id": "Entity_[1613077014484]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1617371981780]": { + "Id": "Entity_[1617371981780]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1621666949076]": { + "Id": "Entity_[1621666949076]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1625961916372]": { + "Id": "Entity_[1625961916372]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1630256883668]": { + "Id": "Entity_[1630256883668]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1634551850964]": { + "Id": "Entity_[1634551850964]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1638846818260]": { + "Id": "Entity_[1638846818260]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1643141785556]": { + "Id": "Entity_[1643141785556]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1647436752852]": { + "Id": "Entity_[1647436752852]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1651731720148]": { + "Id": "Entity_[1651731720148]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1656026687444]": { + "Id": "Entity_[1656026687444]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1660321654740]": { + "Id": "Entity_[1660321654740]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1664616622036]": { + "Id": "Entity_[1664616622036]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1668911589332]": { + "Id": "Entity_[1668911589332]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1673206556628]": { + "Id": "Entity_[1673206556628]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1677501523924]": { + "Id": "Entity_[1677501523924]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1681796491220]": { + "Id": "Entity_[1681796491220]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1686091458516]": { + "Id": "Entity_[1686091458516]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1690386425812]": { + "Id": "Entity_[1690386425812]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1694681393108]": { + "Id": "Entity_[1694681393108]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1698976360404]": { + "Id": "Entity_[1698976360404]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1703271327700]": { + "Id": "Entity_[1703271327700]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1707566294996]": { + "Id": "Entity_[1707566294996]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 54.6579704284668 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1711861262292]": { + "Id": "Entity_[1711861262292]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1716156229588]": { + "Id": "Entity_[1716156229588]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1720451196884]": { + "Id": "Entity_[1720451196884]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1724746164180]": { + "Id": "Entity_[1724746164180]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1729041131476]": { + "Id": "Entity_[1729041131476]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1733336098772]": { + "Id": "Entity_[1733336098772]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1737631066068]": { + "Id": "Entity_[1737631066068]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1741926033364]": { + "Id": "Entity_[1741926033364]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1746221000660]": { + "Id": "Entity_[1746221000660]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1750515967956]": { + "Id": "Entity_[1750515967956]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1754810935252]": { + "Id": "Entity_[1754810935252]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1759105902548]": { + "Id": "Entity_[1759105902548]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1763400869844]": { + "Id": "Entity_[1763400869844]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1767695837140]": { + "Id": "Entity_[1767695837140]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1771990804436]": { + "Id": "Entity_[1771990804436]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1776285771732]": { + "Id": "Entity_[1776285771732]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1780580739028]": { + "Id": "Entity_[1780580739028]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1784875706324]": { + "Id": "Entity_[1784875706324]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1789170673620]": { + "Id": "Entity_[1789170673620]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1793465640916]": { + "Id": "Entity_[1793465640916]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1797760608212]": { + "Id": "Entity_[1797760608212]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1802055575508]": { + "Id": "Entity_[1802055575508]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1806350542804]": { + "Id": "Entity_[1806350542804]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1810645510100]": { + "Id": "Entity_[1810645510100]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1814940477396]": { + "Id": "Entity_[1814940477396]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1819235444692]": { + "Id": "Entity_[1819235444692]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1823530411988]": { + "Id": "Entity_[1823530411988]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1827825379284]": { + "Id": "Entity_[1827825379284]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1832120346580]": { + "Id": "Entity_[1832120346580]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1836415313876]": { + "Id": "Entity_[1836415313876]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1840710281172]": { + "Id": "Entity_[1840710281172]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1845005248468]": { + "Id": "Entity_[1845005248468]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1849300215764]": { + "Id": "Entity_[1849300215764]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1853595183060]": { + "Id": "Entity_[1853595183060]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1857890150356]": { + "Id": "Entity_[1857890150356]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1862185117652]": { + "Id": "Entity_[1862185117652]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1866480084948]": { + "Id": "Entity_[1866480084948]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1870775052244]": { + "Id": "Entity_[1870775052244]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1875070019540]": { + "Id": "Entity_[1875070019540]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1879364986836]": { + "Id": "Entity_[1879364986836]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 114.53101348876953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1883659954132]": { + "Id": "Entity_[1883659954132]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1887954921428]": { + "Id": "Entity_[1887954921428]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1892249888724]": { + "Id": "Entity_[1892249888724]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1896544856020]": { + "Id": "Entity_[1896544856020]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1900839823316]": { + "Id": "Entity_[1900839823316]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1905134790612]": { + "Id": "Entity_[1905134790612]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1909429757908]": { + "Id": "Entity_[1909429757908]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1913724725204]": { + "Id": "Entity_[1913724725204]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1918019692500]": { + "Id": "Entity_[1918019692500]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1922314659796]": { + "Id": "Entity_[1922314659796]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1926609627092]": { + "Id": "Entity_[1926609627092]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1930904594388]": { + "Id": "Entity_[1930904594388]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1935199561684]": { + "Id": "Entity_[1935199561684]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1939494528980]": { + "Id": "Entity_[1939494528980]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1943789496276]": { + "Id": "Entity_[1943789496276]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1948084463572]": { + "Id": "Entity_[1948084463572]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1952379430868]": { + "Id": "Entity_[1952379430868]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 24.573455810546875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1956674398164]": { + "Id": "Entity_[1956674398164]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1960969365460]": { + "Id": "Entity_[1960969365460]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1965264332756]": { + "Id": "Entity_[1965264332756]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1969559300052]": { + "Id": "Entity_[1969559300052]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1973854267348]": { + "Id": "Entity_[1973854267348]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1978149234644]": { + "Id": "Entity_[1978149234644]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1982444201940]": { + "Id": "Entity_[1982444201940]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1986739169236]": { + "Id": "Entity_[1986739169236]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1991034136532]": { + "Id": "Entity_[1991034136532]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1995329103828]": { + "Id": "Entity_[1995329103828]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1999624071124]": { + "Id": "Entity_[1999624071124]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2003919038420]": { + "Id": "Entity_[2003919038420]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2008214005716]": { + "Id": "Entity_[2008214005716]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2012508973012]": { + "Id": "Entity_[2012508973012]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2016803940308]": { + "Id": "Entity_[2016803940308]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2021098907604]": { + "Id": "Entity_[2021098907604]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2025393874900]": { + "Id": "Entity_[2025393874900]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2029688842196]": { + "Id": "Entity_[2029688842196]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2033983809492]": { + "Id": "Entity_[2033983809492]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2038278776788]": { + "Id": "Entity_[2038278776788]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2042573744084]": { + "Id": "Entity_[2042573744084]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2046868711380]": { + "Id": "Entity_[2046868711380]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2051163678676]": { + "Id": "Entity_[2051163678676]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2055458645972]": { + "Id": "Entity_[2055458645972]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2059753613268]": { + "Id": "Entity_[2059753613268]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2064048580564]": { + "Id": "Entity_[2064048580564]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2068343547860]": { + "Id": "Entity_[2068343547860]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2072638515156]": { + "Id": "Entity_[2072638515156]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2076933482452]": { + "Id": "Entity_[2076933482452]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2081228449748]": { + "Id": "Entity_[2081228449748]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2085523417044]": { + "Id": "Entity_[2085523417044]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2089818384340]": { + "Id": "Entity_[2089818384340]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2094113351636]": { + "Id": "Entity_[2094113351636]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2098408318932]": { + "Id": "Entity_[2098408318932]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2102703286228]": { + "Id": "Entity_[2102703286228]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2106998253524]": { + "Id": "Entity_[2106998253524]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2111293220820]": { + "Id": "Entity_[2111293220820]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2115588188116]": { + "Id": "Entity_[2115588188116]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2119883155412]": { + "Id": "Entity_[2119883155412]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2124178122708]": { + "Id": "Entity_[2124178122708]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2128473090004]": { + "Id": "Entity_[2128473090004]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2132768057300]": { + "Id": "Entity_[2132768057300]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2137063024596]": { + "Id": "Entity_[2137063024596]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2141357991892]": { + "Id": "Entity_[2141357991892]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2145652959188]": { + "Id": "Entity_[2145652959188]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2149947926484]": { + "Id": "Entity_[2149947926484]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2154242893780]": { + "Id": "Entity_[2154242893780]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2158537861076]": { + "Id": "Entity_[2158537861076]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2162832828372]": { + "Id": "Entity_[2162832828372]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2167127795668]": { + "Id": "Entity_[2167127795668]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2171422762964]": { + "Id": "Entity_[2171422762964]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2175717730260]": { + "Id": "Entity_[2175717730260]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2180012697556]": { + "Id": "Entity_[2180012697556]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2184307664852]": { + "Id": "Entity_[2184307664852]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2188602632148]": { + "Id": "Entity_[2188602632148]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2192897599444]": { + "Id": "Entity_[2192897599444]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2197192566740]": { + "Id": "Entity_[2197192566740]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2201487534036]": { + "Id": "Entity_[2201487534036]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2205782501332]": { + "Id": "Entity_[2205782501332]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2210077468628]": { + "Id": "Entity_[2210077468628]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2214372435924]": { + "Id": "Entity_[2214372435924]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2218667403220]": { + "Id": "Entity_[2218667403220]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2222962370516]": { + "Id": "Entity_[2222962370516]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2227257337812]": { + "Id": "Entity_[2227257337812]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2231552305108]": { + "Id": "Entity_[2231552305108]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2235847272404]": { + "Id": "Entity_[2235847272404]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2240142239700]": { + "Id": "Entity_[2240142239700]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2244437206996]": { + "Id": "Entity_[2244437206996]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2248732174292]": { + "Id": "Entity_[2248732174292]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2253027141588]": { + "Id": "Entity_[2253027141588]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2257322108884]": { + "Id": "Entity_[2257322108884]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2261617076180]": { + "Id": "Entity_[2261617076180]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2265912043476]": { + "Id": "Entity_[2265912043476]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2270207010772]": { + "Id": "Entity_[2270207010772]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2274501978068]": { + "Id": "Entity_[2274501978068]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2278796945364]": { + "Id": "Entity_[2278796945364]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2283091912660]": { + "Id": "Entity_[2283091912660]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2287386879956]": { + "Id": "Entity_[2287386879956]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2291681847252]": { + "Id": "Entity_[2291681847252]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2295976814548]": { + "Id": "Entity_[2295976814548]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2300271781844]": { + "Id": "Entity_[2300271781844]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2304566749140]": { + "Id": "Entity_[2304566749140]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2308861716436]": { + "Id": "Entity_[2308861716436]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2313156683732]": { + "Id": "Entity_[2313156683732]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2317451651028]": { + "Id": "Entity_[2317451651028]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2321746618324]": { + "Id": "Entity_[2321746618324]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2326041585620]": { + "Id": "Entity_[2326041585620]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2330336552916]": { + "Id": "Entity_[2330336552916]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2334631520212]": { + "Id": "Entity_[2334631520212]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2338926487508]": { + "Id": "Entity_[2338926487508]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2343221454804]": { + "Id": "Entity_[2343221454804]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2347516422100]": { + "Id": "Entity_[2347516422100]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2351811389396]": { + "Id": "Entity_[2351811389396]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2356106356692]": { + "Id": "Entity_[2356106356692]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2360401323988]": { + "Id": "Entity_[2360401323988]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2364696291284]": { + "Id": "Entity_[2364696291284]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2368991258580]": { + "Id": "Entity_[2368991258580]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2373286225876]": { + "Id": "Entity_[2373286225876]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2377581193172]": { + "Id": "Entity_[2377581193172]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2381876160468]": { + "Id": "Entity_[2381876160468]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2386171127764]": { + "Id": "Entity_[2386171127764]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2390466095060]": { + "Id": "Entity_[2390466095060]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2394761062356]": { + "Id": "Entity_[2394761062356]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2399056029652]": { + "Id": "Entity_[2399056029652]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2403350996948]": { + "Id": "Entity_[2403350996948]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2407645964244]": { + "Id": "Entity_[2407645964244]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2411940931540]": { + "Id": "Entity_[2411940931540]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2416235898836]": { + "Id": "Entity_[2416235898836]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2420530866132]": { + "Id": "Entity_[2420530866132]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2424825833428]": { + "Id": "Entity_[2424825833428]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2429120800724]": { + "Id": "Entity_[2429120800724]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2433415768020]": { + "Id": "Entity_[2433415768020]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2437710735316]": { + "Id": "Entity_[2437710735316]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2442005702612]": { + "Id": "Entity_[2442005702612]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2446300669908]": { + "Id": "Entity_[2446300669908]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2450595637204]": { + "Id": "Entity_[2450595637204]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2454890604500]": { + "Id": "Entity_[2454890604500]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2459185571796]": { + "Id": "Entity_[2459185571796]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2463480539092]": { + "Id": "Entity_[2463480539092]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2467775506388]": { + "Id": "Entity_[2467775506388]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2472070473684]": { + "Id": "Entity_[2472070473684]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2476365440980]": { + "Id": "Entity_[2476365440980]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2480660408276]": { + "Id": "Entity_[2480660408276]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2484955375572]": { + "Id": "Entity_[2484955375572]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2489250342868]": { + "Id": "Entity_[2489250342868]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2493545310164]": { + "Id": "Entity_[2493545310164]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2497840277460]": { + "Id": "Entity_[2497840277460]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2502135244756]": { + "Id": "Entity_[2502135244756]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2506430212052]": { + "Id": "Entity_[2506430212052]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2510725179348]": { + "Id": "Entity_[2510725179348]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2515020146644]": { + "Id": "Entity_[2515020146644]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2519315113940]": { + "Id": "Entity_[2519315113940]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2523610081236]": { + "Id": "Entity_[2523610081236]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2527905048532]": { + "Id": "Entity_[2527905048532]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2532200015828]": { + "Id": "Entity_[2532200015828]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2536494983124]": { + "Id": "Entity_[2536494983124]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2540789950420]": { + "Id": "Entity_[2540789950420]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2545084917716]": { + "Id": "Entity_[2545084917716]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2549379885012]": { + "Id": "Entity_[2549379885012]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2553674852308]": { + "Id": "Entity_[2553674852308]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2557969819604]": { + "Id": "Entity_[2557969819604]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2562264786900]": { + "Id": "Entity_[2562264786900]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2566559754196]": { + "Id": "Entity_[2566559754196]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2570854721492]": { + "Id": "Entity_[2570854721492]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2575149688788]": { + "Id": "Entity_[2575149688788]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2579444656084]": { + "Id": "Entity_[2579444656084]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2583739623380]": { + "Id": "Entity_[2583739623380]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2588034590676]": { + "Id": "Entity_[2588034590676]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2592329557972]": { + "Id": "Entity_[2592329557972]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2596624525268]": { + "Id": "Entity_[2596624525268]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2600919492564]": { + "Id": "Entity_[2600919492564]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2605214459860]": { + "Id": "Entity_[2605214459860]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2609509427156]": { + "Id": "Entity_[2609509427156]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2613804394452]": { + "Id": "Entity_[2613804394452]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2618099361748]": { + "Id": "Entity_[2618099361748]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2622394329044]": { + "Id": "Entity_[2622394329044]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2626689296340]": { + "Id": "Entity_[2626689296340]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2630984263636]": { + "Id": "Entity_[2630984263636]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2635279230932]": { + "Id": "Entity_[2635279230932]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2639574198228]": { + "Id": "Entity_[2639574198228]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2643869165524]": { + "Id": "Entity_[2643869165524]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2648164132820]": { + "Id": "Entity_[2648164132820]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2652459100116]": { + "Id": "Entity_[2652459100116]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2656754067412]": { + "Id": "Entity_[2656754067412]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2661049034708]": { + "Id": "Entity_[2661049034708]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2665344002004]": { + "Id": "Entity_[2665344002004]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2669638969300]": { + "Id": "Entity_[2669638969300]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2673933936596]": { + "Id": "Entity_[2673933936596]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2678228903892]": { + "Id": "Entity_[2678228903892]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2682523871188]": { + "Id": "Entity_[2682523871188]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2686818838484]": { + "Id": "Entity_[2686818838484]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2691113805780]": { + "Id": "Entity_[2691113805780]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2695408773076]": { + "Id": "Entity_[2695408773076]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2699703740372]": { + "Id": "Entity_[2699703740372]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2703998707668]": { + "Id": "Entity_[2703998707668]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2708293674964]": { + "Id": "Entity_[2708293674964]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2712588642260]": { + "Id": "Entity_[2712588642260]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2716883609556]": { + "Id": "Entity_[2716883609556]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2721178576852]": { + "Id": "Entity_[2721178576852]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2725473544148]": { + "Id": "Entity_[2725473544148]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2729768511444]": { + "Id": "Entity_[2729768511444]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2734063478740]": { + "Id": "Entity_[2734063478740]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2738358446036]": { + "Id": "Entity_[2738358446036]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2742653413332]": { + "Id": "Entity_[2742653413332]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2746948380628]": { + "Id": "Entity_[2746948380628]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2751243347924]": { + "Id": "Entity_[2751243347924]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2755538315220]": { + "Id": "Entity_[2755538315220]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2759833282516]": { + "Id": "Entity_[2759833282516]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2764128249812]": { + "Id": "Entity_[2764128249812]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2768423217108]": { + "Id": "Entity_[2768423217108]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2772718184404]": { + "Id": "Entity_[2772718184404]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2777013151700]": { + "Id": "Entity_[2777013151700]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2781308118996]": { + "Id": "Entity_[2781308118996]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2785603086292]": { + "Id": "Entity_[2785603086292]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2789898053588]": { + "Id": "Entity_[2789898053588]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2794193020884]": { + "Id": "Entity_[2794193020884]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2798487988180]": { + "Id": "Entity_[2798487988180]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2802782955476]": { + "Id": "Entity_[2802782955476]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2807077922772]": { + "Id": "Entity_[2807077922772]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2811372890068]": { + "Id": "Entity_[2811372890068]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2815667857364]": { + "Id": "Entity_[2815667857364]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2819962824660]": { + "Id": "Entity_[2819962824660]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2824257791956]": { + "Id": "Entity_[2824257791956]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2828552759252]": { + "Id": "Entity_[2828552759252]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2832847726548]": { + "Id": "Entity_[2832847726548]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2837142693844]": { + "Id": "Entity_[2837142693844]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2841437661140]": { + "Id": "Entity_[2841437661140]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2845732628436]": { + "Id": "Entity_[2845732628436]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2850027595732]": { + "Id": "Entity_[2850027595732]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2854322563028]": { + "Id": "Entity_[2854322563028]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2858617530324]": { + "Id": "Entity_[2858617530324]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2862912497620]": { + "Id": "Entity_[2862912497620]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2867207464916]": { + "Id": "Entity_[2867207464916]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2871502432212]": { + "Id": "Entity_[2871502432212]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2875797399508]": { + "Id": "Entity_[2875797399508]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2880092366804]": { + "Id": "Entity_[2880092366804]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2884387334100]": { + "Id": "Entity_[2884387334100]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2888682301396]": { + "Id": "Entity_[2888682301396]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2892977268692]": { + "Id": "Entity_[2892977268692]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2897272235988]": { + "Id": "Entity_[2897272235988]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2901567203284]": { + "Id": "Entity_[2901567203284]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2905862170580]": { + "Id": "Entity_[2905862170580]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2910157137876]": { + "Id": "Entity_[2910157137876]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2914452105172]": { + "Id": "Entity_[2914452105172]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2918747072468]": { + "Id": "Entity_[2918747072468]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2923042039764]": { + "Id": "Entity_[2923042039764]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2927337007060]": { + "Id": "Entity_[2927337007060]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2931631974356]": { + "Id": "Entity_[2931631974356]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2935926941652]": { + "Id": "Entity_[2935926941652]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2940221908948]": { + "Id": "Entity_[2940221908948]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2944516876244]": { + "Id": "Entity_[2944516876244]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2948811843540]": { + "Id": "Entity_[2948811843540]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2953106810836]": { + "Id": "Entity_[2953106810836]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 99.47334289550781 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2957401778132]": { + "Id": "Entity_[2957401778132]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2961696745428]": { + "Id": "Entity_[2961696745428]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2965991712724]": { + "Id": "Entity_[2965991712724]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2970286680020]": { + "Id": "Entity_[2970286680020]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2974581647316]": { + "Id": "Entity_[2974581647316]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2978876614612]": { + "Id": "Entity_[2978876614612]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2983171581908]": { + "Id": "Entity_[2983171581908]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2987466549204]": { + "Id": "Entity_[2987466549204]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2991761516500]": { + "Id": "Entity_[2991761516500]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2996056483796]": { + "Id": "Entity_[2996056483796]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3000351451092]": { + "Id": "Entity_[3000351451092]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3004646418388]": { + "Id": "Entity_[3004646418388]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3008941385684]": { + "Id": "Entity_[3008941385684]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3013236352980]": { + "Id": "Entity_[3013236352980]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3017531320276]": { + "Id": "Entity_[3017531320276]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3021826287572]": { + "Id": "Entity_[3021826287572]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3026121254868]": { + "Id": "Entity_[3026121254868]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3030416222164]": { + "Id": "Entity_[3030416222164]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3034711189460]": { + "Id": "Entity_[3034711189460]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3039006156756]": { + "Id": "Entity_[3039006156756]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3043301124052]": { + "Id": "Entity_[3043301124052]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3047596091348]": { + "Id": "Entity_[3047596091348]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3051891058644]": { + "Id": "Entity_[3051891058644]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 69.38883209228516 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3056186025940]": { + "Id": "Entity_[3056186025940]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3060480993236]": { + "Id": "Entity_[3060480993236]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3064775960532]": { + "Id": "Entity_[3064775960532]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3069070927828]": { + "Id": "Entity_[3069070927828]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3073365895124]": { + "Id": "Entity_[3073365895124]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3077660862420]": { + "Id": "Entity_[3077660862420]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3081955829716]": { + "Id": "Entity_[3081955829716]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3086250797012]": { + "Id": "Entity_[3086250797012]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3090545764308]": { + "Id": "Entity_[3090545764308]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3094840731604]": { + "Id": "Entity_[3094840731604]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3099135698900]": { + "Id": "Entity_[3099135698900]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3103430666196]": { + "Id": "Entity_[3103430666196]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3107725633492]": { + "Id": "Entity_[3107725633492]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3112020600788]": { + "Id": "Entity_[3112020600788]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3116315568084]": { + "Id": "Entity_[3116315568084]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3120610535380]": { + "Id": "Entity_[3120610535380]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3124905502676]": { + "Id": "Entity_[3124905502676]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3129200469972]": { + "Id": "Entity_[3129200469972]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3133495437268]": { + "Id": "Entity_[3133495437268]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3137790404564]": { + "Id": "Entity_[3137790404564]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3142085371860]": { + "Id": "Entity_[3142085371860]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3146380339156]": { + "Id": "Entity_[3146380339156]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3150675306452]": { + "Id": "Entity_[3150675306452]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3154970273748]": { + "Id": "Entity_[3154970273748]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3159265241044]": { + "Id": "Entity_[3159265241044]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3163560208340]": { + "Id": "Entity_[3163560208340]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3167855175636]": { + "Id": "Entity_[3167855175636]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3172150142932]": { + "Id": "Entity_[3172150142932]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3176445110228]": { + "Id": "Entity_[3176445110228]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3180740077524]": { + "Id": "Entity_[3180740077524]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3185035044820]": { + "Id": "Entity_[3185035044820]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3189330012116]": { + "Id": "Entity_[3189330012116]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3193624979412]": { + "Id": "Entity_[3193624979412]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3197919946708]": { + "Id": "Entity_[3197919946708]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3202214914004]": { + "Id": "Entity_[3202214914004]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3206509881300]": { + "Id": "Entity_[3206509881300]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3210804848596]": { + "Id": "Entity_[3210804848596]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3215099815892]": { + "Id": "Entity_[3215099815892]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3219394783188]": { + "Id": "Entity_[3219394783188]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3223689750484]": { + "Id": "Entity_[3223689750484]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3227984717780]": { + "Id": "Entity_[3227984717780]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3232279685076]": { + "Id": "Entity_[3232279685076]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3236574652372]": { + "Id": "Entity_[3236574652372]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3240869619668]": { + "Id": "Entity_[3240869619668]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3245164586964]": { + "Id": "Entity_[3245164586964]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3249459554260]": { + "Id": "Entity_[3249459554260]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3253754521556]": { + "Id": "Entity_[3253754521556]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3258049488852]": { + "Id": "Entity_[3258049488852]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3262344456148]": { + "Id": "Entity_[3262344456148]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3266639423444]": { + "Id": "Entity_[3266639423444]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3270934390740]": { + "Id": "Entity_[3270934390740]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3275229358036]": { + "Id": "Entity_[3275229358036]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3279524325332]": { + "Id": "Entity_[3279524325332]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3283819292628]": { + "Id": "Entity_[3283819292628]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3288114259924]": { + "Id": "Entity_[3288114259924]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3292409227220]": { + "Id": "Entity_[3292409227220]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3296704194516]": { + "Id": "Entity_[3296704194516]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3300999161812]": { + "Id": "Entity_[3300999161812]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3305294129108]": { + "Id": "Entity_[3305294129108]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3309589096404]": { + "Id": "Entity_[3309589096404]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3313884063700]": { + "Id": "Entity_[3313884063700]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3318179030996]": { + "Id": "Entity_[3318179030996]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3322473998292]": { + "Id": "Entity_[3322473998292]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3326768965588]": { + "Id": "Entity_[3326768965588]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3331063932884]": { + "Id": "Entity_[3331063932884]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3335358900180]": { + "Id": "Entity_[3335358900180]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3339653867476]": { + "Id": "Entity_[3339653867476]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3343948834772]": { + "Id": "Entity_[3343948834772]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3348243802068]": { + "Id": "Entity_[3348243802068]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3352538769364]": { + "Id": "Entity_[3352538769364]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3356833736660]": { + "Id": "Entity_[3356833736660]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3361128703956]": { + "Id": "Entity_[3361128703956]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3365423671252]": { + "Id": "Entity_[3365423671252]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3369718638548]": { + "Id": "Entity_[3369718638548]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3374013605844]": { + "Id": "Entity_[3374013605844]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3378308573140]": { + "Id": "Entity_[3378308573140]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3382603540436]": { + "Id": "Entity_[3382603540436]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3386898507732]": { + "Id": "Entity_[3386898507732]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3391193475028]": { + "Id": "Entity_[3391193475028]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3395488442324]": { + "Id": "Entity_[3395488442324]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3399783409620]": { + "Id": "Entity_[3399783409620]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3404078376916]": { + "Id": "Entity_[3404078376916]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3408373344212]": { + "Id": "Entity_[3408373344212]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3412668311508]": { + "Id": "Entity_[3412668311508]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3416963278804]": { + "Id": "Entity_[3416963278804]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3421258246100]": { + "Id": "Entity_[3421258246100]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3425553213396]": { + "Id": "Entity_[3425553213396]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3429848180692]": { + "Id": "Entity_[3429848180692]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3434143147988]": { + "Id": "Entity_[3434143147988]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3438438115284]": { + "Id": "Entity_[3438438115284]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3442733082580]": { + "Id": "Entity_[3442733082580]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3447028049876]": { + "Id": "Entity_[3447028049876]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3451323017172]": { + "Id": "Entity_[3451323017172]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3455617984468]": { + "Id": "Entity_[3455617984468]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3459912951764]": { + "Id": "Entity_[3459912951764]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3464207919060]": { + "Id": "Entity_[3464207919060]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3468502886356]": { + "Id": "Entity_[3468502886356]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3472797853652]": { + "Id": "Entity_[3472797853652]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3477092820948]": { + "Id": "Entity_[3477092820948]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3481387788244]": { + "Id": "Entity_[3481387788244]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3485682755540]": { + "Id": "Entity_[3485682755540]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3489977722836]": { + "Id": "Entity_[3489977722836]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3494272690132]": { + "Id": "Entity_[3494272690132]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3498567657428]": { + "Id": "Entity_[3498567657428]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3502862624724]": { + "Id": "Entity_[3502862624724]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3507157592020]": { + "Id": "Entity_[3507157592020]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3511452559316]": { + "Id": "Entity_[3511452559316]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3515747526612]": { + "Id": "Entity_[3515747526612]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3520042493908]": { + "Id": "Entity_[3520042493908]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 84.44650268554688 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3524337461204]": { + "Id": "Entity_[3524337461204]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3528632428500]": { + "Id": "Entity_[3528632428500]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3532927395796]": { + "Id": "Entity_[3532927395796]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3537222363092]": { + "Id": "Entity_[3537222363092]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3541517330388]": { + "Id": "Entity_[3541517330388]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3545812297684]": { + "Id": "Entity_[3545812297684]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3550107264980]": { + "Id": "Entity_[3550107264980]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3554402232276]": { + "Id": "Entity_[3554402232276]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3558697199572]": { + "Id": "Entity_[3558697199572]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3562992166868]": { + "Id": "Entity_[3562992166868]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3567287134164]": { + "Id": "Entity_[3567287134164]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3571582101460]": { + "Id": "Entity_[3571582101460]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3575877068756]": { + "Id": "Entity_[3575877068756]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3580172036052]": { + "Id": "Entity_[3580172036052]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3584467003348]": { + "Id": "Entity_[3584467003348]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3588761970644]": { + "Id": "Entity_[3588761970644]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3593056937940]": { + "Id": "Entity_[3593056937940]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3597351905236]": { + "Id": "Entity_[3597351905236]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3601646872532]": { + "Id": "Entity_[3601646872532]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3605941839828]": { + "Id": "Entity_[3605941839828]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3610236807124]": { + "Id": "Entity_[3610236807124]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3614531774420]": { + "Id": "Entity_[3614531774420]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3618826741716]": { + "Id": "Entity_[3618826741716]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3623121709012]": { + "Id": "Entity_[3623121709012]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3627416676308]": { + "Id": "Entity_[3627416676308]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3631711643604]": { + "Id": "Entity_[3631711643604]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3636006610900]": { + "Id": "Entity_[3636006610900]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3640301578196]": { + "Id": "Entity_[3640301578196]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3644596545492]": { + "Id": "Entity_[3644596545492]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3648891512788]": { + "Id": "Entity_[3648891512788]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3653186480084]": { + "Id": "Entity_[3653186480084]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3657481447380]": { + "Id": "Entity_[3657481447380]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3661776414676]": { + "Id": "Entity_[3661776414676]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3666071381972]": { + "Id": "Entity_[3666071381972]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3670366349268]": { + "Id": "Entity_[3670366349268]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3674661316564]": { + "Id": "Entity_[3674661316564]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3678956283860]": { + "Id": "Entity_[3678956283860]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3683251251156]": { + "Id": "Entity_[3683251251156]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3687546218452]": { + "Id": "Entity_[3687546218452]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3691841185748]": { + "Id": "Entity_[3691841185748]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3696136153044]": { + "Id": "Entity_[3696136153044]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3700431120340]": { + "Id": "Entity_[3700431120340]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3704726087636]": { + "Id": "Entity_[3704726087636]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3709021054932]": { + "Id": "Entity_[3709021054932]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3713316022228]": { + "Id": "Entity_[3713316022228]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3717610989524]": { + "Id": "Entity_[3717610989524]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3721905956820]": { + "Id": "Entity_[3721905956820]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3726200924116]": { + "Id": "Entity_[3726200924116]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3730495891412]": { + "Id": "Entity_[3730495891412]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3734790858708]": { + "Id": "Entity_[3734790858708]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3739085826004]": { + "Id": "Entity_[3739085826004]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3743380793300]": { + "Id": "Entity_[3743380793300]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3747675760596]": { + "Id": "Entity_[3747675760596]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3751970727892]": { + "Id": "Entity_[3751970727892]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3756265695188]": { + "Id": "Entity_[3756265695188]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3760560662484]": { + "Id": "Entity_[3760560662484]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3764855629780]": { + "Id": "Entity_[3764855629780]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3769150597076]": { + "Id": "Entity_[3769150597076]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3773445564372]": { + "Id": "Entity_[3773445564372]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3777740531668]": { + "Id": "Entity_[3777740531668]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3782035498964]": { + "Id": "Entity_[3782035498964]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3786330466260]": { + "Id": "Entity_[3786330466260]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3790625433556]": { + "Id": "Entity_[3790625433556]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3794920400852]": { + "Id": "Entity_[3794920400852]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3799215368148]": { + "Id": "Entity_[3799215368148]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3803510335444]": { + "Id": "Entity_[3803510335444]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3807805302740]": { + "Id": "Entity_[3807805302740]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3812100270036]": { + "Id": "Entity_[3812100270036]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3816395237332]": { + "Id": "Entity_[3816395237332]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 9.51578426361084 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3820690204628]": { + "Id": "Entity_[3820690204628]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3824985171924]": { + "Id": "Entity_[3824985171924]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3829280139220]": { + "Id": "Entity_[3829280139220]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3833575106516]": { + "Id": "Entity_[3833575106516]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3837870073812]": { + "Id": "Entity_[3837870073812]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3842165041108]": { + "Id": "Entity_[3842165041108]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3846460008404]": { + "Id": "Entity_[3846460008404]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3850754975700]": { + "Id": "Entity_[3850754975700]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3855049942996]": { + "Id": "Entity_[3855049942996]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3859344910292]": { + "Id": "Entity_[3859344910292]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3863639877588]": { + "Id": "Entity_[3863639877588]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3867934844884]": { + "Id": "Entity_[3867934844884]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3872229812180]": { + "Id": "Entity_[3872229812180]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3876524779476]": { + "Id": "Entity_[3876524779476]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3880819746772]": { + "Id": "Entity_[3880819746772]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3885114714068]": { + "Id": "Entity_[3885114714068]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3889409681364]": { + "Id": "Entity_[3889409681364]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3893704648660]": { + "Id": "Entity_[3893704648660]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3897999615956]": { + "Id": "Entity_[3897999615956]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3902294583252]": { + "Id": "Entity_[3902294583252]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3906589550548]": { + "Id": "Entity_[3906589550548]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3910884517844]": { + "Id": "Entity_[3910884517844]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3915179485140]": { + "Id": "Entity_[3915179485140]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3919474452436]": { + "Id": "Entity_[3919474452436]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3923769419732]": { + "Id": "Entity_[3923769419732]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3928064387028]": { + "Id": "Entity_[3928064387028]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3932359354324]": { + "Id": "Entity_[3932359354324]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3936654321620]": { + "Id": "Entity_[3936654321620]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3940949288916]": { + "Id": "Entity_[3940949288916]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3945244256212]": { + "Id": "Entity_[3945244256212]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3949539223508]": { + "Id": "Entity_[3949539223508]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 24.573455810546875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3953834190804]": { + "Id": "Entity_[3953834190804]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3958129158100]": { + "Id": "Entity_[3958129158100]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3962424125396]": { + "Id": "Entity_[3962424125396]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3966719092692]": { + "Id": "Entity_[3966719092692]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3971014059988]": { + "Id": "Entity_[3971014059988]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3975309027284]": { + "Id": "Entity_[3975309027284]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3979603994580]": { + "Id": "Entity_[3979603994580]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3983898961876]": { + "Id": "Entity_[3983898961876]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3988193929172]": { + "Id": "Entity_[3988193929172]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3992488896468]": { + "Id": "Entity_[3992488896468]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3996783863764]": { + "Id": "Entity_[3996783863764]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4001078831060]": { + "Id": "Entity_[4001078831060]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4005373798356]": { + "Id": "Entity_[4005373798356]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4009668765652]": { + "Id": "Entity_[4009668765652]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4013963732948]": { + "Id": "Entity_[4013963732948]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4018258700244]": { + "Id": "Entity_[4018258700244]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4022553667540]": { + "Id": "Entity_[4022553667540]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4026848634836]": { + "Id": "Entity_[4026848634836]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4031143602132]": { + "Id": "Entity_[4031143602132]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4035438569428]": { + "Id": "Entity_[4035438569428]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4039733536724]": { + "Id": "Entity_[4039733536724]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4044028504020]": { + "Id": "Entity_[4044028504020]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4048323471316]": { + "Id": "Entity_[4048323471316]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4052618438612]": { + "Id": "Entity_[4052618438612]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4056913405908]": { + "Id": "Entity_[4056913405908]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4061208373204]": { + "Id": "Entity_[4061208373204]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4065503340500]": { + "Id": "Entity_[4065503340500]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4069798307796]": { + "Id": "Entity_[4069798307796]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4074093275092]": { + "Id": "Entity_[4074093275092]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4078388242388]": { + "Id": "Entity_[4078388242388]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 39.60029602050781 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4082683209684]": { + "Id": "Entity_[4082683209684]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4086978176980]": { + "Id": "Entity_[4086978176980]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4091273144276]": { + "Id": "Entity_[4091273144276]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 39.60029602050781 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4095568111572]": { + "Id": "Entity_[4095568111572]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4099863078868]": { + "Id": "Entity_[4099863078868]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4104158046164]": { + "Id": "Entity_[4104158046164]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4108453013460]": { + "Id": "Entity_[4108453013460]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 84.44650268554688 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4112747980756]": { + "Id": "Entity_[4112747980756]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4117042948052]": { + "Id": "Entity_[4117042948052]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4121337915348]": { + "Id": "Entity_[4121337915348]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4125632882644]": { + "Id": "Entity_[4125632882644]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4129927849940]": { + "Id": "Entity_[4129927849940]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4134222817236]": { + "Id": "Entity_[4134222817236]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4138517784532]": { + "Id": "Entity_[4138517784532]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4142812751828]": { + "Id": "Entity_[4142812751828]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4147107719124]": { + "Id": "Entity_[4147107719124]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4151402686420]": { + "Id": "Entity_[4151402686420]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4155697653716]": { + "Id": "Entity_[4155697653716]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4159992621012]": { + "Id": "Entity_[4159992621012]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4164287588308]": { + "Id": "Entity_[4164287588308]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4168582555604]": { + "Id": "Entity_[4168582555604]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4172877522900]": { + "Id": "Entity_[4172877522900]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4177172490196]": { + "Id": "Entity_[4177172490196]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4181467457492]": { + "Id": "Entity_[4181467457492]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4185762424788]": { + "Id": "Entity_[4185762424788]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4190057392084]": { + "Id": "Entity_[4190057392084]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4194352359380]": { + "Id": "Entity_[4194352359380]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4198647326676]": { + "Id": "Entity_[4198647326676]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4202942293972]": { + "Id": "Entity_[4202942293972]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4207237261268]": { + "Id": "Entity_[4207237261268]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4211532228564]": { + "Id": "Entity_[4211532228564]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4215827195860]": { + "Id": "Entity_[4215827195860]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4220122163156]": { + "Id": "Entity_[4220122163156]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4224417130452]": { + "Id": "Entity_[4224417130452]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4228712097748]": { + "Id": "Entity_[4228712097748]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4233007065044]": { + "Id": "Entity_[4233007065044]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4237302032340]": { + "Id": "Entity_[4237302032340]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4241596999636]": { + "Id": "Entity_[4241596999636]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4245891966932]": { + "Id": "Entity_[4245891966932]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4250186934228]": { + "Id": "Entity_[4250186934228]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4254481901524]": { + "Id": "Entity_[4254481901524]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4258776868820]": { + "Id": "Entity_[4258776868820]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4263071836116]": { + "Id": "Entity_[4263071836116]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4267366803412]": { + "Id": "Entity_[4267366803412]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4271661770708]": { + "Id": "Entity_[4271661770708]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4275956738004]": { + "Id": "Entity_[4275956738004]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4280251705300]": { + "Id": "Entity_[4280251705300]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4284546672596]": { + "Id": "Entity_[4284546672596]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4288841639892]": { + "Id": "Entity_[4288841639892]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4293136607188]": { + "Id": "Entity_[4293136607188]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4297431574484]": { + "Id": "Entity_[4297431574484]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4301726541780]": { + "Id": "Entity_[4301726541780]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4306021509076]": { + "Id": "Entity_[4306021509076]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4310316476372]": { + "Id": "Entity_[4310316476372]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4314611443668]": { + "Id": "Entity_[4314611443668]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4318906410964]": { + "Id": "Entity_[4318906410964]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4323201378260]": { + "Id": "Entity_[4323201378260]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4327496345556]": { + "Id": "Entity_[4327496345556]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4331791312852]": { + "Id": "Entity_[4331791312852]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4336086280148]": { + "Id": "Entity_[4336086280148]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4340381247444]": { + "Id": "Entity_[4340381247444]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4344676214740]": { + "Id": "Entity_[4344676214740]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4348971182036]": { + "Id": "Entity_[4348971182036]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4353266149332]": { + "Id": "Entity_[4353266149332]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4357561116628]": { + "Id": "Entity_[4357561116628]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4361856083924]": { + "Id": "Entity_[4361856083924]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4366151051220]": { + "Id": "Entity_[4366151051220]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4370446018516]": { + "Id": "Entity_[4370446018516]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4374740985812]": { + "Id": "Entity_[4374740985812]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4379035953108]": { + "Id": "Entity_[4379035953108]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4383330920404]": { + "Id": "Entity_[4383330920404]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4387625887700]": { + "Id": "Entity_[4387625887700]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4391920854996]": { + "Id": "Entity_[4391920854996]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4396215822292]": { + "Id": "Entity_[4396215822292]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4400510789588]": { + "Id": "Entity_[4400510789588]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4404805756884]": { + "Id": "Entity_[4404805756884]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4409100724180]": { + "Id": "Entity_[4409100724180]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4413395691476]": { + "Id": "Entity_[4413395691476]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4417690658772]": { + "Id": "Entity_[4417690658772]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4421985626068]": { + "Id": "Entity_[4421985626068]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4426280593364]": { + "Id": "Entity_[4426280593364]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4430575560660]": { + "Id": "Entity_[4430575560660]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4434870527956]": { + "Id": "Entity_[4434870527956]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4439165495252]": { + "Id": "Entity_[4439165495252]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4443460462548]": { + "Id": "Entity_[4443460462548]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4447755429844]": { + "Id": "Entity_[4447755429844]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4452050397140]": { + "Id": "Entity_[4452050397140]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4456345364436]": { + "Id": "Entity_[4456345364436]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4460640331732]": { + "Id": "Entity_[4460640331732]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4464935299028]": { + "Id": "Entity_[4464935299028]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4469230266324]": { + "Id": "Entity_[4469230266324]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4473525233620]": { + "Id": "Entity_[4473525233620]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4477820200916]": { + "Id": "Entity_[4477820200916]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4482115168212]": { + "Id": "Entity_[4482115168212]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4486410135508]": { + "Id": "Entity_[4486410135508]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4490705102804]": { + "Id": "Entity_[4490705102804]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4495000070100]": { + "Id": "Entity_[4495000070100]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4499295037396]": { + "Id": "Entity_[4499295037396]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4503590004692]": { + "Id": "Entity_[4503590004692]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4507884971988]": { + "Id": "Entity_[4507884971988]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4512179939284]": { + "Id": "Entity_[4512179939284]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4516474906580]": { + "Id": "Entity_[4516474906580]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4520769873876]": { + "Id": "Entity_[4520769873876]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4525064841172]": { + "Id": "Entity_[4525064841172]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4529359808468]": { + "Id": "Entity_[4529359808468]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4533654775764]": { + "Id": "Entity_[4533654775764]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4537949743060]": { + "Id": "Entity_[4537949743060]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4542244710356]": { + "Id": "Entity_[4542244710356]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4546539677652]": { + "Id": "Entity_[4546539677652]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4550834644948]": { + "Id": "Entity_[4550834644948]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4555129612244]": { + "Id": "Entity_[4555129612244]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4559424579540]": { + "Id": "Entity_[4559424579540]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4563719546836]": { + "Id": "Entity_[4563719546836]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4568014514132]": { + "Id": "Entity_[4568014514132]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4572309481428]": { + "Id": "Entity_[4572309481428]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4576604448724]": { + "Id": "Entity_[4576604448724]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4580899416020]": { + "Id": "Entity_[4580899416020]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4585194383316]": { + "Id": "Entity_[4585194383316]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4589489350612]": { + "Id": "Entity_[4589489350612]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4593784317908]": { + "Id": "Entity_[4593784317908]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4598079285204]": { + "Id": "Entity_[4598079285204]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[479205648340]": { + "Id": "Entity_[479205648340]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[483500615636]": { + "Id": "Entity_[483500615636]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[487795582932]": { + "Id": "Entity_[487795582932]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[492090550228]": { + "Id": "Entity_[492090550228]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[496385517524]": { + "Id": "Entity_[496385517524]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[500680484820]": { + "Id": "Entity_[500680484820]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[504975452116]": { + "Id": "Entity_[504975452116]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[509270419412]": { + "Id": "Entity_[509270419412]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[513565386708]": { + "Id": "Entity_[513565386708]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[517860354004]": { + "Id": "Entity_[517860354004]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[522155321300]": { + "Id": "Entity_[522155321300]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[526450288596]": { + "Id": "Entity_[526450288596]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[530745255892]": { + "Id": "Entity_[530745255892]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[535040223188]": { + "Id": "Entity_[535040223188]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[539335190484]": { + "Id": "Entity_[539335190484]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[543630157780]": { + "Id": "Entity_[543630157780]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[547925125076]": { + "Id": "Entity_[547925125076]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[552220092372]": { + "Id": "Entity_[552220092372]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[556515059668]": { + "Id": "Entity_[556515059668]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[560810026964]": { + "Id": "Entity_[560810026964]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[565104994260]": { + "Id": "Entity_[565104994260]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[569399961556]": { + "Id": "Entity_[569399961556]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[573694928852]": { + "Id": "Entity_[573694928852]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[577989896148]": { + "Id": "Entity_[577989896148]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[582284863444]": { + "Id": "Entity_[582284863444]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[586579830740]": { + "Id": "Entity_[586579830740]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[590874798036]": { + "Id": "Entity_[590874798036]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[595169765332]": { + "Id": "Entity_[595169765332]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[599464732628]": { + "Id": "Entity_[599464732628]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[603759699924]": { + "Id": "Entity_[603759699924]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[608054667220]": { + "Id": "Entity_[608054667220]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[612349634516]": { + "Id": "Entity_[612349634516]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[616644601812]": { + "Id": "Entity_[616644601812]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[620939569108]": { + "Id": "Entity_[620939569108]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[625234536404]": { + "Id": "Entity_[625234536404]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[629529503700]": { + "Id": "Entity_[629529503700]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[633824470996]": { + "Id": "Entity_[633824470996]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[638119438292]": { + "Id": "Entity_[638119438292]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[642414405588]": { + "Id": "Entity_[642414405588]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[646709372884]": { + "Id": "Entity_[646709372884]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[651004340180]": { + "Id": "Entity_[651004340180]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[655299307476]": { + "Id": "Entity_[655299307476]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[659594274772]": { + "Id": "Entity_[659594274772]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[663889242068]": { + "Id": "Entity_[663889242068]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[668184209364]": { + "Id": "Entity_[668184209364]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[672479176660]": { + "Id": "Entity_[672479176660]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[676774143956]": { + "Id": "Entity_[676774143956]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[681069111252]": { + "Id": "Entity_[681069111252]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[685364078548]": { + "Id": "Entity_[685364078548]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[689659045844]": { + "Id": "Entity_[689659045844]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[693954013140]": { + "Id": "Entity_[693954013140]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 9.51578426361084 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[698248980436]": { + "Id": "Entity_[698248980436]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[702543947732]": { + "Id": "Entity_[702543947732]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[706838915028]": { + "Id": "Entity_[706838915028]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[711133882324]": { + "Id": "Entity_[711133882324]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[715428849620]": { + "Id": "Entity_[715428849620]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[719723816916]": { + "Id": "Entity_[719723816916]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[724018784212]": { + "Id": "Entity_[724018784212]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[728313751508]": { + "Id": "Entity_[728313751508]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[732608718804]": { + "Id": "Entity_[732608718804]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[736903686100]": { + "Id": "Entity_[736903686100]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[741198653396]": { + "Id": "Entity_[741198653396]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[745493620692]": { + "Id": "Entity_[745493620692]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[749788587988]": { + "Id": "Entity_[749788587988]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[754083555284]": { + "Id": "Entity_[754083555284]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[758378522580]": { + "Id": "Entity_[758378522580]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[762673489876]": { + "Id": "Entity_[762673489876]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[766968457172]": { + "Id": "Entity_[766968457172]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[771263424468]": { + "Id": "Entity_[771263424468]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[775558391764]": { + "Id": "Entity_[775558391764]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[779853359060]": { + "Id": "Entity_[779853359060]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[784148326356]": { + "Id": "Entity_[784148326356]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[788443293652]": { + "Id": "Entity_[788443293652]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[792738260948]": { + "Id": "Entity_[792738260948]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[797033228244]": { + "Id": "Entity_[797033228244]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 114.53101348876953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[801328195540]": { + "Id": "Entity_[801328195540]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[805623162836]": { + "Id": "Entity_[805623162836]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[809918130132]": { + "Id": "Entity_[809918130132]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[814213097428]": { + "Id": "Entity_[814213097428]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[818508064724]": { + "Id": "Entity_[818508064724]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[822803032020]": { + "Id": "Entity_[822803032020]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[827097999316]": { + "Id": "Entity_[827097999316]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[831392966612]": { + "Id": "Entity_[831392966612]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[835687933908]": { + "Id": "Entity_[835687933908]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[839982901204]": { + "Id": "Entity_[839982901204]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[844277868500]": { + "Id": "Entity_[844277868500]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[848572835796]": { + "Id": "Entity_[848572835796]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[852867803092]": { + "Id": "Entity_[852867803092]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[857162770388]": { + "Id": "Entity_[857162770388]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[861457737684]": { + "Id": "Entity_[861457737684]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[865752704980]": { + "Id": "Entity_[865752704980]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[870047672276]": { + "Id": "Entity_[870047672276]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[874342639572]": { + "Id": "Entity_[874342639572]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[878637606868]": { + "Id": "Entity_[878637606868]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[882932574164]": { + "Id": "Entity_[882932574164]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[887227541460]": { + "Id": "Entity_[887227541460]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[891522508756]": { + "Id": "Entity_[891522508756]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[895817476052]": { + "Id": "Entity_[895817476052]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[900112443348]": { + "Id": "Entity_[900112443348]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[904407410644]": { + "Id": "Entity_[904407410644]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[908702377940]": { + "Id": "Entity_[908702377940]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[912997345236]": { + "Id": "Entity_[912997345236]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[917292312532]": { + "Id": "Entity_[917292312532]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[921587279828]": { + "Id": "Entity_[921587279828]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[925882247124]": { + "Id": "Entity_[925882247124]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[930177214420]": { + "Id": "Entity_[930177214420]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[934472181716]": { + "Id": "Entity_[934472181716]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[938767149012]": { + "Id": "Entity_[938767149012]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[943062116308]": { + "Id": "Entity_[943062116308]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[947357083604]": { + "Id": "Entity_[947357083604]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[951652050900]": { + "Id": "Entity_[951652050900]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[955947018196]": { + "Id": "Entity_[955947018196]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[960241985492]": { + "Id": "Entity_[960241985492]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[964536952788]": { + "Id": "Entity_[964536952788]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[968831920084]": { + "Id": "Entity_[968831920084]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[973126887380]": { + "Id": "Entity_[973126887380]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[977421854676]": { + "Id": "Entity_[977421854676]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 69.38883209228516 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[981716821972]": { + "Id": "Entity_[981716821972]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[986011789268]": { + "Id": "Entity_[986011789268]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 99.47334289550781 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[990306756564]": { + "Id": "Entity_[990306756564]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[994601723860]": { + "Id": "Entity_[994601723860]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[998896691156]": { + "Id": "Entity_[998896691156]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeAluminumPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeAluminumPolishedPBR.prefab new file mode 100644 index 0000000000..afec89bcc0 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeAluminumPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeAluminumPolishedPBR", + "Components": { + "Component_[1006636009791072742]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 1006636009791072742, + "Parent Entity": "" + }, + "Component_[1076262440422199293]": { + "$type": "EditorEntitySortComponent", + "Id": 1076262440422199293, + "Child Entity Order": [ + "Entity_[1040185651401]" + ] + }, + "Component_[10918235158079012184]": { + "$type": "EditorEntityIconComponent", + "Id": 10918235158079012184 + }, + "Component_[14325323304581185195]": { + "$type": "EditorOnlyEntityComponent", + "Id": 14325323304581185195 + }, + "Component_[15952647410502679667]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15952647410502679667 + }, + "Component_[1646402264018781142]": { + "$type": "EditorVisibilityComponent", + "Id": 1646402264018781142 + }, + "Component_[2017972571432187012]": { + "$type": "EditorInspectorComponent", + "Id": 2017972571432187012 + }, + "Component_[478000835478069459]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 478000835478069459 + }, + "Component_[7132130710158542124]": { + "$type": "EditorPrefabComponent", + "Id": 7132130710158542124 + }, + "Component_[7457311619910333402]": { + "$type": "SelectionComponent", + "Id": 7457311619910333402 + }, + "Component_[8761313808145525748]": { + "$type": "EditorLockComponent", + "Id": 8761313808145525748 + } + } + }, + "Entities": { + "Entity_[1040185651401]": { + "Id": "Entity_[1040185651401]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeBrassPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeBrassPolishedPBR.prefab new file mode 100644 index 0000000000..beca9c9dba --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeBrassPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeBrassPolishedPBR", + "Components": { + "Component_[11392538078593907718]": { + "$type": "EditorVisibilityComponent", + "Id": 11392538078593907718 + }, + "Component_[15271285664593091377]": { + "$type": "EditorPrefabComponent", + "Id": 15271285664593091377 + }, + "Component_[16445950008096288691]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16445950008096288691 + }, + "Component_[17031759897155285515]": { + "$type": "EditorOnlyEntityComponent", + "Id": 17031759897155285515 + }, + "Component_[17333992135029064645]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17333992135029064645, + "Parent Entity": "" + }, + "Component_[2440848159410013062]": { + "$type": "EditorInspectorComponent", + "Id": 2440848159410013062 + }, + "Component_[4872690920600271776]": { + "$type": "EditorEntityIconComponent", + "Id": 4872690920600271776 + }, + "Component_[8105157811055641931]": { + "$type": "SelectionComponent", + "Id": 8105157811055641931 + }, + "Component_[8121804356127130254]": { + "$type": "EditorLockComponent", + "Id": 8121804356127130254 + }, + "Component_[9156467458085058309]": { + "$type": "EditorPendingCompositionComponent", + "Id": 9156467458085058309 + }, + "Component_[998572165026441124]": { + "$type": "EditorEntitySortComponent", + "Id": 998572165026441124, + "Child Entity Order": [ + "Entity_[1169034670281]" + ] + } + } + }, + "Entities": { + "Entity_[1169034670281]": { + "Id": "Entity_[1169034670281]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeChromePolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeChromePolishedPBR.prefab new file mode 100644 index 0000000000..6f933ad666 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeChromePolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeChromePolishedPBR", + "Components": { + "Component_[10194322458002226643]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10194322458002226643 + }, + "Component_[12036481316264753863]": { + "$type": "EditorVisibilityComponent", + "Id": 12036481316264753863 + }, + "Component_[12378089635489881977]": { + "$type": "EditorInspectorComponent", + "Id": 12378089635489881977 + }, + "Component_[14430665156325163680]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14430665156325163680 + }, + "Component_[15205683346512266293]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15205683346512266293, + "Parent Entity": "" + }, + "Component_[16051828087924530008]": { + "$type": "EditorLockComponent", + "Id": 16051828087924530008 + }, + "Component_[3910753277078082783]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 3910753277078082783 + }, + "Component_[4999195701117409226]": { + "$type": "EditorEntityIconComponent", + "Id": 4999195701117409226 + }, + "Component_[5435519106043975119]": { + "$type": "EditorEntitySortComponent", + "Id": 5435519106043975119, + "Child Entity Order": [ + "Entity_[1315063558345]" + ] + }, + "Component_[6762050164377989214]": { + "$type": "EditorPrefabComponent", + "Id": 6762050164377989214 + }, + "Component_[7395721573111063938]": { + "$type": "SelectionComponent", + "Id": 7395721573111063938 + } + } + }, + "Entities": { + "Entity_[1315063558345]": { + "Id": "Entity_[1315063558345]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeCobaltPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeCobaltPolishedPBR.prefab new file mode 100644 index 0000000000..82ed5264dd --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeCobaltPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeCobaltPolishedPBR", + "Components": { + "Component_[12811832964126776693]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12811832964126776693, + "Parent Entity": "" + }, + "Component_[13295886036381057017]": { + "$type": "EditorPrefabComponent", + "Id": 13295886036381057017 + }, + "Component_[13767840970182343359]": { + "$type": "SelectionComponent", + "Id": 13767840970182343359 + }, + "Component_[16269039178417460408]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16269039178417460408 + }, + "Component_[16338942903899315753]": { + "$type": "EditorLockComponent", + "Id": 16338942903899315753 + }, + "Component_[16938354010512315058]": { + "$type": "EditorVisibilityComponent", + "Id": 16938354010512315058 + }, + "Component_[18087692989611771228]": { + "$type": "EditorEntitySortComponent", + "Id": 18087692989611771228, + "Child Entity Order": [ + "Entity_[1478272315593]" + ] + }, + "Component_[2408892657833094901]": { + "$type": "EditorInspectorComponent", + "Id": 2408892657833094901 + }, + "Component_[3273159330768091937]": { + "$type": "EditorPendingCompositionComponent", + "Id": 3273159330768091937 + }, + "Component_[8251134042453350781]": { + "$type": "EditorEntityIconComponent", + "Id": 8251134042453350781 + }, + "Component_[9830348537229676775]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9830348537229676775 + } + } + }, + "Entities": { + "Entity_[1478272315593]": { + "Id": "Entity_[1478272315593]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeCopperPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeCopperPolishedPBR.prefab new file mode 100644 index 0000000000..ca6680593b --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeCopperPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeCopperPolishedPBR", + "Components": { + "Component_[14120317269315619433]": { + "$type": "SelectionComponent", + "Id": 14120317269315619433 + }, + "Component_[143917687187100454]": { + "$type": "EditorInspectorComponent", + "Id": 143917687187100454 + }, + "Component_[15260876699496078513]": { + "$type": "EditorPrefabComponent", + "Id": 15260876699496078513 + }, + "Component_[1746418914802949089]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1746418914802949089 + }, + "Component_[18443523081045072277]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18443523081045072277 + }, + "Component_[4010874908443542212]": { + "$type": "EditorLockComponent", + "Id": 4010874908443542212 + }, + "Component_[4271734532103635304]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4271734532103635304 + }, + "Component_[4383829137523954163]": { + "$type": "EditorEntityIconComponent", + "Id": 4383829137523954163 + }, + "Component_[5749675910289562089]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5749675910289562089, + "Parent Entity": "" + }, + "Component_[6232920837132171119]": { + "$type": "EditorVisibilityComponent", + "Id": 6232920837132171119 + }, + "Component_[7306146920796854544]": { + "$type": "EditorEntitySortComponent", + "Id": 7306146920796854544, + "Child Entity Order": [ + "Entity_[1658660942025]" + ] + } + } + }, + "Entities": { + "Entity_[1658660942025]": { + "Id": "Entity_[1658660942025]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeGoldPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeGoldPolishedPBR.prefab new file mode 100644 index 0000000000..f6b678bb32 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeGoldPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeGoldPolishedPBR", + "Components": { + "Component_[10011820011377711118]": { + "$type": "EditorLockComponent", + "Id": 10011820011377711118 + }, + "Component_[10068789746496377466]": { + "$type": "EditorPrefabComponent", + "Id": 10068789746496377466 + }, + "Component_[11570676153379582500]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11570676153379582500, + "Parent Entity": "" + }, + "Component_[13003038310843603631]": { + "$type": "EditorVisibilityComponent", + "Id": 13003038310843603631 + }, + "Component_[15807328745370882636]": { + "$type": "SelectionComponent", + "Id": 15807328745370882636 + }, + "Component_[2750440106393392905]": { + "$type": "EditorEntitySortComponent", + "Id": 2750440106393392905, + "Child Entity Order": [ + "Entity_[1856229437641]" + ] + }, + "Component_[2761752922494043610]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 2761752922494043610 + }, + "Component_[3027606009106407466]": { + "$type": "EditorInspectorComponent", + "Id": 3027606009106407466 + }, + "Component_[4326682049246572673]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4326682049246572673 + }, + "Component_[5821381882600148312]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821381882600148312 + }, + "Component_[6068739143830165037]": { + "$type": "EditorEntityIconComponent", + "Id": 6068739143830165037 + } + } + }, + "Entities": { + "Entity_[1856229437641]": { + "Id": "Entity_[1856229437641]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeIronPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeIronPolishedPBR.prefab new file mode 100644 index 0000000000..f7118b4084 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeIronPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeIronPolishedPBR", + "Components": { + "Component_[10744633821142630765]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10744633821142630765 + }, + "Component_[15160812085690623525]": { + "$type": "EditorPrefabComponent", + "Id": 15160812085690623525 + }, + "Component_[17506200912680653288]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17506200912680653288, + "Parent Entity": "" + }, + "Component_[1779514216896114299]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1779514216896114299 + }, + "Component_[2089200513910230823]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2089200513910230823 + }, + "Component_[3904312129158421170]": { + "$type": "EditorEntityIconComponent", + "Id": 3904312129158421170 + }, + "Component_[5126366677360310098]": { + "$type": "EditorVisibilityComponent", + "Id": 5126366677360310098 + }, + "Component_[6443652007083636420]": { + "$type": "EditorEntitySortComponent", + "Id": 6443652007083636420, + "Child Entity Order": [ + "Entity_[2070977802441]" + ] + }, + "Component_[8531209872369121358]": { + "$type": "EditorInspectorComponent", + "Id": 8531209872369121358 + }, + "Component_[8558242753126803571]": { + "$type": "SelectionComponent", + "Id": 8558242753126803571 + }, + "Component_[8938179055081804896]": { + "$type": "EditorLockComponent", + "Id": 8938179055081804896 + } + } + }, + "Entities": { + "Entity_[2070977802441]": { + "Id": "Entity_[2070977802441]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeMercuryPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeMercuryPBR.prefab new file mode 100644 index 0000000000..2977bff25b --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeMercuryPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeMercuryPBR", + "Components": { + "Component_[11796219437064669544]": { + "$type": "SelectionComponent", + "Id": 11796219437064669544 + }, + "Component_[12551667429170676889]": { + "$type": "EditorPrefabComponent", + "Id": 12551667429170676889 + }, + "Component_[12693460746131498096]": { + "$type": "EditorInspectorComponent", + "Id": 12693460746131498096 + }, + "Component_[14262931207267008977]": { + "$type": "EditorEntityIconComponent", + "Id": 14262931207267008977 + }, + "Component_[18045441039226816973]": { + "$type": "EditorEntitySortComponent", + "Id": 18045441039226816973, + "Child Entity Order": [ + "Entity_[928516501705]" + ] + }, + "Component_[2268958959705742396]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 2268958959705742396, + "Parent Entity": "" + }, + "Component_[3379321424051234761]": { + "$type": "EditorVisibilityComponent", + "Id": 3379321424051234761 + }, + "Component_[3967973434353405611]": { + "$type": "EditorLockComponent", + "Id": 3967973434353405611 + }, + "Component_[6260092263143569388]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 6260092263143569388 + }, + "Component_[6596926416684557718]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6596926416684557718 + }, + "Component_[9068640134216835201]": { + "$type": "EditorPendingCompositionComponent", + "Id": 9068640134216835201 + } + } + }, + "Entities": { + "Entity_[928516501705]": { + "Id": "Entity_[928516501705]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeNickelPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeNickelPolishedPBR.prefab new file mode 100644 index 0000000000..22fa0873b1 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeNickelPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeNickelPolishedPBR", + "Components": { + "Component_[10826024012928681054]": { + "$type": "EditorPendingCompositionComponent", + "Id": 10826024012928681054 + }, + "Component_[12821987693261496174]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12821987693261496174, + "Parent Entity": "" + }, + "Component_[1347237730046420905]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1347237730046420905 + }, + "Component_[13962868105035894085]": { + "$type": "EditorInspectorComponent", + "Id": 13962868105035894085 + }, + "Component_[17956955568472089321]": { + "$type": "EditorOnlyEntityComponent", + "Id": 17956955568472089321 + }, + "Component_[1982369816302736367]": { + "$type": "EditorLockComponent", + "Id": 1982369816302736367 + }, + "Component_[2765278216943439310]": { + "$type": "EditorEntityIconComponent", + "Id": 2765278216943439310 + }, + "Component_[2823302329697962266]": { + "$type": "SelectionComponent", + "Id": 2823302329697962266 + }, + "Component_[5490362878017390612]": { + "$type": "EditorVisibilityComponent", + "Id": 5490362878017390612 + }, + "Component_[7468073145776592577]": { + "$type": "EditorEntitySortComponent", + "Id": 7468073145776592577, + "Child Entity Order": [ + "Entity_[2302906036425]" + ] + }, + "Component_[7692885660975737763]": { + "$type": "EditorPrefabComponent", + "Id": 7692885660975737763 + } + } + }, + "Entities": { + "Entity_[2302906036425]": { + "Id": "Entity_[2302906036425]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubePalladiumPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubePalladiumPolishedPBR.prefab new file mode 100644 index 0000000000..ace44a3d34 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubePalladiumPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubePalladiumPolishedPBR", + "Components": { + "Component_[10678536274818457672]": { + "$type": "EditorInspectorComponent", + "Id": 10678536274818457672 + }, + "Component_[12041428694628704247]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12041428694628704247 + }, + "Component_[12143022343588526078]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 12143022343588526078 + }, + "Component_[15178316190409605112]": { + "$type": "EditorVisibilityComponent", + "Id": 15178316190409605112 + }, + "Component_[16012620721047170064]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16012620721047170064, + "Parent Entity": "" + }, + "Component_[1646888921009876369]": { + "$type": "EditorPrefabComponent", + "Id": 1646888921009876369 + }, + "Component_[17677550467282239311]": { + "$type": "EditorEntitySortComponent", + "Id": 17677550467282239311, + "Child Entity Order": [ + "Entity_[2552014139593]" + ] + }, + "Component_[4972639499125068141]": { + "$type": "EditorLockComponent", + "Id": 4972639499125068141 + }, + "Component_[5526570610744382545]": { + "$type": "SelectionComponent", + "Id": 5526570610744382545 + }, + "Component_[6509459924043770606]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6509459924043770606 + }, + "Component_[7268409859686144269]": { + "$type": "EditorEntityIconComponent", + "Id": 7268409859686144269 + } + } + }, + "Entities": { + "Entity_[2552014139593]": { + "Id": "Entity_[2552014139593]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubePlatinumPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubePlatinumPolishedPBR.prefab new file mode 100644 index 0000000000..79bc443342 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubePlatinumPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubePlatinumPolishedPBR", + "Components": { + "Component_[12172311178585433096]": { + "$type": "EditorEntityIconComponent", + "Id": 12172311178585433096 + }, + "Component_[14133734575774270778]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14133734575774270778 + }, + "Component_[1499102502234135899]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 1499102502234135899, + "Parent Entity": "" + }, + "Component_[17753826932279572795]": { + "$type": "EditorOnlyEntityComponent", + "Id": 17753826932279572795 + }, + "Component_[3472150728361446089]": { + "$type": "EditorPrefabComponent", + "Id": 3472150728361446089 + }, + "Component_[5413614787652013946]": { + "$type": "EditorLockComponent", + "Id": 5413614787652013946 + }, + "Component_[6608132617418028580]": { + "$type": "EditorEntitySortComponent", + "Id": 6608132617418028580, + "Child Entity Order": [ + "Entity_[2818302111945]" + ] + }, + "Component_[6809102061425149362]": { + "$type": "EditorInspectorComponent", + "Id": 6809102061425149362 + }, + "Component_[6916818921856882722]": { + "$type": "EditorPendingCompositionComponent", + "Id": 6916818921856882722 + }, + "Component_[7486700682637381880]": { + "$type": "SelectionComponent", + "Id": 7486700682637381880 + }, + "Component_[7993011597330638847]": { + "$type": "EditorVisibilityComponent", + "Id": 7993011597330638847 + } + } + }, + "Entities": { + "Entity_[2818302111945]": { + "Id": "Entity_[2818302111945]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeSilverPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeSilverPolishedPBR.prefab new file mode 100644 index 0000000000..74a166e09c --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeSilverPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeSilverPolishedPBR", + "Components": { + "Component_[10846467226799581471]": { + "$type": "EditorPrefabComponent", + "Id": 10846467226799581471 + }, + "Component_[11321068769303258722]": { + "$type": "SelectionComponent", + "Id": 11321068769303258722 + }, + "Component_[14255141886015898000]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14255141886015898000 + }, + "Component_[14442599743555977836]": { + "$type": "EditorLockComponent", + "Id": 14442599743555977836 + }, + "Component_[15390328167304917483]": { + "$type": "EditorOnlyEntityComponent", + "Id": 15390328167304917483 + }, + "Component_[16667892946203958068]": { + "$type": "EditorInspectorComponent", + "Id": 16667892946203958068 + }, + "Component_[17957849336986334052]": { + "$type": "EditorPendingCompositionComponent", + "Id": 17957849336986334052 + }, + "Component_[18049054501916401618]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18049054501916401618, + "Parent Entity": "" + }, + "Component_[362051120594559781]": { + "$type": "EditorVisibilityComponent", + "Id": 362051120594559781 + }, + "Component_[5852346937789040993]": { + "$type": "EditorEntitySortComponent", + "Id": 5852346937789040993, + "Child Entity Order": [ + "Entity_[3101769953481]" + ] + }, + "Component_[7250311833503679341]": { + "$type": "EditorEntityIconComponent", + "Id": 7250311833503679341 + } + } + }, + "Entities": { + "Entity_[3101769953481]": { + "Id": "Entity_[3101769953481]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeTitaniumPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeTitaniumPolishedPBR.prefab new file mode 100644 index 0000000000..c732fee593 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeTitaniumPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeTitaniumPolishedPBR", + "Components": { + "Component_[11835136016071721229]": { + "$type": "EditorInspectorComponent", + "Id": 11835136016071721229 + }, + "Component_[14924371629431224666]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 14924371629431224666, + "Parent Entity": "" + }, + "Component_[15534521734777674027]": { + "$type": "EditorPrefabComponent", + "Id": 15534521734777674027 + }, + "Component_[16612248066971579226]": { + "$type": "SelectionComponent", + "Id": 16612248066971579226 + }, + "Component_[16806731875899878085]": { + "$type": "EditorLockComponent", + "Id": 16806731875899878085 + }, + "Component_[3294763415970396682]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3294763415970396682 + }, + "Component_[3871617444656658973]": { + "$type": "EditorEntitySortComponent", + "Id": 3871617444656658973, + "Child Entity Order": [ + "Entity_[3406712631497]" + ] + }, + "Component_[6604961087017250006]": { + "$type": "EditorEntityIconComponent", + "Id": 6604961087017250006 + }, + "Component_[6721284225512452216]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 6721284225512452216 + }, + "Component_[8673188027501037544]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8673188027501037544 + }, + "Component_[9993323762911548658]": { + "$type": "EditorVisibilityComponent", + "Id": 9993323762911548658 + } + } + }, + "Entities": { + "Entity_[3406712631497]": { + "Id": "Entity_[3406712631497]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file From ddfcccfe2a7e921b521fb59d843543ccc8de859c Mon Sep 17 00:00:00 2001 From: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> Date: Fri, 17 Dec 2021 22:24:16 +0000 Subject: [PATCH 146/399] Add EditorPythonBindings as an explicit dependency of the White Box Tool (#6479) * add EditorPythonBindings as an explicit dependency of the White Box Tool Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * add Gem::EditorPythonBindings.Editor as a runtime dependency to White Box Tool Gem Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * remove redundant target scope Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> --- Gems/WhiteBox/Code/CMakeLists.txt | 3 ++- Gems/WhiteBox/gem.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gems/WhiteBox/Code/CMakeLists.txt b/Gems/WhiteBox/Code/CMakeLists.txt index ee76031beb..bfc4eb724a 100644 --- a/Gems/WhiteBox/Code/CMakeLists.txt +++ b/Gems/WhiteBox/Code/CMakeLists.txt @@ -29,7 +29,6 @@ if(NOT PAL_TRAIT_WHITEBOX_SUPPORTED) if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME WhiteBox.Editor GEM_MODULE - NAMESPACE Gem FILES_CMAKE whitebox_unsupported_files.cmake @@ -44,6 +43,8 @@ if(NOT PAL_TRAIT_WHITEBOX_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzCore + RUNTIME_DEPENDENCIES + Gem::EditorPythonBindings.Editor ) endif() return() diff --git a/Gems/WhiteBox/gem.json b/Gems/WhiteBox/gem.json index 41865efc56..2d173e9a6b 100644 --- a/Gems/WhiteBox/gem.json +++ b/Gems/WhiteBox/gem.json @@ -20,6 +20,7 @@ "dependencies": [ "Atom_RPI", "Atom_Feature_Common", - "CommonFeaturesAtom" + "CommonFeaturesAtom", + "EditorPythonBindings" ] } From 1ba23247b42602fa2c8a64e6d0ac9bcde6e3d285 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Fri, 17 Dec 2021 15:16:24 -0800 Subject: [PATCH 147/399] sandboxing DisplayMapper P0 test for investigation Signed-off-by: Scott Murray --- .../Gem/PythonTests/Atom/TestSuite_Main.py | 4 ---- .../Gem/PythonTests/Atom/TestSuite_Sandbox.py | 14 +++++++------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py index d79e144ae0..905722d103 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py @@ -39,10 +39,6 @@ class TestAutomation(EditorTestSuite): class AtomEditorComponents_DirectionalLightAdded(EditorSharedTest): from Atom.tests import hydra_AtomEditorComponents_DirectionalLightAdded as test_module - @pytest.mark.test_case_id("C36525660") - class AtomEditorComponents_DisplayMapperAdded(EditorSharedTest): - from Atom.tests import hydra_AtomEditorComponents_DisplayMapperAdded as test_module - @pytest.mark.test_case_id("C36525661") class AtomEditorComponents_EntityReferenceAdded(EditorSharedTest): from Atom.tests import hydra_AtomEditorComponents_EntityReferenceAdded as test_module diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py index f0bb6e72ca..29f90e6807 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py @@ -19,13 +19,6 @@ logger = logging.getLogger(__name__) TEST_DIRECTORY = os.path.join(os.path.dirname(__file__), "tests") -class TestAtomEditorComponentsSandbox(object): - - # It requires at least one test - def test_Dummy(self, request, editor, level, workspace, project, launcher_platform): - pass - - @pytest.mark.parametrize("project", ["AutomatedTesting"]) @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @pytest.mark.parametrize("level", ["auto_test"]) @@ -167,10 +160,17 @@ class TestAutomation(EditorTestSuite): enable_prefab_system = False + #this test is intermittently timing out without ever having executed. sandboxing while we investigate cause. + @pytest.mark.test_case_id("C36525660") + class AtomEditorComponents_DisplayMapperAdded(EditorSharedTest): + from Atom.tests import hydra_AtomEditorComponents_DisplayMapperAdded as test_module + + # this test causes editor to crash when using slices. once automation transitions to prefabs it should pass @pytest.mark.test_case_id("C36529666") class AtomEditorComponentsLevel_DiffuseGlobalIlluminationAdded(EditorSharedTest): from Atom.tests import hydra_AtomEditorComponentsLevel_DiffuseGlobalIlluminationAdded as test_module + # this test causes editor to crash when using slices. once automation transitions to prefabs it should pass @pytest.mark.test_case_id("C36525660") class AtomEditorComponentsLevel_DisplayMapperAdded(EditorSharedTest): from Atom.tests import hydra_AtomEditorComponentsLevel_DisplayMapperAdded as test_module From c6eead4efa9a4971588e47dc508ef0301a8f68a2 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Fri, 17 Dec 2021 15:23:14 -0800 Subject: [PATCH 148/399] remove uber build exceptions (#6466) Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index 34b2c4d326..c0dcc04838 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -206,9 +206,4 @@ set(FILES Include/ScriptCanvas/Utils/VersioningUtils.cpp Include/ScriptCanvas/Utils/VersioningUtils.cpp Include/ScriptCanvas/Utils/BehaviorContextUtils.cpp -) - -set(SKIP_UNITY_BUILD_INCLUSION_FILES - Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp - Include/ScriptCanvas/Libraries/Core/FunctionCallNodeIsOutOfDate.cpp -) +) \ No newline at end of file From 20d55c62670ce0a6986bd93bc8f2fa2e7616e477 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 17 Dec 2021 16:31:39 -0600 Subject: [PATCH 149/399] Fixed the translation error messages for GraphCanvas It was unconditionally logging an AZ_Warning and AZ_Error if a translation entry with the same key was added to the database. This didn't account for the same key and value being added to the database, so loading the same translation file twice would result in error messages for each entry. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- .../Code/Source/Translation/TranslationDatabase.cpp | 8 +++++--- .../Code/Source/Translation/TranslationSerializer.cpp | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Gems/GraphCanvas/Code/Source/Translation/TranslationDatabase.cpp b/Gems/GraphCanvas/Code/Source/Translation/TranslationDatabase.cpp index 0b5029de63..448f69adfa 100644 --- a/Gems/GraphCanvas/Code/Source/Translation/TranslationDatabase.cpp +++ b/Gems/GraphCanvas/Code/Source/Translation/TranslationDatabase.cpp @@ -163,9 +163,11 @@ namespace GraphCanvas } else { - AZStd::string warning = AZStd::string::format("Unable to store key: %s with value: %s because that key already exists with value: %s", entry.first.c_str(), entry.second.c_str(), m_database[entry.first].c_str()); - AZ_Warning("TranslationSerializer", false, warning.c_str()); - warnings = true; + const bool valueMatches = entry.second == m_database[entry.first]; + AZ_Warning("TranslationDatabase", valueMatches, + R"(Unable to store key: "%s" with value: "%s" because that key already exists with value: "%s")", + entry.first.c_str(), entry.second.c_str(), m_database[entry.first].c_str()); + warnings = !valueMatches; } } diff --git a/Gems/GraphCanvas/Code/Source/Translation/TranslationSerializer.cpp b/Gems/GraphCanvas/Code/Source/Translation/TranslationSerializer.cpp index 754267b27d..72cbfbb9e8 100644 --- a/Gems/GraphCanvas/Code/Source/Translation/TranslationSerializer.cpp +++ b/Gems/GraphCanvas/Code/Source/Translation/TranslationSerializer.cpp @@ -24,11 +24,12 @@ namespace GraphCanvas } else { - const AZStd::string& existingValue = translationDbItr->second; + [[maybe_unused]] const AZStd::string& existingValue = translationDbItr->second; // There is a name collision - const AZStd::string error = AZStd::string::format("Unable to store key: %s with value: %s because that key already exists with value: %s (proposed: %s)", baseKey.c_str(), it.GetString(), existingValue.c_str(), it.GetString()); - AZ_Error("TranslationSerializer", false, error.c_str()); + AZ_Error("TranslationSerializer", existingValue == it.GetString(), + R"(Unable to store key: "%s" with value: "%s" because that key already exists with value: "%s" (proposed: "%s"))", + baseKey.c_str(), it.GetString(), existingValue.c_str(), it.GetString()); } } else if (it.IsObject()) From 86d22c8bb38ead46a237bcee497ed8e528eb751b Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 17 Dec 2021 18:26:36 -0600 Subject: [PATCH 150/399] Updated GraphCanvasSystemComponent::OnCatalogLoaded to use TranslationRequests::Restore The TranslationDatabase::Restore function will clear out the database before merging in all the translation .names files making it idempotent. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Gems/GraphCanvas/Code/Source/GraphCanvas.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/Gems/GraphCanvas/Code/Source/GraphCanvas.cpp b/Gems/GraphCanvas/Code/Source/GraphCanvas.cpp index 75306969f2..de7966e53c 100644 --- a/Gems/GraphCanvas/Code/Source/GraphCanvas.cpp +++ b/Gems/GraphCanvas/Code/Source/GraphCanvas.cpp @@ -368,25 +368,7 @@ namespace GraphCanvas void GraphCanvasSystemComponent::OnCatalogLoaded(const char* /*catalogFile*/) { - AZStd::vector translationAssets; - auto postEnumerateCb = [&translationAssets]() - { - for (const AZ::Data::AssetId& assetId : translationAssets) - { - AZ::Data::AssetManager::Instance().GetAsset(assetId, AZ::Data::AssetLoadBehavior::Default); - } - }; - - // Find any TranslationAsset files that may have translation database key/values - AZ::Data::AssetCatalogRequests::AssetEnumerationCB collectAssetsCb = [&translationAssets](const AZ::Data::AssetId assetId, const AZ::Data::AssetInfo& assetInfo) - { - if (AZ::StringFunc::EndsWith(assetInfo.m_relativePath, ".names", false)) - { - translationAssets.push_back(assetId); - } - }; - - AZ::Data::AssetCatalogRequestBus::Broadcast(&AZ::Data::AssetCatalogRequestBus::Events::EnumerateAssets, nullptr, collectAssetsCb, postEnumerateCb); + GraphCanvas::TranslationRequestBus::Broadcast(&GraphCanvas::TranslationRequests::Restore); } void GraphCanvasSystemComponent::OnCatalogAssetRemoved(const AZ::Data::AssetId& /*assetId*/, const AZ::Data::AssetInfo& assetInfo) From d508d5c4c2a57eecdc4a7efcb990b803393f373d Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Fri, 17 Dec 2021 17:49:36 -0800 Subject: [PATCH 151/399] Updating pytest code comments and RPC name based on review feedback Signed-off-by: Gene Walters --- ...tworkTestPlayerComponent.AutoComponent.xml | 2 +- .../editor_python_test_tools/utils.py | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml index 9037db43ee..251d2b25af 100644 --- a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml +++ b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml @@ -29,7 +29,7 @@ - + diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py index 92ac279627..2ba692d89b 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py @@ -117,11 +117,31 @@ class TestHelper: @staticmethod def wait_for_critical_expected_line(window, expected_message, print_infos, time_out): + """ + Looks for an expected line in a list of tracer log lines for a period of time. + Reports a critical result based on if the expected line was found. The result is successful if the line is found. + :param window: The log's window name. For example, logs printed via script-canvas use the "Script" window. + :param expected_message: The log message we're expecting to find. + :param print_infos: A list of PrintInfos collected by Tracer to search. Example options: your_tracer.warnings, your_tracer.errors, your_tracer.asserts, or your_tracer.prints + :param time_out: The total amount of time to wait before giving up looking for the expected line. + + :return: No return value, but if the expected message is found, a successful critical result is reported; otherwise failure. + """ TestHelper.wait_for_condition(lambda : TestHelper.find_expected_line(window, expected_message, print_infos), time_out) Report.critical_result(("Found expected line: " + expected_message, "Failed to find expected line: " + expected_message), TestHelper.find_expected_line(window, expected_message, print_infos)) @staticmethod def wait_for_critical_unexpected_line(window, unexpected_line, print_infos, time_out): + """ + Looks for an unexpected line in a list of tracer log lines over a period of time. + Reports a critical result based on if the unexpected line was found. The result is successful if the line is not found. + :param window: The log's window name. For example, logs printed via script-canvas use the "Script" window. + :param unexpected_line: The log message we're hoping to not find. + :param print_infos: A list of PrintInfos collected by Tracer to search. Example options: your_tracer.warnings, your_tracer.errors, your_tracer.asserts, or your_tracer.prints + :param time_out: The total amount of time to wait before giving up looking for the unexpected line. + + :return: No return value, but if the unexpected message is found, a failed critical result is reported; otherwise success. + """ TestHelper.wait_for_condition(lambda : TestHelper.find_expected_line(window, unexpected_line, print_infos), time_out) Report.critical_result(("Unexpected line not found: " + unexpected_line, "Unexpected line found: " + unexpected_line), not TestHelper.find_expected_line(window, unexpected_line, print_infos)) From fd078e3c29a5d39f96cb4965f65ede334b55e338 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Sat, 18 Dec 2021 10:11:20 -0800 Subject: [PATCH 152/399] Small py var name change based on review feedback. Updating script graphs from previous commit to use new RPC name Signed-off-by: Gene Walters --- .../tests/Multiplayer_AutoComponent_RPC.py | 8 +- ...oComponent_RPC_NetLevelEntity.scriptcanvas | 664 ++++++++++-------- 2 files changed, 377 insertions(+), 295 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py index 387de66acd..3b7ae89368 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py @@ -10,7 +10,7 @@ SPDX-License-Identifier: Apache-2.0 OR MIT # fmt: off -class Tests(): +class TestSuccessFailTuples(): enter_game_mode = ("Entered game mode", "Failed to enter game mode") exit_game_mode = ("Exited game mode", "Couldn't exit game mode") find_network_player = ("Found network player", "Couldn't find network player") @@ -55,11 +55,11 @@ def Multiplayer_AutoComponent_RPC(): with Tracer() as section_tracer: # 2) Enter game mode - helper.multiplayer_enter_game_mode(Tests.enter_game_mode, player_prefab_path.lower()) + helper.multiplayer_enter_game_mode(TestSuccessFailTuples.enter_game_mode, player_prefab_path.lower()) # 3) Make sure the network player was spawned player_id = general.find_game_entity(player_prefab_name) - Report.critical_result(Tests.find_network_player, player_id.IsValid()) + Report.critical_result(TestSuccessFailTuples.find_network_player, player_id.IsValid()) # 4) Check the editor logs for expected and unexpected log output EXPECTEDLINE_WAIT_TIME_SECONDS = 1.0 @@ -68,7 +68,7 @@ def Multiplayer_AutoComponent_RPC(): # Exit game mode - helper.exit_game_mode(Tests.exit_game_mode) + helper.exit_game_mode(TestSuccessFailTuples.exit_game_mode) diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas index aa5244a7cd..8e5a6b374c 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas @@ -5,7 +5,7 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 56982432064952 + "id": 5286394689911028851 }, "Name": "AutoComponent_RPC_NetLevelEntity", "Components": { @@ -216,40 +216,51 @@ }, { "Id": { - "id": 57021086770616 + "id": 28956289730909 }, - "Name": "SC-Node(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId)", + "Name": "SC-EventNode(AuthorityToClientNoParams_PlayFx Notify Event)", "Components": { - "Component_[1410603071340071190]": { - "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", - "Id": 1410603071340071190, + "Component_[12478098247313937239]": { + "$type": "AzEventHandler", + "Id": 12478098247313937239, "Slots": [ { "id": { - "m_id": "{406DA66F-95FA-406B-8A5B-F2C5E292EC21}" + "m_id": "{E97830A5-323D-4CD1-85CF-BAFB1735AC34}" }, "contracts": [ { "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 28466663459165 + } } ], - "slotName": "EntityId: 0", + "slotName": "Connect", + "toolTip": "Connect the AZ Event to this AZ Event Handler.", "Descriptor": { "ConnectionType": 1, - "SlotType": 2 - }, - "DataType": 1 + "SlotType": 1 + } }, { "id": { - "m_id": "{5CDED810-9455-424A-9A1D-40B9366D1F94}" + "m_id": "{2A7ABD07-368B-44F3-BB16-946539B76A16}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "In", + "slotName": "Disconnect", + "toolTip": "Disconnect current AZ Event from this AZ Event Handler.", "Descriptor": { "ConnectionType": 1, "SlotType": 1 @@ -257,14 +268,15 @@ }, { "id": { - "m_id": "{2FC162C0-D717-4053-9842-39DAD3E8EA86}" + "m_id": "{E1C7B2B6-B5ED-4BA6-8484-A74F336CD53F}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "Out", + "slotName": "On Connected", + "toolTip": "Signaled when a connection has taken place.", "Descriptor": { "ConnectionType": 2, "SlotType": 1 @@ -272,20 +284,59 @@ }, { "id": { - "m_id": "{C18E637D-BFD1-42C8-A30D-C2B52D157142}" + "m_id": "{2731EE09-9E48-4EDB-9548-024EAAC23A03}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "Event<>", - "DisplayDataType": { - "m_type": 4, - "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" + "slotName": "On Disconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1F11AAA9-2A99-41A2-AABE-7B57463E3664}" }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnEvent", + "toolTip": "Triggered when the AZ Event invokes Signal() function.", "Descriptor": { "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{7A4D75C3-C9C8-4CFB-A87C-C15B71AB3296}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 28466663459165 + } + } + ], + "slotName": "AuthorityToClientNoParams_PlayFx Notify Event", + "Descriptor": { + "ConnectionType": 1, "SlotType": 2 }, "DataType": 1 @@ -293,29 +344,21 @@ ], "Datums": [ { + "isOverloadedStorage": false, "scriptCanvasType": { - "m_type": 1 - }, - "isNullPointer": false, - "$type": "EntityId", - "value": { - "id": 2901262558 + "m_type": 4, + "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" }, - "label": "EntityId: 0" + "isNullPointer": true, + "label": "AuthorityToClientNoParams_PlayFx Notify Event" } ], - "methodType": 2, - "methodName": "GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId", - "className": "NetworkTestPlayerComponent", - "resultSlotIDs": [ - {} - ], - "inputSlots": [ - { - "m_id": "{406DA66F-95FA-406B-8A5B-F2C5E292EC21}" + "m_azEventEntry": { + "m_eventName": "AuthorityToClientNoParams_PlayFx Notify Event", + "m_eventSlotId": { + "m_id": "{7A4D75C3-C9C8-4CFB-A87C-C15B71AB3296}" } - ], - "prettyClassName": "NetworkTestPlayerComponent" + } } } }, @@ -642,83 +685,85 @@ }, { "Id": { - "id": 57016791803320 + "id": 57025381737912 }, - "Name": "SC-EventNode(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event)", + "Name": "SC-Node(Start)", "Components": { - "Component_[17598011665473695286]": { - "$type": "AzEventHandler", - "Id": 17598011665473695286, + "Component_[1888047318201703857]": { + "$type": "Start", + "Id": 1888047318201703857, "Slots": [ { "id": { - "m_id": "{6F8A1DAB-76A6-445F-B532-6B71CD5DB48F}" + "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" }, "contracts": [ { "$type": "SlotTypeContract" - }, - { - "$type": "ConnectionLimitContract", - "limit": 1 - }, - { - "$type": "RestrictedNodeContract", - "m_nodeId": { - "id": 57021086770616 - } } ], - "slotName": "Connect", - "toolTip": "Connect the AZ Event to this AZ Event Handler.", + "slotName": "Out", + "toolTip": "Signaled when the entity that owns this graph is fully activated.", "Descriptor": { - "ConnectionType": 1, + "ConnectionType": 2, "SlotType": 1 } - }, + } + ] + } + } + }, + { + "Id": { + "id": 28466663459165 + }, + "Name": "SC-Node(GetAuthorityToClientNoParams_PlayFxEventByEntityId)", + "Components": { + "Component_[5890343372099746558]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 5890343372099746558, + "Slots": [ { "id": { - "m_id": "{D986DF89-49E8-4CFF-907E-7A46BC118208}" + "m_id": "{4E1A6903-3F02-4395-A4C9-202D1F13250E}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "Disconnect", - "toolTip": "Disconnect current AZ Event from this AZ Event Handler.", + "slotName": "EntityId: 0", "Descriptor": { "ConnectionType": 1, - "SlotType": 1 - } + "SlotType": 2 + }, + "DataType": 1 }, { "id": { - "m_id": "{277D7B39-E1B0-4700-946B-FFA024EEDF89}" + "m_id": "{26902930-1BC7-4BF6-8F41-C313BA819AA3}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "On Connected", - "toolTip": "Signaled when a connection has taken place.", + "slotName": "In", "Descriptor": { - "ConnectionType": 2, + "ConnectionType": 1, "SlotType": 1 } }, { "id": { - "m_id": "{7673B52D-3BEC-4BFF-B29A-D027400B16B1}" + "m_id": "{B6C92656-7593-4759-B657-98DB7CA30482}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "On Disconnected", - "toolTip": "Signaled when this event handler is disconnected.", + "slotName": "Out", "Descriptor": { "ConnectionType": 2, "SlotType": 1 @@ -726,43 +771,20 @@ }, { "id": { - "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + "m_id": "{10D59D8F-E406-431B-87F9-FC1AF1EC65AF}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "OnEvent", - "toolTip": "Triggered when the AZ Event invokes Signal() function.", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - }, - "IsLatent": true - }, - { - "id": { - "m_id": "{F5D0C2B0-F557-4D94-B747-6F3EF01AF54B}" + "slotName": "Event<>", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" }, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - { - "$type": "ConnectionLimitContract", - "limit": 1 - }, - { - "$type": "RestrictedNodeContract", - "m_nodeId": { - "id": 57021086770616 - } - } - ], - "slotName": "AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event", "Descriptor": { - "ConnectionType": 1, + "ConnectionType": 2, "SlotType": 2 }, "DataType": 1 @@ -770,66 +792,43 @@ ], "Datums": [ { + "isOverloadedStorage": false, "scriptCanvasType": { - "m_type": 4, - "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" + "m_type": 1 }, - "isNullPointer": true, - "label": "AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event" + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "EntityId: 0" } ], - "m_azEventEntry": { - "m_eventName": "AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event", - "m_eventSlotId": { - "m_id": "{F5D0C2B0-F557-4D94-B747-6F3EF01AF54B}" - } - } - } - } - }, - { - "Id": { - "id": 57025381737912 - }, - "Name": "SC-Node(Start)", - "Components": { - "Component_[1888047318201703857]": { - "$type": "Start", - "Id": 1888047318201703857, - "Slots": [ + "methodType": 2, + "methodName": "GetAuthorityToClientNoParams_PlayFxEventByEntityId", + "className": "NetworkTestPlayerComponent", + "inputSlots": [ { - "id": { - "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "Out", - "toolTip": "Signaled when the entity that owns this graph is fully activated.", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - } + "m_id": "{4E1A6903-3F02-4395-A4C9-202D1F13250E}" } - ] + ], + "prettyClassName": "NetworkTestPlayerComponent" } } }, { "Id": { - "id": 57008201868728 + "id": 8400576252253 }, - "Name": "SC-Node(AuthorityToClientNoParams_PlaySomeSuperficialFxByEntityId)", + "Name": "SC-Node(AuthorityToClientNoParams_PlayFxByEntityId)", "Components": { - "Component_[5156950796673122600]": { + "Component_[6332803108634970671]": { "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", - "Id": 5156950796673122600, + "Id": 6332803108634970671, "Slots": [ { "id": { - "m_id": "{AF45BF64-D202-411F-9CE1-A7139ABC6E65}" + "m_id": "{87B7266B-D7B1-4CAD-9898-4D7F0274DAB0}" }, "contracts": [ { @@ -846,7 +845,7 @@ }, { "id": { - "m_id": "{A6449574-6CD4-4986-ABED-2E10136D1B2C}" + "m_id": "{AB0D7C00-A334-449A-AC56-EA3167AB8900}" }, "contracts": [ { @@ -861,7 +860,7 @@ }, { "id": { - "m_id": "{F8CE0394-770E-4F0D-B908-3E01D0E04AE1}" + "m_id": "{A52302D6-9DF9-45C2-960D-19BF90A4A931}" }, "contracts": [ { @@ -889,14 +888,14 @@ } ], "methodType": 2, - "methodName": "AuthorityToClientNoParams_PlaySomeSuperficialFxByEntityId", + "methodName": "AuthorityToClientNoParams_PlayFxByEntityId", "className": "NetworkTestPlayerComponent", "resultSlotIDs": [ {} ], "inputSlots": [ { - "m_id": "{AF45BF64-D202-411F-9CE1-A7139ABC6E65}" + "m_id": "{87B7266B-D7B1-4CAD-9898-4D7F0274DAB0}" } ], "prettyClassName": "NetworkTestPlayerComponent" @@ -1074,27 +1073,83 @@ }, { "Id": { - "id": 57033971672504 + "id": 57042561607096 }, - "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId: Event<>), destEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event)", + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId: In)", "Components": { - "Component_[9588403027578693736]": { + "Component_[17563947682404363417]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 9588403027578693736, + "Id": 17563947682404363417, "sourceEndpoint": { + "nodeId": { + "id": 57025381737912 + }, + "slotId": { + "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" + } + }, + "targetEndpoint": { "nodeId": { "id": 57021086770616 }, "slotId": { - "m_id": "{C18E637D-BFD1-42C8-A30D-C2B52D157142}" + "m_id": "{5CDED810-9455-424A-9A1D-40B9366D1F94}" + } + } + } + } + }, + { + "Id": { + "id": 57046856574392 + }, + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: OnEvent), destEndpoint=(Print: In)", + "Components": { + "Component_[12226462283795741406]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 12226462283795741406, + "sourceEndpoint": { + "nodeId": { + "id": 57016791803320 + }, + "slotId": { + "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" } }, "targetEndpoint": { + "nodeId": { + "id": 56995316966840 + }, + "slotId": { + "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" + } + } + } + } + }, + { + "Id": { + "id": 57051151541688 + }, + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: OnEvent), destEndpoint=(DrawTextOnEntity: In)", + "Components": { + "Component_[7209285242155620531]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 7209285242155620531, + "sourceEndpoint": { "nodeId": { "id": 57016791803320 }, "slotId": { - "m_id": "{F5D0C2B0-F557-4D94-B747-6F3EF01AF54B}" + "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 57003906901432 + }, + "slotId": { + "m_id": "{1673B8A0-D4EC-4CC7-8F80-0419BB5560EB}" } } } @@ -1102,27 +1157,27 @@ }, { "Id": { - "id": 57038266639800 + "id": 57055446508984 }, - "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId: Out), destEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: Connect)", + "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(Repeater: Start)", "Components": { - "Component_[1452138089363094396]": { + "Component_[6292481678297438578]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 1452138089363094396, + "Id": 6292481678297438578, "sourceEndpoint": { "nodeId": { - "id": 57021086770616 + "id": 57012496836024 }, "slotId": { - "m_id": "{2FC162C0-D717-4053-9842-39DAD3E8EA86}" + "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" } }, "targetEndpoint": { "nodeId": { - "id": 57016791803320 + "id": 56986727032248 }, "slotId": { - "m_id": "{6F8A1DAB-76A6-445F-B532-6B71CD5DB48F}" + "m_id": "{07267CBA-B377-4B57-8A04-E322F8BFC07F}" } } } @@ -1130,13 +1185,13 @@ }, { "Id": { - "id": 57042561607096 + "id": 57068331410872 }, - "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId: In)", + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(Print: In)", "Components": { - "Component_[17563947682404363417]": { + "Component_[11504712829988319988]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 17563947682404363417, + "Id": 11504712829988319988, "sourceEndpoint": { "nodeId": { "id": 57025381737912 @@ -1147,10 +1202,10 @@ }, "targetEndpoint": { "nodeId": { - "id": 57021086770616 + "id": 56991021999544 }, "slotId": { - "m_id": "{5CDED810-9455-424A-9A1D-40B9366D1F94}" + "m_id": "{8E1B9705-148A-42E4-831E-D7B2877358E3}" } } } @@ -1158,27 +1213,27 @@ }, { "Id": { - "id": 57046856574392 + "id": 9392713697629 }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: OnEvent), destEndpoint=(Print: In)", + "Name": "srcEndpoint=(Repeater: Action), destEndpoint=(AuthorityToClientNoParams_PlayFxByEntityId: In)", "Components": { - "Component_[12226462283795741406]": { + "Component_[17811480012084226596]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 12226462283795741406, + "Id": 17811480012084226596, "sourceEndpoint": { "nodeId": { - "id": 57016791803320 + "id": 56986727032248 }, "slotId": { - "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" } }, "targetEndpoint": { "nodeId": { - "id": 56995316966840 + "id": 8400576252253 }, "slotId": { - "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" + "m_id": "{AB0D7C00-A334-449A-AC56-EA3167AB8900}" } } } @@ -1186,27 +1241,27 @@ }, { "Id": { - "id": 57051151541688 + "id": 9732016114013 }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: OnEvent), destEndpoint=(DrawTextOnEntity: In)", + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFxByEntityId: Out), destEndpoint=(Print: In)", "Components": { - "Component_[7209285242155620531]": { + "Component_[14133537125895802472]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 7209285242155620531, + "Id": 14133537125895802472, "sourceEndpoint": { "nodeId": { - "id": 57016791803320 + "id": 8400576252253 }, "slotId": { - "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + "m_id": "{A52302D6-9DF9-45C2-960D-19BF90A4A931}" } }, "targetEndpoint": { "nodeId": { - "id": 57003906901432 + "id": 56999611934136 }, "slotId": { - "m_id": "{1673B8A0-D4EC-4CC7-8F80-0419BB5560EB}" + "m_id": "{2F11CF04-DC4B-4881-8D74-AB0E51B4A278}" } } } @@ -1214,27 +1269,27 @@ }, { "Id": { - "id": 57055446508984 + "id": 29660664367453 }, - "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(Repeater: Start)", + "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: Event<>), destEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: AuthorityToClientNoParams_PlayFx Notify Event)", "Components": { - "Component_[6292481678297438578]": { + "Component_[17084894170988218373]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 6292481678297438578, + "Id": 17084894170988218373, "sourceEndpoint": { "nodeId": { - "id": 57012496836024 + "id": 28466663459165 }, "slotId": { - "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" + "m_id": "{10D59D8F-E406-431B-87F9-FC1AF1EC65AF}" } }, "targetEndpoint": { "nodeId": { - "id": 56986727032248 + "id": 28956289730909 }, "slotId": { - "m_id": "{07267CBA-B377-4B57-8A04-E322F8BFC07F}" + "m_id": "{7A4D75C3-C9C8-4CFB-A87C-C15B71AB3296}" } } } @@ -1242,27 +1297,27 @@ }, { "Id": { - "id": 57059741476280 + "id": 29716498942301 }, - "Name": "srcEndpoint=(Repeater: Action), destEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFxByEntityId: In)", + "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: Out), destEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: Connect)", "Components": { - "Component_[8833903103579494596]": { + "Component_[6504512854579046293]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 8833903103579494596, + "Id": 6504512854579046293, "sourceEndpoint": { "nodeId": { - "id": 56986727032248 + "id": 28466663459165 }, "slotId": { - "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" + "m_id": "{B6C92656-7593-4759-B657-98DB7CA30482}" } }, "targetEndpoint": { "nodeId": { - "id": 57008201868728 + "id": 28956289730909 }, "slotId": { - "m_id": "{A6449574-6CD4-4986-ABED-2E10136D1B2C}" + "m_id": "{E97830A5-323D-4CD1-85CF-BAFB1735AC34}" } } } @@ -1270,27 +1325,27 @@ }, { "Id": { - "id": 57064036443576 + "id": 30240484952413 }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFxByEntityId: Out), destEndpoint=(Print: In)", + "Name": "srcEndpoint=(: ), destEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: In)", "Components": { - "Component_[8297971328953001309]": { + "Component_[4329986353751309486]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 8297971328953001309, + "Id": 4329986353751309486, "sourceEndpoint": { "nodeId": { - "id": 57008201868728 + "id": 57025381737912 }, "slotId": { - "m_id": "{F8CE0394-770E-4F0D-B908-3E01D0E04AE1}" + "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" } }, "targetEndpoint": { "nodeId": { - "id": 56999611934136 + "id": 28466663459165 }, "slotId": { - "m_id": "{2F11CF04-DC4B-4881-8D74-AB0E51B4A278}" + "m_id": "{26902930-1BC7-4BF6-8F41-C313BA819AA3}" } } } @@ -1298,27 +1353,55 @@ }, { "Id": { - "id": 57068331410872 + "id": 30678571616605 }, - "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(Print: In)", + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: OnEvent), destEndpoint=(: )", "Components": { - "Component_[11504712829988319988]": { + "Component_[14658596010250057469]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 11504712829988319988, + "Id": 14658596010250057469, "sourceEndpoint": { "nodeId": { - "id": 57025381737912 + "id": 28956289730909 }, "slotId": { - "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" + "m_id": "{1F11AAA9-2A99-41A2-AABE-7B57463E3664}" } }, "targetEndpoint": { "nodeId": { - "id": 56991021999544 + "id": 57003906901432 }, "slotId": { - "m_id": "{8E1B9705-148A-42E4-831E-D7B2877358E3}" + "m_id": "{1673B8A0-D4EC-4CC7-8F80-0419BB5560EB}" + } + } + } + } + }, + { + "Id": { + "id": 31060823705949 + }, + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: OnEvent), destEndpoint=(: )", + "Components": { + "Component_[16833378372852944435]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16833378372852944435, + "sourceEndpoint": { + "nodeId": { + "id": 28956289730909 + }, + "slotId": { + "m_id": "{1F11AAA9-2A99-41A2-AABE-7B57463E3664}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 56995316966840 + }, + "slotId": { + "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" } } } @@ -1335,24 +1418,7 @@ "GraphCanvasData": [ { "Key": { - "id": 56982432064952 - }, - "Value": { - "ComponentData": { - "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { - "$type": "SceneComponentSaveData", - "ViewParams": { - "Scale": 1.0440124999999998, - "AnchorX": 173.36956787109375, - "AnchorY": -153.25486755371094 - } - } - } - } - }, - { - "Key": { - "id": 56986727032248 + "id": 8400576252253 }, "Value": { "ComponentData": { @@ -1361,28 +1427,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "DefaultNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 80.0, - -60.0 + 440.0, + -20.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{41B7477C-D5B9-49AC-AFA3-AAAE2A6ED7C5}" + "PersistentId": "{2B6329F7-4CE7-4E01-B1A4-1FFCAB2D0B72}" } } } }, { "Key": { - "id": 56991021999544 + "id": 28466663459165 }, "Value": { "ComponentData": { @@ -1391,28 +1458,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "StringNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - -240.0, - -300.0 + -200.0, + 300.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{0CF0846C-1D21-4B33-8723-1538FD4FD04A}" + "PersistentId": "{A84996D5-99BD-4F5D-859E-02BFAB3FA83A}" } } } }, { "Key": { - "id": 56995316966840 + "id": 28956289730909 }, "Value": { "ComponentData": { @@ -1421,28 +1489,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "StringNodeTitlePalette" + "PaletteOverride": "HandlerNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 800.0, - 260.0 + 260.0, + 300.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".azeventhandler" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{0D04EBA6-E1E7-4DF7-BAA9-CC87F4689CD2}" + "PersistentId": "{B237687E-F57E-4C04-9B46-103548751B5D}" } } } }, { "Key": { - "id": 56999611934136 + "id": 56986727032248 }, "Value": { "ComponentData": { @@ -1451,13 +1520,13 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "StringNodeTitlePalette" + "PaletteOverride": "DefaultNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 960.0, - -40.0 + 80.0, + -60.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1465,14 +1534,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{A4FDCB87-B021-48B9-ABCB-AECA986B33D6}" + "PersistentId": "{41B7477C-D5B9-49AC-AFA3-AAAE2A6ED7C5}" } } } }, { "Key": { - "id": 57003906901432 + "id": 56991021999544 }, "Value": { "ComponentData": { @@ -1481,29 +1550,28 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "StringNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 800.0, - 460.0 + -240.0, + -300.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{82D0ED1B-98D3-4AEF-B1DA-2F27CACD3A4D}" + "PersistentId": "{0CF0846C-1D21-4B33-8723-1538FD4FD04A}" } } } }, { "Key": { - "id": 57008201868728 + "id": 56995316966840 }, "Value": { "ComponentData": { @@ -1512,29 +1580,28 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "StringNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 380.0, - -40.0 + 800.0, + 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{FD25E23C-E976-4F9A-8C16-80B125D80485}" + "PersistentId": "{0D04EBA6-E1E7-4DF7-BAA9-CC87F4689CD2}" } } } }, { "Key": { - "id": 57012496836024 + "id": 56999611934136 }, "Value": { "ComponentData": { @@ -1543,12 +1610,12 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "DefaultNodeTitlePalette" + "PaletteOverride": "StringNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - -220.0, + 960.0, -40.0 ] }, @@ -1557,14 +1624,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{D3F081D7-40C1-4C31-B298-B18C6AFDFD25}" + "PersistentId": "{A4FDCB87-B021-48B9-ABCB-AECA986B33D6}" } } } }, { "Key": { - "id": 57016791803320 + "id": 57003906901432 }, "Value": { "ComponentData": { @@ -1573,29 +1640,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "HandlerNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 220.0, - 260.0 + 800.0, + 460.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { "$type": "StylingComponentSaveData", - "SubStyle": ".azeventhandler" + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{58CEEB80-152A-4B8E-8698-8B8EE5F31A41}" + "PersistentId": "{82D0ED1B-98D3-4AEF-B1DA-2F27CACD3A4D}" } } } }, { "Key": { - "id": 57021086770616 + "id": 57012496836024 }, "Value": { "ComponentData": { @@ -1604,22 +1671,21 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "DefaultNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ -220.0, - 260.0 + -40.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{30443D97-4B57-482D-BA92-005DB39A9FA7}" + "PersistentId": "{D3F081D7-40C1-4C31-B298-B18C6AFDFD25}" } } } @@ -1653,6 +1719,22 @@ } } } + }, + { + "Key": { + "id": 5286394689911028851 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "AnchorX": -579.0, + "AnchorY": -194.0 + } + } + } + } } ], "StatisticsHelper": { @@ -1670,23 +1752,23 @@ "Value": 1 }, { - "Key": 10684225535275896474, - "Value": 3 + "Key": 7087687843968394353, + "Value": 1 }, { - "Key": 11941188735314642437, + "Key": 8679770052035517025, "Value": 1 }, { - "Key": 11983076003173356132, - "Value": 1 + "Key": 10684225535275896474, + "Value": 3 }, { - "Key": 13774516226790665785, + "Key": 11983076003173356132, "Value": 1 }, { - "Key": 17705307213431043531, + "Key": 13774516226790665785, "Value": 1 } ] From 92d3df17fadb7ea5c872068f9d6df26a28664d9b Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Sat, 18 Dec 2021 10:16:02 -0800 Subject: [PATCH 153/399] Fix incomplete comment Signed-off-by: Gene Walters --- .../Code/Source/Editor/MultiplayerEditorConnection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp index f7882d7bf9..f112098eae 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp @@ -43,7 +43,7 @@ namespace Multiplayer { // Server logs will be piped to the editor so turn off buffering, // otherwise it'll take a lot of logs to fill up the buffer before stdout is finally flushed. - // This isn't optimal, but will only affect + // This isn't optimal, but will only affect editor-servers (used when testing multiplayer levels in Editor gameplay mode) and not production servers. // Note: _IOLBF (flush on newlines) won't work for Automated Testing which uses a headless server app and will fall back to _IOFBF (full buffering) setvbuf(stdout, NULL, _IONBF, 0); From 874bbbfca35e1f20a55a028453fa5ca5991f2f6d Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Sat, 18 Dec 2021 10:26:37 -0800 Subject: [PATCH 154/399] Better magic number naming based on review feedback Signed-off-by: Gene Walters --- .../Multiplayer/tests/Multiplayer_AutoComponent_RPC.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py index 3b7ae89368..8c13806a30 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py @@ -62,9 +62,9 @@ def Multiplayer_AutoComponent_RPC(): Report.critical_result(TestSuccessFailTuples.find_network_player, player_id.IsValid()) # 4) Check the editor logs for expected and unexpected log output - EXPECTEDLINE_WAIT_TIME_SECONDS = 1.0 - helper.wait_for_critical_expected_line('EditorServer', 'Script: AutoComponent_RPC: Sending client PlayerNumber 1', section_tracer.prints, EXPECTEDLINE_WAIT_TIME_SECONDS) - helper.wait_for_critical_expected_line('Script', "AutoComponent_RPC: I'm Player #1", section_tracer.prints, EXPECTEDLINE_WAIT_TIME_SECONDS) + PLAYERID_RPC_WAIT_TIME_SECONDS = 1.0 # The player id is sent from the server as soon as the player script is spawned. 1 second should be more than enough time to send/receive that RPC. + helper.wait_for_critical_expected_line('EditorServer', 'Script: AutoComponent_RPC: Sending client PlayerNumber 1', section_tracer.prints, PLAYERID_RPC_WAIT_TIME_SECONDS) + helper.wait_for_critical_expected_line('Script', "AutoComponent_RPC: I'm Player #1", section_tracer.prints, PLAYERID_RPC_WAIT_TIME_SECONDS) # Exit game mode From e58d8815f105f0e28645801d79935685f3bdde2d Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Sat, 18 Dec 2021 17:38:50 -0800 Subject: [PATCH 155/399] chore: add assertions to plane to ensure normalization Signed-off-by: Michael Pollind --- Code/Framework/AzCore/AzCore/Math/Plane.inl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Code/Framework/AzCore/AzCore/Math/Plane.inl b/Code/Framework/AzCore/AzCore/Math/Plane.inl index f33d356312..bade6f1775 100644 --- a/Code/Framework/AzCore/AzCore/Math/Plane.inl +++ b/Code/Framework/AzCore/AzCore/Math/Plane.inl @@ -19,12 +19,14 @@ namespace AZ AZ_MATH_INLINE Plane Plane::CreateFromNormalAndPoint(const Vector3& normal, const Vector3& point) { + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not a normalized"); return Plane(Simd::Vec4::ConstructPlane(normal.GetSimdValue(), point.GetSimdValue())); } AZ_MATH_INLINE Plane Plane::CreateFromNormalAndDistance(const Vector3& normal, float dist) { + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not a normalized"); Plane result; result.Set(normal, dist); return result; @@ -33,6 +35,7 @@ namespace AZ AZ_MATH_INLINE Plane Plane::CreateFromCoefficients(const float a, const float b, const float c, const float d) { + AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is not normalized"); Plane result; result.Set(a, b, c, d); return result; @@ -65,18 +68,21 @@ namespace AZ AZ_MATH_INLINE void Plane::Set(const Vector3& normal, float d) { + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); m_plane.Set(normal, d); } AZ_MATH_INLINE void Plane::Set(float a, float b, float c, float d) { + AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is not normalized"); m_plane.Set(a, b, c, d); } AZ_MATH_INLINE void Plane::SetNormal(const Vector3& normal) { + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); m_plane.SetX(normal.GetX()); m_plane.SetY(normal.GetY()); m_plane.SetZ(normal.GetZ()); From 15c6f6a4a824711a2bdfb06a76f0093e837dc3e4 Mon Sep 17 00:00:00 2001 From: "T.J. McGrath-Daly" Date: Thu, 16 Dec 2021 10:35:25 +0800 Subject: [PATCH 156/399] =?UTF-8?q?When=20the=20tag=20of=20Region=20Force?= =?UTF-8?q?=20component=20changed=EF=BC=8Cthe=20AABB=20of=20the=20componen?= =?UTF-8?q?t=20should=20be=20appended=20to=20=20m=5FpendingAabbUpdates=20o?= =?UTF-8?q?f=20local=20wind=20handler=20in=20wind=20bus=20after=20the=20wi?= =?UTF-8?q?nd=20provider=20delete=20the=20Force=20Region=20entity.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: T.J. McGrath-Daly --- Gems/PhysX/Code/Source/WindProvider.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Gems/PhysX/Code/Source/WindProvider.cpp b/Gems/PhysX/Code/Source/WindProvider.cpp index 3090cea062..3490e79412 100644 --- a/Gems/PhysX/Code/Source/WindProvider.cpp +++ b/Gems/PhysX/Code/Source/WindProvider.cpp @@ -159,6 +159,12 @@ namespace PhysX AZStd::swap(m_entityTransformHandlers[index], m_entityTransformHandlers.back()); m_entityTransformHandlers.pop_back(); + // When deleting entity from handler's m_entities, the AABB should be appended to m_pendingAabbUpdates + // for local wind handler to broadcast OnWindChanged to notify relative entities of wind changes in OnTick(). + m_pendingAabbUpdates.push_back(); + ColliderShapeRequestBus::EventResult(m_pendingAabbUpdates.back(), + entityId, &ColliderShapeRequestBus::Events::GetColliderShapeAabb); + m_changed = true; } } From fea4d0e6b160e04072826cd3b808179f45d4180a Mon Sep 17 00:00:00 2001 From: amzn-sean <75276488+amzn-sean@users.noreply.github.com> Date: Mon, 20 Dec 2021 14:32:25 +0000 Subject: [PATCH 157/399] adding TimeSystem unit tests (#6446) Signed-off-by: amzn-sean <75276488+amzn-sean@users.noreply.github.com> --- .../AzCore/AzCore/Time/TimeSystem.cpp | 10 +- .../Framework/AzCore/Tests/Time/TimeTests.cpp | 193 +++++++++++++++++- 2 files changed, 195 insertions(+), 8 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Time/TimeSystem.cpp b/Code/Framework/AzCore/AzCore/Time/TimeSystem.cpp index f8e254d32d..7ba306fbe6 100644 --- a/Code/Framework/AzCore/AzCore/Time/TimeSystem.cpp +++ b/Code/Framework/AzCore/AzCore/Time/TimeSystem.cpp @@ -23,11 +23,11 @@ namespace AZ } } - void cvar_t_simulationTickDeltaOverride_Changed(const float& value) + void cvar_t_simulationTickDeltaOverride_Changed(const int64_t& value) { if (auto* timeSystem = AZ::Interface::Get()) { - timeSystem->SetSimulationTickDeltaOverride(AZ::SecondsToTimeMs(value)); + timeSystem->SetSimulationTickDeltaOverride(static_cast(value)); } } @@ -44,8 +44,8 @@ namespace AZ AZ_CVAR(float, t_simulationTickScale, 1.0f, cvar_t_simulationTickScale_Changed, AZ::ConsoleFunctorFlags::Null, "A scalar amount to adjust time passage by, 1.0 == realtime, 0.5 == half realtime, 2.0 == doubletime"); - AZ_CVAR(float, t_simulationTickDeltaOverride, 0.0f, cvar_t_simulationTickDeltaOverride_Changed, AZ::ConsoleFunctorFlags::Null, - "If > 0, overrides the simulation tick delta time with the provided value (Seconds) and ignores any t_simulationTickScale value."); + AZ_CVAR(int64_t, t_simulationTickDeltaOverride, 0, cvar_t_simulationTickDeltaOverride_Changed, AZ::ConsoleFunctorFlags::Null, + "If > 0, overrides the simulation tick delta time with the provided value (Milliseconds) and ignores any t_simulationTickScale value."); AZ_CVAR(int, t_simulationTickRate, 0, cvar_t_simulationTickRate_Changed, AZ::ConsoleFunctorFlags::Null, "The minimum rate to force the game simulation tick to run. 0 for as fast as possible. 30 = ~33ms, 60 = ~16ms"); @@ -176,7 +176,7 @@ namespace AZ if (timeUs != m_simulationTickDeltaOverride) { m_simulationTickDeltaOverride = timeUs; - t_simulationTickDeltaOverride = AZ::TimeUsToSeconds(timeUs); //update the cvar + t_simulationTickDeltaOverride = static_cast (timeMs); // update the cvar } } diff --git a/Code/Framework/AzCore/Tests/Time/TimeTests.cpp b/Code/Framework/AzCore/Tests/Time/TimeTests.cpp index 7ba01ec0e0..446368a8ca 100644 --- a/Code/Framework/AzCore/Tests/Time/TimeTests.cpp +++ b/Code/Framework/AzCore/Tests/Time/TimeTests.cpp @@ -11,8 +11,7 @@ namespace UnitTest { - class TimeTests - : public AllocatorsFixture + class TimeTests : public AllocatorsFixture { public: void SetUp() override @@ -77,4 +76,192 @@ namespace UnitTest int64_t delta = static_cast(timeMs) - static_cast(timeUsToMs); EXPECT_LT(abs(delta), 1); } -} + + class TimeSystemTests : public AllocatorsTestFixture + { + public: + void SetUp() override + { + SetupAllocator(); + m_controlTime = static_cast(AZStd::GetTimeNowMicroSecond()); + m_timeSystem = AZStd::make_unique(); + } + + void TearDown() override + { + m_controlTime = AZ::Time::ZeroTimeUs; + m_timeSystem.reset(); + TeardownAllocator(); + } + + AZ::TimeUs GetDiff(AZ::TimeUs time1, AZ::TimeUs time2) const + { + // AZ::TimeUs is unsigned so make sure to not underflow. + return time1 > time2 ? time1 - time2 : time2 - time1; + } + + AZ::TimeUs m_controlTime; + AZStd::unique_ptr m_timeSystem; + }; + + TEST_F(TimeSystemTests, GetRealElapsedTimeUs) + { + // sleep for a bit to advance time. + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); + + // find the delta for the control and from GetRealElapsedTimeUs + const AZ::TimeUs baseline = static_cast(AZStd::GetTimeNowMicroSecond()) - m_controlTime; + const AZ::TimeUs elapsedTime = m_timeSystem->GetRealElapsedTimeUs(); + + const AZ::TimeUs diff = GetDiff(baseline, elapsedTime); + + // elapsedTime should be within 10 microseconds from baseline. + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + } + + TEST_F(TimeSystemTests, GetElapsedTimeUs) + { + // sleep for a bit to advance time. + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); + + // find the delta for the control and from GetElapsedTimeUs + const AZ::TimeUs baseline = static_cast(AZStd::GetTimeNowMicroSecond()) - m_controlTime; + const AZ::TimeUs elapsedTime = m_timeSystem->GetElapsedTimeUs(); + + const AZ::TimeUs diff = GetDiff(baseline, elapsedTime); + + // elapsedTime should be within 10 microseconds from baseline. + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + } + + TEST_F(TimeSystemTests, ElapsedTimeScales) + { + // slow down 'time' + m_timeSystem->SetSimulationTickScale(0.5f); + + // sleep for a bit to advance time. + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); + + // find the delta for the control and from GetElapsedTimeUs + const AZ::TimeUs baseline = static_cast(AZStd::GetTimeNowMicroSecond()) - m_controlTime; + const AZ::TimeUs elapsedTime = m_timeSystem->GetElapsedTimeUs(); + const AZ::TimeUs halfBaseline = (baseline / AZ::TimeUs{ 2 }); + + // elapsedTime should be about half of the control. + const AZ::TimeUs diff = GetDiff(halfBaseline, elapsedTime); + + // elapsedTime should be within 10 microseconds from baseline. + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + + // reset time scale + m_timeSystem->SetSimulationTickScale(1.0f); + } + + TEST_F(TimeSystemTests, AdvanceTickDeltaTimes) + { + // advance the tick delta to get a clean base. + m_timeSystem->AdvanceTickDeltaTimes(); + const AZ::TimeUs baselineStart = static_cast(AZStd::GetTimeNowMicroSecond()); + + // sleep for a bit to advance time. + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); + + // advance the tick delta. + const AZ::TimeUs delta = m_timeSystem->AdvanceTickDeltaTimes(); + const AZ::TimeUs baselineDelta = static_cast(AZStd::GetTimeNowMicroSecond()) - baselineStart; + + // the delta should be close to the baselineDelta. + const AZ::TimeUs diff = GetDiff(delta, baselineDelta); + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + } + + TEST_F(TimeSystemTests, SimulationAndRealTickDeltaTimesWithNoTimeScale) + { + // advance the tick delta to get a clean base. + m_timeSystem->AdvanceTickDeltaTimes(); + const AZ::TimeUs baselineStart = static_cast(AZStd::GetTimeNowMicroSecond()); + + // sleep for a bit to advance time. + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); + + // advance the tick delta. + const AZ::TimeUs delta = m_timeSystem->AdvanceTickDeltaTimes(); + const AZ::TimeUs baselineDelta = static_cast(AZStd::GetTimeNowMicroSecond()) - baselineStart; + + // the delta should be close to the baselineDelta. + AZ::TimeUs diff = GetDiff(delta, baselineDelta); + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + + // the delta should be the same as GetSimulationTickDeltaTimeUs and near GetRealTickDeltaTimeUs + const AZ::TimeUs simDeltaTime = m_timeSystem->GetSimulationTickDeltaTimeUs(); + EXPECT_EQ(delta, simDeltaTime); + + const AZ::TimeUs realDeltaTime = m_timeSystem->GetRealTickDeltaTimeUs(); + diff = GetDiff(delta, realDeltaTime); + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + } + + TEST_F(TimeSystemTests, SimulationAndRealTickDeltaTimesWithTimeScale) + { + // advance the tick delta to get a clean base. + m_timeSystem->AdvanceTickDeltaTimes(); + const AZ::TimeUs baselineStart = static_cast(AZStd::GetTimeNowMicroSecond()); + + // slow down 'time'; + m_timeSystem->SetSimulationTickScale(0.5f); + + // sleep for a bit to advance time. + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); + + // advance the tick delta. + const AZ::TimeUs delta = m_timeSystem->AdvanceTickDeltaTimes(); + const AZ::TimeUs baselineDelta = static_cast(AZStd::GetTimeNowMicroSecond()) - baselineStart; + const AZ::TimeUs halfBaselineDelta = (baselineDelta / AZ::TimeUs{ 2 }); + + // the delta should be half the baselineDelta + AZ::TimeUs diff = GetDiff(delta, halfBaselineDelta); + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + + // the delta should be the same as GetSimulationTickDeltaTimeUs + const AZ::TimeUs simDeltaTime = m_timeSystem->GetSimulationTickDeltaTimeUs(); + EXPECT_EQ(delta, simDeltaTime); + + // the delta should be near half the GetRealTickDeltaTimeUs + const AZ::TimeUs realDeltaTime = m_timeSystem->GetRealTickDeltaTimeUs(); + const AZ::TimeUs halfRealDeltaTime = (realDeltaTime / AZ::TimeUs{ 2 }); + diff = GetDiff(delta, halfRealDeltaTime); + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + + // reset time scale + m_timeSystem->SetSimulationTickScale(1.0f); + } + + TEST_F(TimeSystemTests, SimulationTickDeltaOverride) + { + // advance the tick delta to get a clean base. + m_timeSystem->AdvanceTickDeltaTimes(); + const AZ::TimeUs baselineStart = static_cast(AZStd::GetTimeNowMicroSecond()); + + // set the tick delta override + const AZ::TimeMs tickOverride = AZ::TimeMs{ 3462 }; + m_timeSystem->SetSimulationTickDeltaOverride(tickOverride); + + // sleep for a bit to advance time. + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); + + // advance the tick delta. + const AZ::TimeUs delta = m_timeSystem->AdvanceTickDeltaTimes(); + const AZ::TimeUs baselineDelta = static_cast(AZStd::GetTimeNowMicroSecond()) - baselineStart; + + // the delta should be equal to the tickOverride + EXPECT_EQ(delta, AZ::TimeMsToUs(tickOverride)); + + // real tick delta should be near the baselineDelta + const AZ::TimeUs realDeltaTime = m_timeSystem->GetRealTickDeltaTimeUs(); + const AZ::TimeUs diff = GetDiff(realDeltaTime, baselineDelta); + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + + // reset the tick delta override + m_timeSystem->SetSimulationTickDeltaOverride(AZ::Time::ZeroTimeMs); + } +} // namespace UnitTest From d5b9cf10cf0019ebd97f5b7f150dc7a6745e3c89 Mon Sep 17 00:00:00 2001 From: bosnichd Date: Mon, 20 Dec 2021 08:15:10 -0700 Subject: [PATCH 158/399] Collection of miscellaneous PAL changes required for restricted platforms. (#6482) Signed-off-by: bosnichd --- .../CrySystem/RemoteConsole/RemoteConsole.h | 2 +- .../RemoteConsole/RemoteConsole_none.inl | 10 +++--- .../Code/Source/Editor/EditorCommon.cpp | 4 +++ .../Source/Editor/ShaderBuilderUtility.cpp | 8 +++++ Gems/Atom/Feature/Common/Code/CMakeLists.txt | 10 ++++-- .../DiffuseProbeGridBlendDistancePass.cpp | 11 ++++++- .../DiffuseProbeGridBlendIrradiancePass.cpp | 11 ++++++- .../DiffuseProbeGridBorderUpdatePass.cpp | 31 ++++++++++++------- .../DiffuseProbeGridClassificationPass.cpp | 11 ++++++- .../DiffuseProbeGridRayTracingPass.cpp | 5 +-- .../DiffuseProbeGridRelocationPass.cpp | 11 ++++++- .../DiffuseProbeGridRenderPass.cpp | 8 +++++ .../Common/Code/Source/ImGui/ImGuiPass.cpp | 4 +++ .../Android/Atom_Feature_Traits_Android.h | 1 + .../Linux/Atom_Feature_Traits_Linux.h | 1 + .../Platform/Mac/Atom_Feature_Traits_Mac.h | 1 + .../Windows/Atom_Feature_Traits_Windows.h | 1 + .../Platform/iOS/Atom_Feature_Traits_iOS.h | 1 + .../Include/Atom/RHI/MemorySubAllocator.h | 5 ++- .../Source/Platform/Windows/PAL_windows.cmake | 7 +++++ ...ShaderPlatformInterfaceSystemComponent.cpp | 18 +++++------ Gems/Atom/RHI/gem.json | 1 + .../AtomBridge/Code/CMakeLists.txt | 10 +++++- Gems/ImGui/Code/Source/ImGuiManager.cpp | 4 ++- Registry/bootstrap.setreg | 1 + 25 files changed, 140 insertions(+), 37 deletions(-) diff --git a/Code/Legacy/CrySystem/RemoteConsole/RemoteConsole.h b/Code/Legacy/CrySystem/RemoteConsole/RemoteConsole.h index 23edafa736..f075dd2c17 100644 --- a/Code/Legacy/CrySystem/RemoteConsole/RemoteConsole.h +++ b/Code/Legacy/CrySystem/RemoteConsole/RemoteConsole.h @@ -15,7 +15,7 @@ #include #include -#if !defined(RELEASE) || defined(RELEASE_LOGGING) || defined(ENABLE_PROFILING_CODE) +#if (!defined(RELEASE) || defined(RELEASE_LOGGING) || defined(ENABLE_PROFILING_CODE)) && !defined(AZ_LEGACY_CRYSYSTEM_TRAIT_REMOTE_CONSOLE_UNSUPPORTED) #define USE_REMOTE_CONSOLE struct SRemoteServer; diff --git a/Code/Legacy/CrySystem/RemoteConsole/RemoteConsole_none.inl b/Code/Legacy/CrySystem/RemoteConsole/RemoteConsole_none.inl index faf928a377..ae96fc112a 100644 --- a/Code/Legacy/CrySystem/RemoteConsole/RemoteConsole_none.inl +++ b/Code/Legacy/CrySystem/RemoteConsole/RemoteConsole_none.inl @@ -41,17 +41,17 @@ void CRemoteConsole::Stop() } ///////////////////////////////////////////////////////////////////////////////////////////// -void CRemoteConsole::AddLogMessage(const char* log) +void CRemoteConsole::AddLogMessage(const char*) { } ///////////////////////////////////////////////////////////////////////////////////////////// -void CRemoteConsole::AddLogWarning(const char* log) +void CRemoteConsole::AddLogWarning(const char*) { } ///////////////////////////////////////////////////////////////////////////////////////////// -void CRemoteConsole::AddLogError(const char* log) +void CRemoteConsole::AddLogError(const char*) { } @@ -61,11 +61,11 @@ void CRemoteConsole::Update() } ///////////////////////////////////////////////////////////////////////////////////////////// -void CRemoteConsole::RegisterListener(IRemoteConsoleListener* pListener, const char* name) +void CRemoteConsole::RegisterListener(IRemoteConsoleListener*, const char*) { } ///////////////////////////////////////////////////////////////////////////////////////////// -void CRemoteConsole::UnregisterListener(IRemoteConsoleListener* pListener) +void CRemoteConsole::UnregisterListener(IRemoteConsoleListener*) { } diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Editor/EditorCommon.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Editor/EditorCommon.cpp index 3e255dcccc..f9fe1b791f 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Editor/EditorCommon.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Editor/EditorCommon.cpp @@ -123,6 +123,10 @@ namespace ImageProcessingAtomEditor { readableString = "iOS"; } + else if (platformStrLowerCase == "salem") + { + readableString = "Salem"; + } else if (platformStrLowerCase == "jasper") { readableString = "Jasper"; diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp index e6c99630b2..911981142b 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp @@ -492,6 +492,14 @@ namespace AZ { platformId = AzFramework::PlatformId::IOS; } + else if (platformIdentifier == "salem") + { + platformId = AzFramework::PlatformId::SALEM; + } + else if (platformIdentifier == "jasper") + { + platformId = AzFramework::PlatformId::JASPER; + } else if (platformIdentifier == "server") { platformId = AzFramework::PlatformId::SERVER; diff --git a/Gems/Atom/Feature/Common/Code/CMakeLists.txt b/Gems/Atom/Feature/Common/Code/CMakeLists.txt index b558be3714..3ebb9df104 100644 --- a/Gems/Atom/Feature/Common/Code/CMakeLists.txt +++ b/Gems/Atom/Feature/Common/Code/CMakeLists.txt @@ -96,6 +96,12 @@ ly_add_target( if(PAL_TRAIT_BUILD_HOST_TOOLS) + set(runtime_dependencies_tools ${pal_source_dir}/runtime_dependencies_tools.cmake) + foreach(pal_tools_platform ${LY_PAL_TOOLS_ENABLED}) + ly_get_list_relative_pal_filename(pal_runtime_dependencies_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${pal_tools_platform}) + list(APPEND runtime_dependencies_tools ${pal_runtime_dependencies_source_dir}/runtime_dependencies_tools.cmake) + endforeach() + ly_add_target( NAME Atom_Feature_Common.Editor GEM_MODULE @@ -103,7 +109,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) FILES_CMAKE atom_feature_common_editor_files.cmake PLATFORM_INCLUDE_FILES - ${pal_source_dir}/runtime_dependencies_tools.cmake + ${runtime_dependencies_tools} INCLUDE_DIRECTORIES PRIVATE . @@ -136,7 +142,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) FILES_CMAKE atom_feature_common_builders_files.cmake PLATFORM_INCLUDE_FILES - ${pal_source_dir}/runtime_dependencies_tools.cmake + ${runtime_dependencies_tools} INCLUDE_DIRECTORIES PRIVATE Source/Builders diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp index 0cdc4d14b1..702e784c86 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -30,7 +31,15 @@ namespace AZ DiffuseProbeGridBlendDistancePass::DiffuseProbeGridBlendDistancePass(const RPI::PassDescriptor& descriptor) : RPI::RenderPass(descriptor) { - LoadShader(); + if (!AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) + { + // GI is not supported on this platform + SetEnabled(false); + } + else + { + LoadShader(); + } } void DiffuseProbeGridBlendDistancePass::LoadShader() diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp index e0a4f1ae42..7609e27b66 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -30,7 +31,15 @@ namespace AZ DiffuseProbeGridBlendIrradiancePass::DiffuseProbeGridBlendIrradiancePass(const RPI::PassDescriptor& descriptor) : RPI::RenderPass(descriptor) { - LoadShader(); + if (!AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) + { + // GI is not supported on this platform + SetEnabled(false); + } + else + { + LoadShader(); + } } void DiffuseProbeGridBlendIrradiancePass::LoadShader() diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp index 6c72f904b9..c4fcb49c17 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -30,17 +31,25 @@ namespace AZ DiffuseProbeGridBorderUpdatePass::DiffuseProbeGridBorderUpdatePass(const RPI::PassDescriptor& descriptor) : RPI::RenderPass(descriptor) { - LoadShader("Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdateRow.azshader", - m_rowShader, - m_rowPipelineState, - m_rowSrgLayout, - m_rowDispatchArgs); - - LoadShader("Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdateColumn.azshader", - m_columnShader, - m_columnPipelineState, - m_columnSrgLayout, - m_columnDispatchArgs); + if (!AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) + { + // GI is not supported on this platform + SetEnabled(false); + } + else + { + LoadShader("Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdateRow.azshader", + m_rowShader, + m_rowPipelineState, + m_rowSrgLayout, + m_rowDispatchArgs); + + LoadShader("Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdateColumn.azshader", + m_columnShader, + m_columnPipelineState, + m_columnSrgLayout, + m_columnDispatchArgs); + } } void DiffuseProbeGridBorderUpdatePass::LoadShader(AZStd::string shaderFilePath, diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp index a6e5fd03ff..7394b1ccfb 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,15 @@ namespace AZ DiffuseProbeGridClassificationPass::DiffuseProbeGridClassificationPass(const RPI::PassDescriptor& descriptor) : RPI::RenderPass(descriptor) { - LoadShader(); + if (!AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) + { + // GI is not supported on this platform + SetEnabled(false); + } + else + { + LoadShader(); + } } void DiffuseProbeGridClassificationPass::LoadShader() diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp index abee3693f8..df551e7f42 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -38,9 +39,9 @@ namespace AZ : RPI::RenderPass(descriptor) { RHI::Ptr device = RHI::RHISystemInterface::Get()->GetDevice(); - if (device->GetFeatures().m_rayTracing == false) + if (device->GetFeatures().m_rayTracing == false || !AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) { - // raytracing is not supported on this platform + // raytracing or GI is not supported on this platform SetEnabled(false); } } diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp index e35686d343..fd23dadf6f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,15 @@ namespace AZ DiffuseProbeGridRelocationPass::DiffuseProbeGridRelocationPass(const RPI::PassDescriptor& descriptor) : RPI::RenderPass(descriptor) { - LoadShader(); + if (!AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) + { + // GI is not supported on this platform + SetEnabled(false); + } + else + { + LoadShader(); + } } void DiffuseProbeGridRelocationPass::LoadShader() diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp index fb674673fa..f444c0c6ba 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -27,6 +28,13 @@ namespace AZ DiffuseProbeGridRenderPass::DiffuseProbeGridRenderPass(const RPI::PassDescriptor& descriptor) : Base(descriptor) { + if (!AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) + { + // GI is not supported on this platform + SetEnabled(false); + return; + } + // create the shader resource group // Note: the shader may not be available on all platforms AZStd::string shaderFilePath = "Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRender.azshader"; diff --git a/Gems/Atom/Feature/Common/Code/Source/ImGui/ImGuiPass.cpp b/Gems/Atom/Feature/Common/Code/Source/ImGui/ImGuiPass.cpp index 5dcb0dc2bb..8ba92a3317 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ImGui/ImGuiPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/ImGui/ImGuiPass.cpp @@ -27,6 +27,7 @@ #include #include +#include #include namespace AZ @@ -460,6 +461,9 @@ namespace AZ { auto imguiContextScope = ImguiContextScope(m_imguiContext); auto& io = ImGui::GetIO(); + #if defined(AZ_TRAIT_IMGUI_INI_FILENAME) + io.IniFilename = AZ_TRAIT_IMGUI_INI_FILENAME; + #endif // ImGui IO Setup { diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Android/Atom_Feature_Traits_Android.h b/Gems/Atom/Feature/Common/Code/Source/Platform/Android/Atom_Feature_Traits_Android.h index 81f41bd8c9..f2501f3366 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Android/Atom_Feature_Traits_Android.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Android/Atom_Feature_Traits_Android.h @@ -9,3 +9,4 @@ #define AZ_TRAIT_LUXCORE_SUPPORTED 0 #define AZ_TRAIT_LUXCORE_EXEPATH UNUSED_TRAIT +#define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Linux/Atom_Feature_Traits_Linux.h b/Gems/Atom/Feature/Common/Code/Source/Platform/Linux/Atom_Feature_Traits_Linux.h index 81f41bd8c9..f2501f3366 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Linux/Atom_Feature_Traits_Linux.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Linux/Atom_Feature_Traits_Linux.h @@ -9,3 +9,4 @@ #define AZ_TRAIT_LUXCORE_SUPPORTED 0 #define AZ_TRAIT_LUXCORE_EXEPATH UNUSED_TRAIT +#define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Mac/Atom_Feature_Traits_Mac.h b/Gems/Atom/Feature/Common/Code/Source/Platform/Mac/Atom_Feature_Traits_Mac.h index 81f41bd8c9..f2501f3366 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Mac/Atom_Feature_Traits_Mac.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Mac/Atom_Feature_Traits_Mac.h @@ -9,3 +9,4 @@ #define AZ_TRAIT_LUXCORE_SUPPORTED 0 #define AZ_TRAIT_LUXCORE_EXEPATH UNUSED_TRAIT +#define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/Atom_Feature_Traits_Windows.h b/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/Atom_Feature_Traits_Windows.h index c35b6f0960..71c521a7f2 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/Atom_Feature_Traits_Windows.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/Atom_Feature_Traits_Windows.h @@ -9,3 +9,4 @@ #define AZ_TRAIT_LUXCORE_SUPPORTED 0 #define AZ_TRAIT_LUXCORE_EXEPATH "Gems/Atom/Feature/Common/External/LuxCore2.2/win64/dll/luxcoreui.exe" +#define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/iOS/Atom_Feature_Traits_iOS.h b/Gems/Atom/Feature/Common/Code/Source/Platform/iOS/Atom_Feature_Traits_iOS.h index 81f41bd8c9..f2501f3366 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/iOS/Atom_Feature_Traits_iOS.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/iOS/Atom_Feature_Traits_iOS.h @@ -9,3 +9,4 @@ #define AZ_TRAIT_LUXCORE_SUPPORTED 0 #define AZ_TRAIT_LUXCORE_EXEPATH UNUSED_TRAIT +#define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h index 514907b19e..580ca97b46 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h @@ -91,7 +91,10 @@ namespace AZ m_pageAllocator = &pageAllocator; m_descriptor = descriptor; m_descriptor.m_addressBase = 0; - m_descriptor.m_capacityInBytes = m_pageAllocator->GetPageSize(); + if (m_descriptor.m_capacityInBytes == 0) + { + m_descriptor.m_capacityInBytes = m_pageAllocator->GetPageSize(); + } } template diff --git a/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/PAL_windows.cmake b/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/PAL_windows.cmake index eb733a4d5a..1ee87e3099 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/PAL_windows.cmake +++ b/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/PAL_windows.cmake @@ -33,6 +33,13 @@ if(aftermath_header) set(PAL_TRAIT_AFTERMATH_AVAILABLE TRUE) endif() +ly_add_source_properties( + SOURCES + Source/RHI.Builders/ShaderPlatformInterfaceSystemComponent.cpp + PROPERTY COMPILE_DEFINITIONS + VALUES ${LY_PAL_TOOLS_DEFINES} +) + # Disable windows OS version check until infra can upgrade all our jenkins nodes # if(NOT CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL "10.0.17763") # message(FATAL_ERROR "Windows DX12 RHI implementation requires an OS version and SDK matching windows 10 build 1809 or greater") diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI.Builders/ShaderPlatformInterfaceSystemComponent.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI.Builders/ShaderPlatformInterfaceSystemComponent.cpp index 18834bdf46..3912fbed80 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI.Builders/ShaderPlatformInterfaceSystemComponent.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI.Builders/ShaderPlatformInterfaceSystemComponent.cpp @@ -15,15 +15,15 @@ #include #if defined(AZ_TOOLS_EXPAND_FOR_RESTRICTED_PLATFORMS) - #if defined(TOOLS_SUPPORT_JASPER) - #include - #endif - #if defined(TOOLS_SUPPORT_PROVO) - #include - #endif - #if defined(TOOLS_SUPPORT_SALEM) - #include - #endif +# if defined(TOOLS_SUPPORT_JASPER) +# include AZ_RESTRICTED_FILE_EXPLICIT(RHI.Builders/ShaderPlatformInterface, Jasper) +# endif +# if defined(TOOLS_SUPPORT_PROVO) +# include AZ_RESTRICTED_FILE_EXPLICIT(RHI.Builders/ShaderPlatformInterface, Provo) +# endif +# if defined(TOOLS_SUPPORT_SALEM) +# include AZ_RESTRICTED_FILE_EXPLICIT(RHI.Builders/ShaderPlatformInterface, Salem) +# endif #endif #include diff --git a/Gems/Atom/RHI/gem.json b/Gems/Atom/RHI/gem.json index 7b64476c65..de46c312ad 100644 --- a/Gems/Atom/RHI/gem.json +++ b/Gems/Atom/RHI/gem.json @@ -15,6 +15,7 @@ "Atom_RHI_DX12", "Atom_RHI_Metal", "Atom_RHI_Vulkan", + "Atom_RHI_Salem", "Atom_RHI_Null", "Atom_Feature_Common" ] diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt b/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt index e53a0c6281..67f28767e0 100644 --- a/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt +++ b/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt @@ -68,6 +68,14 @@ ly_create_alias(NAME Atom_AtomBridge.Clients NAMESPACE Gem TARGETS Gem::Atom_Ato ly_create_alias(NAME Atom_AtomBridge.Servers NAMESPACE Gem TARGETS Gem::Atom_AtomBridge) if(PAL_TRAIT_BUILD_HOST_TOOLS) + + set(additional_tool_deps ${pal_dir}/additional_${PAL_PLATFORM_NAME_LOWERCASE}_tool_deps.cmake) + foreach(pal_tools_platform ${LY_PAL_TOOLS_ENABLED}) + string(TOLOWER ${pal_tools_platform} pal_tools_platform_lowercase) + ly_get_list_relative_pal_filename(pal_runtime_dependencies_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${pal_tools_platform}) + list(APPEND additional_tool_deps ${pal_runtime_dependencies_source_dir}/additional_${pal_tools_platform_lowercase}_tool_deps.cmake) + endforeach() + ly_add_target( NAME Atom_AtomBridge.Editor ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} NAMESPACE Gem @@ -79,7 +87,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) PUBLIC Include PLATFORM_INCLUDE_FILES - ${pal_dir}/additional_${PAL_PLATFORM_NAME_LOWERCASE}_tool_deps.cmake + ${additional_tool_deps} COMPILE_DEFINITIONS PRIVATE EDITOR diff --git a/Gems/ImGui/Code/Source/ImGuiManager.cpp b/Gems/ImGui/Code/Source/ImGuiManager.cpp index 4f49fd6509..4b841a7b1e 100644 --- a/Gems/ImGui/Code/Source/ImGuiManager.cpp +++ b/Gems/ImGui/Code/Source/ImGuiManager.cpp @@ -115,7 +115,9 @@ void ImGuiManager::Initialize() // Set config file ImGuiIO& io = ImGui::GetIO(); - io.IniFilename = "imgui.ini"; +#if defined(IMGUI_DISABLE_AUTOMATIC_INI_SAVING_LOADING) + io.IniFilename = nullptr; +#endif // Enable Nav Keyboard by default and allow io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; diff --git a/Registry/bootstrap.setreg b/Registry/bootstrap.setreg index b2bcdd7f3f..5fdb8e0941 100644 --- a/Registry/bootstrap.setreg +++ b/Registry/bootstrap.setreg @@ -12,6 +12,7 @@ "android_assets": "android", "ios_assets": "ios", "mac_assets": "mac", + "salem_assets": "salem", "allowed_list": "", "remote_ip": "127.0.0.1", "remote_port": 45643, From bb14675db718f474ecc79a5b7957efe45dc6dfb6 Mon Sep 17 00:00:00 2001 From: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> Date: Mon, 20 Dec 2021 16:53:41 +0000 Subject: [PATCH 159/399] Fix tests Debug (#6405) Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> --- .../AzToolsFramework/Tests/UI/AssetBrowserTests.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Code/Framework/AzToolsFramework/Tests/UI/AssetBrowserTests.cpp b/Code/Framework/AzToolsFramework/Tests/UI/AssetBrowserTests.cpp index ae5ea5f0ae..5173e40c63 100644 --- a/Code/Framework/AzToolsFramework/Tests/UI/AssetBrowserTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/UI/AssetBrowserTests.cpp @@ -74,10 +74,6 @@ namespace UnitTest AZStd::unique_ptr m_filterModel; AZStd::unique_ptr m_tableModel; - AZStd::unique_ptr m_modelTesterAssetBrowser; - AZStd::unique_ptr m_modelTesterFilterModel; - AZStd::unique_ptr m_modelTesterTableModel; - QVector m_folderIds = { 13, 14, 15 }; QVector m_sourceIDs = { 1, 2, 3, 4, 5 }; QVector m_productIDs = { 1, 2, 3, 4, 5 }; @@ -96,9 +92,6 @@ namespace UnitTest m_filterModel->setSourceModel(m_assetBrowserComponent->GetAssetBrowserModel()); m_tableModel->setSourceModel(m_filterModel.get()); - m_modelTesterAssetBrowser = AZStd::make_unique(m_assetBrowserComponent->GetAssetBrowserModel()); - m_modelTesterFilterModel = AZStd::make_unique(m_filterModel.get()); - m_modelTesterTableModel = AZStd::make_unique(m_tableModel.get()); m_searchWidget = AZStd::make_unique(); // Setup String filters @@ -110,10 +103,6 @@ namespace UnitTest void AssetBrowserTest::TearDownEditorFixtureImpl() { - m_modelTesterAssetBrowser.reset(); - m_modelTesterFilterModel.reset(); - m_modelTesterTableModel.reset(); - m_tableModel.reset(); m_filterModel.reset(); m_assetBrowserComponent->Deactivate(); From 7cce6dde41febbe6bdf8b3ac077e292ede9402d7 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Mon, 20 Dec 2021 20:09:00 +0000 Subject: [PATCH 160/399] Hide the invalid parameters in the EnhancedPBR in the Material Editor (#6298) * Hide the invalid parameters in the EnhancedPBR in the Material Editor Signed-off-by: T.J. McGrath-Daly * Fixed headers Signed-off-by: T.J. McGrath-Daly --- .../Materials/Types/EnhancedPBR.materialtype | 6 +++ .../Types/EnhancedPBR_Anisotropy.lua | 41 +++++++++++++++++++ .../Assets/Materials/Types/Skin.materialtype | 6 +++ .../Materials/Types/Skin_SpecularF0.lua | 30 ++++++++++++++ .../Types/StandardPBR_ClearCoatState.lua | 11 +++++ .../Types/StandardPBR_HandleOpacityMode.lua | 4 ++ 6 files changed, 98 insertions(+) create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Anisotropy.lua create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_SpecularF0.lua diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype index 5de756067a..d4b5882f21 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype @@ -1652,6 +1652,12 @@ "file": "EnhancedPBR_SubsurfaceState.lua" } }, + { + "type": "Lua", + "args": { + "file": "EnhancedPBR_Anisotropy.lua" + } + }, { "type": "Lua", "args": { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Anisotropy.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Anisotropy.lua new file mode 100644 index 0000000000..575a3a3d5e --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Anisotropy.lua @@ -0,0 +1,41 @@ +-------------------------------------------------------------------------------------- +-- +-- Copyright (c) Contributors to the Open 3D Engine Project. +-- For complete copyright and license terms please see the LICENSE at the root of this distribution. +-- +-- SPDX-License-Identifier: Apache-2.0 OR MIT +-- +-- +-- +---------------------------------------------------------------------------------------------------- + +function GetMaterialPropertyDependencies() + return { + "anisotropy.enableAnisotropy" + , "anisotropy.factor" + , "anisotropy.anisotropyAngle" + } +end + +function GetShaderOptionDependencies() + return {"o_enableAnisotropy"} +end + +function Process(context) + local enableAnisotropy = context:GetMaterialPropertyValue_bool("anisotropy.enableAnisotropy") +end + +function ProcessEditor(context) + + local enableAnisotropy = context:GetMaterialPropertyValue_bool("anisotropy.enableAnisotropy") + + local visibility + if(enableAnisotropy) then + visibility = MaterialPropertyVisibility_Enabled + else + visibility = MaterialPropertyVisibility_Hidden + end + + context:SetMaterialPropertyVisibility("anisotropy.factor", visibility) + context:SetMaterialPropertyVisibility("anisotropy.anisotropyAngle", visibility) +end diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype index e2a05aa916..a49eba7975 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype @@ -1084,6 +1084,12 @@ "file": "Skin_WrinkleMaps.lua" } }, + { + "type": "Lua", + "args": { + "file": "Skin_SpecularF0.lua" + } + }, { "type": "Lua", "args": { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_SpecularF0.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_SpecularF0.lua new file mode 100644 index 0000000000..d727e8f301 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_SpecularF0.lua @@ -0,0 +1,30 @@ +-------------------------------------------------------------------------------------- +-- +-- Copyright (c) Contributors to the Open 3D Engine Project. +-- For complete copyright and license terms please see the LICENSE at the root of this distribution. +-- +-- SPDX-License-Identifier: Apache-2.0 OR MIT +-- +-- +-- +---------------------------------------------------------------------------------------------------- + +function GetMaterialPropertyDependencies() + return { + "specularF0.enableMultiScatterCompensation" + } +end + +function GetShaderOptionDependencies() + return { + "o_specularF0_enableMultiScatterCompensation" + } +end + +function Process(context) + local enableMultiScatterCompensation = context:GetMaterialPropertyValue_bool("specularF0.enableMultiScatterCompensation") +end + +function ProcessEditor(context) + context:SetMaterialPropertyVisibility("specularF0.enableMultiScatterCompensation", MaterialPropertyVisibility_Hidden) +end \ No newline at end of file diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ClearCoatState.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ClearCoatState.lua index 3d7eca134e..50644adef4 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ClearCoatState.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ClearCoatState.lua @@ -58,6 +58,15 @@ function UpdateTextureDependentPropertyVisibility(context, textureMapPropertyNam end end +function UpdateNormalStrengthPropertyVisibility(context, textureMapPropertyName, useTexturePropertyName) + local textureMap = context:GetMaterialPropertyValue_Image(textureMapPropertyName) + local useTexture = context:GetMaterialPropertyValue_bool(useTexturePropertyName) + + if(textureMap == nil) or (not useTexture) then + context:SetMaterialPropertyVisibility("clearCoat.normalStrength", MaterialPropertyVisibility_Hidden) + end +end + function ProcessEditor(context) local enable = context:GetMaterialPropertyValue_bool("clearCoat.enable") @@ -79,10 +88,12 @@ function ProcessEditor(context) context:SetMaterialPropertyVisibility("clearCoat.normalMap", mainVisibility) context:SetMaterialPropertyVisibility("clearCoat.useNormalMap", mainVisibility) context:SetMaterialPropertyVisibility("clearCoat.normalMapUv", mainVisibility) + context:SetMaterialPropertyVisibility("clearCoat.normalStrength", mainVisibility) if(enable) then UpdateTextureDependentPropertyVisibility(context, "clearCoat.influenceMap", "clearCoat.useInfluenceMap", "clearCoat.influenceMapUv") UpdateTextureDependentPropertyVisibility(context, "clearCoat.roughnessMap", "clearCoat.useRoughnessMap", "clearCoat.roughnessMapUv") UpdateTextureDependentPropertyVisibility(context, "clearCoat.normalMap", "clearCoat.useNormalMap", "clearCoat.normalMapUv") + UpdateNormalStrengthPropertyVisibility(context, "clearCoat.normalMap", "clearCoat.useNormalMap") end end diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_HandleOpacityMode.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_HandleOpacityMode.lua index 9315131e44..462d433d34 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_HandleOpacityMode.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_HandleOpacityMode.lua @@ -91,6 +91,10 @@ function ProcessEditor(context) if(mainVisibility == MaterialPropertyVisibility_Enabled) then local alphaSource = context:GetMaterialPropertyValue_enum("opacity.alphaSource") + if (opacityMode == OpacityMode_Cutout and alphaSource == AlphaSource_None) then + context:SetMaterialPropertyVisibility("opacity.factor", MaterialPropertyVisibility_Hidden) + end + if(alphaSource ~= AlphaSource_Split) then context:SetMaterialPropertyVisibility("opacity.textureMap", MaterialPropertyVisibility_Hidden) context:SetMaterialPropertyVisibility("opacity.textureMapUv", MaterialPropertyVisibility_Hidden) From 9ee60e6eba56a9b419b21c809a69ad975a843236 Mon Sep 17 00:00:00 2001 From: Junbo Liang <68558268+junbo75@users.noreply.github.com> Date: Mon, 20 Dec 2021 12:15:52 -0800 Subject: [PATCH 161/399] AWSI automation tests support on Linux (#6278) * AWSI automation tests support on Linux Signed-off-by: Junbo Liang <68558268+junbo75@users.noreply.github.com> --- .../Gem/PythonTests/AWS/CMakeLists.txt | 4 +- .../Gem/PythonTests/AWS/README.md | 63 +- .../AWS/Windows/aws_metrics/__init__.py | 6 - .../{Windows/core => aws_metrics}/__init__.py | 0 .../aws_metrics_automation_test.py | 578 ++++++------- .../aws_metrics/aws_metrics_custom_thread.py | 58 +- .../aws_metrics/aws_metrics_utils.py | 478 +++++------ .../aws_metrics/aws_metrics_waiters.py | 278 +++---- .../AWS/{Windows => client_auth}/__init__.py | 0 .../aws_client_auth_automation_test.py | 8 +- .../{Windows/client_auth => core}/__init__.py | 1 - .../core/test_aws_resource_interaction.py | 2 +- .../Levels/AWS/ClientAuth/ClientAuth.ly | 3 - .../Levels/AWS/ClientAuth/ClientAuth.prefab | 620 ++++++++++++++ .../Levels/AWS/ClientAuth/filelist.xml | 6 - .../Levels/AWS/ClientAuth/level.pak | 3 - .../ClientAuthPasswordSignIn.ly | 3 - .../ClientAuthPasswordSignIn.prefab | 620 ++++++++++++++ .../AWS/ClientAuthPasswordSignIn/filelist.xml | 6 - .../AWS/ClientAuthPasswordSignIn/level.pak | 3 - .../ClientAuthPasswordSignUp.ly | 3 - .../ClientAuthPasswordSignUp.prefab | 620 ++++++++++++++ .../AWS/ClientAuthPasswordSignUp/filelist.xml | 6 - .../AWS/ClientAuthPasswordSignUp/level.pak | 3 - AutomatedTesting/Levels/AWS/Core/Core.ly | 3 - AutomatedTesting/Levels/AWS/Core/Core.prefab | 758 ++++++++++++++++++ AutomatedTesting/Levels/AWS/Core/filelist.xml | 6 - AutomatedTesting/Levels/AWS/Core/level.pak | 3 - .../Levels/AWS/Metrics/Metrics.ly | 3 - .../Levels/AWS/Metrics/Metrics.prefab | 627 +++++++++++++++ .../Levels/AWS/Metrics/filelist.xml | 6 - AutomatedTesting/Levels/AWS/Metrics/level.pak | 3 - .../Platform/Linux/deploy_cdk_applications.sh | 106 +++ .../Linux/destroy_cdk_applications.sh | 96 +++ 34 files changed, 4197 insertions(+), 786 deletions(-) delete mode 100644 AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/__init__.py rename AutomatedTesting/Gem/PythonTests/AWS/{Windows/core => aws_metrics}/__init__.py (100%) rename AutomatedTesting/Gem/PythonTests/AWS/{Windows => }/aws_metrics/aws_metrics_automation_test.py (96%) rename AutomatedTesting/Gem/PythonTests/AWS/{Windows => }/aws_metrics/aws_metrics_custom_thread.py (96%) rename AutomatedTesting/Gem/PythonTests/AWS/{Windows => }/aws_metrics/aws_metrics_utils.py (97%) rename AutomatedTesting/Gem/PythonTests/AWS/{Windows => }/aws_metrics/aws_metrics_waiters.py (96%) rename AutomatedTesting/Gem/PythonTests/AWS/{Windows => client_auth}/__init__.py (100%) rename AutomatedTesting/Gem/PythonTests/AWS/{Windows => }/client_auth/aws_client_auth_automation_test.py (94%) rename AutomatedTesting/Gem/PythonTests/AWS/{Windows/client_auth => core}/__init__.py (99%) rename AutomatedTesting/Gem/PythonTests/AWS/{Windows => }/core/test_aws_resource_interaction.py (99%) delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.ly create mode 100644 AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.prefab delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuth/filelist.xml delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuth/level.pak delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.ly create mode 100644 AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.prefab delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/filelist.xml delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/level.pak delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.ly create mode 100644 AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.prefab delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/filelist.xml delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/level.pak delete mode 100644 AutomatedTesting/Levels/AWS/Core/Core.ly create mode 100644 AutomatedTesting/Levels/AWS/Core/Core.prefab delete mode 100644 AutomatedTesting/Levels/AWS/Core/filelist.xml delete mode 100644 AutomatedTesting/Levels/AWS/Core/level.pak delete mode 100644 AutomatedTesting/Levels/AWS/Metrics/Metrics.ly create mode 100644 AutomatedTesting/Levels/AWS/Metrics/Metrics.prefab delete mode 100644 AutomatedTesting/Levels/AWS/Metrics/filelist.xml delete mode 100644 AutomatedTesting/Levels/AWS/Metrics/level.pak create mode 100755 scripts/build/Platform/Linux/deploy_cdk_applications.sh create mode 100755 scripts/build/Platform/Linux/destroy_cdk_applications.sh diff --git a/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt index 2a5e1d7cab..d6740152a7 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt @@ -13,7 +13,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) # Only enable AWS automated tests on Windows - if(NOT "${PAL_PLATFORM_NAME}" STREQUAL "Windows") + set(SUPPORTED_PLATFORMS "Windows" "Linux") + if (NOT "${PAL_PLATFORM_NAME}" IN_LIST SUPPORTED_PLATFORMS) return() endif() @@ -23,7 +24,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TEST_SERIAL PATH ${CMAKE_CURRENT_LIST_DIR}/${PAL_PLATFORM_NAME}/ RUNTIME_DEPENDENCIES - Legacy::Editor AZ::AssetProcessor AutomatedTesting.GameLauncher AutomatedTesting.Assets diff --git a/AutomatedTesting/Gem/PythonTests/AWS/README.md b/AutomatedTesting/Gem/PythonTests/AWS/README.md index 0d046cbe4c..a25f39d9c2 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/README.md +++ b/AutomatedTesting/Gem/PythonTests/AWS/README.md @@ -2,30 +2,61 @@ ## Prerequisites 1. Build the O3DE Editor and AutomatedTesting.GameLauncher in Profile. -2. AWS CLI is installed and configured following [Configuration and Credential File Settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html). -3. [AWS Cloud Development Kit (CDK)](https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html#getting_started_install) is installed. +2. Install the latest version of NodeJs. +3. AWS CLI is installed and configured following [Configuration and Credential File Settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html). +4. [AWS Cloud Development Kit (CDK)](https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html#getting_started_install) is installed. ## Deploy CDK Applications 1. Go to the AWS IAM console and create an IAM role called o3de-automation-tests which adds your own account as as a trusted entity and uses the "AdministratorAccess" permissions policy. -2. Copy {engine_root}\scripts\build\Platform\Windows\deploy_cdk_applications.cmd to your engine root folder. -3. Open a new Command Prompt window at the engine root and set the following environment variables: -``` - Set O3DE_AWS_PROJECT_NAME=AWSAUTO - Set O3DE_AWS_DEPLOY_REGION=us-east-1 - Set O3DE_AWS_DEPLOY_ACCOUNT={your_aws_account_id} - Set ASSUME_ROLE_ARN=arn:aws:iam::{your_aws_account_id}:role/o3de-automation-tests - Set COMMIT_ID=HEAD -``` -4. In the same Command Prompt window, Deploy the CDK applications for AWS gems by running deploy_cdk_applications.cmd. +2. Copy the following deployment script to your engine root folder: + * Windows (Command Prompt) + ``` + {engine_root}\scripts\build\Platform\Windows\deploy_cdk_applications.cmd + ``` + * Linux + ``` + {engine_root}/scripts/build/Platform/Linux/deploy_cdk_applications.sh + ``` +3. Open a new CLI window at the engine root and set the following environment variables: + * Windows + ``` + Set O3DE_AWS_PROJECT_NAME=AWSAUTO + Set O3DE_AWS_DEPLOY_REGION=us-east-1 + Set ASSUME_ROLE_ARN=arn:aws:iam::{your_aws_account_id}:role/o3de-automation-tests + Set COMMIT_ID=HEAD + ``` + * Linux + ``` + export O3DE_AWS_PROJECT_NAME=AWSAUTO + export O3DE_AWS_DEPLOY_REGION=us-east-1 + export ASSUME_ROLE_ARN=arn:aws:iam::{your_aws_account_id}:role/o3de-automation-tests + export COMMIT_ID=HEAD + ``` +4. In the same CLI window, Deploy the CDK applications for AWS gems by running deploy_cdk_applications.cmd. ## Run Automation Tests ### CLI -In the same Command Prompt window, run the following CLI command: -python\python.cmd -m pytest {path_to_the_test_file} --build-directory {directory_to_the_profile_build} +1. In the same CLI window, run the following CLI command: + * Windows + ``` + python\python.cmd -m pytest {path_to_the_test_file} --build-directory {directory_to_the_profile_build} + ``` + * Linux + ``` + python/python.sh -m pytest {path_to_the_test_file} --build-directory {directory_to_the_profile_build} + ``` ### Pycharm You can also run any specific automation test directly from Pycharm by providing the "--build-directory" argument in the Run Configuration. ## Destroy CDK Applications -1. Copy {engine_root}\scripts\build\Platform\Windows\destroy_cdk_applications.cmd to your engine root folder. -2. In the same Command Prompt window, destroy the CDK applications for AWS gems by running destroy_cdk_applications.cmd. \ No newline at end of file +1. Copy the following destruction script to your engine root folder: + * Windows + ``` + {engine_root}\scripts\build\Platform\Windows\destroy_cdk_applications.cmd + ``` + * Linux + ``` + {engine_root}/scripts/build/Platform/Linux/destroy_cdk_applications.sh + ``` +2. In the same CLI window, destroy the CDK applications for AWS gems by running destroy_cdk_applications.cmd. diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/__init__.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/__init__.py deleted file mode 100644 index 50cbb262dd..0000000000 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/__init__.py b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/__init__.py similarity index 100% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/core/__init__.py rename to AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/__init__.py diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_automation_test.py similarity index 96% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py rename to AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_automation_test.py index 6f3113d771..77d71df370 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_automation_test.py @@ -1,289 +1,289 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import logging -import os -import pytest -import typing -from datetime import datetime - -import ly_test_tools.log.log_monitor - -from AWS.common import constants -from AWS.common.resource_mappings import AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY -from .aws_metrics_custom_thread import AWSMetricsThread - -# fixture imports -from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor -from .aws_metrics_utils import aws_metrics_utils - -AWS_METRICS_FEATURE_NAME = 'AWSMetrics' - -logger = logging.getLogger(__name__) - - -def setup(launcher: pytest.fixture, - asset_processor: pytest.fixture) -> pytest.fixture: - """ - Set up the resource mapping configuration and start the log monitor. - :param launcher: Client launcher for running the test level. - :param asset_processor: asset_processor fixture. - :return log monitor object. - """ - asset_processor.start() - asset_processor.wait_for_idle() - - file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), constants.GAME_LOG_NAME) - - # Initialize the log monitor. - log_monitor = ly_test_tools.log.log_monitor.LogMonitor(launcher=launcher, log_file_path=file_to_monitor) - - return log_monitor - - -def monitor_metrics_submission(log_monitor: pytest.fixture) -> None: - """ - Monitor the messages and notifications for submitting metrics. - :param log_monitor: Log monitor to check the log messages. - """ - expected_lines = [ - '(Script) - Submitted metrics without buffer.', - '(Script) - Submitted metrics with buffer.', - '(Script) - Flushed the buffered metrics.', - '(Script) - Metrics is sent successfully.' - ] - - unexpected_lines = [ - '(Script) - Failed to submit metrics without buffer.', - '(Script) - Failed to submit metrics with buffer.', - '(Script) - Failed to send metrics.' - ] - - result = log_monitor.monitor_log_for_lines( - expected_lines=expected_lines, - unexpected_lines=unexpected_lines, - halt_on_unexpected=True) - - # Assert the log monitor detected expected lines and did not detect any unexpected lines. - assert result, ( - f'Log monitoring failed. Used expected_lines values: {expected_lines} & ' - f'unexpected_lines values: {unexpected_lines}') - - -def query_metrics_from_s3(aws_metrics_utils: pytest.fixture, resource_mappings: pytest.fixture) -> None: - """ - Verify that the metrics events are delivered to the S3 bucket and can be queried. - :param aws_metrics_utils: aws_metrics_utils fixture. - :param resource_mappings: resource_mappings fixture. - """ - aws_metrics_utils.verify_s3_delivery( - resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsBucketName') - ) - logger.info('Metrics are sent to S3.') - - aws_metrics_utils.run_glue_crawler( - resource_mappings.get_resource_name_id('AWSMetrics.EventsCrawlerName')) - - # Remove the events_json table if exists so that the sample query can create a table with the same name. - aws_metrics_utils.delete_table(resource_mappings.get_resource_name_id('AWSMetrics.EventDatabaseName'), 'events_json') - aws_metrics_utils.run_named_queries(resource_mappings.get_resource_name_id('AWSMetrics.AthenaWorkGroupName')) - logger.info('Query metrics from S3 successfully.') - - -def verify_operational_metrics(aws_metrics_utils: pytest.fixture, - resource_mappings: pytest.fixture, start_time: datetime) -> None: - """ - Verify that operational health metrics are delivered to CloudWatch. - :param aws_metrics_utils: aws_metrics_utils fixture. - :param resource_mappings: resource_mappings fixture. - :param start_time: Time when the game launcher starts. - """ - aws_metrics_utils.verify_cloud_watch_delivery( - 'AWS/Lambda', - 'Invocations', - [{'Name': 'FunctionName', - 'Value': resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsProcessingLambdaName')}], - start_time) - logger.info('AnalyticsProcessingLambda metrics are sent to CloudWatch.') - - aws_metrics_utils.verify_cloud_watch_delivery( - 'AWS/Lambda', - 'Invocations', - [{'Name': 'FunctionName', - 'Value': resource_mappings.get_resource_name_id('AWSMetrics.EventProcessingLambdaName')}], - start_time) - logger.info('EventsProcessingLambda metrics are sent to CloudWatch.') - - -def update_kinesis_analytics_application_status(aws_metrics_utils: pytest.fixture, - resource_mappings: pytest.fixture, start_application: bool) -> None: - """ - Update the Kinesis analytics application to start or stop it. - :param aws_metrics_utils: aws_metrics_utils fixture. - :param resource_mappings: resource_mappings fixture. - :param start_application: whether to start or stop the application. - """ - if start_application: - aws_metrics_utils.start_kinesis_data_analytics_application( - resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsApplicationName')) - else: - aws_metrics_utils.stop_kinesis_data_analytics_application( - resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsApplicationName')) - -@pytest.mark.SUITE_awsi -@pytest.mark.usefixtures('automatic_process_killer') -@pytest.mark.usefixtures('aws_credentials') -@pytest.mark.usefixtures('resource_mappings') -@pytest.mark.parametrize('assume_role_arn', [constants.ASSUME_ROLE_ARN]) -@pytest.mark.parametrize('feature_name', [AWS_METRICS_FEATURE_NAME]) -@pytest.mark.parametrize('profile_name', ['AWSAutomationTest']) -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('region_name', [constants.AWS_REGION]) -@pytest.mark.parametrize('resource_mappings_filename', [constants.AWS_RESOURCE_MAPPING_FILE_NAME]) -@pytest.mark.parametrize('session_name', [constants.SESSION_NAME]) -@pytest.mark.parametrize('stacks', [[f'{constants.AWS_PROJECT_NAME}-{AWS_METRICS_FEATURE_NAME}-{constants.AWS_REGION}']]) -class TestAWSMetricsWindows(object): - """ - Test class to verify the real-time and batch analytics for metrics. - """ - @pytest.mark.parametrize('level', ['AWS/Metrics']) - def test_realtime_and_batch_analytics(self, - level: str, - launcher: pytest.fixture, - asset_processor: pytest.fixture, - workspace: pytest.fixture, - aws_utils: pytest.fixture, - resource_mappings: pytest.fixture, - aws_metrics_utils: pytest.fixture): - """ - Verify that the metrics events are sent to CloudWatch and S3 for analytics. - """ - # Start Kinesis analytics application on a separate thread to avoid blocking the test. - kinesis_analytics_application_thread = AWSMetricsThread(target=update_kinesis_analytics_application_status, - args=(aws_metrics_utils, resource_mappings, True)) - kinesis_analytics_application_thread.start() - - log_monitor = setup(launcher, asset_processor) - - # Kinesis analytics application needs to be in the running state before we start the game launcher. - kinesis_analytics_application_thread.join() - launcher.args = ['+LoadLevel', level] - launcher.args.extend(['-rhi=null']) - start_time = datetime.utcnow() - with launcher.start(launch_ap=False): - monitor_metrics_submission(log_monitor) - - # Verify that real-time analytics metrics are delivered to CloudWatch. - aws_metrics_utils.verify_cloud_watch_delivery( - AWS_METRICS_FEATURE_NAME, - 'TotalLogins', - [], - start_time) - logger.info('Real-time metrics are sent to CloudWatch.') - - # Run time-consuming operations on separate threads to avoid blocking the test. - operational_threads = list() - operational_threads.append( - AWSMetricsThread(target=query_metrics_from_s3, - args=(aws_metrics_utils, resource_mappings))) - operational_threads.append( - AWSMetricsThread(target=verify_operational_metrics, - args=(aws_metrics_utils, resource_mappings, start_time))) - operational_threads.append( - AWSMetricsThread(target=update_kinesis_analytics_application_status, - args=(aws_metrics_utils, resource_mappings, False))) - for thread in operational_threads: - thread.start() - for thread in operational_threads: - thread.join() - - @pytest.mark.parametrize('level', ['AWS/Metrics']) - def test_realtime_and_batch_analytics_no_global_accountid(self, - level: str, - launcher: pytest.fixture, - asset_processor: pytest.fixture, - workspace: pytest.fixture, - aws_utils: pytest.fixture, - resource_mappings: pytest.fixture, - aws_metrics_utils: pytest.fixture): - """ - Verify that the metrics events are sent to CloudWatch and S3 for analytics. - """ - # Remove top-level account ID from resource mappings - resource_mappings.clear_select_keys([AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY]) - # Start Kinesis analytics application on a separate thread to avoid blocking the test. - kinesis_analytics_application_thread = AWSMetricsThread(target=update_kinesis_analytics_application_status, - args=(aws_metrics_utils, resource_mappings, True)) - kinesis_analytics_application_thread.start() - - log_monitor = setup(launcher, asset_processor) - - # Kinesis analytics application needs to be in the running state before we start the game launcher. - kinesis_analytics_application_thread.join() - launcher.args = ['+LoadLevel', level] - launcher.args.extend(['-rhi=null']) - start_time = datetime.utcnow() - with launcher.start(launch_ap=False): - monitor_metrics_submission(log_monitor) - - # Verify that real-time analytics metrics are delivered to CloudWatch. - aws_metrics_utils.verify_cloud_watch_delivery( - AWS_METRICS_FEATURE_NAME, - 'TotalLogins', - [], - start_time) - logger.info('Real-time metrics are sent to CloudWatch.') - - # Run time-consuming operations on separate threads to avoid blocking the test. - operational_threads = list() - operational_threads.append( - AWSMetricsThread(target=query_metrics_from_s3, - args=(aws_metrics_utils, resource_mappings))) - operational_threads.append( - AWSMetricsThread(target=verify_operational_metrics, - args=(aws_metrics_utils, resource_mappings, start_time))) - operational_threads.append( - AWSMetricsThread(target=update_kinesis_analytics_application_status, - args=(aws_metrics_utils, resource_mappings, False))) - for thread in operational_threads: - thread.start() - for thread in operational_threads: - thread.join() - - @pytest.mark.parametrize('level', ['AWS/Metrics']) - def test_unauthorized_user_request_rejected(self, - level: str, - launcher: pytest.fixture, - asset_processor: pytest.fixture, - workspace: pytest.fixture): - """ - Verify that unauthorized users cannot send metrics events to the AWS backed backend. - """ - log_monitor = setup(launcher, asset_processor) - - # Set invalid AWS credentials. - launcher.args = ['+LoadLevel', level, '+cl_awsAccessKey', 'AKIAIOSFODNN7EXAMPLE', - '+cl_awsSecretKey', 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'] - launcher.args.extend(['-rhi=null']) - - with launcher.start(launch_ap=False): - result = log_monitor.monitor_log_for_lines( - expected_lines=['(Script) - Failed to send metrics.'], - unexpected_lines=['(Script) - Metrics is sent successfully.'], - halt_on_unexpected=True) - assert result, 'Metrics events are sent successfully by unauthorized user' - logger.info('Unauthorized user is rejected to send metrics.') - - def test_clean_up_s3_bucket(self, - aws_utils: pytest.fixture, - resource_mappings: pytest.fixture, - aws_metrics_utils: pytest.fixture): - """ - Clear the analytics bucket objects so that the S3 bucket can be destroyed during tear down. - """ - aws_metrics_utils.empty_bucket( - resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsBucketName')) +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import logging +import os +import pytest +import typing +from datetime import datetime + +import ly_test_tools.log.log_monitor + +from AWS.common import constants +from AWS.common.resource_mappings import AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY +from .aws_metrics_custom_thread import AWSMetricsThread + +# fixture imports +from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor +from .aws_metrics_utils import aws_metrics_utils + +AWS_METRICS_FEATURE_NAME = 'AWSMetrics' + +logger = logging.getLogger(__name__) + + +def setup(launcher: pytest.fixture, + asset_processor: pytest.fixture) -> pytest.fixture: + """ + Set up the resource mapping configuration and start the log monitor. + :param launcher: Client launcher for running the test level. + :param asset_processor: asset_processor fixture. + :return log monitor object. + """ + asset_processor.start() + asset_processor.wait_for_idle() + + file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), constants.GAME_LOG_NAME) + + # Initialize the log monitor. + log_monitor = ly_test_tools.log.log_monitor.LogMonitor(launcher=launcher, log_file_path=file_to_monitor) + + return log_monitor + + +def monitor_metrics_submission(log_monitor: pytest.fixture) -> None: + """ + Monitor the messages and notifications for submitting metrics. + :param log_monitor: Log monitor to check the log messages. + """ + expected_lines = [ + '(Script) - Submitted metrics without buffer.', + '(Script) - Submitted metrics with buffer.', + '(Script) - Flushed the buffered metrics.', + '(Script) - Metrics is sent successfully.' + ] + + unexpected_lines = [ + '(Script) - Failed to submit metrics without buffer.', + '(Script) - Failed to submit metrics with buffer.', + '(Script) - Failed to send metrics.' + ] + + result = log_monitor.monitor_log_for_lines( + expected_lines=expected_lines, + unexpected_lines=unexpected_lines, + halt_on_unexpected=True) + + # Assert the log monitor detected expected lines and did not detect any unexpected lines. + assert result, ( + f'Log monitoring failed. Used expected_lines values: {expected_lines} & ' + f'unexpected_lines values: {unexpected_lines}') + + +def query_metrics_from_s3(aws_metrics_utils: pytest.fixture, resource_mappings: pytest.fixture) -> None: + """ + Verify that the metrics events are delivered to the S3 bucket and can be queried. + :param aws_metrics_utils: aws_metrics_utils fixture. + :param resource_mappings: resource_mappings fixture. + """ + aws_metrics_utils.verify_s3_delivery( + resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsBucketName') + ) + logger.info('Metrics are sent to S3.') + + aws_metrics_utils.run_glue_crawler( + resource_mappings.get_resource_name_id('AWSMetrics.EventsCrawlerName')) + + # Remove the events_json table if exists so that the sample query can create a table with the same name. + aws_metrics_utils.delete_table(resource_mappings.get_resource_name_id('AWSMetrics.EventDatabaseName'), 'events_json') + aws_metrics_utils.run_named_queries(resource_mappings.get_resource_name_id('AWSMetrics.AthenaWorkGroupName')) + logger.info('Query metrics from S3 successfully.') + + +def verify_operational_metrics(aws_metrics_utils: pytest.fixture, + resource_mappings: pytest.fixture, start_time: datetime) -> None: + """ + Verify that operational health metrics are delivered to CloudWatch. + :param aws_metrics_utils: aws_metrics_utils fixture. + :param resource_mappings: resource_mappings fixture. + :param start_time: Time when the game launcher starts. + """ + aws_metrics_utils.verify_cloud_watch_delivery( + 'AWS/Lambda', + 'Invocations', + [{'Name': 'FunctionName', + 'Value': resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsProcessingLambdaName')}], + start_time) + logger.info('AnalyticsProcessingLambda metrics are sent to CloudWatch.') + + aws_metrics_utils.verify_cloud_watch_delivery( + 'AWS/Lambda', + 'Invocations', + [{'Name': 'FunctionName', + 'Value': resource_mappings.get_resource_name_id('AWSMetrics.EventProcessingLambdaName')}], + start_time) + logger.info('EventsProcessingLambda metrics are sent to CloudWatch.') + + +def update_kinesis_analytics_application_status(aws_metrics_utils: pytest.fixture, + resource_mappings: pytest.fixture, start_application: bool) -> None: + """ + Update the Kinesis analytics application to start or stop it. + :param aws_metrics_utils: aws_metrics_utils fixture. + :param resource_mappings: resource_mappings fixture. + :param start_application: whether to start or stop the application. + """ + if start_application: + aws_metrics_utils.start_kinesis_data_analytics_application( + resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsApplicationName')) + else: + aws_metrics_utils.stop_kinesis_data_analytics_application( + resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsApplicationName')) + +@pytest.mark.SUITE_awsi +@pytest.mark.usefixtures('automatic_process_killer') +@pytest.mark.usefixtures('aws_credentials') +@pytest.mark.usefixtures('resource_mappings') +@pytest.mark.parametrize('assume_role_arn', [constants.ASSUME_ROLE_ARN]) +@pytest.mark.parametrize('feature_name', [AWS_METRICS_FEATURE_NAME]) +@pytest.mark.parametrize('profile_name', ['AWSAutomationTest']) +@pytest.mark.parametrize('project', ['AutomatedTesting']) +@pytest.mark.parametrize('region_name', [constants.AWS_REGION]) +@pytest.mark.parametrize('resource_mappings_filename', [constants.AWS_RESOURCE_MAPPING_FILE_NAME]) +@pytest.mark.parametrize('session_name', [constants.SESSION_NAME]) +@pytest.mark.parametrize('stacks', [[f'{constants.AWS_PROJECT_NAME}-{AWS_METRICS_FEATURE_NAME}-{constants.AWS_REGION}']]) +class TestAWSMetricsWindows(object): + """ + Test class to verify the real-time and batch analytics for metrics. + """ + @pytest.mark.parametrize('level', ['levels/aws/metrics/metrics.spawnable']) + def test_realtime_and_batch_analytics(self, + level: str, + launcher: pytest.fixture, + asset_processor: pytest.fixture, + workspace: pytest.fixture, + aws_utils: pytest.fixture, + resource_mappings: pytest.fixture, + aws_metrics_utils: pytest.fixture): + """ + Verify that the metrics events are sent to CloudWatch and S3 for analytics. + """ + # Start Kinesis analytics application on a separate thread to avoid blocking the test. + kinesis_analytics_application_thread = AWSMetricsThread(target=update_kinesis_analytics_application_status, + args=(aws_metrics_utils, resource_mappings, True)) + kinesis_analytics_application_thread.start() + + log_monitor = setup(launcher, asset_processor) + + # Kinesis analytics application needs to be in the running state before we start the game launcher. + kinesis_analytics_application_thread.join() + launcher.args = ['+LoadLevel', level] + launcher.args.extend(['-rhi=null']) + start_time = datetime.utcnow() + with launcher.start(launch_ap=False): + monitor_metrics_submission(log_monitor) + + # Verify that real-time analytics metrics are delivered to CloudWatch. + aws_metrics_utils.verify_cloud_watch_delivery( + AWS_METRICS_FEATURE_NAME, + 'TotalLogins', + [], + start_time) + logger.info('Real-time metrics are sent to CloudWatch.') + + # Run time-consuming operations on separate threads to avoid blocking the test. + operational_threads = list() + operational_threads.append( + AWSMetricsThread(target=query_metrics_from_s3, + args=(aws_metrics_utils, resource_mappings))) + operational_threads.append( + AWSMetricsThread(target=verify_operational_metrics, + args=(aws_metrics_utils, resource_mappings, start_time))) + operational_threads.append( + AWSMetricsThread(target=update_kinesis_analytics_application_status, + args=(aws_metrics_utils, resource_mappings, False))) + for thread in operational_threads: + thread.start() + for thread in operational_threads: + thread.join() + + @pytest.mark.parametrize('level', ['levels/aws/metrics/metrics.spawnable']) + def test_realtime_and_batch_analytics_no_global_accountid(self, + level: str, + launcher: pytest.fixture, + asset_processor: pytest.fixture, + workspace: pytest.fixture, + aws_utils: pytest.fixture, + resource_mappings: pytest.fixture, + aws_metrics_utils: pytest.fixture): + """ + Verify that the metrics events are sent to CloudWatch and S3 for analytics. + """ + # Remove top-level account ID from resource mappings + resource_mappings.clear_select_keys([AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY]) + # Start Kinesis analytics application on a separate thread to avoid blocking the test. + kinesis_analytics_application_thread = AWSMetricsThread(target=update_kinesis_analytics_application_status, + args=(aws_metrics_utils, resource_mappings, True)) + kinesis_analytics_application_thread.start() + + log_monitor = setup(launcher, asset_processor) + + # Kinesis analytics application needs to be in the running state before we start the game launcher. + kinesis_analytics_application_thread.join() + launcher.args = ['+LoadLevel', level] + launcher.args.extend(['-rhi=null']) + start_time = datetime.utcnow() + with launcher.start(launch_ap=False): + monitor_metrics_submission(log_monitor) + + # Verify that real-time analytics metrics are delivered to CloudWatch. + aws_metrics_utils.verify_cloud_watch_delivery( + AWS_METRICS_FEATURE_NAME, + 'TotalLogins', + [], + start_time) + logger.info('Real-time metrics are sent to CloudWatch.') + + # Run time-consuming operations on separate threads to avoid blocking the test. + operational_threads = list() + operational_threads.append( + AWSMetricsThread(target=query_metrics_from_s3, + args=(aws_metrics_utils, resource_mappings))) + operational_threads.append( + AWSMetricsThread(target=verify_operational_metrics, + args=(aws_metrics_utils, resource_mappings, start_time))) + operational_threads.append( + AWSMetricsThread(target=update_kinesis_analytics_application_status, + args=(aws_metrics_utils, resource_mappings, False))) + for thread in operational_threads: + thread.start() + for thread in operational_threads: + thread.join() + + @pytest.mark.parametrize('level', ['levels/aws/metrics/metrics.spawnable']) + def test_unauthorized_user_request_rejected(self, + level: str, + launcher: pytest.fixture, + asset_processor: pytest.fixture, + workspace: pytest.fixture): + """ + Verify that unauthorized users cannot send metrics events to the AWS backed backend. + """ + log_monitor = setup(launcher, asset_processor) + + # Set invalid AWS credentials. + launcher.args = ['+LoadLevel', level, '+cl_awsAccessKey', 'AKIAIOSFODNN7EXAMPLE', + '+cl_awsSecretKey', 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'] + launcher.args.extend(['-rhi=null']) + + with launcher.start(launch_ap=False): + result = log_monitor.monitor_log_for_lines( + expected_lines=['(Script) - Failed to send metrics.'], + unexpected_lines=['(Script) - Metrics is sent successfully.'], + halt_on_unexpected=True) + assert result, 'Metrics events are sent successfully by unauthorized user' + logger.info('Unauthorized user is rejected to send metrics.') + + def test_clean_up_s3_bucket(self, + aws_utils: pytest.fixture, + resource_mappings: pytest.fixture, + aws_metrics_utils: pytest.fixture): + """ + Clear the analytics bucket objects so that the S3 bucket can be destroyed during tear down. + """ + aws_metrics_utils.empty_bucket( + resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsBucketName')) diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_custom_thread.py b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_custom_thread.py similarity index 96% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_custom_thread.py rename to AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_custom_thread.py index 1bba9c3e39..99f9072c4b 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_custom_thread.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_custom_thread.py @@ -1,29 +1,29 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -from threading import Thread - - -class AWSMetricsThread(Thread): - """ - Custom thread for raising assertion errors on the main thread. - """ - def __init__(self, **kwargs): - super().__init__(**kwargs) - self._error = None - - def run(self) -> None: - try: - super().run() - except AssertionError as e: - self._error = e - - def join(self, **kwargs) -> None: - super().join(**kwargs) - - if self._error: - raise AssertionError(self._error) +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +from threading import Thread + + +class AWSMetricsThread(Thread): + """ + Custom thread for raising assertion errors on the main thread. + """ + def __init__(self, **kwargs): + super().__init__(**kwargs) + self._error = None + + def run(self) -> None: + try: + super().run() + except AssertionError as e: + self._error = e + + def join(self, **kwargs) -> None: + super().join(**kwargs) + + if self._error: + raise AssertionError(self._error) diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_utils.py b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_utils.py similarity index 97% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_utils.py rename to AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_utils.py index e7eb486d02..64ee224f4e 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_utils.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_utils.py @@ -1,239 +1,239 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import logging -import pathlib -import pytest -import typing - -from datetime import datetime -from botocore.exceptions import WaiterError - -from .aws_metrics_waiters import KinesisAnalyticsApplicationUpdatedWaiter, \ - CloudWatchMetricsDeliveredWaiter, DataLakeMetricsDeliveredWaiter, GlueCrawlerReadyWaiter - -logging.getLogger('boto').setLevel(logging.CRITICAL) - -# Expected directory and file extension for the S3 objects. -EXPECTED_S3_DIRECTORY = 'firehose_events/' -EXPECTED_S3_OBJECT_EXTENSION = '.parquet' - - -class AWSMetricsUtils: - """ - Provide utils functions for the AWSMetrics gem to interact with the deployed resources. - """ - - def __init__(self, aws_utils: pytest.fixture): - self._aws_util = aws_utils - - def start_kinesis_data_analytics_application(self, application_name: str) -> None: - """ - Start the Kenisis Data Analytics application for real-time analytics. - :param application_name: Name of the Kenisis Data Analytics application. - """ - input_id = self.get_kinesis_analytics_application_input_id(application_name) - assert input_id, 'invalid Kinesis Data Analytics application input.' - - client = self._aws_util.client('kinesisanalytics') - try: - client.start_application( - ApplicationName=application_name, - InputConfigurations=[ - { - 'Id': input_id, - 'InputStartingPositionConfiguration': { - 'InputStartingPosition': 'NOW' - } - }, - ] - ) - except client.exceptions.ResourceInUseException: - # The application has been started. - return - - try: - KinesisAnalyticsApplicationUpdatedWaiter(client, 'RUNNING').wait(application_name=application_name) - except WaiterError as e: - assert False, f'Failed to start the Kinesis Data Analytics application: {str(e)}.' - - def get_kinesis_analytics_application_input_id(self, application_name: str) -> str: - """ - Get the input ID for the Kenisis Data Analytics application. - :param application_name: Name of the Kenisis Data Analytics application. - :return: Input ID for the Kenisis Data Analytics application. - """ - client = self._aws_util.client('kinesisanalytics') - response = client.describe_application( - ApplicationName=application_name - ) - if not response: - return '' - input_descriptions = response.get('ApplicationDetail', {}).get('InputDescriptions', []) - if len(input_descriptions) != 1: - return '' - - return input_descriptions[0].get('InputId', '') - - def stop_kinesis_data_analytics_application(self, application_name: str) -> None: - """ - Stop the Kenisis Data Analytics application. - :param application_name: Name of the Kenisis Data Analytics application. - """ - client = self._aws_util.client('kinesisanalytics') - client.stop_application( - ApplicationName=application_name - ) - - try: - KinesisAnalyticsApplicationUpdatedWaiter(client, 'READY').wait(application_name=application_name) - except WaiterError as e: - assert False, f'Failed to stop the Kinesis Data Analytics application: {str(e)}.' - - def verify_cloud_watch_delivery(self, namespace: str, metrics_name: str, - dimensions: typing.List[dict], start_time: datetime) -> None: - """ - Verify that the expected metrics is delivered to CloudWatch. - :param namespace: Namespace of the metrics. - :param metrics_name: Name of the metrics. - :param dimensions: Dimensions of the metrics. - :param start_time: Start time for generating the metrics. - """ - client = self._aws_util.client('cloudwatch') - - try: - CloudWatchMetricsDeliveredWaiter(client).wait( - namespace=namespace, - metrics_name=metrics_name, - dimensions=dimensions, - start_time=start_time - ) - except WaiterError as e: - assert False, f'Failed to deliver metrics to CloudWatch: {str(e)}.' - - def verify_s3_delivery(self, analytics_bucket_name: str) -> None: - """ - Verify that metrics are delivered to S3 for batch analytics successfully. - :param analytics_bucket_name: Name of the deployed S3 bucket. - """ - client = self._aws_util.client('s3') - bucket_name = analytics_bucket_name - - try: - DataLakeMetricsDeliveredWaiter(client).wait(bucket_name=bucket_name, prefix=EXPECTED_S3_DIRECTORY) - except WaiterError as e: - assert False, f'Failed to find the S3 directory for storing metrics data: {str(e)}.' - - # Check whether the data is converted to the expected data format. - response = client.list_objects_v2( - Bucket=bucket_name, - Prefix=EXPECTED_S3_DIRECTORY - ) - assert response.get('KeyCount', 0) != 0, f'Failed to deliver metrics to the S3 bucket {bucket_name}.' - - s3_objects = response.get('Contents', []) - for s3_object in s3_objects: - key = s3_object.get('Key', '') - assert pathlib.Path(key).suffix == EXPECTED_S3_OBJECT_EXTENSION, \ - f'Invalid data format is found in the S3 bucket {bucket_name}' - - def run_glue_crawler(self, crawler_name: str) -> None: - """ - Run the Glue crawler and wait for it to finish. - :param crawler_name: Name of the Glue crawler - """ - client = self._aws_util.client('glue') - try: - client.start_crawler( - Name=crawler_name - ) - except client.exceptions.CrawlerRunningException: - # The crawler has already been started. - return - - try: - GlueCrawlerReadyWaiter(client).wait(crawler_name=crawler_name) - except WaiterError as e: - assert False, f'Failed to run the Glue crawler: {str(e)}.' - - def run_named_queries(self, work_group: str) -> None: - """ - Run the named queries under the specific Athena work group. - :param work_group: Name of the Athena work group. - """ - client = self._aws_util.client('athena') - # List all the named queries. - response = client.list_named_queries( - WorkGroup=work_group - ) - named_query_ids = response.get('NamedQueryIds', []) - - # Run each of the queries. - for named_query_id in named_query_ids: - get_named_query_response = client.get_named_query( - NamedQueryId=named_query_id - ) - named_query = get_named_query_response.get('NamedQuery', {}) - - start_query_execution_response = client.start_query_execution( - QueryString=named_query.get('QueryString', ''), - QueryExecutionContext={ - 'Database': named_query.get('Database', '') - }, - WorkGroup=work_group - ) - - # Wait for the query to finish. - state = 'RUNNING' - while state == 'QUEUED' or state == 'RUNNING': - get_query_execution_response = client.get_query_execution( - QueryExecutionId=start_query_execution_response.get('QueryExecutionId', '') - ) - - state = get_query_execution_response.get('QueryExecution', {}).get('Status', {}).get('State', '') - - assert state == 'SUCCEEDED', f'Failed to run the named query {named_query.get("Name", {})}' - - def empty_bucket(self, bucket_name: str) -> None: - """ - Empty the S3 bucket following: - https://boto3.amazonaws.com/v1/documentation/api/latest/guide/migrations3.html - - :param bucket_name: Name of the S3 bucket. - """ - s3 = self._aws_util.resource('s3') - bucket = s3.Bucket(bucket_name) - - for key in bucket.objects.all(): - key.delete() - - def delete_table(self, database_name: str, table_name: str) -> None: - """ - Delete an existing Glue table. - - :param database_name: Name of the Glue database. - :param table_name: Name of the table to delete. - """ - client = self._aws_util.client('glue') - client.delete_table( - DatabaseName=database_name, - Name=table_name - ) - - -@pytest.fixture(scope='function') -def aws_metrics_utils( - request: pytest.fixture, - aws_utils: pytest.fixture): - """ - Fixture for the AWS metrics util functions. - :param request: _pytest.fixtures.SubRequest class that handles getting - a pytest fixture from a pytest function/fixture. - :param aws_utils: aws_utils fixture. - """ - aws_utils_obj = AWSMetricsUtils(aws_utils) - return aws_utils_obj +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import logging +import pathlib +import pytest +import typing + +from datetime import datetime +from botocore.exceptions import WaiterError + +from .aws_metrics_waiters import KinesisAnalyticsApplicationUpdatedWaiter, \ + CloudWatchMetricsDeliveredWaiter, DataLakeMetricsDeliveredWaiter, GlueCrawlerReadyWaiter + +logging.getLogger('boto').setLevel(logging.CRITICAL) + +# Expected directory and file extension for the S3 objects. +EXPECTED_S3_DIRECTORY = 'firehose_events/' +EXPECTED_S3_OBJECT_EXTENSION = '.parquet' + + +class AWSMetricsUtils: + """ + Provide utils functions for the AWSMetrics gem to interact with the deployed resources. + """ + + def __init__(self, aws_utils: pytest.fixture): + self._aws_util = aws_utils + + def start_kinesis_data_analytics_application(self, application_name: str) -> None: + """ + Start the Kenisis Data Analytics application for real-time analytics. + :param application_name: Name of the Kenisis Data Analytics application. + """ + input_id = self.get_kinesis_analytics_application_input_id(application_name) + assert input_id, 'invalid Kinesis Data Analytics application input.' + + client = self._aws_util.client('kinesisanalytics') + try: + client.start_application( + ApplicationName=application_name, + InputConfigurations=[ + { + 'Id': input_id, + 'InputStartingPositionConfiguration': { + 'InputStartingPosition': 'NOW' + } + }, + ] + ) + except client.exceptions.ResourceInUseException: + # The application has been started. + return + + try: + KinesisAnalyticsApplicationUpdatedWaiter(client, 'RUNNING').wait(application_name=application_name) + except WaiterError as e: + assert False, f'Failed to start the Kinesis Data Analytics application: {str(e)}.' + + def get_kinesis_analytics_application_input_id(self, application_name: str) -> str: + """ + Get the input ID for the Kenisis Data Analytics application. + :param application_name: Name of the Kenisis Data Analytics application. + :return: Input ID for the Kenisis Data Analytics application. + """ + client = self._aws_util.client('kinesisanalytics') + response = client.describe_application( + ApplicationName=application_name + ) + if not response: + return '' + input_descriptions = response.get('ApplicationDetail', {}).get('InputDescriptions', []) + if len(input_descriptions) != 1: + return '' + + return input_descriptions[0].get('InputId', '') + + def stop_kinesis_data_analytics_application(self, application_name: str) -> None: + """ + Stop the Kenisis Data Analytics application. + :param application_name: Name of the Kenisis Data Analytics application. + """ + client = self._aws_util.client('kinesisanalytics') + client.stop_application( + ApplicationName=application_name + ) + + try: + KinesisAnalyticsApplicationUpdatedWaiter(client, 'READY').wait(application_name=application_name) + except WaiterError as e: + assert False, f'Failed to stop the Kinesis Data Analytics application: {str(e)}.' + + def verify_cloud_watch_delivery(self, namespace: str, metrics_name: str, + dimensions: typing.List[dict], start_time: datetime) -> None: + """ + Verify that the expected metrics is delivered to CloudWatch. + :param namespace: Namespace of the metrics. + :param metrics_name: Name of the metrics. + :param dimensions: Dimensions of the metrics. + :param start_time: Start time for generating the metrics. + """ + client = self._aws_util.client('cloudwatch') + + try: + CloudWatchMetricsDeliveredWaiter(client).wait( + namespace=namespace, + metrics_name=metrics_name, + dimensions=dimensions, + start_time=start_time + ) + except WaiterError as e: + assert False, f'Failed to deliver metrics to CloudWatch: {str(e)}.' + + def verify_s3_delivery(self, analytics_bucket_name: str) -> None: + """ + Verify that metrics are delivered to S3 for batch analytics successfully. + :param analytics_bucket_name: Name of the deployed S3 bucket. + """ + client = self._aws_util.client('s3') + bucket_name = analytics_bucket_name + + try: + DataLakeMetricsDeliveredWaiter(client).wait(bucket_name=bucket_name, prefix=EXPECTED_S3_DIRECTORY) + except WaiterError as e: + assert False, f'Failed to find the S3 directory for storing metrics data: {str(e)}.' + + # Check whether the data is converted to the expected data format. + response = client.list_objects_v2( + Bucket=bucket_name, + Prefix=EXPECTED_S3_DIRECTORY + ) + assert response.get('KeyCount', 0) != 0, f'Failed to deliver metrics to the S3 bucket {bucket_name}.' + + s3_objects = response.get('Contents', []) + for s3_object in s3_objects: + key = s3_object.get('Key', '') + assert pathlib.Path(key).suffix == EXPECTED_S3_OBJECT_EXTENSION, \ + f'Invalid data format is found in the S3 bucket {bucket_name}' + + def run_glue_crawler(self, crawler_name: str) -> None: + """ + Run the Glue crawler and wait for it to finish. + :param crawler_name: Name of the Glue crawler + """ + client = self._aws_util.client('glue') + try: + client.start_crawler( + Name=crawler_name + ) + except client.exceptions.CrawlerRunningException: + # The crawler has already been started. + return + + try: + GlueCrawlerReadyWaiter(client).wait(crawler_name=crawler_name) + except WaiterError as e: + assert False, f'Failed to run the Glue crawler: {str(e)}.' + + def run_named_queries(self, work_group: str) -> None: + """ + Run the named queries under the specific Athena work group. + :param work_group: Name of the Athena work group. + """ + client = self._aws_util.client('athena') + # List all the named queries. + response = client.list_named_queries( + WorkGroup=work_group + ) + named_query_ids = response.get('NamedQueryIds', []) + + # Run each of the queries. + for named_query_id in named_query_ids: + get_named_query_response = client.get_named_query( + NamedQueryId=named_query_id + ) + named_query = get_named_query_response.get('NamedQuery', {}) + + start_query_execution_response = client.start_query_execution( + QueryString=named_query.get('QueryString', ''), + QueryExecutionContext={ + 'Database': named_query.get('Database', '') + }, + WorkGroup=work_group + ) + + # Wait for the query to finish. + state = 'RUNNING' + while state == 'QUEUED' or state == 'RUNNING': + get_query_execution_response = client.get_query_execution( + QueryExecutionId=start_query_execution_response.get('QueryExecutionId', '') + ) + + state = get_query_execution_response.get('QueryExecution', {}).get('Status', {}).get('State', '') + + assert state == 'SUCCEEDED', f'Failed to run the named query {named_query.get("Name", {})}' + + def empty_bucket(self, bucket_name: str) -> None: + """ + Empty the S3 bucket following: + https://boto3.amazonaws.com/v1/documentation/api/latest/guide/migrations3.html + + :param bucket_name: Name of the S3 bucket. + """ + s3 = self._aws_util.resource('s3') + bucket = s3.Bucket(bucket_name) + + for key in bucket.objects.all(): + key.delete() + + def delete_table(self, database_name: str, table_name: str) -> None: + """ + Delete an existing Glue table. + + :param database_name: Name of the Glue database. + :param table_name: Name of the table to delete. + """ + client = self._aws_util.client('glue') + client.delete_table( + DatabaseName=database_name, + Name=table_name + ) + + +@pytest.fixture(scope='function') +def aws_metrics_utils( + request: pytest.fixture, + aws_utils: pytest.fixture): + """ + Fixture for the AWS metrics util functions. + :param request: _pytest.fixtures.SubRequest class that handles getting + a pytest fixture from a pytest function/fixture. + :param aws_utils: aws_utils fixture. + """ + aws_utils_obj = AWSMetricsUtils(aws_utils) + return aws_utils_obj diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_waiters.py b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_waiters.py similarity index 96% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_waiters.py rename to AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_waiters.py index 46070a3a64..7b09557c79 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_waiters.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_waiters.py @@ -1,139 +1,139 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import botocore.client -import logging - -from datetime import timedelta -from AWS.common.custom_waiter import CustomWaiter, WaitState - -logging.getLogger('boto').setLevel(logging.CRITICAL) - - -class KinesisAnalyticsApplicationUpdatedWaiter(CustomWaiter): - """ - Subclass of the base custom waiter class. - Wait for the Kinesis analytics application being updated to a specific status. - """ - def __init__(self, client: botocore.client, status: str): - """ - Initialize the waiter. - - :param client: Boto3 client to use. - :param status: Expected status. - """ - super().__init__( - 'KinesisAnalyticsApplicationUpdated', - 'DescribeApplication', - 'ApplicationDetail.ApplicationStatus', - {status: WaitState.SUCCESS}, - client) - - def wait(self, application_name: str): - """ - Wait for the expected status. - - :param application_name: Name of the Kinesis analytics application. - """ - self._wait(ApplicationName=application_name) - - -class GlueCrawlerReadyWaiter(CustomWaiter): - """ - Subclass of the base custom waiter class. - Wait for the Glue crawler to finish its processing. Return when the crawler is in the "Stopping" status - to avoid wasting too much time in the automation tests on its shutdown process. - """ - def __init__(self, client: botocore.client): - """ - Initialize the waiter. - - :param client: Boto3 client to use. - """ - super().__init__( - 'GlueCrawlerReady', - 'GetCrawler', - 'Crawler.State', - {'STOPPING': WaitState.SUCCESS}, - client) - - def wait(self, crawler_name): - """ - Wait for the expected status. - - :param crawler_name: Name of the Glue crawler. - """ - self._wait(Name=crawler_name) - - -class DataLakeMetricsDeliveredWaiter(CustomWaiter): - """ - Subclass of the base custom waiter class. - Wait for the expected directory being created in the S3 bucket. - """ - def __init__(self, client: botocore.client): - """ - Initialize the waiter. - - :param client: Boto3 client to use. - """ - super().__init__( - 'DataLakeMetricsDelivered', - 'ListObjectsV2', - 'KeyCount > `0`', - {True: WaitState.SUCCESS}, - client) - - def wait(self, bucket_name, prefix): - """ - Wait for the expected directory being created. - - :param bucket_name: Name of the S3 bucket. - :param prefix: Name of the expected directory prefix. - """ - self._wait(Bucket=bucket_name, Prefix=prefix) - - -class CloudWatchMetricsDeliveredWaiter(CustomWaiter): - """ - Subclass of the base custom waiter class. - Wait for the expected metrics being delivered to CloudWatch. - """ - def __init__(self, client: botocore.client): - """ - Initialize the waiter. - - :param client: Boto3 client to use. - """ - super().__init__( - 'CloudWatchMetricsDelivered', - 'GetMetricStatistics', - 'length(Datapoints) > `0`', - {True: WaitState.SUCCESS}, - client) - - def wait(self, namespace, metrics_name, dimensions, start_time): - """ - Wait for the expected metrics being delivered. - - :param namespace: Namespace of the metrics. - :param metrics_name: Name of the metrics. - :param dimensions: Dimensions of the metrics. - :param start_time: Start time for generating the metrics. - """ - self._wait( - Namespace=namespace, - MetricName=metrics_name, - Dimensions=dimensions, - StartTime=start_time, - EndTime=start_time + timedelta(0, self.timeout), - Period=60, - Statistics=[ - 'SampleCount' - ], - Unit='Count' - ) +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import botocore.client +import logging + +from datetime import timedelta +from AWS.common.custom_waiter import CustomWaiter, WaitState + +logging.getLogger('boto').setLevel(logging.CRITICAL) + + +class KinesisAnalyticsApplicationUpdatedWaiter(CustomWaiter): + """ + Subclass of the base custom waiter class. + Wait for the Kinesis analytics application being updated to a specific status. + """ + def __init__(self, client: botocore.client, status: str): + """ + Initialize the waiter. + + :param client: Boto3 client to use. + :param status: Expected status. + """ + super().__init__( + 'KinesisAnalyticsApplicationUpdated', + 'DescribeApplication', + 'ApplicationDetail.ApplicationStatus', + {status: WaitState.SUCCESS}, + client) + + def wait(self, application_name: str): + """ + Wait for the expected status. + + :param application_name: Name of the Kinesis analytics application. + """ + self._wait(ApplicationName=application_name) + + +class GlueCrawlerReadyWaiter(CustomWaiter): + """ + Subclass of the base custom waiter class. + Wait for the Glue crawler to finish its processing. Return when the crawler is in the "Stopping" status + to avoid wasting too much time in the automation tests on its shutdown process. + """ + def __init__(self, client: botocore.client): + """ + Initialize the waiter. + + :param client: Boto3 client to use. + """ + super().__init__( + 'GlueCrawlerReady', + 'GetCrawler', + 'Crawler.State', + {'STOPPING': WaitState.SUCCESS}, + client) + + def wait(self, crawler_name): + """ + Wait for the expected status. + + :param crawler_name: Name of the Glue crawler. + """ + self._wait(Name=crawler_name) + + +class DataLakeMetricsDeliveredWaiter(CustomWaiter): + """ + Subclass of the base custom waiter class. + Wait for the expected directory being created in the S3 bucket. + """ + def __init__(self, client: botocore.client): + """ + Initialize the waiter. + + :param client: Boto3 client to use. + """ + super().__init__( + 'DataLakeMetricsDelivered', + 'ListObjectsV2', + 'KeyCount > `0`', + {True: WaitState.SUCCESS}, + client) + + def wait(self, bucket_name, prefix): + """ + Wait for the expected directory being created. + + :param bucket_name: Name of the S3 bucket. + :param prefix: Name of the expected directory prefix. + """ + self._wait(Bucket=bucket_name, Prefix=prefix) + + +class CloudWatchMetricsDeliveredWaiter(CustomWaiter): + """ + Subclass of the base custom waiter class. + Wait for the expected metrics being delivered to CloudWatch. + """ + def __init__(self, client: botocore.client): + """ + Initialize the waiter. + + :param client: Boto3 client to use. + """ + super().__init__( + 'CloudWatchMetricsDelivered', + 'GetMetricStatistics', + 'length(Datapoints) > `0`', + {True: WaitState.SUCCESS}, + client) + + def wait(self, namespace, metrics_name, dimensions, start_time): + """ + Wait for the expected metrics being delivered. + + :param namespace: Namespace of the metrics. + :param metrics_name: Name of the metrics. + :param dimensions: Dimensions of the metrics. + :param start_time: Start time for generating the metrics. + """ + self._wait( + Namespace=namespace, + MetricName=metrics_name, + Dimensions=dimensions, + StartTime=start_time, + EndTime=start_time + timedelta(0, self.timeout), + Period=60, + Statistics=[ + 'SampleCount' + ], + Unit='Count' + ) diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/__init__.py b/AutomatedTesting/Gem/PythonTests/AWS/client_auth/__init__.py similarity index 100% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/__init__.py rename to AutomatedTesting/Gem/PythonTests/AWS/client_auth/__init__.py diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/aws_client_auth_automation_test.py b/AutomatedTesting/Gem/PythonTests/AWS/client_auth/aws_client_auth_automation_test.py similarity index 94% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/aws_client_auth_automation_test.py rename to AutomatedTesting/Gem/PythonTests/AWS/client_auth/aws_client_auth_automation_test.py index 077a068a18..b185a155ed 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/aws_client_auth_automation_test.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/client_auth/aws_client_auth_automation_test.py @@ -40,7 +40,7 @@ class TestAWSClientAuthWindows(object): Test class to verify AWS Client Auth gem features on Windows. """ - @pytest.mark.parametrize('level', ['AWS/ClientAuth']) + @pytest.mark.parametrize('level', ['levels/aws/clientauth/clientauth.spawnable']) def test_anonymous_credentials(self, level: str, launcher: pytest.fixture, @@ -72,7 +72,7 @@ class TestAWSClientAuthWindows(object): ) assert result, 'Anonymous credentials fetched successfully.' - @pytest.mark.parametrize('level', ['AWS/ClientAuth']) + @pytest.mark.parametrize('level', ['levels/aws/clientauth/clientauth.spawnable']) def test_anonymous_credentials_no_global_accountid(self, level: str, launcher: pytest.fixture, @@ -140,7 +140,7 @@ class TestAWSClientAuthWindows(object): except cognito_idp.exceptions.UserNotFoundException: pass - launcher.args = ['+LoadLevel', 'AWS/ClientAuthPasswordSignUp'] + launcher.args = ['+LoadLevel', 'levels/aws/clientauthpasswordsignup/clientauthpasswordsignup.spawnable'] launcher.args.extend(['-rhi=null']) with launcher.start(launch_ap=False): @@ -158,7 +158,7 @@ class TestAWSClientAuthWindows(object): Username='test1' ) - launcher.args = ['+LoadLevel', 'AWS/ClientAuthPasswordSignIn'] + launcher.args = ['+LoadLevel', 'levels/aws/clientauthpasswordsignin/clientauthpasswordsignin.spawnable'] launcher.args.extend(['-rhi=null']) with launcher.start(launch_ap=False): diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/__init__.py b/AutomatedTesting/Gem/PythonTests/AWS/core/__init__.py similarity index 99% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/__init__.py rename to AutomatedTesting/Gem/PythonTests/AWS/core/__init__.py index bbcbcf1807..f5193b300e 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/__init__.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/core/__init__.py @@ -4,4 +4,3 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ - diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py b/AutomatedTesting/Gem/PythonTests/AWS/core/test_aws_resource_interaction.py similarity index 99% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py rename to AutomatedTesting/Gem/PythonTests/AWS/core/test_aws_resource_interaction.py index 59c517fd1c..367f02cac3 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/core/test_aws_resource_interaction.py @@ -84,7 +84,7 @@ def write_test_data_to_dynamodb_table(resource_mappings: pytest.fixture, aws_uti @pytest.mark.parametrize('session_name', [constants.SESSION_NAME]) @pytest.mark.usefixtures('workspace') @pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['AWS/Core']) +@pytest.mark.parametrize('level', ['levels/aws/core/core.spawnable']) @pytest.mark.usefixtures('resource_mappings') @pytest.mark.parametrize('resource_mappings_filename', [constants.AWS_RESOURCE_MAPPING_FILE_NAME]) @pytest.mark.parametrize('stacks', [[f'{constants.AWS_PROJECT_NAME}-{AWS_CORE_FEATURE_NAME}', diff --git a/AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.ly b/AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.ly deleted file mode 100644 index b4a2d6cb3a..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.ly +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:19f2c4454bb395cdc0a36d1e45e6a384bbd23037af1a2fb93e088ecfa0f10e5b -size 9343 diff --git a/AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.prefab b/AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.prefab new file mode 100644 index 0000000000..8f2fb61c71 --- /dev/null +++ b/AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.prefab @@ -0,0 +1,620 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Entity_[2670735447885]", + "Entity_[2670735447885]" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 6861302815203973165 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1172344194419]": { + "Id": "Entity_[1172344194419]", + "Name": "Shader Ball", + "Components": { + "Component_[10789351944715265527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10789351944715265527 + }, + "Component_[12037033284781049225]": { + "$type": "EditorEntitySortComponent", + "Id": 12037033284781049225 + }, + "Component_[13759153306105970079]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13759153306105970079 + }, + "Component_[14135560884830586279]": { + "$type": "EditorInspectorComponent", + "Id": 14135560884830586279 + }, + "Component_[16247165675903986673]": { + "$type": "EditorVisibilityComponent", + "Id": 16247165675903986673 + }, + "Component_[18082433625958885247]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18082433625958885247 + }, + "Component_[6472623349872972660]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6472623349872972660, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Rotate": [ + 0.0, + 0.10000000149011612, + 180.0 + ] + } + }, + "Component_[6495255223970673916]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 6495255223970673916, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}", + "subId": 281415304 + }, + "assetHint": "objects/shaderball/shaderball_default_1m.azmodel" + } + } + } + }, + "Component_[8056625192494070973]": { + "$type": "SelectionComponent", + "Id": 8056625192494070973 + }, + "Component_[8550141614185782969]": { + "$type": "EditorEntityIconComponent", + "Id": 8550141614185782969 + }, + "Component_[9439770997198325425]": { + "$type": "EditorLockComponent", + "Id": 9439770997198325425 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1172344194419]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + }, + "Entity_[2670735447885]": { + "Id": "Entity_[2670735447885]", + "Name": "AnonymousAuthorization", + "Components": { + "Component_[11400228652398928245]": { + "$type": "EditorOnlyEntityComponent", + "Id": 11400228652398928245 + }, + "Component_[15542812360906781451]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15542812360906781451, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 0.0, + 0.10000038146972656, + 4.005923748016357 + ] + } + }, + "Component_[16858205397479531670]": { + "$type": "EditorLockComponent", + "Id": 16858205397479531670 + }, + "Component_[1921474395300693283]": { + "$type": "EditorScriptCanvasComponent", + "Id": 1921474395300693283, + "m_name": "ConitoAnonymousAuthorization.scriptcanvas", + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "id": "{C0B0CEBA-064E-580F-AD81-CFE8CE0D61B1}" + } + }, + "sourceHandle": { + "id": "{C0B0CEBA-064E-580F-AD81-CFE8CE0D61B1}" + } + }, + "Component_[2312432053711106201]": { + "$type": "EditorEntityIconComponent", + "Id": 2312432053711106201 + }, + "Component_[4066858233846929269]": { + "$type": "EditorEntitySortComponent", + "Id": 4066858233846929269 + }, + "Component_[6542133807409587028]": { + "$type": "EditorPendingCompositionComponent", + "Id": 6542133807409587028 + }, + "Component_[7002965736546436267]": { + "$type": "SelectionComponent", + "Id": 7002965736546436267 + }, + "Component_[7455250879152263787]": { + "$type": "EditorVisibilityComponent", + "Id": 7455250879152263787 + }, + "Component_[8081535907930415421]": { + "$type": "EditorInspectorComponent", + "Id": 8081535907930415421 + }, + "Component_[9630473919092479415]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 9630473919092479415 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/AWS/ClientAuth/filelist.xml b/AutomatedTesting/Levels/AWS/ClientAuth/filelist.xml deleted file mode 100644 index 6b5b5a8727..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuth/filelist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AutomatedTesting/Levels/AWS/ClientAuth/level.pak b/AutomatedTesting/Levels/AWS/ClientAuth/level.pak deleted file mode 100644 index bd791070e9..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuth/level.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8a674e05824e5ceec13a0487b318923568710bc8269e5be84adad59c495a7ceb -size 3610 diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.ly b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.ly deleted file mode 100644 index 40d9ad619c..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.ly +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a1c0b621525b8e88c3775ea4c60c2197d1e1b060ace9bad9d6efcb0532817e44 -size 9356 diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.prefab b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.prefab new file mode 100644 index 0000000000..46c01bbb0f --- /dev/null +++ b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.prefab @@ -0,0 +1,620 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Entity_[3263440934733]", + "Entity_[3263440934733]" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 6861302815203973165 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1172344194419]": { + "Id": "Entity_[1172344194419]", + "Name": "Shader Ball", + "Components": { + "Component_[10789351944715265527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10789351944715265527 + }, + "Component_[12037033284781049225]": { + "$type": "EditorEntitySortComponent", + "Id": 12037033284781049225 + }, + "Component_[13759153306105970079]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13759153306105970079 + }, + "Component_[14135560884830586279]": { + "$type": "EditorInspectorComponent", + "Id": 14135560884830586279 + }, + "Component_[16247165675903986673]": { + "$type": "EditorVisibilityComponent", + "Id": 16247165675903986673 + }, + "Component_[18082433625958885247]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18082433625958885247 + }, + "Component_[6472623349872972660]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6472623349872972660, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Rotate": [ + 0.0, + 0.10000000149011612, + 180.0 + ] + } + }, + "Component_[6495255223970673916]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 6495255223970673916, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}", + "subId": 281415304 + }, + "assetHint": "objects/shaderball/shaderball_default_1m.azmodel" + } + } + } + }, + "Component_[8056625192494070973]": { + "$type": "SelectionComponent", + "Id": 8056625192494070973 + }, + "Component_[8550141614185782969]": { + "$type": "EditorEntityIconComponent", + "Id": 8550141614185782969 + }, + "Component_[9439770997198325425]": { + "$type": "EditorLockComponent", + "Id": 9439770997198325425 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1172344194419]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + }, + "Entity_[3263440934733]": { + "Id": "Entity_[3263440934733]", + "Name": "Auth", + "Components": { + "Component_[10677660472305013611]": { + "$type": "EditorPendingCompositionComponent", + "Id": 10677660472305013611 + }, + "Component_[12020966173483420539]": { + "$type": "EditorInspectorComponent", + "Id": 12020966173483420539 + }, + "Component_[1395011275436594572]": { + "$type": "EditorLockComponent", + "Id": 1395011275436594572 + }, + "Component_[14204408480276164321]": { + "$type": "EditorScriptCanvasComponent", + "Id": 14204408480276164321, + "m_name": "PasswordSignIn.scriptcanvas", + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "id": "{DA0FCA2B-66E4-575B-802E-BA93F35690C1}" + } + }, + "sourceHandle": { + "id": "{DA0FCA2B-66E4-575B-802E-BA93F35690C1}" + } + }, + "Component_[15510129631063791276]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15510129631063791276 + }, + "Component_[2829815269827202953]": { + "$type": "EditorEntitySortComponent", + "Id": 2829815269827202953 + }, + "Component_[4152540778425032559]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 4152540778425032559, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 0.0, + 0.10000038146972656, + 4.005923748016357 + ] + } + }, + "Component_[4562090268412258507]": { + "$type": "EditorEntityIconComponent", + "Id": 4562090268412258507 + }, + "Component_[4826060551136971267]": { + "$type": "SelectionComponent", + "Id": 4826060551136971267 + }, + "Component_[8974703175361704047]": { + "$type": "EditorVisibilityComponent", + "Id": 8974703175361704047 + }, + "Component_[9513341577149946975]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9513341577149946975 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/filelist.xml b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/filelist.xml deleted file mode 100644 index ce3f3f3407..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/filelist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/level.pak b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/level.pak deleted file mode 100644 index 1af55520b6..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/level.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f318a1787069385de291660f79e350cea2ca2c3ef3b5e0576686066bd9c49395 -size 3667 diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.ly b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.ly deleted file mode 100644 index b3f66ff34a..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.ly +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:afc5d665128738e6bea09e78a16ee38acc923a8ecefff90d987858ce72c395fa -size 9360 diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.prefab b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.prefab new file mode 100644 index 0000000000..3d85ec02a5 --- /dev/null +++ b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.prefab @@ -0,0 +1,620 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Entity_[3851851454285]", + "Entity_[3851851454285]" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 6861302815203973165 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1172344194419]": { + "Id": "Entity_[1172344194419]", + "Name": "Shader Ball", + "Components": { + "Component_[10789351944715265527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10789351944715265527 + }, + "Component_[12037033284781049225]": { + "$type": "EditorEntitySortComponent", + "Id": 12037033284781049225 + }, + "Component_[13759153306105970079]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13759153306105970079 + }, + "Component_[14135560884830586279]": { + "$type": "EditorInspectorComponent", + "Id": 14135560884830586279 + }, + "Component_[16247165675903986673]": { + "$type": "EditorVisibilityComponent", + "Id": 16247165675903986673 + }, + "Component_[18082433625958885247]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18082433625958885247 + }, + "Component_[6472623349872972660]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6472623349872972660, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Rotate": [ + 0.0, + 0.10000000149011612, + 180.0 + ] + } + }, + "Component_[6495255223970673916]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 6495255223970673916, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}", + "subId": 281415304 + }, + "assetHint": "objects/shaderball/shaderball_default_1m.azmodel" + } + } + } + }, + "Component_[8056625192494070973]": { + "$type": "SelectionComponent", + "Id": 8056625192494070973 + }, + "Component_[8550141614185782969]": { + "$type": "EditorEntityIconComponent", + "Id": 8550141614185782969 + }, + "Component_[9439770997198325425]": { + "$type": "EditorLockComponent", + "Id": 9439770997198325425 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1172344194419]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + }, + "Entity_[3851851454285]": { + "Id": "Entity_[3851851454285]", + "Name": "Auth", + "Components": { + "Component_[10199578265902796701]": { + "$type": "EditorScriptCanvasComponent", + "Id": 10199578265902796701, + "m_name": "PasswordSignUp.scriptcanvas", + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "id": "{367CEE66-3A7D-549E-BD69-C63612B3F12D}" + } + }, + "sourceHandle": { + "id": "{367CEE66-3A7D-549E-BD69-C63612B3F12D}" + } + }, + "Component_[10665743855533689275]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10665743855533689275 + }, + "Component_[15982638153420818774]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15982638153420818774, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 0.0, + 0.10000038146972656, + 4.005923748016357 + ] + } + }, + "Component_[17743308263820862394]": { + "$type": "EditorOnlyEntityComponent", + "Id": 17743308263820862394 + }, + "Component_[18074634570765223479]": { + "$type": "SelectionComponent", + "Id": 18074634570765223479 + }, + "Component_[3471158028107369345]": { + "$type": "EditorEntityIconComponent", + "Id": 3471158028107369345 + }, + "Component_[376079292001997684]": { + "$type": "EditorInspectorComponent", + "Id": 376079292001997684 + }, + "Component_[4387781728620577034]": { + "$type": "EditorLockComponent", + "Id": 4387781728620577034 + }, + "Component_[8591645353763910598]": { + "$type": "EditorEntitySortComponent", + "Id": 8591645353763910598 + }, + "Component_[9373910525775599099]": { + "$type": "EditorVisibilityComponent", + "Id": 9373910525775599099 + }, + "Component_[9394316863271268125]": { + "$type": "EditorPendingCompositionComponent", + "Id": 9394316863271268125 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/filelist.xml b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/filelist.xml deleted file mode 100644 index 6565342dd4..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/filelist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/level.pak b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/level.pak deleted file mode 100644 index 781de219f7..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/level.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:87882b64688a77815d93c6973929fa21b89dc6c13d4866c710124ce2cd0f411e -size 3652 diff --git a/AutomatedTesting/Levels/AWS/Core/Core.ly b/AutomatedTesting/Levels/AWS/Core/Core.ly deleted file mode 100644 index 8b01ee7abe..0000000000 --- a/AutomatedTesting/Levels/AWS/Core/Core.ly +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5242a9b598bc329ef2af2b114092e4e50c7c398cdde4605a0717b0b3ce66d797 -size 10030 diff --git a/AutomatedTesting/Levels/AWS/Core/Core.prefab b/AutomatedTesting/Levels/AWS/Core/Core.prefab new file mode 100644 index 0000000000..3d2749849b --- /dev/null +++ b/AutomatedTesting/Levels/AWS/Core/Core.prefab @@ -0,0 +1,758 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Entity_[1386540226381]", + "Entity_[1390835193677]", + "Entity_[1395130160973]", + "Entity_[1395130160973]" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 6861302815203973165 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1172344194419]": { + "Id": "Entity_[1172344194419]", + "Name": "Shader Ball", + "Components": { + "Component_[10789351944715265527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10789351944715265527 + }, + "Component_[12037033284781049225]": { + "$type": "EditorEntitySortComponent", + "Id": 12037033284781049225 + }, + "Component_[13759153306105970079]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13759153306105970079 + }, + "Component_[14135560884830586279]": { + "$type": "EditorInspectorComponent", + "Id": 14135560884830586279 + }, + "Component_[16247165675903986673]": { + "$type": "EditorVisibilityComponent", + "Id": 16247165675903986673 + }, + "Component_[18082433625958885247]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18082433625958885247 + }, + "Component_[6472623349872972660]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6472623349872972660, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Rotate": [ + 0.0, + 0.10000000149011612, + 180.0 + ] + } + }, + "Component_[6495255223970673916]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 6495255223970673916, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}", + "subId": 281415304 + }, + "assetHint": "objects/shaderball/shaderball_default_1m.azmodel" + } + } + } + }, + "Component_[8056625192494070973]": { + "$type": "SelectionComponent", + "Id": 8056625192494070973 + }, + "Component_[8550141614185782969]": { + "$type": "EditorEntityIconComponent", + "Id": 8550141614185782969 + }, + "Component_[9439770997198325425]": { + "$type": "EditorLockComponent", + "Id": 9439770997198325425 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1172344194419]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + }, + "Entity_[1386540226381]": { + "Id": "Entity_[1386540226381]", + "Name": "s3", + "Components": { + "Component_[11158492000035348927]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 11158492000035348927 + }, + "Component_[13101294672800983417]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13101294672800983417 + }, + "Component_[13312594438559441372]": { + "$type": "EditorEntitySortComponent", + "Id": 13312594438559441372 + }, + "Component_[14532086496432860950]": { + "$type": "EditorVisibilityComponent", + "Id": 14532086496432860950 + }, + "Component_[15284288439796123368]": { + "$type": "EditorOnlyEntityComponent", + "Id": 15284288439796123368 + }, + "Component_[17553238493971510581]": { + "$type": "EditorScriptCanvasComponent", + "Id": 17553238493971510581, + "m_name": "s3demo.scriptcanvas", + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "id": "{D72821C5-1C31-5AE5-891D-30371C49B9E0}" + } + }, + "sourceHandle": { + "id": "{D72821C5-1C31-5AE5-891D-30371C49B9E0}" + } + }, + "Component_[17621265899133139471]": { + "$type": "EditorLockComponent", + "Id": 17621265899133139471 + }, + "Component_[2763569637558196086]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 2763569637558196086, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 0.0, + 0.10000038146972656, + 4.005923748016357 + ] + } + }, + "Component_[3946146016045577093]": { + "$type": "SelectionComponent", + "Id": 3946146016045577093 + }, + "Component_[4521094551057628689]": { + "$type": "EditorInspectorComponent", + "Id": 4521094551057628689 + }, + "Component_[5378520857609165944]": { + "$type": "EditorEntityIconComponent", + "Id": 5378520857609165944 + } + } + }, + "Entity_[1390835193677]": { + "Id": "Entity_[1390835193677]", + "Name": "dynamodb", + "Components": { + "Component_[13579073750136791325]": { + "$type": "EditorVisibilityComponent", + "Id": 13579073750136791325 + }, + "Component_[14581079376974874313]": { + "$type": "EditorEntitySortComponent", + "Id": 14581079376974874313 + }, + "Component_[15354545119837386836]": { + "$type": "SelectionComponent", + "Id": 15354545119837386836 + }, + "Component_[15913971829919706180]": { + "$type": "EditorEntityIconComponent", + "Id": 15913971829919706180 + }, + "Component_[17308449372189366987]": { + "$type": "EditorPendingCompositionComponent", + "Id": 17308449372189366987 + }, + "Component_[17741852956994822371]": { + "$type": "EditorOnlyEntityComponent", + "Id": 17741852956994822371 + }, + "Component_[4363122368868820254]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4363122368868820254 + }, + "Component_[4890242568951925088]": { + "$type": "EditorScriptCanvasComponent", + "Id": 4890242568951925088, + "m_name": "dynamodbdemo.scriptcanvas", + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "id": "{004B97C6-75F3-5B95-ADA4-EBF751EEF697}" + } + }, + "sourceHandle": { + "id": "{004B97C6-75F3-5B95-ADA4-EBF751EEF697}" + } + }, + "Component_[7140725680315799866]": { + "$type": "EditorLockComponent", + "Id": 7140725680315799866 + }, + "Component_[8431133659360426398]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 8431133659360426398, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 0.0, + 0.10000038146972656, + 4.005923748016357 + ] + } + }, + "Component_[9486500593077263666]": { + "$type": "EditorInspectorComponent", + "Id": 9486500593077263666 + } + } + }, + "Entity_[1395130160973]": { + "Id": "Entity_[1395130160973]", + "Name": "lambda", + "Components": { + "Component_[14224781635611846065]": { + "$type": "SelectionComponent", + "Id": 14224781635611846065 + }, + "Component_[14532864313352417822]": { + "$type": "EditorInspectorComponent", + "Id": 14532864313352417822 + }, + "Component_[14621438229914413040]": { + "$type": "EditorEntitySortComponent", + "Id": 14621438229914413040 + }, + "Component_[15642112885025274607]": { + "$type": "EditorLockComponent", + "Id": 15642112885025274607 + }, + "Component_[16340039184260739086]": { + "$type": "EditorVisibilityComponent", + "Id": 16340039184260739086 + }, + "Component_[17170806711467412600]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17170806711467412600, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 0.0, + 0.10000038146972656, + 4.005923748016357 + ] + } + }, + "Component_[18080677632538463069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18080677632538463069 + }, + "Component_[2663457305102263144]": { + "$type": "EditorEntityIconComponent", + "Id": 2663457305102263144 + }, + "Component_[4954526281430171003]": { + "$type": "EditorOnlyEntityComponent", + "Id": 4954526281430171003 + }, + "Component_[6251151424244415885]": { + "$type": "EditorScriptCanvasComponent", + "Id": 6251151424244415885, + "m_name": "lambdademo.scriptcanvas", + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "id": "{3DCA213D-534E-5C86-9308-2F7675A08029}" + } + }, + "sourceHandle": { + "id": "{3DCA213D-534E-5C86-9308-2F7675A08029}" + } + }, + "Component_[6526999075003995619]": { + "$type": "EditorPendingCompositionComponent", + "Id": 6526999075003995619 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/AWS/Core/filelist.xml b/AutomatedTesting/Levels/AWS/Core/filelist.xml deleted file mode 100644 index 9d1fcd2e83..0000000000 --- a/AutomatedTesting/Levels/AWS/Core/filelist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AutomatedTesting/Levels/AWS/Core/level.pak b/AutomatedTesting/Levels/AWS/Core/level.pak deleted file mode 100644 index 01b79da84e..0000000000 --- a/AutomatedTesting/Levels/AWS/Core/level.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4ba2f409fc974c72b8ee8b660d200ed1d013ee8408419b0e91d6d487e71e4997 -size 3774 diff --git a/AutomatedTesting/Levels/AWS/Metrics/Metrics.ly b/AutomatedTesting/Levels/AWS/Metrics/Metrics.ly deleted file mode 100644 index 12998e89be..0000000000 --- a/AutomatedTesting/Levels/AWS/Metrics/Metrics.ly +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:023992998ab5a1d64b38dacd1d5e1a9dc930ff704289c0656ed6eaba6951d660 -size 9066 diff --git a/AutomatedTesting/Levels/AWS/Metrics/Metrics.prefab b/AutomatedTesting/Levels/AWS/Metrics/Metrics.prefab new file mode 100644 index 0000000000..7f4144d734 --- /dev/null +++ b/AutomatedTesting/Levels/AWS/Metrics/Metrics.prefab @@ -0,0 +1,627 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Entity_[2086619895629]", + "Entity_[2086619895629]" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 6861302815203973165 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1172344194419]": { + "Id": "Entity_[1172344194419]", + "Name": "Shader Ball", + "Components": { + "Component_[10789351944715265527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10789351944715265527 + }, + "Component_[12037033284781049225]": { + "$type": "EditorEntitySortComponent", + "Id": 12037033284781049225 + }, + "Component_[13759153306105970079]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13759153306105970079 + }, + "Component_[14135560884830586279]": { + "$type": "EditorInspectorComponent", + "Id": 14135560884830586279 + }, + "Component_[16247165675903986673]": { + "$type": "EditorVisibilityComponent", + "Id": 16247165675903986673 + }, + "Component_[18082433625958885247]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18082433625958885247 + }, + "Component_[6472623349872972660]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6472623349872972660, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Rotate": [ + 0.0, + 0.10000000149011612, + 180.0 + ] + } + }, + "Component_[6495255223970673916]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 6495255223970673916, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}", + "subId": 281415304 + }, + "assetHint": "objects/shaderball/shaderball_default_1m.azmodel" + } + } + } + }, + "Component_[8056625192494070973]": { + "$type": "SelectionComponent", + "Id": 8056625192494070973 + }, + "Component_[8550141614185782969]": { + "$type": "EditorEntityIconComponent", + "Id": 8550141614185782969 + }, + "Component_[9439770997198325425]": { + "$type": "EditorLockComponent", + "Id": 9439770997198325425 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1172344194419]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + }, + "Entity_[2086619895629]": { + "Id": "Entity_[2086619895629]", + "Name": "metrics", + "Components": { + "Component_[10664937239001700943]": { + "$type": "SelectionComponent", + "Id": 10664937239001700943 + }, + "Component_[12411100785613400502]": { + "$type": "EditorVisibilityComponent", + "Id": 12411100785613400502 + }, + "Component_[13461617945403887462]": { + "$type": "EditorEntityIconComponent", + "Id": 13461617945403887462 + }, + "Component_[1398528805938487915]": { + "$type": "EditorInspectorComponent", + "Id": 1398528805938487915 + }, + "Component_[15586634767575159325]": { + "$type": "EditorEntitySortComponent", + "Id": 15586634767575159325 + }, + "Component_[1737734807882912852]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1737734807882912852 + }, + "Component_[2398400563175352537]": { + "$type": "EditorOnlyEntityComponent", + "Id": 2398400563175352537 + }, + "Component_[3845542252660517302]": { + "$type": "EditorPendingCompositionComponent", + "Id": 3845542252660517302 + }, + "Component_[3873433240186817282]": { + "$type": "EditorLockComponent", + "Id": 3873433240186817282 + }, + "Component_[4474288881478318615]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 4474288881478318615, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 0.0, + 0.10000038146972656, + 4.005923748016357 + ] + } + }, + "Component_[5865591669658426602]": { + "$type": "ScriptEditorComponent", + "Id": 5865591669658426602, + "ScriptComponent": { + "Script": { + "assetId": { + "guid": "{50D66834-9277-5469-892E-DAD087FF4C0E}", + "subId": 1 + }, + "loadBehavior": "QueueLoad", + "assetHint": "levels/aws/metrics/script/metrics.luac" + } + }, + "ScriptAsset": { + "assetId": { + "guid": "{50D66834-9277-5469-892E-DAD087FF4C0E}", + "subId": 1 + }, + "assetHint": "levels/aws/metrics/script/metrics.luac" + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/AWS/Metrics/filelist.xml b/AutomatedTesting/Levels/AWS/Metrics/filelist.xml deleted file mode 100644 index 3539102346..0000000000 --- a/AutomatedTesting/Levels/AWS/Metrics/filelist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AutomatedTesting/Levels/AWS/Metrics/level.pak b/AutomatedTesting/Levels/AWS/Metrics/level.pak deleted file mode 100644 index fd1f5ac6ad..0000000000 --- a/AutomatedTesting/Levels/AWS/Metrics/level.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e7c0c07b13bb64db344b94d5712e1e802e607a9dee506768b34481f4a76d8505 -size 3593 diff --git a/scripts/build/Platform/Linux/deploy_cdk_applications.sh b/scripts/build/Platform/Linux/deploy_cdk_applications.sh new file mode 100755 index 0000000000..93a3dccd9f --- /dev/null +++ b/scripts/build/Platform/Linux/deploy_cdk_applications.sh @@ -0,0 +1,106 @@ +#!/bin/bash + +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# + +# Deploy the CDK applications for AWS gems (Linux only) +# Prerequisites: +# 1) Node.js is installed +# 2) Node.js version >= 10.13.0, except for versions 13.0.0 - 13.6.0. A version in active long-term support is recommended. + +SOURCE_DIRECTORY=$(dirname "$0") +PATH=$SOURCE_DIRECTORY/python:$PATH +GEM_DIRECTORY=$SOURCE_DIRECTORY/Gems + +DeployCDKApplication() +{ + # Deploy the CDK application for a specific AWS gem + GEM_NAME=$1 + ADDITIONAL_ARGUMENTS=$2 + echo [cdk_deployment] Deploy the CDK application for the $GEM_NAME gem + pushd $GEM_DIRECTORY/$GEM_NAME/cdk + + # Revert the CDK application code to a stable state using the provided commit ID + if ! git checkout $COMMIT_ID -- .; + then + echo [git_checkout] Failed to checkout the CDK application for the $GEM_NAME gem using commit ID $COMMIT_ID + popd + exit 1 + fi + + # Install required packages for the CDK application + if ! python -m pip install -r requirements.txt; + then + echo [cdk_deployment] Failed to install required packages for the $GEM_NAME gem + popd + exit 1 + fi + + # Deploy the CDK application + if ! cdk deploy $ADDITIONAL_ARGUMENTS --require-approval never; + then + echo [cdk_deployment] Failed to deploy the CDK application for the $GEM_NAME gem + popd + exit 1 + fi + popd +} + +# Create and activate a virtualenv for the CDK deployment +if ! python/python.sh -m venv .env; +then + echo [cdk_bootstrap] Failed to create a virtualenv for the CDK deployment + exit 1 +fi +if ! source .env/bin/activate; +then + echo [cdk_bootstrap] Failed to activate the virtualenv for the CDK deployment + exit 1 +fi + +echo [cdk_installation] Install the latest version of CDK +if ! sudo npm uninstall -g aws-cdk; +then + echo [cdk_bootstrap] Failed to uninstall the current version of CDK + exit 1 +fi +if ! sudo npm install -g aws-cdk@latest; +then + echo [cdk_bootstrap] Failed to install the latest version of CDK + exit 1 +fi + +# Set temporary AWS credentials from the assume role +credentials=$(aws sts assume-role --query Credentials.[SecretAccessKey,SessionToken,AccessKeyId] --output text --role-arn $ASSUME_ROLE_ARN --role-session-name o3de-Automation-session) +AWS_SECRET_ACCESS_KEY=$(echo "$credentials" | cut -d' ' -f1) +AWS_SESSION_TOKEN=$(echo "$credentials" | cut -d' ' -f2) +AWS_ACCESS_KEY_ID=$(echo "$credentials" | cut -d' ' -f3) + +O3DE_AWS_DEPLOY_ACCOUNT=$(echo "$ASSUME_ROLE_ARN" | cut -d':' -f5) + +# Bootstrap and deploy the CDK applications +echo [cdk_bootstrap] Bootstrap CDK +if ! cdk bootstrap aws://$O3DE_AWS_DEPLOY_ACCOUNT/$O3DE_AWS_DEPLOY_REGION; +then + echo [cdk_bootstrap] Failed to bootstrap CDK + exit 1 +fi + +if ! DeployCDKApplication AWSCore "-c disable_access_log=true -c remove_all_storage_on_destroy=true --all"; +then + exit 1 +fi +if ! DeployCDKApplication AWSClientAuth; +then + exit 1 +fi +if ! DeployCDKApplication AWSMetrics "-c batch_processing=true"; +then + exit 1 +fi + +exit 0 + diff --git a/scripts/build/Platform/Linux/destroy_cdk_applications.sh b/scripts/build/Platform/Linux/destroy_cdk_applications.sh new file mode 100755 index 0000000000..795ab78484 --- /dev/null +++ b/scripts/build/Platform/Linux/destroy_cdk_applications.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# + +# Deploy the CDK applications for AWS gems (Linux only) +# Prerequisites: +# 1) Node.js is installed +# 2) Node.js version >= 10.13.0, except for versions 13.0.0 - 13.6.0. A version in active long-term support is recommended. + +SOURCE_DIRECTORY=$(dirname "$0") +PATH=$SOURCE_DIRECTORY/python:$PATH +GEM_DIRECTORY=$SOURCE_DIRECTORY/Gems + +DestroyCDKApplication() +{ +# Destroy the CDK application for a specific AWS gem +GEM_NAME=$1 +echo [cdk_destruction] Destroy the CDK application for the $GEM_NAME gem +pushd $GEM_DIRECTORY/$GEM_NAME/cdk + +# Revert the CDK application code to a stable state using the provided commit ID +if ! git checkout $COMMIT_ID -- .; +then + echo [git_checkout] Failed to checkout the CDK application for the $GEM_NAME gem using commit ID $COMMIT_ID + popd + return 1 +fi + +# Install required packages for the CDK application +if ! python -m pip install -r requirements.txt; +then + echo [cdk_destruction] Failed to install required packages for the $GEM_NAME gem + popd + return 1 +fi + +# Destroy the CDK application +if ! cdk destroy --all -f; +then + echo [cdk_destruction] Failed to destroy the CDK application for the $GEM_NAME gem + popd + return 1 +fi +popd +return 0 +} + +# Create and activate a virtualenv for the CDK deployment +if ! python/python.sh -m venv .env; +then + echo [cdk_bootstrap] Failed to create a virtualenv for the CDK deployment + return 1 +fi +if ! source .env/bin/activate; +then + echo [cdk_bootstrap] Failed to activate the virtualenv for the CDK deployment + exit 1 +fi + +echo [cdk_installation] Install the latest version of CDK +if ! sudo npm uninstall -g aws-cdk; +then + echo [cdk_bootstrap] Failed to uninstall the current version of CDK + exit 1 +fi +if ! sudo npm install -g aws-cdk@latest; +then + echo [cdk_bootstrap] Failed to install the latest version of CDK + exit 1 +fi + +# Set temporary AWS credentials from the assume role +credentials=$(aws sts assume-role --query Credentials.[SecretAccessKey,SessionToken,AccessKeyId] --output text --role-arn $ASSUME_ROLE_ARN --role-session-name o3de-Automation-session) +AWS_SECRET_ACCESS_KEY=$(echo "$credentials" | cut -d' ' -f1) +AWS_SESSION_TOKEN=$(echo "$credentials" | cut -d' ' -f2) +AWS_ACCESS_KEY_ID=$(echo "$credentials" | cut -d' ' -f3) + +ERROR_EXISTS=0 +DestroyCDKApplication AWSCore +ERROR_EXISTS=$? +DestroyCDKApplication AWSClientAuth +ERROR_EXISTS=$? +DestroyCDKApplication AWSMetrics +ERROR_EXISTS=$? + +if [ $ERROR_EXISTS -eq 1 ] +then + exit 1 +fi + +exit 0 + From 92b0514b4842ab75ca5dcad86a6d084e95f59e9f Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Mon, 20 Dec 2021 15:20:38 -0600 Subject: [PATCH 162/399] Merge commit 'fb36145e2e1f34574948233aa65eaa97f20e6e67' into mbalfour/gitflow_211220_stabilization_2111RTE # Conflicts: # Gems/Atom/RHI/Metal/Code/Source/RHI/ShaderResourceGroupPool.cpp Also fixed bad merge on ScripCanvas MainWindow.cpp Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 37ef63c1a1..f0bee2171a 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1617,7 +1617,6 @@ namespace ScriptCanvasEditor } PrepareAssetForSave(inMemoryAssetId); - ScriptCanvasAssetDescription assetDescription; AZStd::string suggestedFilename; AZStd::string suggestedFileFilter; From 1845eba6eeb8c141857bdc8a8b5a26daa73074b0 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Mon, 20 Dec 2021 16:33:36 -0600 Subject: [PATCH 163/399] Fixed compile error. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp b/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp index c6c08ca9ae..b7362a5e61 100644 --- a/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp +++ b/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp @@ -74,6 +74,11 @@ namespace AZ { return GetCurrentSerializeContextModule().CreateGenericClassInfo(); } + + static const Uuid& GetClassTypeId() + { + return GetGenericInfo()->GetClassData()->m_typeId; + } }; } // namespace AZ From bbd00adadeaf315a615b1e08259f44763a5272fb Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 20 Dec 2021 16:54:06 -0800 Subject: [PATCH 164/399] Address some AZ::Dom::Value feedback - Use a vector for shared string storage (to avoid the double heap allocation for AZStd::string) - Use a shared heap allocated any for opaque types (instead of an unsafe ref) - Add a string comparison key lookup benchmark to measure the impact of Name Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 49 ++++++++------- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 59 +++++++++---------- .../AzCore/AzCore/DOM/DomValueWriter.cpp | 2 +- .../AzCore/AzCore/DOM/DomValueWriter.h | 2 +- .../AzCore/AzCore/DOM/DomVisitor.cpp | 4 +- Code/Framework/AzCore/AzCore/DOM/DomVisitor.h | 5 +- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 29 +++++++++ 7 files changed, 91 insertions(+), 59 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index dcecc67460..3dafc02c6e 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -19,7 +19,7 @@ namespace AZ::Dom { if (refCountedPointer.use_count() > 1) { - AZStd::shared_ptr newPointer = AZStd::allocate_shared(AZStdAlloc()); + AZStd::shared_ptr newPointer = AZStd::allocate_shared(StdValueAllocator()); *newPointer = *refCountedPointer; refCountedPointer = AZStd::move(newPointer); } @@ -92,12 +92,12 @@ namespace AZ::Dom } } - Value::Value(AZStd::any* value) - : m_value(value) + Value::Value(const AZStd::any& value) + : m_value(AZStd::allocate_shared(StdValueAllocator(), value)) { } - Value Value::FromOpaqueValue(AZStd::any& value) + Value Value::FromOpaqueValue(const AZStd::any& value) { return Value(&value); } @@ -330,7 +330,7 @@ namespace AZ::Dom Value& Value::SetObject() { - m_value = AZStd::allocate_shared(AZStdAlloc()); + m_value = AZStd::allocate_shared(StdValueAllocator()); return *this; } @@ -634,7 +634,7 @@ namespace AZ::Dom Value& Value::SetArray() { - m_value = AZStd::allocate_shared(AZStdAlloc()); + m_value = AZStd::allocate_shared(StdValueAllocator()); return *this; } @@ -740,7 +740,7 @@ namespace AZ::Dom void Value::SetNode(AZ::Name name) { - m_value = AZStd::allocate_shared(AZStdAlloc(), name); + m_value = AZStd::allocate_shared(StdValueAllocator(), name); } void Value::SetNode(AZStd::string_view name) @@ -914,9 +914,9 @@ namespace AZ::Dom m_value = aznumeric_cast(value); } - void Value::SetString(AZStd::shared_ptr string) + void Value::SetString(SharedStringType sharedString) { - m_value = string; + m_value = sharedString; } AZStd::string_view Value::GetString() const @@ -925,12 +925,15 @@ namespace AZ::Dom { case 5: // AZStd::string_view return AZStd::get(m_value); - case 6: // AZStd::shared_ptr - return *AZStd::get>(m_value); + case 6: // AZStd::shared_ptr> + { + auto& buffer = *AZStd::get(m_value); + return { buffer.data(), buffer.size() }; + } case 7: // ShortStringType { - const ShortStringType& ShortString = AZStd::get(m_value); - return { ShortString.m_data.data(), ShortString.m_size }; + const ShortStringType& shortString = AZStd::get(m_value); + return { shortString.data(), shortString.size() }; } } AZ_Assert(false, "AZ::Dom::Value: Called GetString on a non-string type"); @@ -947,8 +950,8 @@ namespace AZ::Dom if (value.size() <= ShortStringSize) { ShortStringType buffer; - buffer.m_size = value.size(); - memcpy(buffer.m_data.data(), value.data(), buffer.m_size); + buffer.resize_no_construct(value.size()); + memcpy(buffer.data(), value.data(), value.size()); m_value = buffer; } m_value = value; @@ -962,18 +965,20 @@ namespace AZ::Dom } else { - m_value = AZStd::allocate_shared(AZStdAlloc(), value); + SharedStringType sharedString = + AZStd::allocate_shared(StdValueAllocator(), value.begin(), value.end()); + m_value = AZStd::move(sharedString); } } - AZStd::any& Value::GetOpaqueValue() const + const AZStd::any& Value::GetOpaqueValue() const { - return *AZStd::get(m_value); + return *AZStd::get>(m_value); } - void Value::SetOpaqueValue(AZStd::any& value) + void Value::SetOpaqueValue(const AZStd::any& value) { - m_value = &value; + m_value = AZStd::allocate_shared(StdValueAllocator(), value); } void Value::SetNull() @@ -1014,7 +1019,7 @@ namespace AZ::Dom { result = visitor.String(arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); } - else if constexpr (AZStd::is_same_v>) + else if constexpr (AZStd::is_same_v) { result = visitor.RefCountedString(arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); } @@ -1110,7 +1115,7 @@ namespace AZ::Dom if (IsString() && other.IsString()) { // If we both hold the same ref counted string we don't need to do a full comparison - if (AZStd::holds_alternative>(m_value) && m_value == other.m_value) + if (AZStd::holds_alternative(m_value) && m_value == other.m_value) { return true; } diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 1b69c73ecc..bc1b790009 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -55,13 +55,15 @@ namespace AZ::Dom } }; + using StdValueAllocator = AZStdAlloc; + class Value; //! Internal storage for a Value array: an ordered list of Values. class Array { public: - using ContainerType = AZStd::vector>; + using ContainerType = AZStd::vector; using Iterator = ContainerType::iterator; using ConstIterator = ContainerType::const_iterator; static constexpr const size_t ReserveIncrement = 4; @@ -80,7 +82,7 @@ namespace AZ::Dom { public: using EntryType = AZStd::pair; - using ContainerType = AZStd::vector>; + using ContainerType = AZStd::vector; using Iterator = ContainerType::iterator; using ConstIterator = ContainerType::const_iterator; static constexpr const size_t ReserveIncrement = 8; @@ -150,6 +152,13 @@ namespace AZ::Dom class Value final { public: + // Determine the short string buffer size based on the size of our largest internal type (string_view) + // minus the size of the short string size field. + static constexpr const size_t ShortStringSize = sizeof(AZStd::string_view) - 2; + using ShortStringType = AZStd::fixed_string; + using SharedStringContainer = AZStd::vector; + using SharedStringType = AZStd::shared_ptr; + // Constructors... Value(); Value(const Value&); @@ -167,7 +176,7 @@ namespace AZ::Dom explicit Value(Type type); - static Value FromOpaqueValue(AZStd::any& value); + static Value FromOpaqueValue(const AZStd::any& value); // Equality / comparison / swap... Value& operator=(const Value&); @@ -306,17 +315,17 @@ namespace AZ::Dom AZStd::string_view GetString() const; size_t GetStringLength() const; void SetString(AZStd::string_view); - void SetString(AZStd::shared_ptr); + void SetString(SharedStringType sharedString); void CopyFromString(AZStd::string_view); // Opaque type API... - AZStd::any& GetOpaqueValue() const; + const AZStd::any& GetOpaqueValue() const; //! This sets this Value to represent a value of an type that the DOM has //! no formal knowledge of. Where possible, it should be preferred to //! serialize an opaque type into a DOM value instead, as serializers //! and other systems will have no means of dealing with fully arbitrary //! values. - void SetOpaqueValue(AZStd::any&); + void SetOpaqueValue(const AZStd::any&); // Null API... void SetNull(); @@ -336,49 +345,37 @@ namespace AZ::Dom const Array::ContainerType& GetArrayInternal() const; Array::ContainerType& GetArrayInternal(); - explicit Value(AZStd::any* opaqueValue); - - // Determine the short string buffer size based on the size of our largest internal type (string_view) - // minus the size of the short string size field. - static constexpr const size_t ShortStringSize = sizeof(AZStd::string_view) - sizeof(size_t); - struct ShortStringType - { - AZStd::array m_data; - size_t m_size; - - bool operator==(const ShortStringType& other) const - { - return m_size == other.m_size ? memcmp(m_data.data(), other.m_data.data(), m_size) == 0 : false; - } - }; + explicit Value(const AZStd::any& opaqueValue); //! The internal storage type for Value. //! These types do not correspond one-to-one with the Value's external Type as there may be multiple storage classes //! for the same type in some instances, such as string storage. using ValueType = AZStd::variant< - // NullType + // Null AZStd::monostate, - // NumberType + // Int64 int64_t, + // Uint64 uint64_t, + // Double double, - // FalseType & TrueType + // Bool bool, // StringType AZStd::string_view, - AZStd::shared_ptr, + SharedStringType, ShortStringType, - // ObjectType + // Object ObjectPtr, - // ArrayType + // Array ArrayPtr, - // NodeType + // Node NodePtr, - // OpaqueType - AZStd::any*>; + // Opaque + AZStd::shared_ptr>; static_assert( - sizeof(ValueType) == sizeof(AZStd::variant), "ValueType should have no members larger than ShortStringType"); + sizeof(ValueType) == sizeof(ShortStringType) + sizeof(size_t), "ValueType should have no members larger than ShortStringType"); ValueType m_value; }; diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index 172f7f2a92..9b814b1bff 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -68,7 +68,7 @@ namespace AZ::Dom return FinishWrite(); } - Visitor::Result ValueWriter::RefCountedString(AZStd::shared_ptr value, [[maybe_unused]] Lifetime lifetime) + Visitor::Result ValueWriter::RefCountedString(AZStd::shared_ptr> value, [[maybe_unused]] Lifetime lifetime) { CurrentValue().SetString(value); return FinishWrite(); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h index 488535ace6..4fdea293eb 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h @@ -28,7 +28,7 @@ namespace AZ::Dom Result Double(double value) override; Result String(AZStd::string_view value, Lifetime lifetime) override; - Result RefCountedString(AZStd::shared_ptr value, Lifetime lifetime) override; + Result RefCountedString(AZStd::shared_ptr> value, Lifetime lifetime) override; Result StartObject() override; Result EndObject(AZ::u64 attributeCount) override; Result Key(AZ::Name key) override; diff --git a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp index 4e13a2a95c..0da4bcd5d3 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp @@ -105,9 +105,9 @@ namespace AZ::Dom return VisitorSuccess(); } - Visitor::Result Visitor::RefCountedString(AZStd::shared_ptr value, Lifetime lifetime) + Visitor::Result Visitor::RefCountedString(AZStd::shared_ptr> value, Lifetime lifetime) { - return String(*value, lifetime); + return String({ value->data(), value->size() }, lifetime); } Visitor::Result Visitor::OpaqueValue([[maybe_unused]] OpaqueType& value) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h index 3bf1b3419b..f9930f93c6 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h @@ -11,8 +11,9 @@ #include #include #include -#include +#include #include +#include namespace AZ::Dom { @@ -176,7 +177,7 @@ namespace AZ::Dom //! Operates on a ref-counted string value. S //! \param lifetime Specifies the lifetime of this string. If the string has a temporary lifetime, it may not //! be safely stored as a reference, but may still be safely stored as a ref-counted shared_ptr. - virtual Result RefCountedString(AZStd::shared_ptr value, Lifetime lifetime); + virtual Result RefCountedString(AZStd::shared_ptr> value, Lifetime lifetime); //! Operates on an opaque value. As opaque values are a reference type, storage semantics are provided to //! indicate where the value may be stored persistently or requires a copy. //! The base implementation of OpaqueValue rejects the operation, as opaque values are meant for special diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index 51d2e5c10c..af5b367d63 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -220,4 +220,33 @@ namespace AZ::Dom::Benchmark } BENCHMARK_REGISTER_F(DomValueBenchmark, LookupMemberByString)->Arg(100)->Arg(1000)->Arg(10000)->Unit(benchmark::kMillisecond); + BENCHMARK_DEFINE_F(DomValueBenchmark, LookupMemberByStringComparison)(benchmark::State& state) + { + Value value(Type::Object); + AZStd::vector keys; + for (int64_t i = 0; i < state.range(0); ++i) + { + AZStd::string key(AZStd::string::format("key%" PRId64, i)); + keys.push_back(key); + value[key] = i; + } + + for (auto _ : state) + { + for (const AZStd::string& key : keys) + { + const Object::ContainerType& object = value.GetObject(); + benchmark::DoNotOptimize(AZStd::find_if( + object.cbegin(), object.cend(), + [&key](const Object::EntryType& entry) + { + return key == entry.first.GetStringView(); + })); + } + } + + state.SetItemsProcessed(state.iterations() * state.range(0)); + } + BENCHMARK_REGISTER_F(DomValueBenchmark, LookupMemberByStringComparison)->Arg(100)->Arg(1000)->Arg(10000)->Unit(benchmark::kMillisecond); + } // namespace AZ::Dom::Benchmark From a4df91b718b673d676af0dbcd40e9322ec904ff9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Dec 2021 17:38:47 -0800 Subject: [PATCH 165/399] Bump pyyaml in /scripts/build/build_node/Platform/Common (#6514) Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.3.1 to 5.4. - [Release notes](https://github.com/yaml/pyyaml/releases) - [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES) - [Commits](https://github.com/yaml/pyyaml/compare/5.3.1...5.4) --- updated-dependencies: - dependency-name: pyyaml dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../Platform/Common/requirements.txt | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/scripts/build/build_node/Platform/Common/requirements.txt b/scripts/build/build_node/Platform/Common/requirements.txt index 6fb767509e..7375d3e849 100644 --- a/scripts/build/build_node/Platform/Common/requirements.txt +++ b/scripts/build/build_node/Platform/Common/requirements.txt @@ -148,20 +148,28 @@ pywin32==228 \ pyxb==1.2.6 \ --hash=sha256:2a00f38dd1d87b88f92d79bc5a09718d730419b88e814545f472bbd5a3bf27b4 \ # via -r requirements.txt -pyyaml==5.3.1 \ - --hash=sha256:06a0d7ba600ce0b2d2fe2e78453a470b5a6e000a985dd4a4e54e436cc36b0e97 \ - --hash=sha256:240097ff019d7c70a4922b6869d8a86407758333f02203e0fc6ff79c5dcede76 \ - --hash=sha256:4f4b913ca1a7319b33cfb1369e91e50354d6f07a135f3b901aca02aa95940bd2 \ - --hash=sha256:6034f55dab5fea9e53f436aa68fa3ace2634918e8b5994d82f3621c04ff5ed2e \ - --hash=sha256:69f00dca373f240f842b2931fb2c7e14ddbacd1397d57157a9b005a6a9942648 \ - --hash=sha256:73f099454b799e05e5ab51423c7bcf361c58d3206fa7b0d555426b1f4d9a3eaf \ - --hash=sha256:74809a57b329d6cc0fdccee6318f44b9b8649961fa73144a98735b0aaf029f1f \ - --hash=sha256:7739fc0fa8205b3ee8808aea45e968bc90082c10aef6ea95e855e10abf4a37b2 \ - --hash=sha256:95f71d2af0ff4227885f7a6605c37fd53d3a106fcab511b8860ecca9fcf400ee \ - --hash=sha256:ad9c67312c84def58f3c04504727ca879cb0013b2517c85a9a253f0cb6380c0a \ - --hash=sha256:b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d \ - --hash=sha256:cc8955cfbfc7a115fa81d85284ee61147059a753344bc51098f3ccd69b0d7e0c \ - --hash=sha256:d13155f591e6fcc1ec3b30685d50bf0711574e2c0dfffd7644babf8b5102ca1a \ +pyyaml==5.4 \ + --hash=sha256:f7a21e3d99aa3095ef0553e7ceba36fb693998fbb1226f1392ce33681047465f \ + --hash=sha256:5e7ac4e0e79a53451dc2814f6876c2fa6f71452de1498bbe29c0b54b69a986f4 \ + --hash=sha256:52bf0930903818e600ae6c2901f748bc4869c0c406056f679ab9614e5d21a166 \ + --hash=sha256:a36a48a51e5471513a5aea920cdad84cbd56d70a5057cca3499a637496ea379c \ + --hash=sha256:cc552b6434b90d9dbed6a4f13339625dc466fd82597119897e9489c953acbc22 \ + --hash=sha256:0dc9f2eb2e3c97640928dec63fd8dc1dd91e6b6ed236bd5ac00332b99b5c2ff9 \ + --hash=sha256:5a3f345acff76cad4aa9cb171ee76c590f37394186325d53d1aa25318b0d4a09 \ + --hash=sha256:f3790156c606299ff499ec44db422f66f05a7363b39eb9d5b064f17bd7d7c47b \ + --hash=sha256:124fd7c7bc1e95b1eafc60825f2daf67c73ce7b33f1194731240d24b0d1bf628 \ + --hash=sha256:8b818b6c5a920cbe4203b5a6b14256f0e5244338244560da89b7b0f1313ea4b6 \ + --hash=sha256:737bd70e454a284d456aa1fa71a0b429dd527bcbf52c5c33f7c8eee81ac16b89 \ + --hash=sha256:7242790ab6c20316b8e7bb545be48d7ed36e26bbe279fd56f2c4a12510e60b4b \ + --hash=sha256:cc547d3ead3754712223abb7b403f0a184e4c3eae18c9bb7fd15adef1597cc4b \ + --hash=sha256:8635d53223b1f561b081ff4adecb828fd484b8efffe542edcfdff471997f7c39 \ + --hash=sha256:26fcb33776857f4072601502d93e1a619f166c9c00befb52826e7b774efaa9db \ + --hash=sha256:b2243dd033fd02c01212ad5c601dafb44fbb293065f430b0d3dbf03f3254d615 \ + --hash=sha256:31ba07c54ef4a897758563e3a0fcc60077698df10180abe4b8165d9895c00ebf \ + --hash=sha256:02c78d77281d8f8d07a255e57abdbf43b02257f59f50cc6b636937d68efa5dd0 \ + --hash=sha256:fdc6b2cb4b19e431994f25a9160695cc59a4e861710cc6fc97161c5e845fc579 \ + --hash=sha256:8bf38641b4713d77da19e91f8b5296b832e4db87338d6aeffe422d42f1ca896d \ + --hash=sha256:3c49e39ac034fd64fd576d63bb4db53cda89b362768a67f07749d55f128ac18a \ # via -r requirements.txt requests==2.25.0 \ --hash=sha256:7f1a0b932f4a60a1a65caa4263921bb7d9ee911957e0ae4a23a6dd08185ad5f8 \ From 1da99eaea02874f22c1fde8df07e7e730dbd3c6a Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 20 Dec 2021 18:27:00 -0800 Subject: [PATCH 166/399] Add type-safe GetTypeIndex instead of hardcoded index lookups Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 96 ++++++++++++++----- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 54 +++++------ 2 files changed, 97 insertions(+), 53 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 3dafc02c6e..3836568f37 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -26,6 +26,51 @@ namespace AZ::Dom return refCountedPointer; } + namespace Internal + { + template + constexpr size_t GetTypeIndexInternal(size_t index = 0) + { + static_assert(false, "Type not found in ValueType"); + return index; + } + + template + constexpr size_t GetTypeIndexInternal(size_t index = 0) + { + if constexpr (AZStd::is_same_v) + { + return index; + } + else + { + return GetTypeIndexInternal(index + 1); + } + } + + template + struct ExtractTypeArgs + { + }; + + template class TypeToExtract, typename... Args> + struct ExtractTypeArgs> + { + template + static constexpr size_t GetTypeIndex() + { + return GetTypeIndexInternal(); + } + }; + } // namespace Internal + + // Helper function, looks up the index of a type within Value::m_value's storage + template + constexpr size_t GetTypeIndex() + { + return Internal::ExtractTypeArgs::GetTypeIndex(); + } + Node::Node(AZ::Name name) : m_name(name) { @@ -227,27 +272,27 @@ namespace AZ::Dom { switch (m_value.index()) { - case 0: // AZStd::monostate + case GetTypeIndex(): return Type::Null; - case 1: // int64_t + case GetTypeIndex(): return Type::Int64; - case 2: // uint64_t + case GetTypeIndex(): return Type::Uint64; - case 3: // double + case GetTypeIndex(): return Type::Double; - case 4: // bool + case GetTypeIndex(): return Type::Bool; - case 5: // AZStd::string_view - case 6: // AZStd::shared_ptr - case 7: // ShortStringType + case GetTypeIndex(): + case GetTypeIndex(): + case GetTypeIndex(): return Type::String; - case 8: // ObjectPtr + case GetTypeIndex(): return Type::Object; - case 9: // ArrayPtr + case GetTypeIndex(): return Type::Array; - case 10: // NodePtr + case GetTypeIndex(): return Type::Node; - case 11: // AZStd::any* + case GetTypeIndex>(): return Type::Opaque; } AZ_Assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); @@ -813,11 +858,11 @@ namespace AZ::Dom { switch (m_value.index()) { - case 1: // int64_t + case GetTypeIndex(): return AZStd::get(m_value); - case 2: // uint64_t + case GetTypeIndex(): return aznumeric_cast(AZStd::get(m_value)); - case 3: // double + case GetTypeIndex(): return aznumeric_cast(AZStd::get(m_value)); } AZ_Assert(false, "AZ::Dom::Value: Called GetInt on a non-numeric type"); @@ -843,11 +888,11 @@ namespace AZ::Dom { switch (m_value.index()) { - case 1: // int64_t + case GetTypeIndex(): return aznumeric_cast(AZStd::get(m_value)); - case 2: // uint64_t + case GetTypeIndex(): return AZStd::get(m_value); - case 3: // double + case GetTypeIndex(): return aznumeric_cast(AZStd::get(m_value)); } AZ_Assert(false, "AZ::Dom::Value: Called GetInt on a non-numeric type"); @@ -888,11 +933,11 @@ namespace AZ::Dom { switch (m_value.index()) { - case 1: // int64_t + case GetTypeIndex(): return aznumeric_cast(AZStd::get(m_value)); - case 2: // uint64_t + case GetTypeIndex(): return aznumeric_cast(AZStd::get(m_value)); - case 3: // double + case GetTypeIndex(): return AZStd::get(m_value); } AZ_Assert(false, "AZ::Dom::Value: Called GetInt on a non-numeric type"); @@ -923,14 +968,14 @@ namespace AZ::Dom { switch (m_value.index()) { - case 5: // AZStd::string_view + case GetTypeIndex(): return AZStd::get(m_value); - case 6: // AZStd::shared_ptr> + case GetTypeIndex(): { auto& buffer = *AZStd::get(m_value); return { buffer.data(), buffer.size() }; } - case 7: // ShortStringType + case GetTypeIndex(): { const ShortStringType& shortString = AZStd::get(m_value); return { shortString.data(), shortString.size() }; @@ -965,8 +1010,7 @@ namespace AZ::Dom } else { - SharedStringType sharedString = - AZStd::allocate_shared(StdValueAllocator(), value.begin(), value.end()); + SharedStringType sharedString = AZStd::allocate_shared(StdValueAllocator(), value.begin(), value.end()); m_value = AZStd::move(sharedString); } } diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index bc1b790009..86e98030e2 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -159,6 +159,33 @@ namespace AZ::Dom using SharedStringContainer = AZStd::vector; using SharedStringType = AZStd::shared_ptr; + //! The internal storage type for Value. + //! These types do not correspond one-to-one with the Value's external Type as there may be multiple storage classes + //! for the same type in some instances, such as string storage. + using ValueType = AZStd::variant< + // Null + AZStd::monostate, + // Int64 + int64_t, + // Uint64 + uint64_t, + // Double + double, + // Bool + bool, + // StringType + AZStd::string_view, + SharedStringType, + ShortStringType, + // Object + ObjectPtr, + // Array + ArrayPtr, + // Node + NodePtr, + // Opaque + AZStd::shared_ptr>; + // Constructors... Value(); Value(const Value&); @@ -347,33 +374,6 @@ namespace AZ::Dom explicit Value(const AZStd::any& opaqueValue); - //! The internal storage type for Value. - //! These types do not correspond one-to-one with the Value's external Type as there may be multiple storage classes - //! for the same type in some instances, such as string storage. - using ValueType = AZStd::variant< - // Null - AZStd::monostate, - // Int64 - int64_t, - // Uint64 - uint64_t, - // Double - double, - // Bool - bool, - // StringType - AZStd::string_view, - SharedStringType, - ShortStringType, - // Object - ObjectPtr, - // Array - ArrayPtr, - // Node - NodePtr, - // Opaque - AZStd::shared_ptr>; - static_assert( sizeof(ValueType) == sizeof(ShortStringType) + sizeof(size_t), "ValueType should have no members larger than ShortStringType"); From 366a7118ab8e2f7eb11b271feeae5c2d0b73fe37 Mon Sep 17 00:00:00 2001 From: Roman <69218254+amzn-rhhong@users.noreply.github.com> Date: Mon, 20 Dec 2021 22:00:47 -0800 Subject: [PATCH 167/399] Attachment: expose more function from AttachmentComponentRequestBus to behavior context (#6456) Signed-off-by: rhhong --- .../Code/Source/Animation/AttachmentComponent.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp index ee66518779..74e01c7829 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp @@ -58,13 +58,17 @@ namespace AZ behaviorContext->EBus("AttachmentComponentRequestBus") ->Event("Attach", &LmbrCentral::AttachmentComponentRequestBus::Events::Attach) ->Event("Detach", &LmbrCentral::AttachmentComponentRequestBus::Events::Detach) - ->Event("SetAttachmentOffset", &LmbrCentral::AttachmentComponentRequestBus::Events::SetAttachmentOffset); + ->Event("SetAttachmentOffset", &LmbrCentral::AttachmentComponentRequestBus::Events::SetAttachmentOffset) + ->Event("GetJointName", &LmbrCentral::AttachmentComponentRequestBus::Events::GetJointName) + ->Event("GetTargetEntityId", &LmbrCentral::AttachmentComponentRequestBus::Events::GetTargetEntityId) + ->Event("GetOffset", &LmbrCentral::AttachmentComponentRequestBus::Events::GetOffset); behaviorContext->EBus("AttachmentComponentNotificationBus") ->Handler(); } } + void AttachmentComponent::Reflect(AZ::ReflectContext* context) { AttachmentConfiguration::Reflect(context); From 657e56edf7b06d986e1588aaf59c0af9c308143a Mon Sep 17 00:00:00 2001 From: sphrose <82213493+sphrose@users.noreply.github.com> Date: Tue, 21 Dec 2021 09:55:29 +0000 Subject: [PATCH 168/399] revew changes Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com> --- .../Source/Components/TerrainSurfaceDataSystemComponent.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp index b36283bd3c..a35fa50e65 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp @@ -98,6 +98,7 @@ namespace Terrain { m_providerHandle = SurfaceData::InvalidSurfaceDataRegistryHandle; AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusConnect(); + SurfaceData::SurfaceDataTagProviderRequestBus::Handler::BusConnect(); UpdateTerrainData(AZ::Aabb::CreateNull()); } @@ -112,6 +113,7 @@ namespace Terrain } SurfaceData::SurfaceDataProviderRequestBus::Handler::BusDisconnect(); + SurfaceData::SurfaceDataTagProviderRequestBus::Handler::BusDisconnect(); AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusDisconnect(); // Clear the cached terrain bounds data @@ -241,8 +243,6 @@ namespace Terrain // Start listening for surface data events AZ_Assert((m_providerHandle != SurfaceData::InvalidSurfaceDataRegistryHandle), "Invalid surface data handle"); SurfaceData::SurfaceDataProviderRequestBus::Handler::BusConnect(m_providerHandle); - - SurfaceData::SurfaceDataTagProviderRequestBus::Handler::BusConnect(); } else if (terrainValidBeforeUpdate && !terrainValidAfterUpdate) { @@ -251,8 +251,6 @@ namespace Terrain SurfaceData::SurfaceDataSystemRequestBus::Broadcast( &SurfaceData::SurfaceDataSystemRequestBus::Events::UnregisterSurfaceDataProvider, m_providerHandle); m_providerHandle = SurfaceData::InvalidSurfaceDataRegistryHandle; - - SurfaceData::SurfaceDataProviderRequestBus::Handler::BusDisconnect(); } else { From 219653a75beddc3db51bb8de5a9d6b980214f272 Mon Sep 17 00:00:00 2001 From: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> Date: Tue, 21 Dec 2021 10:43:18 +0000 Subject: [PATCH 169/399] Fixes rounding error display in Slider control (#6477) Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> --- .../Components/Widgets/SliderCombo.cpp | 28 +++++++++++++++++-- .../Components/Widgets/SliderCombo.h | 3 ++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.cpp index 7b818459d6..6333d28365 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.cpp @@ -243,7 +243,7 @@ SliderDoubleCombo::SliderDoubleCombo(QWidget* parent) InitialiseSliderCombo(this, layout, m_spinbox, m_slider); - connect(m_slider, &SliderDouble::valueChanged, this, &SliderDoubleCombo::setValue); + connect(m_slider, &SliderDouble::valueChanged, this, &SliderDoubleCombo::setValueSlider); connect(m_spinbox, QOverload::of(&DoubleSpinBox::valueChanged), this, &SliderDoubleCombo::setValue); connect(m_slider, &SliderDouble::sliderReleased, this, &SliderDoubleCombo::editingFinished); connect(m_spinbox, &DoubleSpinBox::editingFinished, this, &SliderDoubleCombo::editingFinished); @@ -254,7 +254,7 @@ SliderDoubleCombo::~SliderDoubleCombo() { } -void SliderDoubleCombo::setValue(double value) +void SliderDoubleCombo::setValueSlider(double value) { const bool doEmit = m_value != value; m_value = value; @@ -264,10 +264,34 @@ void SliderDoubleCombo::setValue(double value) if (doEmit) { + // We don't want to update the slider from setValue as this + // causes rounding errors in the tooltip hint. + m_fromSlider = true; Q_EMIT valueChanged(); } } +void SliderDoubleCombo::setValue(double value) +{ + const bool doEmit = m_value != value; + m_value = value; + + updateSpinBox(); + if (!m_fromSlider) + { + updateSlider(); + + if (doEmit) + { + Q_EMIT valueChanged(); + } + } + else + { + m_fromSlider = false; + } +} + SliderDouble* SliderDoubleCombo::slider() const { return m_slider; diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.h b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.h index 2646162af4..05d0f7b51b 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.h +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.h @@ -151,6 +151,8 @@ namespace AzQtComponents //! Sets the current value. void setValue(double value); + //! Sets the current value. + void setValueSlider(double value); //! Return the current value. Q_REQUIRED_RESULT double value() const; @@ -235,5 +237,6 @@ namespace AzQtComponents double m_softMinimum = 0.0; double m_softMaximum = 100.0; double m_value = 0.0; + bool m_fromSlider{ false }; }; } // namespace AzQtComponents From 704aef8cad2ac4b8b9c12fde26c9e66ae5a8977c Mon Sep 17 00:00:00 2001 From: allisaurus <34254888+allisaurus@users.noreply.github.com> Date: Tue, 21 Dec 2021 11:11:45 -0800 Subject: [PATCH 170/399] Add pytest to Resource Mapping Tool requirements.txt (#6259) * Add pytest to Resource Mapping Tool requirements.txt Signed-off-by: allisaurus <34254888+allisaurus@users.noreply.github.com> --- .../Code/Tools/ResourceMappingTool/README.md | 48 +++++++++++++------ .../ResourceMappingTool/requirements.txt | 3 ++ 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/README.md b/Gems/AWSCore/Code/Tools/ResourceMappingTool/README.md index ba764dc993..33152fb2ee 100644 --- a/Gems/AWSCore/Code/Tools/ResourceMappingTool/README.md +++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/README.md @@ -1,35 +1,40 @@ # Welcome to the AWS Core Resource Mapping Tool project! -## Setup aws config and credential -Resource mapping tool is using boto3 to interact with aws services: +## Setup aws config and credentials +The Resource Mapping Tool uses boto3 to interact with aws services: * Read boto3 [Configuration](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html) to setup default aws region. * Read boto3 [Credentials](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html) to setup default profile or credential keys. -Or follow **AWS CLI** configuration which can be reused by boto3 lib: +Or follow **AWS CLI** configuration directions which can be reused by the boto3 lib: * Follow [Quick configuration with aws configure](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html#cli-configure-quickstart-config) ## Python Environment Setup Options -### 1. Engine python environment (Including Editor) -1. In order to use engine python environment, it requires to link Qt binaries for this tool. +### 1. Use Engine python environment (Including Editor) +1. In order to use the Open 3D Engine's python environment, this tool requires linking the Qt binaries. Follow cmake instructions to configure your project, for example: ``` $ cmake -B -S . -G "Visual Studio 16 2019" -DLY_PROJECTS= ``` -2. At this point, double check engine python environment gets setup under */python/runtime* directory +2. At this point, double check that the Open 3D Engine's python environment gets set up under */python/runtime* directory -3. Build project with **AWSCore.Editor** (or **AWSCore.ResourceMappintTool**, or **Editor**) target to generate required Qt binaries. +3. Build the project with the **AWSCore.Editor** (or **AWSCore.ResourceMappingTool**, or **Editor**) target to generate the required Qt binaries. + * Windows + ``` + $ cmake --build --target AWSCore.Editor --config /m + ``` + * Linux ``` $ cmake --build --target AWSCore.Editor --config -j ``` -4. At this point, double check Qt binaries gets generated under */bin//AWSCoreEditorQtBin* directory +4. At this point, double check the Qt binaries have been generated under */bin//AWSCoreEditorQtBin* directory -5. Launch resource mapping tool under engine root folder: +5. Launch the Resource Mapping Tool from the engine root folder: * Windows * release mode ``` @@ -49,10 +54,9 @@ Follow cmake instructions to configure your project, for example: $ python/python.sh Gems/AWSCore/Code/Tools/ResourceMappingTool/resource_mapping_tool.py --binaries_path /bin/debug/AWSCoreEditorQtBin ``` -* Note - Editor is integrated with the same engine python environment to launch Resource Mapping Tool. If it is failed to launch the tool -in Editor, please follow above steps to make sure expected scripts/binaries are present. +* Note - the engine Editor is integrated with the same python environment used to launch the Resource Mapping Tool. If the tool fails to launch from the Editor, please double check that you have completed all of the above steps and that the expected scripts and binaries are present in the expected directories. -### 2. Python virtual environment +### 2. Use a separate python virtual environment This project is set up like a standard Python project. The initialization process also creates a virtualenv within this project, stored under the `.env` directory. To create the virtualenv it assumes that there is a `python3` @@ -105,7 +109,23 @@ you can create the virtualenv manually. * `--config-path` **[Optional]** Path to resource mapping config directory, if not provided tool will use current directory. * `--debug` **[Optional]** Execute on debug mode to enable DEBUG logging level. -* `--log-path` **[Optional]** Path to resource mapping tool logging directory, +* `--log-path` **[Optional]** Path to Resource Mapping Tool logging directory, if not provided tool will store logging under tool source code directory. * `--profile` **[Optional]** Named AWS profile to use for querying AWS resources, - if not provided tool will use `default` aws profile. \ No newline at end of file + if not provided tool will use `default` aws profile. + + +## Running tests + +How to run the unit tests for the project: + +1. If not already activated, activate the project's python environment as explained above. +2. Use `pytest` to run one or more tests (command paths formatted as if run from this directory): + * Run all the tests + ``` + python -m pytest -vv . + ``` + * Run a specific test file or directory: + ``` + python -m pytest tests\unit\model\test_basic_resource_attributes.py + ``` \ No newline at end of file diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/requirements.txt b/Gems/AWSCore/Code/Tools/ResourceMappingTool/requirements.txt index 2b931e0b51..ee8e94640a 100644 --- a/Gems/AWSCore/Code/Tools/ResourceMappingTool/requirements.txt +++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/requirements.txt @@ -1,2 +1,5 @@ PySide2>=5.15.2 boto3>=1.17.30 +pytest>=5.3.2 + + From 44744d95b0682a19108b1fa8d71475589fabdf42 Mon Sep 17 00:00:00 2001 From: Junbo Liang <68558268+junbo75@users.noreply.github.com> Date: Tue, 21 Dec 2021 12:28:54 -0800 Subject: [PATCH 171/399] Fix the cmake issue for AWSI automation tests (#6531) Signed-off-by: Junbo Liang <68558268+junbo75@users.noreply.github.com> --- AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt index d6740152a7..c8629bbe8b 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt @@ -22,7 +22,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) NAME AutomatedTesting::AWSTests TEST_SUITE awsi TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/${PAL_PLATFORM_NAME}/ + PATH ${CMAKE_CURRENT_LIST_DIR}/ RUNTIME_DEPENDENCIES AZ::AssetProcessor AutomatedTesting.GameLauncher From a96387ee3585ae9abb0e2bdde676e3703dac1d3e Mon Sep 17 00:00:00 2001 From: Jeremy Ong Date: Tue, 21 Dec 2021 13:12:25 -0700 Subject: [PATCH 172/399] Fix compile issues blocking adoption of Pix 2108 Signed-off-by: Jeremy Ong --- Code/Editor/IEditorImpl.cpp | 2 +- Code/Editor/Include/IEditorClassFactory.h | 7 ++----- Code/Editor/Include/IViewPane.h | 2 +- Code/Editor/Plugin.cpp | 2 +- .../PerforcePlugin/PerforceSourceControl.h | 2 +- Code/Editor/PreferencesStdPages.cpp | 2 +- Code/Editor/Util/FileUtil.cpp | 2 +- .../native/utilities/ApplicationManagerBase.cpp | 16 ++++++++-------- 8 files changed, 16 insertions(+), 19 deletions(-) diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp index e5df6be58e..5bd816174c 100644 --- a/Code/Editor/IEditorImpl.cpp +++ b/Code/Editor/IEditorImpl.cpp @@ -1445,7 +1445,7 @@ ISourceControl* CEditorImpl::GetSourceControl() { IClassDesc* pClass = classes[i]; ISourceControl* pSCM = nullptr; - HRESULT hRes = pClass->QueryInterface(__uuidof(ISourceControl), (void**)&pSCM); + HRESULT hRes = pClass->QueryInterface(__az_uuidof(ISourceControl), (void**)&pSCM); if (!FAILED(hRes) && pSCM) { m_pSourceControl = pSCM; diff --git a/Code/Editor/Include/IEditorClassFactory.h b/Code/Editor/Include/IEditorClassFactory.h index dd47f803e2..6c85192436 100644 --- a/Code/Editor/Include/IEditorClassFactory.h +++ b/Code/Editor/Include/IEditorClassFactory.h @@ -31,10 +31,7 @@ struct IUnknown }; #endif -#ifdef __uuidof -#undef __uuidof -#endif -#define __uuidof(T) T::uuid() +#define __az_uuidof(T) T::uuid() #if defined(AZ_PLATFORM_LINUX) || defined(AZ_PLATFORM_MAC) @@ -107,7 +104,7 @@ struct IClassDesc template HRESULT STDMETHODCALLTYPE QueryInterface(Q** pp) { - return QueryInterface(__uuidof(Q), (void**)pp); + return QueryInterface(__az_uuidof(Q), (void**)pp); } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Editor/Include/IViewPane.h b/Code/Editor/Include/IViewPane.h index b4a25a87a9..f2425fb954 100644 --- a/Code/Editor/Include/IViewPane.h +++ b/Code/Editor/Include/IViewPane.h @@ -60,7 +60,7 @@ struct IViewPaneClass ////////////////////////////////////////////////////////////////////////// HRESULT STDMETHODCALLTYPE QueryInterface(const IID& riid, void** ppvObj) { - if (riid == __uuidof(IViewPaneClass)) + if (riid == __az_uuidof(IViewPaneClass)) { *ppvObj = this; return S_OK; diff --git a/Code/Editor/Plugin.cpp b/Code/Editor/Plugin.cpp index 68f8d8833b..16c386e31c 100644 --- a/Code/Editor/Plugin.cpp +++ b/Code/Editor/Plugin.cpp @@ -155,7 +155,7 @@ IViewPaneClass* CClassFactory::FindViewPaneClassByTitle(const char* pPaneTitle) { IViewPaneClass* viewPane = nullptr; IClassDesc* desc = m_classes[i]; - if (SUCCEEDED(desc->QueryInterface(__uuidof(IViewPaneClass), (void**)&viewPane))) + if (SUCCEEDED(desc->QueryInterface(__az_uuidof(IViewPaneClass), (void**)&viewPane))) { if (QString::compare(viewPane->GetPaneTitle(), pPaneTitle) == 0) { diff --git a/Code/Editor/Plugins/PerforcePlugin/PerforceSourceControl.h b/Code/Editor/Plugins/PerforcePlugin/PerforceSourceControl.h index ec06fdc82a..794dca0f86 100644 --- a/Code/Editor/Plugins/PerforcePlugin/PerforceSourceControl.h +++ b/Code/Editor/Plugins/PerforcePlugin/PerforceSourceControl.h @@ -49,7 +49,7 @@ public: // from IUnknown HRESULT STDMETHODCALLTYPE QueryInterface(const IID& riid, void** ppvObj) { - if (riid == __uuidof(ISourceControl) /* && m_pIntegrator*/) + if (riid == __az_uuidof(ISourceControl) /* && m_pIntegrator*/) { *ppvObj = this; return S_OK; diff --git a/Code/Editor/PreferencesStdPages.cpp b/Code/Editor/PreferencesStdPages.cpp index 1dd40702a7..77b912a44e 100644 --- a/Code/Editor/PreferencesStdPages.cpp +++ b/Code/Editor/PreferencesStdPages.cpp @@ -50,7 +50,7 @@ CStdPreferencesClassDesc::CStdPreferencesClassDesc() HRESULT CStdPreferencesClassDesc::QueryInterface(const IID& riid, void** ppvObj) { - if (riid == __uuidof(IPreferencesPageCreator)) + if (riid == __az_uuidof(IPreferencesPageCreator)) { *ppvObj = (IPreferencesPageCreator*)this; return S_OK; diff --git a/Code/Editor/Util/FileUtil.cpp b/Code/Editor/Util/FileUtil.cpp index 9f96d45381..182a122ea8 100644 --- a/Code/Editor/Util/FileUtil.cpp +++ b/Code/Editor/Util/FileUtil.cpp @@ -251,7 +251,7 @@ bool CFileUtil::ExtractDccFilenameFromAssetDatabase(const QString& assetFilename for (size_t i = 0; i < assetDatabasePlugins.size(); ++i) { - if (assetDatabasePlugins[i]->QueryInterface(__uuidof(IAssetItemDatabase), (void**)&pCurrentDatabaseInterface) == S_OK) + if (assetDatabasePlugins[i]->QueryInterface(__az_uuidof(IAssetItemDatabase), (void**)&pCurrentDatabaseInterface) == S_OK) { if (!pCurrentDatabaseInterface) { diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp index 499e5fe4f7..8837e9dc3f 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp @@ -966,18 +966,18 @@ void ApplicationManagerBase::HandleFileRelocation() const AZ_Printf(AssetProcessor::ConsoleChannel, "SETTING: Preview file move. Run again with --%s to actually make changes\n", ConfirmCommand); } - auto* interface = AZ::Interface::Get(); + auto* relocationInterface = AZ::Interface::Get(); - if(interface) + if(relocationInterface) { - auto result = interface->Move(source, destination, previewOnly, allowBrokenDependencies, !leaveEmptyFolders, updateReferences, excludeMetaDataFiles); + auto result = relocationInterface->Move(source, destination, previewOnly, allowBrokenDependencies, !leaveEmptyFolders, updateReferences, excludeMetaDataFiles); if (result.IsSuccess()) { AssetProcessor::RelocationSuccess success = result.TakeValue(); // The report can be too long for the AZ_Printf buffer, so split it into individual lines - AZStd::string report = interface->BuildReport(success.m_relocationContainer, success.m_updateTasks, true, updateReferences); + AZStd::string report = relocationInterface->BuildReport(success.m_relocationContainer, success.m_updateTasks, true, updateReferences); AZStd::vector lines; AzFramework::StringFunc::Tokenize(report.c_str(), lines, "\n"); @@ -1051,18 +1051,18 @@ void ApplicationManagerBase::HandleFileRelocation() const AZ_Printf(AssetProcessor::ConsoleChannel, "SETTING: Preview file delete. Run again with --%s to actually make changes\n", ConfirmCommand); } - auto* interface = AZ::Interface::Get(); + auto* relocationInterface = AZ::Interface::Get(); - if (interface) + if (relocationInterface) { - auto result = interface->Delete(source, previewOnly, allowBrokenDependencies, !leaveEmptyFolders, excludeMetaDataFiles); + auto result = relocationInterface->Delete(source, previewOnly, allowBrokenDependencies, !leaveEmptyFolders, excludeMetaDataFiles); if (result.IsSuccess()) { AssetProcessor::RelocationSuccess success = result.TakeValue(); // The report can be too long for the AZ_Printf buffer, so split it into individual lines - AZStd::string report = interface->BuildReport(success.m_relocationContainer, success.m_updateTasks, false, updateReferences); + AZStd::string report = relocationInterface->BuildReport(success.m_relocationContainer, success.m_updateTasks, false, updateReferences); AZStd::vector lines; AzFramework::StringFunc::Tokenize(report.c_str(), lines, "\n"); From 09c041559c45b6b86ad8ab8421701975abcab47e Mon Sep 17 00:00:00 2001 From: evanchia Date: Tue, 21 Dec 2021 13:13:57 -0800 Subject: [PATCH 173/399] removing outdated remote console test Signed-off-by: evanchia --- .../Gem/PythonTests/smoke/CMakeLists.txt | 16 ------- .../test_RemoteConsole_GPULoadLevel_Works.py | 43 ------------------- 2 files changed, 59 deletions(-) delete mode 100644 AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_GPULoadLevel_Works.py diff --git a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt index 3fc4f3db0e..5d0808adb6 100644 --- a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt @@ -31,22 +31,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) Smoke ) - ly_add_pytest( - NAME AutomatedTesting::LoadLevelGPU - TEST_SUITE smoke - TEST_SERIAL - TEST_REQUIRES gpu - PATH ${CMAKE_CURRENT_LIST_DIR}/test_RemoteConsole_GPULoadLevel_Works.py - TIMEOUT 100 - RUNTIME_DEPENDENCIES - AZ::AssetProcessor - AZ::PythonBindingsExample - AutomatedTesting.GameLauncher - AutomatedTesting.Assets - COMPONENT - Smoke - ) - ly_add_pytest( NAME AutomatedTesting::EditorTestWithGPU TEST_REQUIRES gpu diff --git a/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_GPULoadLevel_Works.py b/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_GPULoadLevel_Works.py deleted file mode 100644 index 7debcab938..0000000000 --- a/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_GPULoadLevel_Works.py +++ /dev/null @@ -1,43 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT - - -UI Apps: AutomatedTesting.GameLauncher -Launch AutomatedTesting.GameLauncher with Simple level -Test should run in both gpu and non gpu -""" - -import pytest -import psutil - -import ly_test_tools.environment.waiter as waiter -import editor_python_test_tools.hydra_test_utils as editor_test_utils -from ly_remote_console.remote_console_commands import RemoteConsole as RemoteConsole -from ly_remote_console.remote_console_commands import ( - send_command_and_expect_response as send_command_and_expect_response, -) - - -@pytest.mark.parametrize("launcher_platform", ["windows"]) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -@pytest.mark.parametrize("level", ["Simple"]) -class TestRemoteConsoleLoadLevelWorks(object): - @pytest.fixture - def remote_console_instance(self, request): - console = RemoteConsole() - - def teardown(): - if console.connected: - console.stop() - - request.addfinalizer(teardown) - - return console - - def test_RemoteConsole_LoadLevel_Works(self, launcher, level, remote_console_instance, launcher_platform): - expected_lines = ['Level system is loading "Simple"'] - - editor_test_utils.launch_and_validate_results_launcher(launcher, level, remote_console_instance, expected_lines, null_renderer=False) From 845525a722eae059e7750e6281d2cc751b4fad21 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Tue, 21 Dec 2021 16:28:44 -0600 Subject: [PATCH 174/399] Add support for loading Png data directly from a memory buffer. (#6527) * Add support for loading Png data directly from a memory buffer. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> (cherry picked from commit 6193dcf603d3c16ee193e1e6dc868bd6d04f89bc) * Addressed PR feedback. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Addressed PR feedback. Simplified LoadInternal() by having it always use a GenericStream. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Utils/Code/Include/Atom/Utils/PngFile.h | 8 +- Gems/Atom/Utils/Code/Source/PngFile.cpp | 84 +++++++++++++++---- Gems/Atom/Utils/Code/Tests/PngFileTests.cpp | 64 +++++++++++++- 3 files changed, 138 insertions(+), 18 deletions(-) diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/PngFile.h b/Gems/Atom/Utils/Code/Include/Atom/Utils/PngFile.h index 1de27e9b96..b862786c2f 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/PngFile.h +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/PngFile.h @@ -7,6 +7,7 @@ */ #pragma once +#include #include #include #include @@ -53,6 +54,9 @@ namespace AZ //! @return the loaded PngFile or an invalid PngFile if there was an error. static PngFile Load(const char* path, LoadSettings loadSettings = {}); + //! @return the loaded PngFile or an invalid PngFile if there was an error. + static PngFile LoadFromBuffer(AZStd::array_view data, LoadSettings loadSettings = {}); + //! Create a PngFile from an RHI data buffer. //! @param size the dimensions of the image (m_depth is not used, assumed to be 1) //! @param format indicates the pixel format represented by @data. Only a limited set of formats are supported, see implementation. @@ -83,10 +87,12 @@ namespace AZ private: AZ_DEFAULT_COPY(PngFile) - static const int HeaderSize = 8; + static const int HeaderSize = 8; static void DefaultErrorHandler(const char* message); + static PngFile LoadInternal(AZ::IO::GenericStream& dataStream, LoadSettings loadSettings); + uint32_t m_width = 0; uint32_t m_height = 0; int32_t m_bitDepth = 0; diff --git a/Gems/Atom/Utils/Code/Source/PngFile.cpp b/Gems/Atom/Utils/Code/Source/PngFile.cpp index 28f5374d88..1454dc68c9 100644 --- a/Gems/Atom/Utils/Code/Source/PngFile.cpp +++ b/Gems/Atom/Utils/Code/Source/PngFile.cpp @@ -8,6 +8,7 @@ #include #include +#include namespace AZ { @@ -68,24 +69,66 @@ namespace AZ { if (!loadSettings.m_errorHandler) { - loadSettings.m_errorHandler = [path](const char* message) { DefaultErrorHandler(AZStd::string::format("Could not load file '%s'. %s", path, message).c_str()); }; + loadSettings.m_errorHandler = [path](const char* message) + { + DefaultErrorHandler(AZStd::string::format("Could not load file '%s'. %s", path, message).c_str()); + }; + } + + AZ::IO::SystemFile file; + file.Open(path, AZ::IO::SystemFile::SF_OPEN_READ_ONLY); + if (!file.IsOpen()) + { + loadSettings.m_errorHandler("Cannot open file."); + return {}; } + constexpr bool StreamOwnsFilePointer = true; + AZ::IO::SystemFileStream fileLoadStream(&file, StreamOwnsFilePointer); + + auto pngFile = LoadInternal(fileLoadStream, loadSettings); + return pngFile; + } + + PngFile PngFile::LoadFromBuffer(AZStd::array_view data, LoadSettings loadSettings) + { + if (!loadSettings.m_errorHandler) + { + loadSettings.m_errorHandler = [](const char* message) + { + DefaultErrorHandler(AZStd::string::format("Could not load Png from buffer. %s", message).c_str()); + }; + } + + if (data.empty()) + { + loadSettings.m_errorHandler("Buffer is empty."); + return {}; + } + + AZ::IO::MemoryStream memStream(data.data(), data.size()); + + return LoadInternal(memStream, loadSettings); + } + PngFile PngFile::LoadInternal(AZ::IO::GenericStream& dataStream, LoadSettings loadSettings) + { // For documentation of this code, see http://www.libpng.org/pub/png/libpng-1.4.0-manual.pdf chapter 3 - FILE* fp = NULL; - azfopen(&fp, path, "rb"); // return type differs across platforms so can't do inside if - if (!fp) + // Verify that we've passed in a valid data stream. + if (!dataStream.IsOpen() || !dataStream.CanRead()) { - loadSettings.m_errorHandler("Cannot open file."); + loadSettings.m_errorHandler("Data stream isn't valid."); return {}; } png_byte header[HeaderSize] = {}; + size_t headerBytesRead = 0; - if (fread(header, 1, HeaderSize, fp) != HeaderSize) + // This is the one I/O read that occurs outside of the png library, so either read from the file or the buffer and + // verify the results. + headerBytesRead = dataStream.Read(HeaderSize, header); + if (headerBytesRead != HeaderSize) { - fclose(fp); loadSettings.m_errorHandler("Invalid png header."); return {}; } @@ -93,7 +136,6 @@ namespace AZ bool isPng = !png_sig_cmp(header, 0, HeaderSize); if (!isPng) { - fclose(fp); loadSettings.m_errorHandler("Invalid png header."); return {}; } @@ -105,7 +147,6 @@ namespace AZ png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, user_error_ptr, user_error_fn, user_warning_fn); if (!png_ptr) { - fclose(fp); loadSettings.m_errorHandler("png_create_read_struct failed."); return {}; } @@ -114,7 +155,6 @@ namespace AZ if (!info_ptr) { png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL); - fclose(fp); loadSettings.m_errorHandler("png_create_info_struct failed."); return {}; } @@ -123,22 +163,35 @@ namespace AZ if (!end_info) { png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); - fclose(fp); loadSettings.m_errorHandler("png_create_info_struct failed."); return {}; } -AZ_PUSH_DISABLE_WARNING(4611, "-Wunknown-warning-option") // Disables "interaction between '_setjmp' and C++ object destruction is non-portable". See https://docs.microsoft.com/en-us/cpp/preprocessor/warning?view=msvc-160 +// Disables "interaction between '_setjmp' and C++ object destruction is non-portable". +// See https://docs.microsoft.com/en-us/cpp/preprocessor/warning?view=msvc-160 +AZ_PUSH_DISABLE_WARNING(4611, "-Wunknown-warning-option") if (setjmp(png_jmpbuf(png_ptr))) { png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); - fclose(fp); // We don't report an error message here because the user_error_fn should have done that already. return {}; } AZ_POP_DISABLE_WARNING - png_init_io(png_ptr, fp); + auto genericStreamReader = [](png_structp pngPtr, png_bytep data, png_size_t length) + { + // Here we get our IO pointer back from the read struct. + // This should be the GenericStream pointer we passed to the png_set_read_fn() function. + png_voidp ioPtr = png_get_io_ptr(pngPtr); + + if (ioPtr != nullptr) + { + AZ::IO::GenericStream* genericStream = static_cast(ioPtr); + genericStream->Read(length, data); + } + }; + + png_set_read_fn(png_ptr, &dataStream, genericStreamReader); png_set_sig_bytes(png_ptr, HeaderSize); @@ -187,7 +240,6 @@ AZ_POP_DISABLE_WARNING default: AZ_Assert(false, "The png transforms should have ensured a pixel format of RGB or RGBA, 8 bits per channel"); png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); - fclose(fp); loadSettings.m_errorHandler("Unsupported pixel format."); return {}; } @@ -201,7 +253,6 @@ AZ_POP_DISABLE_WARNING } png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); - fclose(fp); return pngFile; } @@ -322,3 +373,4 @@ AZ_POP_DISABLE_WARNING } // namespace Utils }// namespace AZ + diff --git a/Gems/Atom/Utils/Code/Tests/PngFileTests.cpp b/Gems/Atom/Utils/Code/Tests/PngFileTests.cpp index b60939b39b..436b9ae752 100644 --- a/Gems/Atom/Utils/Code/Tests/PngFileTests.cpp +++ b/Gems/Atom/Utils/Code/Tests/PngFileTests.cpp @@ -311,4 +311,66 @@ namespace UnitTest EXPECT_TRUE(gotErrorMessage.find("PngFile is invalid") != AZStd::string::npos); EXPECT_FALSE(AZ::IO::FileIOBase::GetInstance()->Exists(m_tempPngFilePath.c_str())); } -} + + TEST_F(PngFileTests, LoadRgbFromMemoryBuffer) + { + // This is an in-memory copy of the ColorChart_rgb.png test file. + AZStd::fixed_vector pngBuffer = + { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, + 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, + 0x08, 0x02, 0x00, 0x00, 0x00, 0x12, 0x16, 0xf1, + + 0x4d, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, + 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00, + + 0x00, 0x04, 0x67, 0x41, 0x4d, 0x41, 0x00, 0x00, + 0xb1, 0x8f, 0x0b, 0xfc, 0x61, 0x05, 0x00, 0x00, + + 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, + 0x0e, 0xc3, 0x00, 0x00, 0x0e, 0xc3, 0x01, 0xc7, + + 0x6f, 0xa8, 0x64, 0x00, 0x00, 0x00, 0x13, 0x49, + 0x44, 0x41, 0x54, 0x18, 0x57, 0x63, 0xf8, 0xcf, + + 0xc0, 0x00, 0xc1, 0x4c, 0x10, 0xea, 0x3f, 0x03, + 0x03, 0x00, 0x3b, 0xec, 0x05, 0xfd, 0x6a, 0x50, + + 0x07, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, + 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 + }; + + PngFile image = PngFile::LoadFromBuffer(pngBuffer); + EXPECT_TRUE(image.IsValid()); + EXPECT_EQ(image.GetBufferFormat(), PngFile::Format::RGB); + EXPECT_EQ(image.GetWidth(), 3); + EXPECT_EQ(image.GetHeight(), 2); + EXPECT_EQ(image.GetBuffer().size(), 18); + EXPECT_EQ(Color3(image.GetBuffer().begin() + 0), Color3(255u, 0u, 0u)); + EXPECT_EQ(Color3(image.GetBuffer().begin() + 3), Color3(0u, 255u, 0u)); + EXPECT_EQ(Color3(image.GetBuffer().begin() + 6), Color3(0u, 0u, 255u)); + EXPECT_EQ(Color3(image.GetBuffer().begin() + 9), Color3(255u, 255u, 0u)); + EXPECT_EQ(Color3(image.GetBuffer().begin() + 12), Color3(0u, 255u, 255u)); + EXPECT_EQ(Color3(image.GetBuffer().begin() + 15), Color3(255u, 0u, 255u)); + } + + TEST_F(PngFileTests, ErrorCannotLoadEmptyMemoryBuffer) + { + AZStd::vector pngBuffer; + + AZStd::string gotErrorMessage; + + PngFile::LoadSettings loadSettings; + loadSettings.m_errorHandler = [&gotErrorMessage](const char* errorMessage) + { + gotErrorMessage = errorMessage; + }; + + PngFile image = PngFile::LoadFromBuffer(pngBuffer, loadSettings); + EXPECT_FALSE(image.IsValid()); + EXPECT_TRUE(gotErrorMessage.find("Buffer is empty") != AZStd::string::npos); + } + +} // namespace UnitTest From 37330c43a9408ad9ffcd726c14f510c4b5d264f5 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Tue, 21 Dec 2021 15:47:42 -0800 Subject: [PATCH 175/399] Address some more Generic Dom Value perf feedback Signed-off-by: Nicholas Van Sickle --- .../Backends/JSON/JsonSerializationUtils.cpp | 4 -- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 57 ++++++++++--------- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 4 +- .../AzCore/AzCore/DOM/DomValueWriter.cpp | 26 ++++----- .../AzCore/Tests/DOM/DomJsonBenchmarks.cpp | 26 ++++++--- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 16 +++++- 6 files changed, 77 insertions(+), 56 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp b/Code/Framework/AzCore/AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp index bc8ac9167c..3baf78b63d 100644 --- a/Code/Framework/AzCore/AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp @@ -373,10 +373,6 @@ namespace AZ::Dom::Json bool RapidJsonReadHandler::Key(const char* str, rapidjson::SizeType length, [[maybe_unused]] bool copy) { AZStd::string_view key = AZStd::string_view(str, length); - if (!m_visitor->SupportsRawKeys()) - { - m_visitor->Key(AZ::Name(key)); - } const Lifetime lifetime = !copy ? m_stringLifetime : Lifetime::Temporary; return CheckResult(m_visitor->RawKey(key, lifetime)); } diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 3836568f37..407d1e66a2 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -17,13 +17,15 @@ namespace AZ::Dom template AZStd::shared_ptr& CheckCopyOnWrite(AZStd::shared_ptr& refCountedPointer) { - if (refCountedPointer.use_count() > 1) + if (refCountedPointer.use_count() == 1) { - AZStd::shared_ptr newPointer = AZStd::allocate_shared(StdValueAllocator()); - *newPointer = *refCountedPointer; - refCountedPointer = AZStd::move(newPointer); + return refCountedPointer; + } + else + { + refCountedPointer = AZStd::allocate_shared(StdValueAllocator(), *refCountedPointer); + return refCountedPointer; } - return refCountedPointer; } namespace Internal @@ -72,7 +74,7 @@ namespace AZ::Dom } Node::Node(AZ::Name name) - : m_name(name) + : m_name(AZStd::move(name)) { } @@ -83,7 +85,7 @@ namespace AZ::Dom void Node::SetName(AZ::Name name) { - m_name = name; + m_name = AZStd::move(name); } Object::ContainerType& Node::GetProperties() @@ -106,8 +108,8 @@ namespace AZ::Dom return m_children; } - Value::Value(AZStd::shared_ptr string) - : m_value(string) + Value::Value(SharedStringType sharedString) + : m_value(AZStd::move(sharedString)) { } @@ -122,18 +124,19 @@ namespace AZ::Dom Value::Value(Value&& value) noexcept { - operator=(value); + memcpy(this, &value, sizeof(Value)); + memset(&value, 0, sizeof(Value)); } - Value::Value(AZStd::string_view string, bool copy) + Value::Value(AZStd::string_view stringView, bool copy) { if (copy) { - CopyFromString(string); + CopyFromString(stringView); } else { - SetString(string); + SetString(stringView); } } @@ -227,7 +230,9 @@ namespace AZ::Dom Value& Value::operator=(Value&& other) noexcept { - m_value.swap(other.m_value); + SetNull(); + memcpy(this, &other, sizeof(Value)); + memset(&other, 0, sizeof(Value)); return *this; } @@ -265,7 +270,10 @@ namespace AZ::Dom void Value::Swap(Value& other) noexcept { - m_value.swap(other.m_value); + AZStd::aligned_storage_for_t temp; + memcpy(&temp, this, sizeof(Value)); + memcpy(this, &other, sizeof(Value)); + memcpy(&other, &temp, sizeof(Value)); } Type Dom::Value::GetType() const @@ -583,7 +591,7 @@ namespace AZ::Dom } else { - object.emplace_back(name, value); + object.emplace_back(AZStd::move(name), value); } return *this; } @@ -602,7 +610,7 @@ namespace AZ::Dom } else { - object.emplace_back(name, value); + object.emplace_back(AZStd::move(name), value); } return *this; } @@ -636,15 +644,12 @@ namespace AZ::Dom Object::Iterator Value::RemoveMember(Object::Iterator pos) { Object::ContainerType& object = GetObjectInternal(); - Object::Iterator nextIndex = object.end(); - auto lastEntry = object.end() - 1; - if (pos != lastEntry) + if (!object.empty()) { - AZStd::swap(*pos, *lastEntry); - nextIndex = pos; + AZStd::swap(*pos, object.back()); + object.pop_back(); } - object.resize(object.size() - 1); - return nextIndex; + return object.end(); } Object::Iterator Value::EraseMember(Object::ConstIterator pos) @@ -785,7 +790,7 @@ namespace AZ::Dom void Value::SetNode(AZ::Name name) { - m_value = AZStd::allocate_shared(StdValueAllocator(), name); + m_value = AZStd::allocate_shared(StdValueAllocator(), AZStd::move(name)); } void Value::SetNode(AZStd::string_view name) @@ -800,7 +805,7 @@ namespace AZ::Dom void Value::SetNodeName(AZ::Name name) { - GetNodeInternal().SetName(name); + GetNodeInternal().SetName(AZStd::move(name)); } void Value::SetNodeName(AZStd::string_view name) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 86e98030e2..a777640aaf 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -190,8 +190,8 @@ namespace AZ::Dom Value(); Value(const Value&); Value(Value&&) noexcept; - Value(AZStd::string_view string, bool copy); - Value(AZStd::shared_ptr string); + Value(AZStd::string_view stringView, bool copy); + Value(SharedStringType sharedString); Value(int32_t value); Value(uint32_t value); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index 9b814b1bff..3259579aaa 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -82,6 +82,16 @@ namespace AZ::Dom return VisitorSuccess(); } + template + void MoveVectorMemory(AZStd::vector& dest, AZStd::vector& source) + { + dest.resize_no_construct(source.size()); + const size_t size = sizeof(T) * source.size(); + memcpy(dest.data(), source.data(), size); + memset(source.data(), 0, size); + source.resize(0); + } + Visitor::Result ValueWriter::EndContainer(Type containerType, AZ::u64 attributeCount, AZ::u64 elementCount) { const char* endMethodName; @@ -138,22 +148,12 @@ namespace AZ::Dom } if (buffer.m_attributes.size() > 0) { - container.MemberReserve(buffer.m_attributes.size()); - for (AZStd::pair& entry : buffer.m_attributes) - { - container.AddMember(AZStd::move(entry.first), AZStd::move(entry.second)); - } - buffer.m_attributes.clear(); + MoveVectorMemory(container.GetMutableObject(), buffer.m_attributes); } if(buffer.m_elements.size() > 0) { - container.Reserve(buffer.m_elements.size()); - for (Value& entry : buffer.m_elements) - { - container.PushBack(AZStd::move(entry)); - } - buffer.m_elements.clear(); + MoveVectorMemory(container.GetMutableArray(), buffer.m_elements); } m_entryStack.pop(); @@ -180,7 +180,7 @@ namespace AZ::Dom { AZ_Assert(!m_entryStack.empty(), "Attempmted to push a key with no object"); AZ_Assert(!m_entryStack.top().m_container.IsArray(), "Attempted to push a key to an array"); - m_entryStack.top().m_key = key; + m_entryStack.top().m_key = AZStd::move(key); return VisitorSuccess(); } diff --git a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp index 477802dc37..8eda110e7b 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp @@ -120,6 +120,16 @@ namespace Benchmark AZ_Assert(result.IsSuccess(), "Failed to serialize generated JSON"); return serializedJson; } + + template + void TakeAndDiscardWithoutTimingDtor(T&& value, benchmark::State& state) + { + { + T instance = AZStd::move(value); + state.PauseTiming(); + } + state.ResumeTiming(); + } }; // Helper macro for registering JSON benchmarks @@ -148,7 +158,7 @@ namespace Benchmark return AZ::Dom::Utils::ReadFromStringInPlace(backend, payloadCopy, visitor); }); - benchmark::DoNotOptimize(result.GetValue()); + TakeAndDiscardWithoutTimingDtor(result.TakeValue(), state); } state.SetBytesProcessed(serializedPayload.size() * state.iterations()); @@ -172,7 +182,7 @@ namespace Benchmark return AZ::Dom::Utils::ReadFromStringInPlace(backend, payloadCopy, visitor); }); - benchmark::DoNotOptimize(result.GetValue()); + TakeAndDiscardWithoutTimingDtor(result.TakeValue(), state); } state.SetBytesProcessed(serializedPayload.size() * state.iterations()); @@ -192,7 +202,7 @@ namespace Benchmark return AZ::Dom::Utils::ReadFromString(backend, serializedPayload, AZ::Dom::Lifetime::Temporary, visitor); }); - benchmark::DoNotOptimize(result.GetValue()); + TakeAndDiscardWithoutTimingDtor(result.TakeValue(), state); } state.SetBytesProcessed(serializedPayload.size() * state.iterations()); @@ -212,7 +222,7 @@ namespace Benchmark return AZ::Dom::Utils::ReadFromString(backend, serializedPayload, AZ::Dom::Lifetime::Temporary, visitor); }); - benchmark::DoNotOptimize(result.GetValue()); + TakeAndDiscardWithoutTimingDtor(result.TakeValue(), state); } state.SetBytesProcessed(serializedPayload.size() * state.iterations()); @@ -228,7 +238,7 @@ namespace Benchmark { auto result = AZ::JsonSerializationUtils::ReadJsonString(serializedPayload); - benchmark::DoNotOptimize(result.GetValue()); + TakeAndDiscardWithoutTimingDtor(result.TakeValue(), state); } state.SetBytesProcessed(serializedPayload.size() * state.iterations()); @@ -239,7 +249,7 @@ namespace Benchmark { for (auto _ : state) { - benchmark::DoNotOptimize(GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1))); + TakeAndDiscardWithoutTimingDtor(GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1)), state); } state.SetItemsProcessed(state.range(0) * state.range(0) * state.iterations()); @@ -277,7 +287,7 @@ namespace Benchmark { rapidjson::Document copy; copy.CopyFrom(original, copy.GetAllocator(), true); - benchmark::DoNotOptimize(copy); + TakeAndDiscardWithoutTimingDtor(AZStd::move(copy), state); } state.SetItemsProcessed(state.iterations()); @@ -294,7 +304,7 @@ namespace Benchmark rapidjson::Document copy; copy.CopyFrom(original, copy.GetAllocator(), true); copy["entries"]["Key0"].PushBack(42, copy.GetAllocator()); - benchmark::DoNotOptimize(copy); + TakeAndDiscardWithoutTimingDtor(AZStd::move(copy), state); } state.SetItemsProcessed(state.iterations()); diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index af5b367d63..12684c64bc 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -98,13 +98,23 @@ namespace AZ::Dom::Benchmark return root; } + + template + void TakeAndDiscardWithoutTimingDtor(T&& value, benchmark::State& state) + { + { + T instance = AZStd::move(value); + state.PauseTiming(); + } + state.ResumeTiming(); + } }; BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueMakeComplexObject)(benchmark::State& state) { for (auto _ : state) { - benchmark::DoNotOptimize(GenerateDomBenchmarkPayload(state.range(0), state.range(1))); + TakeAndDiscardWithoutTimingDtor(GenerateDomBenchmarkPayload(state.range(0), state.range(1)), state); } state.SetItemsProcessed(state.range(0) * state.range(0) * state.iterations()); @@ -143,7 +153,7 @@ namespace AZ::Dom::Benchmark { Value copy = original; copy["entries"]["Key0"].PushBack(42); - benchmark::DoNotOptimize(copy); + TakeAndDiscardWithoutTimingDtor(AZStd::move(copy), state); } state.SetItemsProcessed(state.iterations()); @@ -162,7 +172,7 @@ namespace AZ::Dom::Benchmark for (auto _ : state) { Value copy = original.DeepCopy(); - benchmark::DoNotOptimize(copy); + TakeAndDiscardWithoutTimingDtor(AZStd::move(copy), state); } state.SetItemsProcessed(state.iterations()); From 68c93273d687bda5c57e88d9ab630ca6ee03b6f1 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Tue, 21 Dec 2021 16:09:11 -0800 Subject: [PATCH 176/399] Add 8 and 16 bit numeric type API Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 20 +++++++++++++++++++ Code/Framework/AzCore/AzCore/DOM/DomValue.h | 12 +++++++++++ 2 files changed, 32 insertions(+) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 407d1e66a2..f9f4f726dd 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -150,6 +150,26 @@ namespace AZ::Dom return Value(&value); } + Value::Value(int8_t value) + : m_value(aznumeric_cast(value)) + { + } + + Value::Value(uint8_t value) + : m_value(aznumeric_cast(value)) + { + } + + Value::Value(int16_t value) + : m_value(aznumeric_cast(value)) + { + } + + Value::Value(uint16_t value) + : m_value(aznumeric_cast(value)) + { + } + Value::Value(int32_t value) : m_value(aznumeric_cast(value)) { diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index a777640aaf..7ef794486e 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -193,6 +193,10 @@ namespace AZ::Dom Value(AZStd::string_view stringView, bool copy); Value(SharedStringType sharedString); + Value(int8_t value); + Value(uint8_t value); + Value(int16_t value); + Value(uint16_t value); Value(int32_t value); Value(uint32_t value); Value(int64_t value); @@ -321,12 +325,20 @@ namespace AZ::Dom void SetInt64(int64_t); int32_t GetInt32() const; void SetInt32(int32_t); + int16_t GetInt16() const; + void SetInt16(int16_t); + int8_t GetInt8() const; + void SetInt8(int8_t); // uint API... uint64_t GetUint64() const; void SetUint64(uint64_t); uint32_t GetUint32() const; void SetUint32(uint32_t); + uint16_t GetUint16() const; + void SetUint16(uint16_t); + uint8_t GetUint8() const; + void SetUint8(uint8_t); // bool API... bool GetBool() const; From deb3568aaa15e962b49fb5a0aa6b19960866fa73 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Tue, 21 Dec 2021 16:19:32 -0800 Subject: [PATCH 177/399] Fix up a couple opaque value cases Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 4 ++-- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index f9f4f726dd..01d7bcf6e1 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -1042,7 +1042,7 @@ namespace AZ::Dom const AZStd::any& Value::GetOpaqueValue() const { - return *AZStd::get>(m_value); + return *AZStd::get(m_value); } void Value::SetOpaqueValue(const AZStd::any& value) @@ -1165,7 +1165,7 @@ namespace AZ::Dom result = visitor.EndNode(object.size(), arrayContainer.size()); } } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { result = visitor.OpaqueValue(*arg); } diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 7ef794486e..b9c1062ed7 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -158,6 +158,7 @@ namespace AZ::Dom using ShortStringType = AZStd::fixed_string; using SharedStringContainer = AZStd::vector; using SharedStringType = AZStd::shared_ptr; + using OpaqueStorageType = AZStd::shared_ptr; //! The internal storage type for Value. //! These types do not correspond one-to-one with the Value's external Type as there may be multiple storage classes @@ -184,7 +185,7 @@ namespace AZ::Dom // Node NodePtr, // Opaque - AZStd::shared_ptr>; + OpaqueStorageType>; // Constructors... Value(); From fd70a2207e68dc456a91e23e5446f64b5a6971a6 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Tue, 21 Dec 2021 16:47:13 -0800 Subject: [PATCH 178/399] Address a few other small pieces of feedback Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 14 +++++--------- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 8 ++++---- .../Framework/AzCore/AzCore/DOM/DomValueWriter.cpp | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 01d7bcf6e1..7659afa070 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -113,10 +113,6 @@ namespace AZ::Dom { } - Value::Value() - { - } - Value::Value(const Value& value) : m_value(value.m_value) { @@ -344,7 +340,7 @@ namespace AZ::Dom bool Value::IsBool() const { - return AZStd::holds_alternative(m_value); + return GetType() == Type::Bool; } bool Value::IsNode() const @@ -383,17 +379,17 @@ namespace AZ::Dom bool Value::IsInt() const { - return AZStd::holds_alternative(m_value); + return GetType() == Type::Int64; } bool Value::IsUint() const { - return AZStd::holds_alternative(m_value); + return GetType() == Type::Uint64; } bool Value::IsDouble() const { - return AZStd::holds_alternative(m_value); + return GetType() == Type::Double; } bool Value::IsString() const @@ -666,7 +662,7 @@ namespace AZ::Dom Object::ContainerType& object = GetObjectInternal(); if (!object.empty()) { - AZStd::swap(*pos, object.back()); + *pos = AZStd::move(object.back()); object.pop_back(); } return object.end(); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index b9c1062ed7..b73da92d23 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -103,9 +103,9 @@ namespace AZ::Dom { public: Node() = default; - Node(AZ::Name name); - Node(const Node&) = default; - Node(Node&&) = default; + explicit Node(AZ::Name name); + explicit Node(const Node&) = default; + explicit Node(Node&&) = default; Node& operator=(const Node&) = default; Node& operator=(Node&&) = default; @@ -188,7 +188,7 @@ namespace AZ::Dom OpaqueStorageType>; // Constructors... - Value(); + Value() = default; Value(const Value&); Value(Value&&) noexcept; Value(AZStd::string_view stringView, bool copy); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index 3259579aaa..f8ca56ea32 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -70,7 +70,7 @@ namespace AZ::Dom Visitor::Result ValueWriter::RefCountedString(AZStd::shared_ptr> value, [[maybe_unused]] Lifetime lifetime) { - CurrentValue().SetString(value); + CurrentValue().SetString(AZStd::move(value)); return FinishWrite(); } From 8aa54659741a4f67861c43b94dfbd3008006ce61 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 21 Dec 2021 17:53:59 -0800 Subject: [PATCH 179/399] Resaving script graph which was old and causing some deserialization errors on game start Signed-off-by: Gene Walters --- ...oComponent_RPC_NetLevelEntity.scriptcanvas | 778 +++++++++++------- 1 file changed, 470 insertions(+), 308 deletions(-) diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas index 8e5a6b374c..3869dfdfcb 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas @@ -5,7 +5,7 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 5286394689911028851 + "id": 1685762441320719908 }, "Name": "AutoComponent_RPC_NetLevelEntity", "Components": { @@ -148,7 +148,7 @@ }, "isNullPointer": false, "$type": "double", - "value": 10.0, + "value": 99.0, "label": "Repetitions" }, { @@ -214,154 +214,6 @@ } } }, - { - "Id": { - "id": 28956289730909 - }, - "Name": "SC-EventNode(AuthorityToClientNoParams_PlayFx Notify Event)", - "Components": { - "Component_[12478098247313937239]": { - "$type": "AzEventHandler", - "Id": 12478098247313937239, - "Slots": [ - { - "id": { - "m_id": "{E97830A5-323D-4CD1-85CF-BAFB1735AC34}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - { - "$type": "ConnectionLimitContract", - "limit": 1 - }, - { - "$type": "RestrictedNodeContract", - "m_nodeId": { - "id": 28466663459165 - } - } - ], - "slotName": "Connect", - "toolTip": "Connect the AZ Event to this AZ Event Handler.", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{2A7ABD07-368B-44F3-BB16-946539B76A16}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "Disconnect", - "toolTip": "Disconnect current AZ Event from this AZ Event Handler.", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{E1C7B2B6-B5ED-4BA6-8484-A74F336CD53F}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "On Connected", - "toolTip": "Signaled when a connection has taken place.", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{2731EE09-9E48-4EDB-9548-024EAAC23A03}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "On Disconnected", - "toolTip": "Signaled when this event handler is disconnected.", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{1F11AAA9-2A99-41A2-AABE-7B57463E3664}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "OnEvent", - "toolTip": "Triggered when the AZ Event invokes Signal() function.", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - }, - "IsLatent": true - }, - { - "id": { - "m_id": "{7A4D75C3-C9C8-4CFB-A87C-C15B71AB3296}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - { - "$type": "ConnectionLimitContract", - "limit": 1 - }, - { - "$type": "RestrictedNodeContract", - "m_nodeId": { - "id": 28466663459165 - } - } - ], - "slotName": "AuthorityToClientNoParams_PlayFx Notify Event", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 2 - }, - "DataType": 1 - } - ], - "Datums": [ - { - "isOverloadedStorage": false, - "scriptCanvasType": { - "m_type": 4, - "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" - }, - "isNullPointer": true, - "label": "AuthorityToClientNoParams_PlayFx Notify Event" - } - ], - "m_azEventEntry": { - "m_eventName": "AuthorityToClientNoParams_PlayFx Notify Event", - "m_eventSlotId": { - "m_id": "{7A4D75C3-C9C8-4CFB-A87C-C15B71AB3296}" - } - } - } - } - }, { "Id": { "id": 57003906901432 @@ -578,9 +430,9 @@ } } ], - "m_format": "AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some superficial fx.\n", + "m_format": "AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some fx.\n", "m_unresolvedString": [ - "AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some superficial fx.\n" + "AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some fx.\n" ] } } @@ -627,13 +479,160 @@ } } ], - "m_format": "AutoComponent_RPC_NetLevelEntity: I'm a client playing some superficial fx.\n", + "m_format": "AutoComponent_RPC_NetLevelEntity: I'm a client playing some fx.\n", "m_unresolvedString": [ - "AutoComponent_RPC_NetLevelEntity: I'm a client playing some superficial fx.\n" + "AutoComponent_RPC_NetLevelEntity: I'm a client playing some fx.\n" ] } } }, + { + "Id": { + "id": 8318619017825 + }, + "Name": "SC-EventNode(AuthorityToClientNoParams_PlayFx Notify Event)", + "Components": { + "Component_[15772128920819427182]": { + "$type": "AzEventHandler", + "Id": 15772128920819427182, + "Slots": [ + { + "id": { + "m_id": "{2A42C379-8E3B-46EF-BC63-C1D5395CB583}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 7820402811489 + } + } + ], + "slotName": "Connect", + "toolTip": "Connect the AZ Event to this AZ Event Handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{3DB9829E-6088-49B9-A56D-4D1884C679BD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect current AZ Event from this AZ Event Handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{9AC3CF57-B648-4B43-8FCA-8576B6EA350B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Connected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{5FB8D529-6FC6-4543-99B5-5B147EBD7BE6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Disconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{0481BBFE-D31E-421F-A6C2-8A7AF3012545}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnEvent", + "toolTip": "Triggered when the AZ Event invokes Signal() function.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{5F809F1C-ED4E-4391-9E33-AD3B64561A40}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 7820402811489 + } + } + ], + "slotName": "AuthorityToClientNoParams_PlayFx Notify Event", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" + }, + "isNullPointer": true, + "label": "AuthorityToClientNoParams_PlayFx Notify Event" + } + ], + "m_azEventEntry": { + "m_eventName": "AuthorityToClientNoParams_PlayFx Notify Event", + "m_eventSlotId": { + "m_id": "{5F809F1C-ED4E-4391-9E33-AD3B64561A40}" + } + } + } + } + }, { "Id": { "id": 56991021999544 @@ -657,8 +656,32 @@ "toolTip": "Input signal", "Descriptor": { "ConnectionType": 1, - "SlotType": 1 - } + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{CEBD2B9C-7DBA-486A-88DB-19F9C406B18E}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Value", + "toolTip": "Value which replaces instances of {Value} in the resulting string.", + "DisplayDataType": { + "m_type": 5 + }, + "DisplayGroup": { + "Value": 1015031923 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 }, { "id": { @@ -676,10 +699,36 @@ } } ], - "m_format": "AutoComponent_RPC_NetLevelEntity Activated!\n", + "Datums": [ + { + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Value" + } + ], + "m_format": "AutoComponent_RPC_NetLevelEntity Activated on entity: {Value}\n", + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{CEBD2B9C-7DBA-486A-88DB-19F9C406B18E}" + } + } + ], "m_unresolvedString": [ - "AutoComponent_RPC_NetLevelEntity Activated!\n" - ] + "AutoComponent_RPC_NetLevelEntity Activated on entity: ", + {}, + "\n" + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{CEBD2B9C-7DBA-486A-88DB-19F9C406B18E}" + } + } } } }, @@ -715,17 +764,17 @@ }, { "Id": { - "id": 28466663459165 + "id": 8310662318335 }, - "Name": "SC-Node(GetAuthorityToClientNoParams_PlayFxEventByEntityId)", + "Name": "SC-Node(GetEntityName)", "Components": { - "Component_[5890343372099746558]": { + "Component_[2232030369305027010]": { "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", - "Id": 5890343372099746558, + "Id": 2232030369305027010, "Slots": [ { "id": { - "m_id": "{4E1A6903-3F02-4395-A4C9-202D1F13250E}" + "m_id": "{F69C5762-0CAB-4A54-9C81-C99CDB73C834}" }, "contracts": [ { @@ -741,7 +790,7 @@ }, { "id": { - "m_id": "{26902930-1BC7-4BF6-8F41-C313BA819AA3}" + "m_id": "{03554C56-8237-4C19-B9F8-87DEA1AC3ED0}" }, "contracts": [ { @@ -756,7 +805,7 @@ }, { "id": { - "m_id": "{B6C92656-7593-4759-B657-98DB7CA30482}" + "m_id": "{6ECBD749-25FE-4813-B34E-EF46BC09E616}" }, "contracts": [ { @@ -771,17 +820,16 @@ }, { "id": { - "m_id": "{10D59D8F-E406-431B-87F9-FC1AF1EC65AF}" + "m_id": "{36D47097-8F0C-4CBD-8DE2-32F4754C569F}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "Event<>", + "slotName": "String", "DisplayDataType": { - "m_type": 4, - "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" + "m_type": 5 }, "Descriptor": { "ConnectionType": 2, @@ -792,7 +840,6 @@ ], "Datums": [ { - "isOverloadedStorage": false, "scriptCanvasType": { "m_type": 1 }, @@ -801,18 +848,21 @@ "value": { "id": 2901262558 }, - "label": "EntityId: 0" + "label": "Entity Id" } ], - "methodType": 2, - "methodName": "GetAuthorityToClientNoParams_PlayFxEventByEntityId", - "className": "NetworkTestPlayerComponent", + "methodType": 0, + "methodName": "GetEntityName", + "className": "GameEntityContextRequestBus", + "resultSlotIDs": [ + {} + ], "inputSlots": [ { - "m_id": "{4E1A6903-3F02-4395-A4C9-202D1F13250E}" + "m_id": "{F69C5762-0CAB-4A54-9C81-C99CDB73C834}" } ], - "prettyClassName": "NetworkTestPlayerComponent" + "prettyClassName": "GameEntityContextRequestBus" } } }, @@ -1040,46 +1090,123 @@ } } } - } - ], - "m_connections": [ + }, { "Id": { - "id": 57029676705208 + "id": 7820402811489 }, - "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(TimeDelay: Start)", + "Name": "SC-Node(GetAuthorityToClientNoParams_PlayFxEventByEntityId)", "Components": { - "Component_[5204535376548158590]": { - "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 5204535376548158590, - "sourceEndpoint": { - "nodeId": { - "id": 57025381737912 + "Component_[9263945554457190064]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 9263945554457190064, + "Slots": [ + { + "id": { + "m_id": "{F22A7438-E72F-4757-90D9-99F03C91E10D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityId: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 }, - "slotId": { - "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" - } - }, - "targetEndpoint": { - "nodeId": { - "id": 57012496836024 + { + "id": { + "m_id": "{510F56FD-6778-4DB8-BDDE-258335431CC6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } }, - "slotId": { - "m_id": "{EA0DF0AE-2FF7-4670-8D99-7CF863038E68}" + { + "id": { + "m_id": "{94C2AF04-6BFA-4E5A-9490-C7479A7AF61E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{9C6DDF96-6BF0-45ED-B15F-2E6C2FF5F886}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Event<>", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 } - } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "EntityId: 0" + } + ], + "methodType": 2, + "methodName": "GetAuthorityToClientNoParams_PlayFxEventByEntityId", + "className": "NetworkTestPlayerComponent", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{F22A7438-E72F-4757-90D9-99F03C91E10D}" + } + ], + "prettyClassName": "NetworkTestPlayerComponent" } } - }, + } + ], + "m_connections": [ { "Id": { - "id": 57042561607096 + "id": 57029676705208 }, - "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId: In)", + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(TimeDelay: Start)", "Components": { - "Component_[17563947682404363417]": { + "Component_[5204535376548158590]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 17563947682404363417, + "Id": 5204535376548158590, "sourceEndpoint": { "nodeId": { "id": 57025381737912 @@ -1090,10 +1217,10 @@ }, "targetEndpoint": { "nodeId": { - "id": 57021086770616 + "id": 57012496836024 }, "slotId": { - "m_id": "{5CDED810-9455-424A-9A1D-40B9366D1F94}" + "m_id": "{EA0DF0AE-2FF7-4670-8D99-7CF863038E68}" } } } @@ -1101,27 +1228,27 @@ }, { "Id": { - "id": 57046856574392 + "id": 57055446508984 }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: OnEvent), destEndpoint=(Print: In)", + "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(Repeater: Start)", "Components": { - "Component_[12226462283795741406]": { + "Component_[6292481678297438578]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 12226462283795741406, + "Id": 6292481678297438578, "sourceEndpoint": { "nodeId": { - "id": 57016791803320 + "id": 57012496836024 }, "slotId": { - "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" } }, "targetEndpoint": { "nodeId": { - "id": 56995316966840 + "id": 56986727032248 }, "slotId": { - "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" + "m_id": "{07267CBA-B377-4B57-8A04-E322F8BFC07F}" } } } @@ -1129,27 +1256,27 @@ }, { "Id": { - "id": 57051151541688 + "id": 9392713697629 }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: OnEvent), destEndpoint=(DrawTextOnEntity: In)", + "Name": "srcEndpoint=(Repeater: Action), destEndpoint=(AuthorityToClientNoParams_PlayFxByEntityId: In)", "Components": { - "Component_[7209285242155620531]": { + "Component_[17811480012084226596]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 7209285242155620531, + "Id": 17811480012084226596, "sourceEndpoint": { "nodeId": { - "id": 57016791803320 + "id": 56986727032248 }, "slotId": { - "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" } }, "targetEndpoint": { "nodeId": { - "id": 57003906901432 + "id": 8400576252253 }, "slotId": { - "m_id": "{1673B8A0-D4EC-4CC7-8F80-0419BB5560EB}" + "m_id": "{AB0D7C00-A334-449A-AC56-EA3167AB8900}" } } } @@ -1157,27 +1284,27 @@ }, { "Id": { - "id": 57055446508984 + "id": 10269167405311 }, - "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(Repeater: Start)", + "Name": "srcEndpoint=(GetEntityName: String), destEndpoint=(Print: Value)", "Components": { - "Component_[6292481678297438578]": { + "Component_[11931728297561282182]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 6292481678297438578, + "Id": 11931728297561282182, "sourceEndpoint": { "nodeId": { - "id": 57012496836024 + "id": 8310662318335 }, "slotId": { - "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" + "m_id": "{36D47097-8F0C-4CBD-8DE2-32F4754C569F}" } }, "targetEndpoint": { "nodeId": { - "id": 56986727032248 + "id": 56991021999544 }, "slotId": { - "m_id": "{07267CBA-B377-4B57-8A04-E322F8BFC07F}" + "m_id": "{CEBD2B9C-7DBA-486A-88DB-19F9C406B18E}" } } } @@ -1185,19 +1312,19 @@ }, { "Id": { - "id": 57068331410872 + "id": 11042261518591 }, - "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(Print: In)", + "Name": "srcEndpoint=(GetEntityName: Out), destEndpoint=(Print: In)", "Components": { - "Component_[11504712829988319988]": { + "Component_[5559381044656171146]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 11504712829988319988, + "Id": 5559381044656171146, "sourceEndpoint": { "nodeId": { - "id": 57025381737912 + "id": 8310662318335 }, "slotId": { - "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" + "m_id": "{6ECBD749-25FE-4813-B34E-EF46BC09E616}" } }, "targetEndpoint": { @@ -1213,27 +1340,27 @@ }, { "Id": { - "id": 9392713697629 + "id": 36365388695807 }, - "Name": "srcEndpoint=(Repeater: Action), destEndpoint=(AuthorityToClientNoParams_PlayFxByEntityId: In)", + "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(GetEntityName: In)", "Components": { - "Component_[17811480012084226596]": { + "Component_[5574600651313925988]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 17811480012084226596, + "Id": 5574600651313925988, "sourceEndpoint": { "nodeId": { - "id": 56986727032248 + "id": 57012496836024 }, "slotId": { - "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" + "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" } }, "targetEndpoint": { "nodeId": { - "id": 8400576252253 + "id": 8310662318335 }, "slotId": { - "m_id": "{AB0D7C00-A334-449A-AC56-EA3167AB8900}" + "m_id": "{03554C56-8237-4C19-B9F8-87DEA1AC3ED0}" } } } @@ -1241,27 +1368,27 @@ }, { "Id": { - "id": 9732016114013 + "id": 9022993654369 }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFxByEntityId: Out), destEndpoint=(Print: In)", + "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: Event<>), destEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: AuthorityToClientNoParams_PlayFx Notify Event)", "Components": { - "Component_[14133537125895802472]": { + "Component_[4910818715692868417]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 14133537125895802472, + "Id": 4910818715692868417, "sourceEndpoint": { "nodeId": { - "id": 8400576252253 + "id": 7820402811489 }, "slotId": { - "m_id": "{A52302D6-9DF9-45C2-960D-19BF90A4A931}" + "m_id": "{9C6DDF96-6BF0-45ED-B15F-2E6C2FF5F886}" } }, "targetEndpoint": { "nodeId": { - "id": 56999611934136 + "id": 8318619017825 }, "slotId": { - "m_id": "{2F11CF04-DC4B-4881-8D74-AB0E51B4A278}" + "m_id": "{5F809F1C-ED4E-4391-9E33-AD3B64561A40}" } } } @@ -1269,27 +1396,27 @@ }, { "Id": { - "id": 29660664367453 + "id": 9078828229217 }, - "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: Event<>), destEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: AuthorityToClientNoParams_PlayFx Notify Event)", + "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: Out), destEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: Connect)", "Components": { - "Component_[17084894170988218373]": { + "Component_[16758724763058723803]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 17084894170988218373, + "Id": 16758724763058723803, "sourceEndpoint": { "nodeId": { - "id": 28466663459165 + "id": 7820402811489 }, "slotId": { - "m_id": "{10D59D8F-E406-431B-87F9-FC1AF1EC65AF}" + "m_id": "{94C2AF04-6BFA-4E5A-9490-C7479A7AF61E}" } }, "targetEndpoint": { "nodeId": { - "id": 28956289730909 + "id": 8318619017825 }, "slotId": { - "m_id": "{7A4D75C3-C9C8-4CFB-A87C-C15B71AB3296}" + "m_id": "{2A42C379-8E3B-46EF-BC63-C1D5395CB583}" } } } @@ -1297,27 +1424,27 @@ }, { "Id": { - "id": 29716498942301 + "id": 9808972669537 }, - "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: Out), destEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: Connect)", + "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: In)", "Components": { - "Component_[6504512854579046293]": { + "Component_[597205010205160938]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 6504512854579046293, + "Id": 597205010205160938, "sourceEndpoint": { "nodeId": { - "id": 28466663459165 + "id": 57012496836024 }, "slotId": { - "m_id": "{B6C92656-7593-4759-B657-98DB7CA30482}" + "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" } }, "targetEndpoint": { "nodeId": { - "id": 28956289730909 + "id": 7820402811489 }, "slotId": { - "m_id": "{E97830A5-323D-4CD1-85CF-BAFB1735AC34}" + "m_id": "{510F56FD-6778-4DB8-BDDE-258335431CC6}" } } } @@ -1325,27 +1452,27 @@ }, { "Id": { - "id": 30240484952413 + "id": 10148275085921 }, - "Name": "srcEndpoint=(: ), destEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: In)", + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: OnEvent), destEndpoint=(Print: In)", "Components": { - "Component_[4329986353751309486]": { + "Component_[1594149632687531010]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 4329986353751309486, + "Id": 1594149632687531010, "sourceEndpoint": { "nodeId": { - "id": 57025381737912 + "id": 8318619017825 }, "slotId": { - "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" + "m_id": "{0481BBFE-D31E-421F-A6C2-8A7AF3012545}" } }, "targetEndpoint": { "nodeId": { - "id": 28466663459165 + "id": 56995316966840 }, "slotId": { - "m_id": "{26902930-1BC7-4BF6-8F41-C313BA819AA3}" + "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" } } } @@ -1353,19 +1480,19 @@ }, { "Id": { - "id": 30678571616605 + "id": 10629311423073 }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: OnEvent), destEndpoint=(: )", + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: OnEvent), destEndpoint=(DrawTextOnEntity: In)", "Components": { - "Component_[14658596010250057469]": { + "Component_[17976200298405988971]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 14658596010250057469, + "Id": 17976200298405988971, "sourceEndpoint": { "nodeId": { - "id": 28956289730909 + "id": 8318619017825 }, "slotId": { - "m_id": "{1F11AAA9-2A99-41A2-AABE-7B57463E3664}" + "m_id": "{0481BBFE-D31E-421F-A6C2-8A7AF3012545}" } }, "targetEndpoint": { @@ -1381,27 +1508,27 @@ }, { "Id": { - "id": 31060823705949 + "id": 42045766425613 }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: OnEvent), destEndpoint=(: )", + "Name": "srcEndpoint=(Repeater: Action), destEndpoint=(Print: In)", "Components": { - "Component_[16833378372852944435]": { + "Component_[1911118463107071864]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 16833378372852944435, + "Id": 1911118463107071864, "sourceEndpoint": { "nodeId": { - "id": 28956289730909 + "id": 56986727032248 }, "slotId": { - "m_id": "{1F11AAA9-2A99-41A2-AABE-7B57463E3664}" + "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" } }, "targetEndpoint": { "nodeId": { - "id": 56995316966840 + "id": 56999611934136 }, "slotId": { - "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" + "m_id": "{2F11CF04-DC4B-4881-8D74-AB0E51B4A278}" } } } @@ -1418,7 +1545,7 @@ "GraphCanvasData": [ { "Key": { - "id": 8400576252253 + "id": 7820402811489 }, "Value": { "ComponentData": { @@ -1432,8 +1559,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 440.0, - -20.0 + -100.0, + 400.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1442,14 +1569,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{2B6329F7-4CE7-4E01-B1A4-1FFCAB2D0B72}" + "PersistentId": "{F35F8202-B5EE-4ADD-9FF6-AF214A094266}" } } } }, { "Key": { - "id": 28466663459165 + "id": 8310662318335 }, "Value": { "ComponentData": { @@ -1463,8 +1590,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - -200.0, - 300.0 + 80.0, + -320.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1473,14 +1600,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{A84996D5-99BD-4F5D-859E-02BFAB3FA83A}" + "PersistentId": "{346AFC26-B2EF-4495-AA1A-347BF77CB99D}" } } } }, { "Key": { - "id": 28956289730909 + "id": 8318619017825 }, "Value": { "ComponentData": { @@ -1494,8 +1621,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 260.0, - 300.0 + 340.0, + 400.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1504,7 +1631,38 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{B237687E-F57E-4C04-9B46-103548751B5D}" + "PersistentId": "{67499699-CA73-48B4-87E0-C66F4A3EA7CB}" + } + } + } + }, + { + "Key": { + "id": 8400576252253 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 420.0, + -60.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{2B6329F7-4CE7-4E01-B1A4-1FFCAB2D0B72}" } } } @@ -1555,8 +1713,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - -240.0, - -300.0 + 540.0, + -320.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1615,8 +1773,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 960.0, - -40.0 + 420.0, + 100.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1722,15 +1880,15 @@ }, { "Key": { - "id": 5286394689911028851 + "id": 1685762441320719908 }, "Value": { "ComponentData": { "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { "$type": "SceneComponentSaveData", "ViewParams": { - "AnchorX": -579.0, - "AnchorY": -194.0 + "AnchorX": -349.0, + "AnchorY": 10.0 } } } @@ -1767,6 +1925,10 @@ "Key": 11983076003173356132, "Value": 1 }, + { + "Key": 13774516196858047560, + "Value": 1 + }, { "Key": 13774516226790665785, "Value": 1 From 9aec7d311382de38d9c84a7fb151206b350a41e7 Mon Sep 17 00:00:00 2001 From: sphrose <82213493+sphrose@users.noreply.github.com> Date: Wed, 22 Dec 2021 10:43:37 +0000 Subject: [PATCH 180/399] Fix compile issues in tests Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com> --- Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp | 2 +- Gems/Vegetation/Code/Tests/VegetationComponentFilterTests.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp index 8f4420bcc5..9d182312a4 100644 --- a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp +++ b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp @@ -288,7 +288,7 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestRegisteredTags) ASSERT_TRUE(AZStd::find_if( registeredTags.begin(), registeredTags.end(), - [searchTerm](decltype(registeredTags)::value_type pair) + [=](decltype(registeredTags)::value_type pair) { return pair.second == searchTerm; })); diff --git a/Gems/Vegetation/Code/Tests/VegetationComponentFilterTests.cpp b/Gems/Vegetation/Code/Tests/VegetationComponentFilterTests.cpp index 221a2da432..bb1efb5ebd 100644 --- a/Gems/Vegetation/Code/Tests/VegetationComponentFilterTests.cpp +++ b/Gems/Vegetation/Code/Tests/VegetationComponentFilterTests.cpp @@ -108,7 +108,7 @@ namespace UnitTest Vegetation::SurfaceMaskDepthFilterConfig config; config.m_lowerDistance = -1000.0f; config.m_upperDistance = -0.5f; - config.m_depthComparisonTags.push_back(SurfaceData::Constants::s_terrainTagCrc); + config.m_depthComparisonTags.push_back(SurfaceData::Constants::s_unassignedTagCrc); Vegetation::SurfaceMaskDepthFilterComponent* component = nullptr; auto entity = CreateEntity(config, &component, [](AZ::Entity* e) @@ -120,7 +120,7 @@ namespace UnitTest mockSurfaceHandler.m_outPosition = AZ::Vector3::CreateZero(); mockSurfaceHandler.m_outNormal = AZ::Vector3::CreateAxisZ(); mockSurfaceHandler.m_outMasks.clear(); - mockSurfaceHandler.m_outMasks[SurfaceData::Constants::s_terrainTagCrc] = 1.0f; + mockSurfaceHandler.m_outMasks[SurfaceData::Constants::s_unassignedTagCrc] = 1.0f; // passes { From aafb9e81106e140949c9096c2c3c05880ea03e62 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Wed, 22 Dec 2021 10:38:04 -0600 Subject: [PATCH 181/399] Misc Bugfixes (#6530) * Bugfix: AreaIds don't compare correctly when the priority bus doesn't have a listener. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> (cherry picked from commit eb9e95fcb3884dee638b9032785b828359b0d8c0) * Bugfix: Only deactivate a component if it's currently active. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> (cherry picked from commit 7c9e4b7de49e8fe009616651d6e09f66c356db38) * Switched shared_lock to unique_lock, since the data is being written to. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Moved Legacy::CryCommon build dependency to correct location. It was a public build dependency in FastNoise and GradientSignal, but really only should be a private dependency in Vegetation due to the vegetation system needing some init/shutdown events. Fixing this up also required cleanup of a few unused legacy remnants in other files. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * InWorldBounds was incorrectly checking the X bounds against the Z bounds. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Removed some additional unneeded legacy code that was now causing compile errors. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Addressed PR feedback. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Adjusted cmake dependencies again, based on what's needed in the public header files in the gems. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Second attempt at the Deactivate() fix, this time by tracking the nested component state. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Addressed PR feedback, made operation symmetrical. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added CryCommon privately to other veg modules too, since they all reference AreaSystemComponent, which uses the legacy events. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Source/Animation/AttachmentComponent.cpp | 1 - .../SurfaceData/SurfaceDataMeshComponent.cpp | 2 -- Gems/FastNoise/Code/CMakeLists.txt | 4 ++- Gems/FastNoise/Code/Tests/FastNoiseTest.cpp | 28 ------------------- Gems/GradientSignal/Code/CMakeLists.txt | 15 +++++++--- .../Code/Include/GradientSignal/Util.h | 5 ---- .../Component/EditorWrappedComponentBase.h | 1 + .../Component/EditorWrappedComponentBase.inl | 16 +++++++++-- .../include/LmbrCentral/Rendering/MeshAsset.h | 2 -- .../Source/TerrainSystem/TerrainSystem.cpp | 13 +++++---- Gems/Vegetation/Code/CMakeLists.txt | 4 +++ 11 files changed, 39 insertions(+), 52 deletions(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp index 74e01c7829..e8cf03d26e 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.cpp index d8cae4564d..862e3599a3 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.cpp @@ -17,8 +17,6 @@ #include #include -#include - namespace SurfaceData { void SurfaceDataMeshConfig::Reflect(AZ::ReflectContext* context) diff --git a/Gems/FastNoise/Code/CMakeLists.txt b/Gems/FastNoise/Code/CMakeLists.txt index 76b2cb4bd1..819592e018 100644 --- a/Gems/FastNoise/Code/CMakeLists.txt +++ b/Gems/FastNoise/Code/CMakeLists.txt @@ -18,9 +18,11 @@ ly_add_target( Include BUILD_DEPENDENCIES PUBLIC - Legacy::CryCommon Gem::GradientSignal + PUBLIC + AZ::AzCore PRIVATE + AZ::AzFramework Gem::LmbrCentral ) diff --git a/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp b/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp index 3fb60cdaf6..bae1d424c7 100644 --- a/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp +++ b/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp @@ -7,9 +7,6 @@ */ #include -#include -#include -#include #include #include @@ -101,28 +98,6 @@ public: void SetAdvancedMode([[maybe_unused]] bool value) override {} }; -struct MockGlobalEnvironment -{ - MockGlobalEnvironment() - { - m_stubEnv.pCryPak = &m_stubPak; - m_stubEnv.pConsole = &m_stubConsole; - m_stubEnv.pSystem = &m_stubSystem; - gEnv = &m_stubEnv; - } - - ~MockGlobalEnvironment() - { - gEnv = nullptr; - } - -private: - SSystemGlobalEnvironment m_stubEnv; - testing::NiceMock m_stubPak; - testing::NiceMock m_stubConsole; - testing::NiceMock m_stubSystem; -}; - TEST(FastNoiseTest, ComponentsWithComponentApplication) { AZ::ComponentApplication::Descriptor appDesc; @@ -130,8 +105,6 @@ TEST(FastNoiseTest, ComponentsWithComponentApplication) appDesc.m_recordingMode = AZ::Debug::AllocationRecords::RECORD_FULL; appDesc.m_stackRecordLevels = 20; - MockGlobalEnvironment mocks; - AZ::ComponentApplication app; AZ::Entity* systemEntity = app.Create(appDesc); ASSERT_TRUE(systemEntity != nullptr); @@ -186,7 +159,6 @@ public: AZ::ComponentApplication m_application; AZ::Entity* m_systemEntity; - MockGlobalEnvironment m_mocks; }; ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index 5b88044116..c0b36f4b12 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -18,10 +18,11 @@ ly_add_target( Include BUILD_DEPENDENCIES PUBLIC - Legacy::CryCommon + AZ::AzCore + AZ::AtomCore + AZ::AzFramework Gem::SurfaceData Gem::ImageProcessingAtom.Headers - PRIVATE Gem::LmbrCentral ) @@ -37,9 +38,11 @@ ly_add_target( Include BUILD_DEPENDENCIES PRIVATE - Gem::GradientSignal.Static Gem::LmbrCentral PUBLIC + AZ::AzCore + AZ::AtomCore + Gem::GradientSignal.Static Gem::ImageProcessingAtom.Headers # Atom/ImageProcessing/PixelFormats.h is part of a header in Includes RUNTIME_DEPENDENCIES Gem::LmbrCentral @@ -69,7 +72,9 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) Gem::LmbrCentral.Editor PUBLIC 3rdParty::Qt::Widgets - Legacy::CryCommon + AZ::AzCore + AZ::AtomCore + AZ::AzFramework AZ::AzToolsFramework AZ::AssetBuilderSDK Gem::GradientSignal.Static @@ -92,6 +97,8 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) PRIVATE Gem::GradientSignal.Editor.Static Gem::LmbrCentral.Editor + PUBLIC + AZ::AtomCore RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor ) diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Util.h b/Gems/GradientSignal/Code/Include/GradientSignal/Util.h index 1e0ae79e08..a6dbe118af 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Util.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Util.h @@ -14,11 +14,6 @@ #include #include -namespace LmbrCentral -{ - class MeshAsset; -} - namespace GradientSignal { enum class WrappingType : AZ::u8 diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Component/EditorWrappedComponentBase.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Component/EditorWrappedComponentBase.h index 29169ec9d7..af7509e3a6 100644 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Component/EditorWrappedComponentBase.h +++ b/Gems/LmbrCentral/Code/include/LmbrCentral/Component/EditorWrappedComponentBase.h @@ -56,6 +56,7 @@ namespace LmbrCentral TComponent m_component; TConfiguration m_configuration; bool m_visible = true; + bool m_runtimeComponentActive = false; }; } // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Component/EditorWrappedComponentBase.inl b/Gems/LmbrCentral/Code/include/LmbrCentral/Component/EditorWrappedComponentBase.inl index 6a9fceabbf..ee5dbe867e 100644 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Component/EditorWrappedComponentBase.inl +++ b/Gems/LmbrCentral/Code/include/LmbrCentral/Component/EditorWrappedComponentBase.inl @@ -177,6 +177,7 @@ namespace LmbrCentral void EditorWrappedComponentBase::Init() { AzToolsFramework::Components::EditorComponentBase::Init(); + m_runtimeComponentActive = false; m_component.ReadInConfig(&m_configuration); m_component.Init(); } @@ -196,6 +197,7 @@ namespace LmbrCentral if (m_visible) { m_component.Activate(); + m_runtimeComponentActive = true; } } @@ -205,8 +207,10 @@ namespace LmbrCentral AzToolsFramework::EditorVisibilityNotificationBus::Handler::BusDisconnect(); AzToolsFramework::Components::EditorComponentBase::Deactivate(); + m_runtimeComponentActive = false; m_component.Deactivate(); - m_component.SetEntity(nullptr); // remove the entity association, in case the parent component is being removed, otherwise the component will be reactivated + // remove the entity association, in case the parent component is being removed, otherwise the component will be reactivated + m_component.SetEntity(nullptr); } template @@ -222,12 +226,18 @@ namespace LmbrCentral template AZ::u32 EditorWrappedComponentBase::ConfigurationChanged() { - m_component.Deactivate(); + if (m_runtimeComponentActive) + { + m_runtimeComponentActive = false; + m_component.Deactivate(); + } + m_component.ReadInConfig(&m_configuration); - if (m_visible && m_component.GetEntity()) + if (m_visible && !m_runtimeComponentActive) { m_component.Activate(); + m_runtimeComponentActive = true; } return AZ::Edit::PropertyRefreshLevels::None; diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MeshAsset.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MeshAsset.h index b4cefa8502..329687ab82 100644 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MeshAsset.h +++ b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MeshAsset.h @@ -9,8 +9,6 @@ #include -#include - namespace LmbrCentral { class MeshAsset diff --git a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp index bc951f7c48..1b2dedd469 100644 --- a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp +++ b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp @@ -25,10 +25,12 @@ bool TerrainLayerPriorityComparator::operator()(const AZ::EntityId& layer1id, co { // Comparator for insertion/keylookup. // Sorts into layer/priority order, highest priority first. - AZ::u32 priority1, layer1; + AZ::u32 priority1 = 0; + AZ::u32 layer1 = 0; Terrain::TerrainSpawnerRequestBus::Event(layer1id, &Terrain::TerrainSpawnerRequestBus::Events::GetPriority, layer1, priority1); - AZ::u32 priority2, layer2; + AZ::u32 priority2 = 0; + AZ::u32 layer2 = 0; Terrain::TerrainSpawnerRequestBus::Event(layer2id, &Terrain::TerrainSpawnerRequestBus::Events::GetPriority, layer2, priority2); if (layer1 < layer2) @@ -80,7 +82,7 @@ void TerrainSystem::Activate() m_requestedSettings.m_systemActive = true; { - AZStd::shared_lock lock(m_areaMutex); + AZStd::unique_lock lock(m_areaMutex); m_registeredAreas.clear(); } @@ -109,7 +111,7 @@ void TerrainSystem::Deactivate() AzFramework::Terrain::TerrainDataRequestBus::Handler::BusDisconnect(); { - AZStd::shared_lock lock(m_areaMutex); + AZStd::unique_lock lock(m_areaMutex); m_registeredAreas.clear(); } @@ -163,8 +165,7 @@ void TerrainSystem::ClampPosition(float x, float y, AZ::Vector2& outPosition, AZ bool TerrainSystem::InWorldBounds(float x, float y) const { - const float zTestValue = m_currentSettings.m_worldBounds.GetMin().GetX() + - ((m_currentSettings.m_worldBounds.GetMax().GetX() - m_currentSettings.m_worldBounds.GetMin().GetX()) / 2.0f); + const float zTestValue = m_currentSettings.m_worldBounds.GetMin().GetZ(); const AZ::Vector3 testValue{ x, y, zTestValue }; if (m_currentSettings.m_worldBounds.Contains(testValue)) { diff --git a/Gems/Vegetation/Code/CMakeLists.txt b/Gems/Vegetation/Code/CMakeLists.txt index 53fa6bd59f..c5e2accc9e 100644 --- a/Gems/Vegetation/Code/CMakeLists.txt +++ b/Gems/Vegetation/Code/CMakeLists.txt @@ -24,6 +24,7 @@ ly_add_target( PRIVATE Gem::LmbrCentral Gem::SurfaceData + Legacy::CryCommon PUBLIC Gem::AtomLyIntegration_CommonFeatures.Static RUNTIME_DEPENDENCIES @@ -43,6 +44,7 @@ ly_add_target( BUILD_DEPENDENCIES PRIVATE Gem::Vegetation.Static + Legacy::CryCommon RUNTIME_DEPENDENCIES Gem::LmbrCentral Gem::GradientSignal @@ -72,6 +74,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) PRIVATE Gem::Vegetation.Static AZ::AzToolsFramework + Legacy::CryCommon RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor Gem::GradientSignal.Editor @@ -104,6 +107,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzFrameworkTestShared Gem::Vegetation.Static Gem::LmbrCentral.Mocks + Legacy::CryCommon ) ly_add_googletest( NAME Gem::Vegetation.Tests From 74f0cb5b984ef997763bb6aeba9f0313cb696ab8 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 09:06:28 -0800 Subject: [PATCH 182/399] Removes LuxCore (#6491) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Assets/Shaders/LuxCore/RenderTexture.azsl | 61 ---- .../Shaders/LuxCore/RenderTexture.shader | 22 -- .../LuxCore/RenderTexture.shadervariantlist | 17 - .../atom_feature_common_asset_files.cmake | 2 - Gems/Atom/Feature/Common/Code/CMakeLists.txt | 2 - .../Include/Atom/Feature/LuxCore/LuxCoreBus.h | 63 ---- .../Atom/Feature/LuxCore/LuxCoreTexturePass.h | 51 --- .../Atom/Feature/LuxCore/RenderTexturePass.h | 55 ---- .../Code/Source/CommonSystemComponent.cpp | 10 - .../Code/Source/CommonSystemComponent.h | 9 - .../Code/Source/LuxCore/LuxCoreMaterial.cpp | 139 -------- .../Code/Source/LuxCore/LuxCoreMaterial.h | 61 ---- .../Code/Source/LuxCore/LuxCoreMesh.cpp | 135 -------- .../Common/Code/Source/LuxCore/LuxCoreMesh.h | 49 --- .../Code/Source/LuxCore/LuxCoreObject.cpp | 57 ---- .../Code/Source/LuxCore/LuxCoreObject.h | 41 --- .../Code/Source/LuxCore/LuxCoreRenderer.cpp | 308 ------------------ .../Code/Source/LuxCore/LuxCoreRenderer.h | 56 ---- .../Code/Source/LuxCore/LuxCoreTexture.cpp | 158 --------- .../Code/Source/LuxCore/LuxCoreTexture.h | 62 ---- .../Source/LuxCore/LuxCoreTexturePass.cpp | 90 ----- .../Code/Source/LuxCore/RenderTexturePass.cpp | 90 ----- .../Android/Atom_Feature_Traits_Android.h | 3 +- .../Clang/atom_feature_common_clang.cmake | 6 - .../MSVC/atom_feature_common_msvc.cmake | 6 - .../Linux/Atom_Feature_Traits_Linux.h | 3 +- .../Platform/Mac/Atom_Feature_Traits_Mac.h | 3 +- .../Windows/Atom_Feature_Traits_Windows.h | 3 +- .../Windows/LaunchLuxCoreUI_Windows.cpp | 45 --- .../Windows/platform_windows_files.cmake | 1 - .../Platform/iOS/Atom_Feature_Traits_iOS.h | 3 +- .../Code/atom_feature_common_files.cmake | 15 - .../Android/BuiltInPackages_android.cmake | 2 +- .../Linux/BuiltInPackages_linux.cmake | 1 - .../Platform/Mac/BuiltInPackages_mac.cmake | 1 - .../Windows/BuiltInPackages_windows.cmake | 1 - .../Platform/iOS/BuiltInPackages_ios.cmake | 1 - 37 files changed, 6 insertions(+), 1626 deletions(-) delete mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.azsl delete mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.shader delete mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.shadervariantlist delete mode 100644 Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/LuxCoreBus.h delete mode 100644 Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/LuxCoreTexturePass.h delete mode 100644 Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/RenderTexturePass.h delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMaterial.cpp delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMaterial.h delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMesh.cpp delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMesh.h delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreObject.cpp delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreObject.h delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreRenderer.cpp delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreRenderer.h delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexture.cpp delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexture.h delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexturePass.cpp delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/RenderTexturePass.cpp delete mode 100644 Gems/Atom/Feature/Common/Code/Source/Platform/Windows/LaunchLuxCoreUI_Windows.cpp diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.azsl deleted file mode 100644 index e31179c733..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.azsl +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include -#include - -ShaderResourceGroup PassSrg : SRG_PerPass -{ - Texture2D m_sourceTexture; - - Sampler TextureSampler - { - MinFilter = Point; - MagFilter = Point; - MipFilter = Point; - AddressU = Clamp; - AddressV = Clamp; - AddressW = Clamp; - }; -} - -float4 RestoreNormalMap(float4 normalMapSample) -{ - float4 restoredNormal; - - // [GFX TODO][ATOM-2404] For some reason, the image build pipeline swaps the R and G channels so we swap them back here. - restoredNormal.xy = normalMapSample.yx; - - // The image build pipeline drops the B channel so we have to reconstruct it here. - restoredNormal.z = sqrt(1 - dot(restoredNormal.xy, restoredNormal.xy)); - - restoredNormal.xyz = restoredNormal.xyz * 0.5 + 0.5; - restoredNormal.a = 1; - - return restoredNormal; -} - -option bool o_isNormal; - -PSOutput MainPS(VSOutput IN) -{ - PSOutput OUT; - - if(o_isNormal) - { - float4 sampledValue = PassSrg::m_sourceTexture.SampleLevel(PassSrg::TextureSampler, IN.m_texCoord, 0); - OUT.m_color = RestoreNormalMap(sampledValue); - } - else - { - OUT.m_color = PassSrg::m_sourceTexture.SampleLevel(PassSrg::TextureSampler, IN.m_texCoord, 0); - } - - return OUT; -} diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.shader b/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.shader deleted file mode 100644 index 6035f98f5d..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.shader +++ /dev/null @@ -1,22 +0,0 @@ -{ - "Source" : "RenderTexture.azsl", - - "DepthStencilState" : { - "Depth" : { "Enable" : false } - }, - - "ProgramSettings": - { - "EntryPoints": - [ - { - "name": "MainVS", - "type": "Vertex" - }, - { - "name": "MainPS", - "type": "Fragment" - } - ] - } -} diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.shadervariantlist b/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.shadervariantlist deleted file mode 100644 index 97faeac819..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.shadervariantlist +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Shader" : "RenderTexture.shader", - "Variants" : [ - { - "StableId": 1, - "Options": { - "o_isNormal": "false" - } - }, - { - "StableId": 2, - "Options": { - "o_isNormal": "true" - } - } - ] -} diff --git a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake index a03058e2bf..1844d26e10 100644 --- a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake +++ b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake @@ -366,8 +366,6 @@ set(FILES Shaders/LightCulling/LightCullingRemap.shader Shaders/LightCulling/LightCullingTilePrepare.azsl Shaders/LightCulling/LightCullingTilePrepare.shader - Shaders/LuxCore/RenderTexture.azsl - Shaders/LuxCore/RenderTexture.shader Shaders/MorphTargets/MorphTargetCS.azsl Shaders/MorphTargets/MorphTargetCS.shader Shaders/MorphTargets/MorphTargetSRG.azsli diff --git a/Gems/Atom/Feature/Common/Code/CMakeLists.txt b/Gems/Atom/Feature/Common/Code/CMakeLists.txt index 3ebb9df104..db9ac8560f 100644 --- a/Gems/Atom/Feature/Common/Code/CMakeLists.txt +++ b/Gems/Atom/Feature/Common/Code/CMakeLists.txt @@ -40,7 +40,6 @@ ly_add_target( Gem::Atom_Feature_Common.Public Gem::ImGui.imguilib 3rdParty::TIFF - #3rdParty::lux_core # AZ_TRAIT_LUXCORE_SUPPORTED is disabled in every platform, Issue #3915 will remove RUNTIME_DEPENDENCIES Gem::ImGui.imguilib ) @@ -91,7 +90,6 @@ ly_add_target( AZ::AzFramework Gem::Atom_Feature_Common.Static Gem::Atom_Feature_Common.Public - #3rdParty::lux_core # AZ_TRAIT_LUXCORE_SUPPORTED is disabled in every platform, Issue #3915 will remove ) if(PAL_TRAIT_BUILD_HOST_TOOLS) diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/LuxCoreBus.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/LuxCoreBus.h deleted file mode 100644 index 1aa7778834..0000000000 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/LuxCoreBus.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - -#include -#include -#include - -namespace AZ -{ - namespace Render - { - enum LuxCoreTextureType - { - Default = 0, - IBL, - Albedo, - Normal - }; - - class LuxCoreRequests - : public EBusTraits - { - - public: - /// Overrides the default AZ::EBusTraits handler policy to allow one listener only. - static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single; - virtual ~LuxCoreRequests() {} - virtual void SetCameraEntityID(AZ::EntityId id) = 0; - virtual void AddMesh(Data::Asset modelAsset) = 0; - virtual void AddMaterial(Data::Instance material) = 0; - virtual void AddTexture(Data::Instance texture, LuxCoreTextureType type) = 0; - virtual void AddObject(Data::Asset modelAsset, Data::InstanceId materialInstanceId) = 0; - virtual bool CheckTextureStatus() = 0; - virtual void RenderInLuxCore() = 0; - virtual void ClearLuxCore() = 0; - virtual void ClearObject() = 0; - }; - - typedef AZ::EBus LuxCoreRequestsBus; - - class LuxCoreNotification - : public EBusTraits - { - public: - static const EBusAddressPolicy AddressPolicy = EBusAddressPolicy::ById; - /** - * Overrides the default AZ::EBusTraits ID type so that AssetId are - * used to access the addresses of the bus. - */ - typedef Data::AssetId BusIdType; - virtual ~LuxCoreNotification() {} - - virtual void OnRenderPrepare() {} - }; - typedef AZ::EBus LuxCoreNotificationBus; - } -} diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/LuxCoreTexturePass.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/LuxCoreTexturePass.h deleted file mode 100644 index 63258a6570..0000000000 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/LuxCoreTexturePass.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - -#include - -#include -#include -#include - -#include - -namespace AZ -{ - namespace Render - { - class LuxCoreTexturePass final - : public RPI::ParentPass - { - public: - AZ_RTTI(LuxCoreTexturePass, "{A6CA80C0-63A6-4686-A627-B5D1DA04B627}", ParentPass); - AZ_CLASS_ALLOCATOR(LuxCoreTexturePass, SystemAllocator, 0); - - static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); - - LuxCoreTexturePass(const RPI::PassDescriptor& descriptor); - ~LuxCoreTexturePass(); - - void SetSourceTexture(Data::Instance image, RHI::Format format); - void SetIsNormalTexture(bool isNormal); - void SetReadbackCallback(RPI::AttachmentReadback::CallbackFunction callbackFunciton); - - protected: - // Pass behavior overrides - void CreateChildPassesInternal() final; - void BuildInternal() final; - void FrameBeginInternal(FramePrepareParams params) final; - - private: - - RPI::Ptr m_renderTargetPass = nullptr; - AZStd::shared_ptr m_readback = nullptr; - bool m_attachmentReadbackComplete = false; - }; - } -} diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/RenderTexturePass.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/RenderTexturePass.h deleted file mode 100644 index 8389fe33a7..0000000000 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/RenderTexturePass.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - -#include - -namespace AZ -{ - namespace Render - { - /* - * A simple pass to render a texture to an attachment render target - * The attachment size and format will be configure as the same as the input texture - */ - class RenderTexturePass final - : public RPI::FullscreenTrianglePass - { - - AZ_RPI_PASS(RenderTexturePass); - - public: - AZ_RTTI(RenderTexturePass, "{476A4E41-08D7-456C-B324-E0493A321FE7}", FullscreenTrianglePass); - AZ_CLASS_ALLOCATOR(RenderTexturePass, SystemAllocator, 0); - virtual ~RenderTexturePass(); - - static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); - - // Set the source image - void SetPassSrgImage(AZ::Data::Instance image, RHI::Format format); - - RHI::AttachmentId GetRenderTargetId(); - - void InitShaderVariant(bool isNormal); - - protected: - RenderTexturePass(const RPI::PassDescriptor& descriptor); - - private: - - void BuildInternal() override; - void FrameBeginInternal(FramePrepareParams params) override; - - void UpdataAttachment(); - - RHI::ShaderInputImageIndex m_textureIndex; - RHI::Size m_attachmentSize; - RHI::Format m_attachmentFormat; - }; - } -} diff --git a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp index dc5d1a5c12..a06defff08 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp @@ -74,11 +74,6 @@ #include -#if AZ_TRAIT_LUXCORE_SUPPORTED -#include -#include -#endif - #include #include @@ -221,11 +216,6 @@ namespace AZ passSystem->AddPassCreator(Name("DisplayMapperFullScreenPass"), &DisplayMapperFullScreenPass::Create); passSystem->AddPassCreator(Name("OutputTransformPass"), &OutputTransformPass::Create); passSystem->AddPassCreator(Name("EyeAdaptationPass"), &EyeAdaptationPass::Create); - // Add RenderTexture and LuxCoreTexture pass -#if AZ_TRAIT_LUXCORE_SUPPORTED - passSystem->AddPassCreator(Name("RenderTexturePass"), &RenderTexturePass::Create); - passSystem->AddPassCreator(Name("LuxCoreTexturePass"), &LuxCoreTexturePass::Create); -#endif passSystem->AddPassCreator(Name("ImGuiPass"), &ImGuiPass::Create); passSystem->AddPassCreator(Name("LightCullingPass"), &LightCullingPass::Create); passSystem->AddPassCreator(Name("LightCullingRemapPass"), &LightCullingRemap::Create); diff --git a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.h b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.h index b12ad3459c..4838cc3d3d 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.h +++ b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.h @@ -12,10 +12,6 @@ #include -#if AZ_TRAIT_LUXCORE_SUPPORTED -#include "LuxCore/LuxCoreRenderer.h" -#endif - namespace AZ { namespace Render @@ -50,11 +46,6 @@ namespace AZ RPI::PassSystemInterface::OnReadyLoadTemplatesEvent::Handler m_loadTemplatesHandler; AZStd::unique_ptr m_modelReloaderSystem; - -#if AZ_TRAIT_LUXCORE_SUPPORTED - // LuxCore - LuxCoreRenderer m_luxCore; -#endif }; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMaterial.cpp b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMaterial.cpp deleted file mode 100644 index e454a1c7ba..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMaterial.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include "LuxCoreMaterial.h" -#include - -#include -#include - -namespace AZ -{ - namespace Render - { - LuxCoreMaterial::LuxCoreMaterial(const AZ::Data::Instance& material) - { - Init(material); - } - - LuxCoreMaterial::LuxCoreMaterial(const LuxCoreMaterial &material) - { - Init(material.m_material); - } - - LuxCoreMaterial::~LuxCoreMaterial() - { - if (m_material) - { - m_material = nullptr; - } - } - - void LuxCoreMaterial::Init(const AZ::Data::Instance& material) - { - m_material = material; - m_luxCoreMaterialName = "scene.materials." + m_material->GetId().ToString(); - m_luxCoreMaterial = m_luxCoreMaterial << luxrays::Property(std::string(m_luxCoreMaterialName.data()) + ".type")("disney"); - - ParseProperty(s_pbrColorGroup, ".basecolor"); - ParseProperty(s_pbrMetallicGroup, ".metallic"); - ParseProperty(s_pbrRoughnessGroup, ".roughness"); - ParseProperty(s_pbrSpecularGroup, ".specular"); - ParseProperty(s_pbrNormalGroup, ".bumptex"); - } - - bool LuxCoreMaterial::ParseTexture(const char* group, AZStd::string propertyName) - { - AZ::RPI::MaterialPropertyIndex propertyIndex; - - propertyIndex = m_material->FindPropertyIndex(MakePbrPropertyName(group, s_pbrUseTextureProperty)); - bool useTexture = m_material->GetPropertyValue(propertyIndex); - - if (useTexture) - { - propertyIndex = m_material->FindPropertyIndex(MakePbrPropertyName(group, s_pbrTextureProperty)); - Data::Instance texture = m_material->GetPropertyValue>(propertyIndex); - - if (texture) - { - if (group == s_pbrNormalGroup) - { - AZ::Render::LuxCoreRequestsBus::Broadcast(&AZ::Render::LuxCoreRequestsBus::Events::AddTexture, texture, LuxCoreTextureType::Normal); - } - else if (group == s_pbrColorGroup) - { - AZ::Render::LuxCoreRequestsBus::Broadcast(&AZ::Render::LuxCoreRequestsBus::Events::AddTexture, texture, LuxCoreTextureType::Albedo); - } - else - { - AZ::Render::LuxCoreRequestsBus::Broadcast(&AZ::Render::LuxCoreRequestsBus::Events::AddTexture, texture, LuxCoreTextureType::Default); - } - - AZStd::string materialProperty = m_luxCoreMaterialName + propertyName; - m_luxCoreMaterial = m_luxCoreMaterial << luxrays::Property(std::string(materialProperty.data()))(std::string(texture->GetAssetId().ToString().data())); - return true; - } - } - - return false; - } - - AZ::Name LuxCoreMaterial::MakePbrPropertyName(const char* groupName, const char* propertyName) const - { - return AZ::Name{AZStd::string::format("%s.%s", groupName, propertyName)}; - } - - void LuxCoreMaterial::ParseProperty(const char* group, AZStd::string propertyName) - { - if (!ParseTexture(group, propertyName)) - { - if (group == s_pbrNormalGroup) - { - // Normal should always be texture - return; - } - else if (group == s_pbrColorGroup) - { - AZ::RPI::MaterialPropertyIndex propertyIndex; - propertyIndex = m_material->FindPropertyIndex(MakePbrPropertyName(s_pbrColorGroup, s_pbrColorProperty)); - Color color = m_material->GetPropertyValue(propertyIndex); - propertyIndex = m_material->FindPropertyIndex(MakePbrPropertyName(s_pbrColorGroup, s_pbrFactorProperty)); - float factor = m_material->GetPropertyValue(propertyIndex); - - AZStd::string materialProperty = m_luxCoreMaterialName + propertyName; - m_luxCoreMaterial = m_luxCoreMaterial << luxrays::Property(std::string(materialProperty.data()))(float(color.GetR())* factor, float(color.GetG())*factor, float(color.GetB())*factor); - } - else - { - AZ::RPI::MaterialPropertyIndex propertyIndex; - propertyIndex = m_material->FindPropertyIndex(MakePbrPropertyName(group, s_pbrFactorProperty)); - float factor = m_material->GetPropertyValue(propertyIndex); - - AZStd::string materialProperty = m_luxCoreMaterialName + propertyName; - m_luxCoreMaterial = m_luxCoreMaterial << luxrays::Property(std::string(materialProperty.data()))(factor); - } - } - } - - luxrays::Properties LuxCoreMaterial::GetLuxCoreMaterialProperties() - { - return m_luxCoreMaterial; - } - - AZ::Data::InstanceId LuxCoreMaterial::GetMaterialId() - { - return m_material->GetId(); - } - } -} - -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMaterial.h b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMaterial.h deleted file mode 100644 index 86c095f7fd..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMaterial.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - - -#include -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include -#include "LuxCoreTexture.h" - -#include - -namespace AZ -{ - namespace Render - { - // Manage mapping between Atom PBR material and LuxCore Disney material - class LuxCoreMaterial final - { - public: - LuxCoreMaterial() = default; - LuxCoreMaterial(const AZ::Data::Instance& material); - LuxCoreMaterial(const LuxCoreMaterial &material); - ~LuxCoreMaterial(); - - luxrays::Properties GetLuxCoreMaterialProperties(); - AZ::Data::InstanceId GetMaterialId(); - private: - - static constexpr const char* s_pbrColorGroup = "baseColor"; - static constexpr const char* s_pbrMetallicGroup = "metallic"; - static constexpr const char* s_pbrRoughnessGroup = "roughness"; - static constexpr const char* s_pbrSpecularGroup = "specularF0"; - static constexpr const char* s_pbrNormalGroup = "normal"; - static constexpr const char* s_pbrOpacityGroup = "opacity"; - - static constexpr const char* s_pbrColorProperty = "color"; - static constexpr const char* s_pbrFactorProperty = "factor"; - static constexpr const char* s_pbrUseTextureProperty = "useTexture"; - static constexpr const char* s_pbrTextureProperty = "textureMap"; - - void ParseProperty(const char* group, AZStd::string propertyName); - bool ParseTexture(const char* group, AZStd::string propertyName); - AZ::Name MakePbrPropertyName(const char* groupName, const char* propertyName) const; - - void Init(const AZ::Data::Instance& material); - - AZStd::string m_luxCoreMaterialName; - luxrays::Properties m_luxCoreMaterial; - - AZ::Data::Instance m_material = nullptr; - }; - } -} -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMesh.cpp b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMesh.cpp deleted file mode 100644 index 34272f8cbf..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMesh.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include "LuxCoreMesh.h" -#include - -namespace AZ -{ - namespace Render - { - LuxCoreMesh::LuxCoreMesh(AZ::Data::Asset modelAsset) - { - Init(modelAsset); - } - - LuxCoreMesh::LuxCoreMesh(const LuxCoreMesh &model) - { - Init(model.m_modelAsset); - } - - LuxCoreMesh::~LuxCoreMesh() - { - if (m_position) - { - delete m_position; - m_position = nullptr; - } - - if (m_normal) - { - delete m_normal; - m_normal = nullptr; - } - - if (m_uv) - { - delete m_uv; - m_uv = nullptr; - } - - if (m_index) - { - delete m_index; - m_index = nullptr; - } - - if (m_modelAsset) - { - m_modelAsset.Reset(); - } - } - - void LuxCoreMesh::Init(AZ::Data::Asset modelAsset) - { - m_modelAsset = modelAsset; - // [TODO ATOM-3547] Multiple meshes handling - AZ::RPI::ModelLodAsset::Mesh mesh = m_modelAsset->GetLodAssets()[0]->GetMeshes()[0]; - - // index data - AZStd::array_view indexBuffer = mesh.GetIndexBufferAssetView().GetBufferAsset()->GetBuffer(); - m_index = luxcore::Scene::AllocTrianglesBuffer(mesh.GetIndexCount() / 3); - memcpy(m_index, indexBuffer.data(), indexBuffer.size()); - - // vertices data - for (AZ::RPI::ModelLodAsset::Mesh::StreamBufferInfo streamBufferInfo : mesh.GetStreamBufferInfoList()) - { - AZStd::array_view dataBuffer = streamBufferInfo.m_bufferAssetView.GetBufferAsset()->GetBuffer(); - - if (streamBufferInfo.m_semantic == RHI::ShaderSemantic{ "POSITION" }) - { - m_position = luxcore::Scene::AllocVerticesBuffer(mesh.GetVertexCount()); - memcpy(m_position, dataBuffer.data(), dataBuffer.size()); - } - else if (streamBufferInfo.m_semantic == RHI::ShaderSemantic{ "NORMAL" }) - { - m_normal = new float[mesh.GetVertexCount() * 3]; - memcpy(m_normal, dataBuffer.data(), dataBuffer.size()); - } - else if (streamBufferInfo.m_semantic == RHI::ShaderSemantic{ "UV", 0 }) - { - m_uv = new float[mesh.GetVertexCount() * 2]; - memcpy(m_uv, dataBuffer.data(), dataBuffer.size()); - } - } - } - - - uint32_t LuxCoreMesh::GetVertexCount() - { - // [TODO ATOM-3547] Multiple meshes handling - return m_modelAsset->GetLodAssets()[0]->GetMeshes()[0].GetVertexCount(); - } - - uint32_t LuxCoreMesh::GetTriangleCount() - { - // [TODO ATOM-3547] Multiple meshes handling - return (m_modelAsset->GetLodAssets()[0]->GetMeshes()[0].GetIndexCount() / 3); - } - - AZ::Data::AssetId LuxCoreMesh::GetMeshId() - { - return m_modelAsset->GetId(); - } - - const float* LuxCoreMesh::GetPositionData() - { - return m_position; - } - - const float* LuxCoreMesh::GetNormalData() - { - return m_normal; - } - - const float* LuxCoreMesh::GetUVData() - { - return m_uv; - } - - const unsigned int* LuxCoreMesh::GetIndexData() - { - return m_index; - } - } -} -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMesh.h b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMesh.h deleted file mode 100644 index 597049f849..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMesh.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - - -#include -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include - -namespace AZ -{ - namespace Render - { - // Extract vertex and index data from source model - class LuxCoreMesh final - { - public: - LuxCoreMesh() = default; - LuxCoreMesh(AZ::Data::Asset modelAsset); - LuxCoreMesh(const LuxCoreMesh &mesh); - ~LuxCoreMesh(); - - AZ::Data::AssetId GetMeshId(); - const float* GetPositionData(); - const float* GetNormalData(); - const float* GetUVData(); - const unsigned int* GetIndexData(); - - uint32_t GetVertexCount(); - uint32_t GetTriangleCount(); - - private: - void Init(AZ::Data::Asset modelAsset); - - float* m_position = nullptr; - float* m_normal = nullptr; - float* m_uv = nullptr; - unsigned int* m_index = nullptr; - AZ::Data::Asset m_modelAsset; - }; - } -} -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreObject.cpp b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreObject.cpp deleted file mode 100644 index ddeb61e394..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreObject.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include "LuxCoreObject.h" -#include - -namespace AZ -{ - namespace Render - { - LuxCoreObject::LuxCoreObject(AZStd::string modelAssetId, AZStd::string materialInstanceId) - { - Init(modelAssetId, materialInstanceId); - } - - LuxCoreObject::LuxCoreObject(const LuxCoreObject &object) - { - Init(object.m_modelAssetId, object.m_materialInstanceId); - } - - LuxCoreObject::~LuxCoreObject() - { - } - - luxrays::Properties LuxCoreObject::GetLuxCoreObjectProperties() - { - return m_luxCoreObject; - } - - void LuxCoreObject::Init(AZStd::string modelAssetId, AZStd::string materialInstanceId) - { - m_modelAssetId = modelAssetId; - m_materialInstanceId = materialInstanceId; - - static std::atomic_int ObjectId { 0 }; - const int localObjectId = ObjectId++; - - m_luxCoreObjectName = "scene.objects." + AZStd::to_string(localObjectId); - AZStd::string shapePropertyName = m_luxCoreObjectName + ".shape"; - AZStd::string materialPropertyName = m_luxCoreObjectName + ".material"; - - m_luxCoreObject = m_luxCoreObject << luxrays::Property(std::string(shapePropertyName.data()))(std::string(modelAssetId.data())); - m_luxCoreObject = m_luxCoreObject << luxrays::Property(std::string(materialPropertyName.data()))(std::string(materialInstanceId.data())); - } - }; -}; - -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreObject.h b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreObject.h deleted file mode 100644 index 6529b0487b..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreObject.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - -#include -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include -#include - -namespace AZ -{ - namespace Render - { - // Object holds mesh and material in LuxCore - class LuxCoreObject final - { - public: - LuxCoreObject(AZStd::string modelAssetId, AZStd::string materialInstanceId); - LuxCoreObject(const LuxCoreObject &object); - ~LuxCoreObject(); - - luxrays::Properties GetLuxCoreObjectProperties(); - - private: - - void Init(AZStd::string modelAssetId, AZStd::string materialInstanceId); - AZStd::string m_luxCoreObjectName; - luxrays::Properties m_luxCoreObject; - - AZStd::string m_modelAssetId; - AZStd::string m_materialInstanceId; - }; - }; -}; -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreRenderer.cpp b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreRenderer.cpp deleted file mode 100644 index ef3f33d1c3..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreRenderer.cpp +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#include -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include "LuxCoreRenderer.h" - -#include -#include -#include -#include -#include - -#include - -namespace LuxCoreUI -{ - void LaunchLuxCoreUI(const AZStd::string& luxCoreExeFullPath, const AZStd::string& commandLine); -} - -namespace AZ -{ - namespace Render - { - LuxCoreRenderer::LuxCoreRenderer() - { - LuxCoreRequestsBus::Handler::BusConnect(); - } - - LuxCoreRenderer::~LuxCoreRenderer() - { - LuxCoreRequestsBus::Handler::BusDisconnect(); - ClearLuxCore(); - } - - void LuxCoreRenderer::SetCameraEntityID(AZ::EntityId id) - { - m_cameraEntityId = id; - } - - void LuxCoreRenderer::AddMesh(Data::Asset modelAsset) - { - AZStd::string meshId = modelAsset->GetId().ToString(); - m_meshs.emplace(AZStd::piecewise_construct_t{}, - AZStd::forward_as_tuple(meshId), - AZStd::forward_as_tuple(modelAsset)); - } - - void LuxCoreRenderer::AddMaterial(Data::Instance material) - { - AZStd::string materialId = material->GetId().ToString(); - m_materials.emplace(AZStd::piecewise_construct_t{}, - AZStd::forward_as_tuple(materialId), - AZStd::forward_as_tuple(material)); - } - - void LuxCoreRenderer::AddTexture(Data::Instance image, LuxCoreTextureType type) - { - AZStd::string textureId = image->GetAssetId().ToString(); - m_textures.emplace(AZStd::piecewise_construct_t{}, - AZStd::forward_as_tuple(textureId), - AZStd::forward_as_tuple(image, type)); - } - - void LuxCoreRenderer::AddObject(AZ::Data::Asset modelAsset, AZ::Data::InstanceId materialInstanceId) - { - m_objects.emplace_back(modelAsset->GetId().ToString(), materialInstanceId.ToString()); - } - - bool LuxCoreRenderer::CheckTextureStatus() - { - for (auto it = m_textures.begin(); it != m_textures.end(); ++it) - { - if (!it->second.IsTextureReady()) - { - return false; - } - } - return true; - } - - void LuxCoreRenderer::ClearLuxCore() - { - m_meshs.clear(); - m_materials.clear(); - m_textures.clear(); - m_objects.clear(); - } - - void LuxCoreRenderer::ClearObject() - { - m_objects.clear(); - } - - void LuxCoreRenderer::RenderInLuxCore() - { - luxcore::Init(); - luxcore::Scene *luxCoreScene = luxcore::Scene::Create(); - - const char* folderName = "luxcoredata"; - if (!AZ::IO::FileIOBase::GetInstance()->Exists(folderName)) - { - AZ::IO::FileIOBase::GetInstance()->CreatePath(folderName); - } - - char resolvedPath[1024]; - AZ::IO::FileIOBase::GetInstance()->ResolvePath(folderName, resolvedPath, 1024); - - // Camera transform - if (!m_cameraEntityId.IsValid()) - { - AZ_Assert(false, "Please set camera entity id"); - return; - } - - AZ::Transform cameraTransform = AZ::Transform::CreateIdentity(); - AZ::Vector4 cameraUp, cameraFwd, cameraOrig, cameraTarget; - AZ::TransformBus::EventResult(cameraTransform, m_cameraEntityId, &AZ::TransformBus::Events::GetWorldTM); - - const AZ::Matrix4x4 rotationMatrix = AZ::Matrix4x4::CreateFromTransform(cameraTransform); - - cameraFwd = rotationMatrix.GetColumn(1); - cameraUp = rotationMatrix.GetColumn(2); - cameraOrig = rotationMatrix.GetColumn(3); - cameraTarget = cameraOrig + cameraFwd; - - // Camera parameter - float nearClip, farClip, fieldOfView; - Camera::CameraRequestBus::EventResult(fieldOfView, m_cameraEntityId, &Camera::CameraRequestBus::Events::GetFovDegrees); - Camera::CameraRequestBus::EventResult(nearClip, m_cameraEntityId, &Camera::CameraRequestBus::Events::GetNearClipDistance); - Camera::CameraRequestBus::EventResult(farClip, m_cameraEntityId, &Camera::CameraRequestBus::Events::GetFarClipDistance); - - // Set Camera - luxCoreScene->Parse( - luxrays::Property("scene.camera.lookat.orig")((float)cameraOrig.GetX(), (float)cameraOrig.GetY(), (float)cameraOrig.GetZ()) << - luxrays::Property("scene.camera.lookat.target")((float)cameraTarget.GetX(), (float)cameraTarget.GetY(), (float)cameraTarget.GetZ()) << - luxrays::Property("scene.camera.up")((float)cameraUp.GetX(), (float)cameraUp.GetY(), (float)cameraUp.GetZ()) << - luxrays::Property("scene.camera.fieldofview")(fieldOfView) << - luxrays::Property("scene.camera.cliphither")(nearClip) << - luxrays::Property("scene.camera.clipyon")(farClip) << - luxrays::Property("scene.camera.type")("perspective")); - - // Set Texture - try { - for (auto it = m_textures.begin(); it != m_textures.end(); ++it) - { - if (it->second.GetRawDataPointer() != nullptr) - { - if (it->second.IsIBLTexture()) - { - luxCoreScene->DefineImageMap(std::string(it->first.data()), static_cast(it->second.GetRawDataPointer()), 1.f, it->second.GetTextureChannels(), it->second.GetTextureWidth(), it->second.GetTextureHeight()); - } - else - { - luxCoreScene->DefineImageMap(std::string(it->first.data()), static_cast(it->second.GetRawDataPointer()), 1.f, it->second.GetTextureChannels(), it->second.GetTextureWidth(), it->second.GetTextureHeight()); - } - - luxCoreScene->Parse( - - it->second.GetLuxCoreTextureProperties() - ); - } - else - { - AZ_Assert(false, "texture data is nullptr!!!"); - return; - } - } - } - catch (const std::runtime_error& e) - { - (void)e; - AZ_Assert(false, "%s", e.what()); - return; - } - catch (const std::exception& e) - { - (void)e; - AZ_Assert(false, "%s", e.what()); - return; - } - - - // Set Material - try { - for (auto it = m_materials.begin(); it != m_materials.end(); ++it) - { - luxCoreScene->Parse( - it->second.GetLuxCoreMaterialProperties() - ); - } - } - catch (const std::exception& e) - { - (void)e; - AZ_Assert(false, "%s", e.what()); - return; - } - - // Set Model - try { - for (auto it = m_meshs.begin(); it != m_meshs.end(); ++it) - { - luxCoreScene->DefineMesh(std::string(it->second.GetMeshId().ToString().data()), - it->second.GetVertexCount(), - it->second.GetTriangleCount(), - const_cast(it->second.GetPositionData()), - const_cast(it->second.GetIndexData()), - const_cast(it->second.GetNormalData()), - const_cast(it->second.GetUVData()), - NULL, - NULL); - } - } - catch (const std::exception& e) - { - (void)e; - AZ_Assert(false, "%s", e.what()); - return; - } - - // Objects - try { - for (auto it = m_objects.begin(); it != m_objects.end(); ++it) - { - luxCoreScene->Parse( - it->GetLuxCoreObjectProperties() - ); - } - } - catch (const std::exception& e) - { - (void)e; - AZ_Assert(false, "%s", e.what()); - return; - } - - // RenderConfig - luxcore::RenderConfig *config = luxcore::RenderConfig::Create( - luxrays::Property("path.pathdepth.total")(7) << - luxrays::Property("path.pathdepth.diffuse")(5) << - luxrays::Property("path.pathdepth.glossy")(5) << - luxrays::Property("path.pathdepth.specular")(6) << - luxrays::Property("path.hybridbackforward.enable")(0) << - luxrays::Property("path.hybridbackforward.partition")(0) << - luxrays::Property("path.hybridbackforward.glossinessthreshold ")(0.05) << - luxrays::Property("path.forceblackbackground.enable")(0) << - luxrays::Property("film.noiseestimation.warmup")(8) << - luxrays::Property("film.noiseestimation.step")(32) << - luxrays::Property("film.width")(1920) << - luxrays::Property("film.height")(1080) << - luxrays::Property("film.filter.type")("BLACKMANHARRIS") << - luxrays::Property("film.filter.width")(1.5) << - luxrays::Property("film.imagepipelines.0.0.type")("NOP") << - luxrays::Property("film.imagepipelines.0.1.type")("GAMMA_CORRECTION") << - luxrays::Property("film.imagepipelines.0.1.value")(2.2f) << - luxrays::Property("film.imagepipelines.0.radiancescales.0.enabled")(1) << - luxrays::Property("film.imagepipelines.0.radiancescales.0.globalscale")(1) << - luxrays::Property("film.imagepipelines.0.radiancescales.0.rgbscale")(1, 1, 1) << - luxrays::Property("film.outputs.0.type")("RGB_IMAGEPIPELINE") << - luxrays::Property("film.outputs.0.index")(0) << - luxrays::Property("film.outputs.0.filename")("RGB_IMAGEPIPELINE_0.png") << - luxrays::Property("sampler.type")("SOBOL") << - luxrays::Property("renderengine.type")("PATHCPU") << - luxrays::Property("renderengine.seed")(1) << - luxrays::Property("lightstrategy.type")("LOG_POWER") << - luxrays::Property("scene.epsilon.min")(9.9999997473787516e-06f) << - luxrays::Property("scene.epsilon.max")(0.10000000149011612f) << - luxrays::Property("scene.epsilon.max")(0.10000000149011612f) << - luxrays::Property("batch.haltthreshold")(0.01953125f) << - luxrays::Property("batch.haltthreshold.warmup")(64) << - luxrays::Property("batch.haltthreshold.step")(64) << - luxrays::Property("batch.haltthreshold.filter.enable")(1) << - luxrays::Property("batch.haltthreshold.stoprendering.enable")(1) << - luxrays::Property("batch.haltspp")(0) << - luxrays::Property("batch.halttime")(0) << - luxrays::Property("filesaver.renderengine.type")("PATHCPU") << - luxrays::Property("filesaver.format")("TXT"), - luxCoreScene); - - - // Export - try { - config->Export(resolvedPath); - } - catch (const std::runtime_error& e) - { - (void)e; - AZ_Assert(false, "%s", e.what()); - return; - } - - // Run luxcoreui.exe - AZ::IO::FixedMaxPath luxCoreExeFullPath = AZ::Utils::GetEnginePath(); - luxCoreExeFullPath /= AZ_TRAIT_LUXCORE_EXEPATH; - - AZStd::string commandLine = "-o " + AZStd::string(resolvedPath) + "/render.cfg"; - - LuxCoreUI::LaunchLuxCoreUI(luxCoreExeFullPath.String(), commandLine); - } - } -} -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreRenderer.h b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreRenderer.h deleted file mode 100644 index 9c9f8039f5..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreRenderer.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - -#include -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include -#include "LuxCoreMaterial.h" -#include "LuxCoreMesh.h" -#include "LuxCoreObject.h" -#include "LuxCoreTexture.h" - -namespace AZ -{ - namespace Render - { - // Hold all converted data, write scene and render file to disk when command received - // Can be extend to do real-time rendering in the future - class LuxCoreRenderer - : public LuxCoreRequestsBus::Handler - { - public: - LuxCoreRenderer(); - ~LuxCoreRenderer(); - - //////////////////////////////////////////////////////////////////////// - // LuxCoreRequestsBus - void SetCameraEntityID(AZ::EntityId id); - void AddMesh( Data::Asset modelAsset); - void AddMaterial(Data::Instance material); - void AddTexture(Data::Instance image, LuxCoreTextureType type); - void AddObject(AZ::Data::Asset modelAsset, AZ::Data::InstanceId materialInstanceId); - bool CheckTextureStatus(); - void RenderInLuxCore(); - void ClearLuxCore(); - void ClearObject(); - ///////////////////////////////////////////////////////////////////////// - - private: - AZ::EntityId m_cameraEntityId; - AZ::Transform m_cameraTransform; - - AZStd::unordered_map m_meshs; - AZStd::unordered_map m_materials; - AZStd::unordered_map m_textures; - AZStd::vector m_objects; - }; - } -} -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexture.cpp b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexture.cpp deleted file mode 100644 index 1fd8f0d91c..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexture.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include "LuxCoreTexture.h" -#include -#include - -namespace AZ -{ - namespace Render - { - LuxCoreTexture::LuxCoreTexture(AZ::Data::Instance image, LuxCoreTextureType type) - { - Init(image, type); - } - - LuxCoreTexture::LuxCoreTexture(const LuxCoreTexture &texture) - { - Init(texture.m_texture, texture.m_type); - } - - LuxCoreTexture::~LuxCoreTexture() - { - if (m_rtPipeline) - { - m_rtPipeline->RemoveFromScene(); - m_rtPipeline = nullptr; - } - - if (m_texture) - { - m_texture = nullptr; - } - } - - void LuxCoreTexture::Init(AZ::Data::Instance image, LuxCoreTextureType type) - { - m_textureAssetId = image->GetAssetId(); - m_texture = image; - m_type = type; - - if (m_type == LuxCoreTextureType::IBL) - { - m_luxCoreTextureName = "scene.lights." + m_textureAssetId.ToString(); - m_luxCoreTexture = m_luxCoreTexture << luxrays::Property(std::string(m_luxCoreTextureName.data()) + ".type")("infinite"); - } - else - { - m_luxCoreTextureName = "scene.textures." + m_textureAssetId.ToString(); - m_luxCoreTexture = m_luxCoreTexture << luxrays::Property(std::string(m_luxCoreTextureName.data()) + ".type")("imagemap"); - } - - m_luxCoreTexture = m_luxCoreTexture << luxrays::Property(std::string(m_luxCoreTextureName.data()) + ".file")(std::string(m_textureAssetId.ToString().data())); - m_textureChannels = 4; - - AddRenderTargetPipeline(); - } - - void LuxCoreTexture::AddRenderTargetPipeline() - { - // Render Texture pipeline - AZ::RPI::RenderPipelineDescriptor pipelineDesc; - pipelineDesc.m_name = m_textureAssetId.ToString(); - pipelineDesc.m_rootPassTemplate = "LuxCoreTexturePassTemplate"; - m_rtPipeline = AZ::RPI::RenderPipeline::CreateRenderPipeline(pipelineDesc); - - // Set source texture - AZ::RPI::Pass* rootPass = m_rtPipeline->GetRootPass().get(); - AZ_Assert(rootPass != nullptr, "Failed to get root pass for render target pipeline"); - LuxCoreTexturePass* parentPass = static_cast(rootPass); - - // Setup call back to save read back data to m_textureData - RPI::AttachmentReadback::CallbackFunction callback = - [this](const AZ::RPI::AttachmentReadback::ReadbackResult& readbackResult) - { - RHI::ImageSubresourceLayout imageLayout = RHI::GetImageSubresourceLayout(readbackResult.m_imageDescriptor.m_size, - readbackResult.m_imageDescriptor.m_format); - m_textureData.resize_no_construct(imageLayout.m_bytesPerImage); - memcpy(m_textureData.data(), readbackResult.m_dataBuffer->data(), imageLayout.m_bytesPerImage); - - m_textureReadbackComplete = true; - }; - parentPass->SetReadbackCallback(callback); - - switch (m_type) - { - case LuxCoreTextureType::Default: - // assume a 8 bits linear texture - parentPass->SetSourceTexture(m_texture, RHI::Format::R8G8B8A8_UNORM); - break; - case LuxCoreTextureType::IBL: - // assume its a float image if its an IBL source - parentPass->SetSourceTexture(m_texture, RHI::Format::R32G32B32A32_FLOAT); - break; - case LuxCoreTextureType::Albedo: - // albedo texture is in sRGB space - parentPass->SetSourceTexture(m_texture, RHI::Format::R8G8B8A8_UNORM_SRGB); - break; - case LuxCoreTextureType::Normal: - // Normal texture needs special handling - parentPass->SetIsNormalTexture(true); - parentPass->SetSourceTexture(m_texture, RHI::Format::R8G8B8A8_UNORM); - break; - } - - const auto mainScene = AZ::RPI::RPISystemInterface::Get()->GetSceneByName(AZ::Name("RPI")); - if (mainScene) - { - mainScene->AddRenderPipeline(m_rtPipeline); - } - } - - bool LuxCoreTexture::IsIBLTexture() - { - return m_type == LuxCoreTextureType::IBL; - } - - void* LuxCoreTexture::GetRawDataPointer() - { - return (void*)m_textureData.data(); - } - - unsigned int LuxCoreTexture::GetTextureWidth() - { - return m_texture->GetRHIImage()->GetDescriptor().m_size.m_width; - } - - unsigned int LuxCoreTexture::GetTextureHeight() - { - return m_texture->GetRHIImage()->GetDescriptor().m_size.m_height; - } - - unsigned int LuxCoreTexture::GetTextureChannels() - { - return m_textureChannels; - } - - luxrays::Properties LuxCoreTexture::GetLuxCoreTextureProperties() - { - return m_luxCoreTexture; - } - - bool LuxCoreTexture::IsTextureReady() - { - return m_textureReadbackComplete; - } - } -} -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexture.h b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexture.h deleted file mode 100644 index abfb7cfe13..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexture.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - - -#include -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include -#include -#include -#include - -namespace AZ -{ - namespace Render - { - // Build a pipeline to get raw data from runtime texture - class LuxCoreTexture final - { - public: - LuxCoreTexture() = default; - LuxCoreTexture( AZ::Data::Instance image, LuxCoreTextureType type); - LuxCoreTexture(const LuxCoreTexture &texture); - ~LuxCoreTexture(); - - void* GetRawDataPointer(); - - unsigned int GetTextureWidth(); - unsigned int GetTextureHeight(); - unsigned int GetTextureChannels(); - - void Init(AZ::Data::Instance image, LuxCoreTextureType type); - - void AddRenderTargetPipeline(); - luxrays::Properties GetLuxCoreTextureProperties(); - bool IsIBLTexture(); - bool IsTextureReady(); - - private: - AZStd::string m_luxCoreTextureName; - luxrays::Properties m_luxCoreTexture; - - AZ::RPI::RenderPipelinePtr m_rtPipeline = nullptr; - - AZStd::vector m_textureData; - AZ::Data::Instance m_texture; - unsigned int m_textureChannels = 4; - - Data::AssetId m_textureAssetId; - LuxCoreTextureType m_type = LuxCoreTextureType::Default; - - bool m_textureReadbackComplete = false; - }; - } -} -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexturePass.cpp b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexturePass.cpp deleted file mode 100644 index 721e8b0c90..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexturePass.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include - -#include - -namespace AZ -{ - namespace Render - { - RPI::Ptr LuxCoreTexturePass::Create(const RPI::PassDescriptor& descriptor) - { - RPI::Ptr pass = aznew LuxCoreTexturePass(descriptor); - return pass; - } - - LuxCoreTexturePass::LuxCoreTexturePass(const RPI::PassDescriptor& descriptor) - : ParentPass(descriptor) - { - RPI::PassSystemInterface* passSystem = RPI::PassSystemInterface::Get(); - - // Create render target pass - RPI::PassRequest request; - request.m_templateName = "RenderTextureTemplate"; - request.m_passName = "RenderTarget"; - m_renderTargetPass = passSystem->CreatePassFromRequest(&request); - AZ_Assert(m_renderTargetPass, "render target pass is invalid"); - - // Create readback - m_readback = AZStd::make_shared(AZ::RHI::ScopeId{ Uuid::CreateRandom().ToString() }); - } - - LuxCoreTexturePass::~LuxCoreTexturePass() - { - m_renderTargetPass = nullptr; - m_readback = nullptr; - } - - void LuxCoreTexturePass::SetSourceTexture(AZ::Data::Instance image, RHI::Format format) - { - static_cast(m_renderTargetPass.get())->SetPassSrgImage(image, format); - } - - void LuxCoreTexturePass::CreateChildPassesInternal() - { - AddChild(m_renderTargetPass); - } - - void LuxCoreTexturePass::BuildInternal() - { - ParentPass::BuildInternal(); - } - - void LuxCoreTexturePass::FrameBeginInternal(FramePrepareParams params) - { - if (!m_attachmentReadbackComplete && m_readback != nullptr) - { - // Set up read back attachment before children prepare - if (m_readback->IsReady()) - { - if (m_renderTargetPass) - { - m_attachmentReadbackComplete = m_renderTargetPass->ReadbackAttachment(m_readback, AZ::Name("RenderTargetOutput")); - } - } - } - ParentPass::FrameBeginInternal(params); - } - - void LuxCoreTexturePass::SetIsNormalTexture(bool isNormal) - { - static_cast(m_renderTargetPass.get())->InitShaderVariant(isNormal); - } - - void LuxCoreTexturePass::SetReadbackCallback(RPI::AttachmentReadback::CallbackFunction callbackFunciton) - { - if (m_readback != nullptr) - { - m_readback->SetCallback(callbackFunciton); - } - } - } -} diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/RenderTexturePass.cpp b/Gems/Atom/Feature/Common/Code/Source/LuxCore/RenderTexturePass.cpp deleted file mode 100644 index c890da596b..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/RenderTexturePass.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include - -namespace AZ -{ - namespace Render - { - RPI::Ptr RenderTexturePass::Create(const RPI::PassDescriptor& descriptor) - { - RPI::Ptr pass = aznew RenderTexturePass(descriptor); - return pass; - } - - RenderTexturePass::RenderTexturePass(const RPI::PassDescriptor& descriptor) - : FullscreenTrianglePass(descriptor) - { - m_textureIndex = m_shaderResourceGroup->FindShaderInputImageIndex(Name("m_sourceTexture")); - } - - RenderTexturePass::~RenderTexturePass() - { - } - - void RenderTexturePass::SetPassSrgImage(AZ::Data::Instance image, RHI::Format format) - { - m_attachmentSize = image->GetRHIImage()->GetDescriptor().m_size; - m_attachmentFormat = format; - m_shaderResourceGroup->SetImage(m_textureIndex, image); - QueueForBuildAndInitialization(); - } - - void RenderTexturePass::BuildInternal() - { - UpdataAttachment(); - FullscreenTrianglePass::BuildInternal(); - } - - void RenderTexturePass::FrameBeginInternal(FramePrepareParams params) - { - FullscreenTrianglePass::FrameBeginInternal(params); - } - - void RenderTexturePass::UpdataAttachment() - { - // [GFX TODO][ATOM-2470] stop caring about attachment - RPI::Ptr attachment = m_ownedAttachments.front(); - if (!attachment) - { - AZ_Assert(false, "[RenderTexturePass %s] Cannot find any image attachment.", GetPathName().GetCStr()); - return; - } - AZ_Assert(attachment->m_descriptor.m_type == RHI::AttachmentType::Image, "[RenderTexturePass %s] requires an image attachment", GetPathName().GetCStr()); - - RPI::PassAttachmentBinding& binding = GetOutputBinding(0); - binding.m_attachment = attachment; - - RHI::ImageDescriptor& imageDescriptor = attachment->m_descriptor.m_image; - imageDescriptor.m_size = m_attachmentSize; - imageDescriptor.m_format = m_attachmentFormat; - } - - RHI::AttachmentId RenderTexturePass::GetRenderTargetId() - { - return m_ownedAttachments.front()->GetAttachmentId(); - } - - void RenderTexturePass::InitShaderVariant(bool isNormal) - { - auto shaderOption = m_shader->CreateShaderOptionGroup(); - RPI::ShaderOptionValue isNormalOption{ isNormal }; - shaderOption.SetValue(AZ::Name("o_isNormal"), isNormalOption); - - RPI::ShaderVariantSearchResult result = m_shader->FindVariantStableId(shaderOption.GetShaderVariantId()); - m_shaderVariantStableId = result.GetStableId(); - - if (!result.IsFullyBaked() && m_drawShaderResourceGroup->HasShaderVariantKeyFallbackEntry()) - { - m_drawShaderResourceGroup->SetShaderVariantKeyFallbackValue(shaderOption.GetShaderVariantId().m_key); - } - } - } -} diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Android/Atom_Feature_Traits_Android.h b/Gems/Atom/Feature/Common/Code/Source/Platform/Android/Atom_Feature_Traits_Android.h index f2501f3366..40f06f7191 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Android/Atom_Feature_Traits_Android.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Android/Atom_Feature_Traits_Android.h @@ -7,6 +7,5 @@ */ #pragma once -#define AZ_TRAIT_LUXCORE_SUPPORTED 0 -#define AZ_TRAIT_LUXCORE_EXEPATH UNUSED_TRAIT #define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 + diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Common/Clang/atom_feature_common_clang.cmake b/Gems/Atom/Feature/Common/Code/Source/Platform/Common/Clang/atom_feature_common_clang.cmake index b3f7867308..7a325ca97e 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Common/Clang/atom_feature_common_clang.cmake +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Common/Clang/atom_feature_common_clang.cmake @@ -5,9 +5,3 @@ # SPDX-License-Identifier: Apache-2.0 OR MIT # # - -set_source_files_properties( - Source/LuxCore/LuxCoreRenderer.cpp - PROPERTIES - COMPILE_OPTIONS -fexceptions -) diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Common/MSVC/atom_feature_common_msvc.cmake b/Gems/Atom/Feature/Common/Code/Source/Platform/Common/MSVC/atom_feature_common_msvc.cmake index 9b5c59d310..7a325ca97e 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Common/MSVC/atom_feature_common_msvc.cmake +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Common/MSVC/atom_feature_common_msvc.cmake @@ -5,9 +5,3 @@ # SPDX-License-Identifier: Apache-2.0 OR MIT # # - -set_source_files_properties( - Source/LuxCore/LuxCoreRenderer.cpp - PROPERTIES - COMPILE_OPTIONS /EHsc -) diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Linux/Atom_Feature_Traits_Linux.h b/Gems/Atom/Feature/Common/Code/Source/Platform/Linux/Atom_Feature_Traits_Linux.h index f2501f3366..40f06f7191 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Linux/Atom_Feature_Traits_Linux.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Linux/Atom_Feature_Traits_Linux.h @@ -7,6 +7,5 @@ */ #pragma once -#define AZ_TRAIT_LUXCORE_SUPPORTED 0 -#define AZ_TRAIT_LUXCORE_EXEPATH UNUSED_TRAIT #define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 + diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Mac/Atom_Feature_Traits_Mac.h b/Gems/Atom/Feature/Common/Code/Source/Platform/Mac/Atom_Feature_Traits_Mac.h index f2501f3366..40f06f7191 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Mac/Atom_Feature_Traits_Mac.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Mac/Atom_Feature_Traits_Mac.h @@ -7,6 +7,5 @@ */ #pragma once -#define AZ_TRAIT_LUXCORE_SUPPORTED 0 -#define AZ_TRAIT_LUXCORE_EXEPATH UNUSED_TRAIT #define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 + diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/Atom_Feature_Traits_Windows.h b/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/Atom_Feature_Traits_Windows.h index 71c521a7f2..40f06f7191 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/Atom_Feature_Traits_Windows.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/Atom_Feature_Traits_Windows.h @@ -7,6 +7,5 @@ */ #pragma once -#define AZ_TRAIT_LUXCORE_SUPPORTED 0 -#define AZ_TRAIT_LUXCORE_EXEPATH "Gems/Atom/Feature/Common/External/LuxCore2.2/win64/dll/luxcoreui.exe" #define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 + diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/LaunchLuxCoreUI_Windows.cpp b/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/LaunchLuxCoreUI_Windows.cpp deleted file mode 100644 index 7f15949201..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/LaunchLuxCoreUI_Windows.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include -#include - -namespace LuxCoreUI -{ - void LaunchLuxCoreUI(const AZStd::string& luxCoreExeFullPath, const AZStd::string& commandLine) - { - STARTUPINFO si; - PROCESS_INFORMATION pi; - - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - ZeroMemory(&pi, sizeof(pi)); - - AZStd::wstring luxCoreExeFullPathW; - AZStd::to_wstring(luxCoreExeFullPathW, luxCoreExeFullPath.c_str()); - AZStd::wstring commandLineW; - AZStd::to_wstring(commandLineW, commandLine.c_str()); - - // start the program up - CreateProcessW(luxCoreExeFullPathW.c_str(), // the path - commandLineW.data(), // Command line - NULL, // Process handle not inheritable - NULL, // Thread handle not inheritable - FALSE, // Set handle inheritance to FALSE - 0, // No creation flags - NULL, // Use parent's environment block - NULL, // Use parent's starting directory - &si, // Pointer to STARTUPINFO structure - &pi // Pointer to PROCESS_INFORMATION structure (removed extra parentheses) - ); - // Close process and thread handles. - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - } -} diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/platform_windows_files.cmake b/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/platform_windows_files.cmake index 95d27d01ac..4acf1599f5 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/platform_windows_files.cmake +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/platform_windows_files.cmake @@ -9,5 +9,4 @@ set(FILES Atom_Feature_Traits_Platform.h Atom_Feature_Traits_Windows.h - LaunchLuxCoreUI_Windows.cpp ) diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/iOS/Atom_Feature_Traits_iOS.h b/Gems/Atom/Feature/Common/Code/Source/Platform/iOS/Atom_Feature_Traits_iOS.h index f2501f3366..40f06f7191 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/iOS/Atom_Feature_Traits_iOS.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/iOS/Atom_Feature_Traits_iOS.h @@ -7,6 +7,5 @@ */ #pragma once -#define AZ_TRAIT_LUXCORE_SUPPORTED 0 -#define AZ_TRAIT_LUXCORE_EXEPATH UNUSED_TRAIT #define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 + diff --git a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake index 900e71717c..375dbd9724 100644 --- a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake +++ b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake @@ -46,9 +46,6 @@ set(FILES Include/Atom/Feature/Utils/MultiSparseVector.h Include/Atom/Feature/Utils/ProfilingCaptureBus.h Include/Atom/Feature/Utils/SparseVector.h - Include/Atom/Feature/LuxCore/LuxCoreBus.h - Include/Atom/Feature/LuxCore/LuxCoreTexturePass.h - Include/Atom/Feature/LuxCore/RenderTexturePass.h Source/CommonModule.cpp Source/CommonSystemComponent.cpp Source/FrameCaptureSystemComponent.cpp @@ -317,18 +314,6 @@ set(FILES Source/SkyBox/SkyBoxFogSettings.cpp Source/TransformService/TransformServiceFeatureProcessor.cpp Source/Utils/GpuBufferHandler.cpp - Source/LuxCore/LuxCoreTexturePass.cpp - Source/LuxCore/RenderTexturePass.cpp - Source/LuxCore/LuxCoreMaterial.cpp - Source/LuxCore/LuxCoreMaterial.h - Source/LuxCore/LuxCoreMesh.cpp - Source/LuxCore/LuxCoreMesh.h - Source/LuxCore/LuxCoreObject.cpp - Source/LuxCore/LuxCoreObject.h - Source/LuxCore/LuxCoreRenderer.cpp - Source/LuxCore/LuxCoreRenderer.h - Source/LuxCore/LuxCoreTexture.cpp - Source/LuxCore/LuxCoreTexture.h ) set(SKIP_UNITY_BUILD_INCLUSION_FILES diff --git a/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake b/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake index 6bd50861c7..c6a262926c 100644 --- a/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake +++ b/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake @@ -14,7 +14,7 @@ ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cit ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform TARGETS expat PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418) ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee) -ly_associate_package(PACKAGE_NAME lux_core-2.2-rev5-multiplatform TARGETS lux_core PACKAGE_HASH c8c13cf7bc351643e1abd294d0841b24dee60e51647dff13db7aec396ad1e0b5) + # platform-specific: ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-rev4-android TARGETS TIFF PACKAGE_HASH 2c62cdf34a8ee6c7eb091d05d98f60b4da7634c74054d4dbb8736886182f4589) ly_associate_package(PACKAGE_NAME freetype-2.10.4.16-android TARGETS freetype PACKAGE_HASH df9e4d559ea0f03b0666b48c79813b1cd4d9624429148a249865de9f5c2c11cd) diff --git a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake index 5c84fc3198..109ae75f38 100644 --- a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake +++ b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake @@ -18,7 +18,6 @@ ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) ly_associate_package(PACKAGE_NAME SQLite-3.32.2-rev3-multiplatform TARGETS SQLite PACKAGE_HASH dd4d3de6cbb4ce3d15fc504ba0ae0587e515dc89a25228037035fc0aef4831f4) ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee) -ly_associate_package(PACKAGE_NAME lux_core-2.2-rev5-multiplatform TARGETS lux_core PACKAGE_HASH c8c13cf7bc351643e1abd294d0841b24dee60e51647dff13db7aec396ad1e0b5) ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform TARGETS xxhash PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e) # platform-specific: diff --git a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake index 994f42e983..35a6b87c6c 100644 --- a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake +++ b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake @@ -18,7 +18,6 @@ ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) ly_associate_package(PACKAGE_NAME SQLite-3.32.2-rev3-multiplatform TARGETS SQLite PACKAGE_HASH dd4d3de6cbb4ce3d15fc504ba0ae0587e515dc89a25228037035fc0aef4831f4) ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee) -ly_associate_package(PACKAGE_NAME lux_core-2.2-rev5-multiplatform TARGETS lux_core PACKAGE_HASH c8c13cf7bc351643e1abd294d0841b24dee60e51647dff13db7aec396ad1e0b5) ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform TARGETS xxhash PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e) # platform-specific: diff --git a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake index 6e2d2a92e2..90d44a3658 100644 --- a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake +++ b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake @@ -18,7 +18,6 @@ ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) ly_associate_package(PACKAGE_NAME SQLite-3.32.2-rev3-multiplatform TARGETS SQLite PACKAGE_HASH dd4d3de6cbb4ce3d15fc504ba0ae0587e515dc89a25228037035fc0aef4831f4) ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee) -ly_associate_package(PACKAGE_NAME lux_core-2.2-rev5-multiplatform TARGETS lux_core PACKAGE_HASH c8c13cf7bc351643e1abd294d0841b24dee60e51647dff13db7aec396ad1e0b5) ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform TARGETS xxhash PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e) # platform-specific: diff --git a/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake b/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake index 1eea5082da..d8dd7e8134 100644 --- a/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake +++ b/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake @@ -14,7 +14,6 @@ ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cit ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform TARGETS expat PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418) ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee) -ly_associate_package(PACKAGE_NAME lux_core-2.2-rev5-multiplatform TARGETS lux_core PACKAGE_HASH c8c13cf7bc351643e1abd294d0841b24dee60e51647dff13db7aec396ad1e0b5) # platform-specific: ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-rev3-ios TARGETS TIFF PACKAGE_HASH e9067e88649fb6e93a926d9ed38621a9fae360a2e6f6eb24ebca63c1bc7761ea) From 1a26ea439aab0b43dd1a591587801c3caf72d141 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 22 Dec 2021 09:07:42 -0800 Subject: [PATCH 183/399] bugfix[Linux]: resolve Lua script file not found (#6369) * bugfix: resolve Lua script file not found REF: https://github.com/o3de/o3de/issues/5899 Signed-off-by: Michael Pollind * chore: user lowcase version of assetIdLower Signed-off-by: Michael Pollind --- .../LuaIDE/Source/LUA/LUAEditorContext.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Code/Tools/LuaIDE/Source/LUA/LUAEditorContext.cpp b/Code/Tools/LuaIDE/Source/LUA/LUAEditorContext.cpp index f36724ee1a..533a89a77c 100644 --- a/Code/Tools/LuaIDE/Source/LUA/LUAEditorContext.cpp +++ b/Code/Tools/LuaIDE/Source/LUA/LUAEditorContext.cpp @@ -1433,7 +1433,8 @@ namespace LUAEditor return; } - AZStd::to_lower(const_cast(assetId).begin(), const_cast(assetId).end()); + AZStd::string assetIdLower(assetId); + AZStd::to_lower(assetIdLower.begin(), assetIdLower.end()); ShowLUAEditorView(); @@ -1446,11 +1447,11 @@ namespace LUAEditor // * we need to load that lua panel with the document's data, initializing it. // are we already tracking it? - auto it = m_documentInfoMap.find(assetId); + auto it = m_documentInfoMap.find(assetIdLower); if (it != m_documentInfoMap.end()) { // tell the view that it needs to focus that document! - mostRecentlyOpenedDocumentView = assetId; + mostRecentlyOpenedDocumentView = assetIdLower; if (m_queuedOpenRecent) { return; @@ -1482,14 +1483,14 @@ namespace LUAEditor // Register the script into the asset catalog AZ::Data::AssetType assetType = AZ::AzTypeInfo::Uuid(); AZ::Data::AssetId catalogAssetId; - EBUS_EVENT_RESULT(catalogAssetId, AZ::Data::AssetCatalogRequestBus, GetAssetIdByPath, assetId.c_str(), assetType, true); + EBUS_EVENT_RESULT(catalogAssetId, AZ::Data::AssetCatalogRequestBus, GetAssetIdByPath, assetIdLower.c_str(), assetType, true); uint64_t modTime = m_fileIO->ModificationTime(assetId.c_str()); DocumentInfo info; - info.m_assetName = assetId; + info.m_assetName = assetIdLower; AzFramework::StringFunc::Path::GetFullFileName(assetId.c_str(), info.m_displayName); - info.m_assetId = assetId; + info.m_assetId = assetIdLower; info.m_bSourceControl_BusyGettingStats = true; info.m_bSourceControl_BusyGettingStats = false; info.m_bSourceControl_CanWrite = true; @@ -1532,7 +1533,7 @@ namespace LUAEditor luaFile.Close(); } - DataLoadDoneCallback(isLoaded, assetId); + DataLoadDoneCallback(isLoaded, assetIdLower); ////////////////////////////////////////////////////////////////////////// if (m_queuedOpenRecent) @@ -1545,7 +1546,7 @@ namespace LUAEditor m_pLUAEditorMainWindow->IgnoreFocusEvents(false); } - mostRecentlyOpenedDocumentView = assetId; + mostRecentlyOpenedDocumentView = assetIdLower; EBUS_QUEUE_FUNCTION(AZ::SystemTickBus, &Context::OpenMostRecentDocumentView, this); } From 67689d48cc0f142eccd4856b0686277b49ca42d0 Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Wed, 22 Dec 2021 11:29:48 -0600 Subject: [PATCH 184/399] Add precise keyword to the depth and forward pass shaders. (#6536) * Add precise keyword to the depth and forward pass shaders. Make sure metal shader pipeline passes the invariant along Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> * Update with VickyAtAZ's feedback, split the preserve invariance into a separate string Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> * Fix attribute comment alignment in the shaders Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- .../Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp | 3 +-- .../Materials/Types/StandardPBR_DepthPass_WithPS.azsl | 2 +- .../Assets/Materials/Types/StandardPBR_ForwardPass.azsl | 2 +- .../Atom/Features/PBR/Surfaces/BasePbrSurfaceData.azsli | 2 +- .../Atom/Features/PBR/Surfaces/StandardSurface.azsli | 2 +- .../Code/Source/RHI.Builders/ShaderPlatformInterface.cpp | 6 ++++-- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp index 99b7c814d1..cc80b38b85 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp @@ -82,8 +82,7 @@ namespace AZ // Register Shader Asset Builder AssetBuilderSDK::AssetBuilderDesc shaderAssetBuilderDescriptor; shaderAssetBuilderDescriptor.m_name = "Shader Asset Builder"; - shaderAssetBuilderDescriptor.m_version = 108; // The Build Time Stamp of ShaderAsset And ShaderVariantAsset Should Be Based On GetTimeUTCMilliSecond() - // .shader file changes trigger rebuilds + shaderAssetBuilderDescriptor.m_version = 109; // Modify Metal shader platform to permit the precise keyword to fix depth bitwise mismatch between passes shaderAssetBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern( AZStd::string::format("*.%s", RPI::ShaderSourceData::Extension), AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); shaderAssetBuilderDescriptor.m_busId = azrtti_typeid(); shaderAssetBuilderDescriptor.m_createJobFunction = AZStd::bind(&ShaderAssetBuilder::CreateJobs, &m_shaderAssetBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2); diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl index 136841907b..264542cd0a 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl @@ -29,7 +29,7 @@ struct VSInput struct VSDepthOutput { // "centroid" is needed for SV_Depth to compile - linear centroid float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float2 m_uv[UvSetCount] : UV1; // only used for parallax depth calculation diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.azsl index 1d5e4ad9e3..b99ea734af 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.azsl @@ -62,7 +62,7 @@ struct VSOutput { // Base fields (required by the template azsli file)... // "centroid" is needed for SV_Depth to compile - linear centroid float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float3 m_normal: NORMAL; float3 m_tangent : TANGENT; float3 m_bitangent : BITANGENT; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/BasePbrSurfaceData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/BasePbrSurfaceData.azsli index 54bfa31fe8..484958c26c 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/BasePbrSurfaceData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/BasePbrSurfaceData.azsli @@ -24,7 +24,7 @@ static const float MinRoughnessA = 0.0005f; class BasePbrSurfaceData { - float3 position; //!< Position in world-space + precise float3 position; //!< Position in world-space float3 normal; //!< Normal in world-space float3 albedo; //!< Albedo color of the non-metallic material, will be multiplied against the diffuse lighting value float3 specularF0; //!< Fresnel f0 spectral value of the surface diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli index 084943bf38..e1b3ff8206 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli @@ -20,7 +20,7 @@ class Surface // ------- BasePbrSurfaceData ------- - float3 position; //!< Position in world-space + precise float3 position; //!< Position in world-space float3 normal; //!< Normal in world-space float3 vertexNormal; //!< Vertex normal in world-space float3 albedo; //!< Albedo color of the non-metallic material, will be multiplied against the diffuse lighting value diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp index d43d88a7e1..8c80205c17 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp @@ -347,7 +347,7 @@ namespace AZ // spirv cross compiler executable static const char* spirvCrossRelativePath = "Builders/SPIRVCross/spirv-cross"; - AZStd::string spirvCrossCommandOptions = AZStd::string::format("--msl --msl-version 20100 --msl-argument-buffers --msl-decoration-binding --msl-texture-buffer-native --output \"%s\" \"%s\"", shaderMSLOutputFile.c_str(), shaderSpirvOutputFile.c_str()); + AZStd::string spirvCrossCommandOptions = AZStd::string::format("--msl --msl-version 20100 --msl-invariant-float-math --msl-argument-buffers --msl-decoration-binding --msl-texture-buffer-native --output \"%s\" \"%s\"", shaderMSLOutputFile.c_str(), shaderSpirvOutputFile.c_str()); // Run spirv cross if (!RHI::ExecuteShaderCompiler(spirvCrossRelativePath, spirvCrossCommandOptions, shaderSpirvOutputFile, "SpirvCross")) @@ -426,6 +426,8 @@ namespace AZ //Debug symbols are always enabled at the moment. Need to turn them off for optimized shader assets. AZStd::string shaderDebugInfo = "-gline-tables-only -MO"; + AZStd::string shaderMslToAirOptions = "-fpreserve-invariance"; + //Apply the correct platform sdk option AZStd::string platformSdk = "macosx"; if (platform.HasTag("mobile")) @@ -434,7 +436,7 @@ namespace AZ } //Convert to air file - AZStd::string mslToAirCommandOptions = AZStd::string::format("-sdk %s metal \"%s\" %s -c -o \"%s\"", platformSdk.c_str(), inputMetalFile.c_str(), shaderDebugInfo.c_str(), outputAirFile.c_str()); + AZStd::string mslToAirCommandOptions = AZStd::string::format("-sdk %s metal \"%s\" %s %s -c -o \"%s\"", platformSdk.c_str(), inputMetalFile.c_str(), shaderDebugInfo.c_str(), shaderMslToAirOptions.c_str(), outputAirFile.c_str()); if (!RHI::ExecuteShaderCompiler("/usr/bin/xcrun", mslToAirCommandOptions, inputMetalFile, "MslToAir")) { From d5e6ec5758f910b22f38611d78efa81567981850 Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Wed, 22 Dec 2021 11:30:32 -0600 Subject: [PATCH 185/399] Change the nvidia Aftermath integration to use c strings directly rather than convert to an AZStd::string (#6535) Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- .../Source/Platform/Windows/RHI/NsightAftermath_Windows.cpp | 6 +++--- Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.cpp | 2 +- Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.h | 2 +- Gems/Atom/RHI/DX12/Code/Source/RHI/NsightAftermath.h | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/RHI/NsightAftermath_Windows.cpp b/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/RHI/NsightAftermath_Windows.cpp index 199efbb139..429fded6ad 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/RHI/NsightAftermath_Windows.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/RHI/NsightAftermath_Windows.cpp @@ -53,14 +53,14 @@ namespace Aftermath #endif } - void SetAftermathEventMarker( [[maybe_unused]] void* cntxHandle, [[maybe_unused]] const AZStd::string& markerData, [[maybe_unused]] bool isAftermathInitialized) + void SetAftermathEventMarker( [[maybe_unused]] void* cntxHandle, [[maybe_unused]] const char* markerData, [[maybe_unused]] bool isAftermathInitialized) { #if defined(USE_NSIGHT_AFTERMATH) if (isAftermathInitialized) { GFSDK_Aftermath_Result result = GFSDK_Aftermath_SetEventMarker( - static_cast(cntxHandle), static_cast(markerData.c_str()), - static_cast(markerData.size()) + 1); + static_cast(cntxHandle), static_cast(markerData), + static_cast(strlen(markerData) + 1); AssertOnError(result); } #endif diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.cpp index 9733045179..35f52b3930 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.cpp @@ -85,7 +85,7 @@ namespace AZ return m_hardwareQueueClass; } - void CommandListBase::SetAftermathEventMarker(const AZStd::string& markerData) + void CommandListBase::SetAftermathEventMarker(const char* markerData) { auto& device = static_cast(GetDevice()); Aftermath::SetAftermathEventMarker(m_aftermathCommandListContext, markerData, device.IsAftermathInitialized()); diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.h b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.h index 5f3e4dce1e..d2ad804524 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.h +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.h @@ -52,7 +52,7 @@ namespace AZ RHI::HardwareQueueClass GetHardwareQueueClass() const; - void SetAftermathEventMarker(const AZStd::string& markerData); + void SetAftermathEventMarker(const char* markerData); protected: void Init(Device& device, RHI::HardwareQueueClass hardwareQueueClass, ID3D12CommandAllocator* commandAllocator); diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/NsightAftermath.h b/Gems/Atom/RHI/DX12/Code/Source/RHI/NsightAftermath.h index a486822309..bce293ad29 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/NsightAftermath.h +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/NsightAftermath.h @@ -15,6 +15,7 @@ namespace Aftermath { void SetAftermathEventMarker(void* cntxHandle, const AZStd::string& markerData, bool isAftermathInitialized); + void SetAftermathEventMarker(void* cntxHandle, const char* markerData, bool isAftermathInitialized); bool InitializeAftermath(AZ::RHI::Ptr dx12Device); void* CreateAftermathContextHandle(ID3D12GraphicsCommandList* commandList, void* crashTracker); void OutputLastScopeExecutingOnGPU(void* crashTracker); From 3f766629bc2e05644e072e3f1cc86b23a58a56ee Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 17:36:34 +0000 Subject: [PATCH 186/399] Lua Editor log - text ghosted (#6329) Signed-off-by: T.J. McGrath-Daly --- .../AzToolsFramework/UI/Logging/LogPanel_Panel.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Logging/LogPanel_Panel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Logging/LogPanel_Panel.cpp index ef8bf42713..a9449645c7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Logging/LogPanel_Panel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Logging/LogPanel_Panel.cpp @@ -840,8 +840,6 @@ namespace AzToolsFramework richLabel->setTextFormat(Qt::RichText); } - richLabel->setText(data); - richLabel->setGeometry(options.rect); richLabel->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse); richLabel->setPalette(options.palette); From 38bbf9659e4254564e71e901588d91f7568c12f8 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 18:54:49 +0000 Subject: [PATCH 187/399] Fix: jumps disordered (Go to Line,Transpose Lines UP,Transpose Lines (#6210) Down,Comment Selected Block and UnComment Selected Block) Signed-off-by: T.J. McGrath-Daly Co-authored-by: Tobias Alexander Franke --- .../LuaIDE/Source/LUA/LUAEditorMainWindow.cpp | 2 +- .../Tools/LuaIDE/Source/LUA/LUAEditorView.cpp | 33 ++++++++++++------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp b/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp index 33d8373487..85274cf5e1 100644 --- a/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp +++ b/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp @@ -1280,7 +1280,7 @@ namespace LUAEditor // go to that line of the selected file. lineNumber = dlg.getLineNumber(); - currentView->SetCursorPosition(lineNumber - 1, 0); + currentView->SetCursorPosition(lineNumber, 0); } } diff --git a/Code/Tools/LuaIDE/Source/LUA/LUAEditorView.cpp b/Code/Tools/LuaIDE/Source/LUA/LUAEditorView.cpp index 18d12f292c..c83c9a5513 100644 --- a/Code/Tools/LuaIDE/Source/LUA/LUAEditorView.cpp +++ b/Code/Tools/LuaIDE/Source/LUA/LUAEditorView.cpp @@ -964,9 +964,11 @@ namespace LUAEditor int endLine; auto newText = AcumulateSelectedLines(startLine, endLine, callable); - SetSelection(startLine, 0, endLine + 1, 0); + SetSelection(startLine + 1, 0, endLine + 2, 0); + RemoveSelectedText(); + SetCursorPosition(startLine + 1, 0); ReplaceSelectedText(newText); - SetSelection(startLine, 0, endLine + 1, 0); + SetSelection(startLine + 1, 0, endLine + 1, INT_MAX); } void LUAViewWidget::CommentSelectedLines() @@ -1002,21 +1004,30 @@ namespace LUAEditor { int startLine; int endLine; - auto newText = AcumulateSelectedLines(startLine, endLine, [&](QString& newText, QTextBlock& block) + auto currText = AcumulateSelectedLines(startLine, endLine, [&](QString& newText, QTextBlock& block) { newText.append(block.text()); newText.append("\n"); }); + currText.remove(currText.count() - 1, 1); + if (startLine == 0) { return; } - - SetSelection(startLine - 1, INT_MAX, endLine, INT_MAX); + auto upText = GetLineText(startLine -1); + SetSelection(startLine, 0, startLine, INT_MAX); RemoveSelectedText(); - SetCursorPosition(startLine - 1, 0); - ReplaceSelectedText(newText); - SetSelection(startLine - 1, 0, endLine - 1, INT_MAX); + SetSelection(startLine + 1, 0, endLine + 1, INT_MAX); + RemoveSelectedText(); + + SetCursorPosition(startLine , 0); + ReplaceSelectedText(currText); + + SetCursorPosition(endLine + 1, 0); + ReplaceSelectedText(upText); + + SetSelection(startLine, 0, endLine, INT_MAX); } void LUAViewWidget::MoveSelectedLinesDn() @@ -1040,11 +1051,11 @@ namespace LUAEditor newText.prepend("\n"); } - SetSelection(startLine, 0, endLine + 1, 0); + SetSelection(startLine + 1, 0, endLine + 2, 0); RemoveSelectedText(); - SetCursorPosition(startLine + 1, 0); + SetCursorPosition(startLine + 2, 0); ReplaceSelectedText(newText); - SetSelection(startLine + 1, 0, endLine + 1, INT_MAX); + SetSelection(startLine + 2, 0, endLine + 2, INT_MAX); } void LUAViewWidget::SetReadonly(bool readonly) From f69b9b817c19b73921d5e4095d309a51b656fe8c Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Wed, 22 Dec 2021 11:03:51 -0800 Subject: [PATCH 188/399] Round of clang compile fixes Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp | 2 +- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 10 ++-------- Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp | 7 +++---- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp index 46fa5b9bac..d65497e194 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp @@ -22,7 +22,7 @@ namespace AZ::Dom::Utils return backend.ReadFromBufferInPlace(string.data(), string.size(), visitor); } - AZ::Outcome AZ::Dom::Utils::WriteToValue(Backend::WriteCallback writeCallback) + AZ::Outcome WriteToValue(Backend::WriteCallback writeCallback) { Value value; AZStd::unique_ptr writer = value.GetWriteHandler(); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 7659afa070..7401a5ac98 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -6,8 +6,6 @@ * */ -#pragma once - #include #include #include @@ -31,11 +29,7 @@ namespace AZ::Dom namespace Internal { template - constexpr size_t GetTypeIndexInternal(size_t index = 0) - { - static_assert(false, "Type not found in ValueType"); - return index; - } + constexpr size_t GetTypeIndexInternal(size_t index = 0); template constexpr size_t GetTypeIndexInternal(size_t index = 0) @@ -143,7 +137,7 @@ namespace AZ::Dom Value Value::FromOpaqueValue(const AZStd::any& value) { - return Value(&value); + return Value(value); } Value::Value(int8_t value) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index f8ca56ea32..b7ed44f8de 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -129,7 +129,7 @@ namespace AZ::Dom AZStd::string::format("AZ::Dom::ValueWriter: %s called from within a different container type", endMethodName)); } - if (buffer.m_attributes.size() != attributeCount) + if (static_cast(buffer.m_attributes.size()) != attributeCount) { return VisitorFailure( VisitorErrorCode::InternalError, @@ -138,7 +138,7 @@ namespace AZ::Dom buffer.m_attributes.size())); } - if (buffer.m_elements.size() != elementCount) + if (static_cast(buffer.m_elements.size()) != elementCount) { return VisitorFailure( VisitorErrorCode::InternalError, @@ -146,6 +146,7 @@ namespace AZ::Dom "AZ::Dom::ValueWriter: %s expected %llu elements but received %llu elements instead", endMethodName, elementCount, buffer.m_elements.size())); } + if (buffer.m_attributes.size() > 0) { MoveVectorMemory(container.GetMutableObject(), buffer.m_attributes); @@ -237,8 +238,6 @@ namespace AZ::Dom m_entryStack.top().m_value.Swap(value); ValueInfo& newEntry = m_entryStack.top(); - constexpr const size_t reserveSize = 8; - if (!newEntry.m_key.IsEmpty()) { GetValueBuffer().m_attributes.emplace_back(AZStd::move(newEntry.m_key), AZStd::move(value)); From 7b99b6a1e2ede0b8fb70e894de666853e52f966f Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 19:31:49 +0000 Subject: [PATCH 189/399] Fix: next and prev tabs incorrectly implemented (#6208) Signed-off-by: T.J. McGrath-Daly Co-authored-by: Tobias Alexander Franke --- .../LuaIDE/Source/LUA/LUAEditorMainWindow.cpp | 126 ++++++++---------- 1 file changed, 52 insertions(+), 74 deletions(-) diff --git a/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp b/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp index 85274cf5e1..c05e11f575 100644 --- a/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp +++ b/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp @@ -2141,24 +2141,7 @@ namespace LUAEditor if (event->type() == QEvent::KeyPress) { QKeyEvent* keyEvent = static_cast(event); - if (keyEvent->key() == Qt::Key_Control) - { - TrackedLUACtrlTabOrder::iterator tabIter = m_CtrlTabOrder.begin(); - while (tabIter != m_CtrlTabOrder.end()) - { - if (*tabIter == m_lastFocusedAssetId) - { - // store the visible top window and make it the list's topmost - m_StoredTabAssetId = m_lastFocusedAssetId; - m_CtrlTabOrder.erase(tabIter); - m_CtrlTabOrder.push_front(m_lastFocusedAssetId); - break; - } - - ++tabIter; - } - } - else if (keyEvent->key() == Qt::Key_C && (keyEvent->modifiers() & Qt::ControlModifier)) + if (keyEvent->key() == Qt::Key_C && (keyEvent->modifiers() & Qt::ControlModifier)) { OnEditMenuCopy(); return true; @@ -2174,32 +2157,6 @@ namespace LUAEditor QKeyEvent* keyEvent = static_cast(event); if (keyEvent->key() == Qt::Key_Control) { - // reconfigure the ctrl+tab stack to set the next document to be the stored guid - // which was recorded when Ctrl was first pressed - TrackedLUACtrlTabOrder::iterator tabIter = m_CtrlTabOrder.begin(); - while (tabIter != m_CtrlTabOrder.end()) - { - if (*tabIter == m_StoredTabAssetId) - { - m_CtrlTabOrder.erase(tabIter); - - tabIter = m_CtrlTabOrder.begin(); - ++tabIter; - if (tabIter != m_CtrlTabOrder.end()) - { - m_CtrlTabOrder.insert(tabIter, m_StoredTabAssetId); - } - else - { - m_CtrlTabOrder.push_back(m_StoredTabAssetId); - } - - break; - } - - ++tabIter; - } - m_StoredTabAssetId = ""; } } @@ -2210,46 +2167,67 @@ namespace LUAEditor void LUAEditorMainWindow::OnTabForwards() { - // pop the first entry and push it to the last spot TrackedLUACtrlTabOrder::iterator tabIter = m_CtrlTabOrder.begin(); - if (tabIter != m_CtrlTabOrder.end()) - { - AZStd::string assetId = *tabIter; - m_CtrlTabOrder.pop_front(); - m_CtrlTabOrder.push_back(assetId); - // then grab the new first entry and pass it on to the widgetry - tabIter = m_CtrlTabOrder.begin(); - - TrackedLUAViewMap::iterator viewInfoIter = m_dOpenLUAView.find(*tabIter); - if (viewInfoIter != m_dOpenLUAView.end()) + while (tabIter != m_CtrlTabOrder.end()) + { + if (*tabIter == m_lastFocusedAssetId) { - viewInfoIter->second.luaDockWidget()->show(); - viewInfoIter->second.luaDockWidget()->raise(); - viewInfoIter->second.luaViewWidget()->setFocus(); + break; } + tabIter++; + } + + if (tabIter == m_CtrlTabOrder.begin()) + { + tabIter = m_CtrlTabOrder.end(); + --tabIter; + } + else + { + --tabIter; + } + + TrackedLUAViewMap::iterator viewInfoIter = m_dOpenLUAView.find(*tabIter); + if (viewInfoIter != m_dOpenLUAView.end()) + { + viewInfoIter->second.luaDockWidget()->show(); + viewInfoIter->second.luaDockWidget()->raise(); + viewInfoIter->second.luaViewWidget()->setFocus(); + m_lastFocusedAssetId = *tabIter; } } void LUAEditorMainWindow::OnTabBackwards() - { - // pop the last entry and push it to the first spot - TrackedLUACtrlTabOrder::iterator tabIter = m_CtrlTabOrder.end(); - --tabIter; - if (tabIter != m_CtrlTabOrder.end()) + { + TrackedLUACtrlTabOrder::iterator tabIter = m_CtrlTabOrder.begin(); + while (tabIter != m_CtrlTabOrder.end()) { - AZStd::string assetId = *tabIter; - m_CtrlTabOrder.pop_back(); - m_CtrlTabOrder.push_front(assetId); - // then grab the new first entry and pass it on to the widgetry - tabIter = m_CtrlTabOrder.begin(); - - TrackedLUAViewMap::iterator viewInfoIter = m_dOpenLUAView.find(*tabIter); - if (viewInfoIter != m_dOpenLUAView.end()) + if (*tabIter == m_lastFocusedAssetId) { - viewInfoIter->second.luaDockWidget()->show(); - viewInfoIter->second.luaDockWidget()->raise(); - viewInfoIter->second.luaViewWidget()->setFocus(); + break; } + tabIter++; + } + + if (tabIter == m_CtrlTabOrder.end()) + { + return; + } + + tabIter++; + if (tabIter == m_CtrlTabOrder.end()) + { + tabIter = m_CtrlTabOrder.begin(); + + } + + TrackedLUAViewMap::iterator viewInfoIter = m_dOpenLUAView.find(*tabIter); + if (viewInfoIter != m_dOpenLUAView.end()) + { + viewInfoIter->second.luaDockWidget()->show(); + viewInfoIter->second.luaDockWidget()->raise(); + viewInfoIter->second.luaViewWidget()->setFocus(); + m_lastFocusedAssetId = *tabIter; } } From 33495e4858f5cd1fd576a2deb2fc5fa0061483a1 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 19:32:14 +0000 Subject: [PATCH 190/399] Slice save path incorrect, and error message incomplete (#6214) Signed-off-by: T.J. McGrath-Daly --- .../AzToolsFramework/Slice/SliceUtilities.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp index c13f7dd848..93b1fce5b4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp @@ -2666,19 +2666,15 @@ namespace AzToolsFramework if (!isPathSafeForAssets) { // Put an error in the console, so the log files have info about this error, or the user can look up the error after dismissing it. - AZStd::string errorMessage = "You can save slices only to your game project folder or the Gems folder. Update the location and try again.\n\n" - "You can also review and update your save locations in the AssetProcessorPlatformConfig.ini file."; + AZStd::string errorMessage = "You can save slices only to your game project folder or the Gems folder. Update the location and try again.\n\n"; AZ_Error("Slice", false, errorMessage.c_str()); - QString learnMoreLink(QObject::tr("")); - QString learnMoreDescription(QObject::tr(" Learn more").arg(learnMoreLink)); - // Display a pop-up, the logs are easy to miss. This will make sure a user who encounters this error immediately knows their slice save has failed. QMessageBox msgBox(activeWindow); msgBox.setIcon(QMessageBox::Icon::Warning); msgBox.setTextFormat(Qt::RichText); msgBox.setWindowTitle(QObject::tr("Invalid save location")); - msgBox.setText(QString("%1 %2").arg(QObject::tr(errorMessage.c_str())).arg(learnMoreDescription)); + msgBox.setText(QString("%1").arg(QObject::tr(errorMessage.c_str()))); msgBox.setStandardButtons(QMessageBox::Cancel | QMessageBox::Retry); msgBox.setDefaultButton(QMessageBox::Retry); const int response = msgBox.exec(); @@ -2689,7 +2685,16 @@ namespace AzToolsFramework // so set the suggested save path to a known valid location. if (assetSafeFolders.size() > 0) { - retrySavePath = assetSafeFolders[0]; + QStringList strList = slicePath.split("/"); + if (strList.size() > 0) + { + retrySavePath = assetSafeFolders[0] + ("/" + strList[strList.size() - 1]).toUtf8().data(); + } + else + { + retrySavePath = assetSafeFolders[0]; + } + } return SliceSaveResult::Retry; case QMessageBox::Cancel: From 254906cd83daa9ea34637ccfb7dd3221be8cf0f7 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 19:32:40 +0000 Subject: [PATCH 191/399] The line number displayed by Breakpoints in Lua Editor is 1 larger than (#6299) the actual line number of the code. Signed-off-by: T.J. McGrath-Daly --- Code/Tools/LuaIDE/Source/LUA/BreakpointPanel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Tools/LuaIDE/Source/LUA/BreakpointPanel.cpp b/Code/Tools/LuaIDE/Source/LUA/BreakpointPanel.cpp index 56379a3f07..cb8fffffc7 100644 --- a/Code/Tools/LuaIDE/Source/LUA/BreakpointPanel.cpp +++ b/Code/Tools/LuaIDE/Source/LUA/BreakpointPanel.cpp @@ -140,7 +140,7 @@ void DHBreakpointsWidget::CreateBreakpoint(const AZStd::string& debugName, int l QTableWidgetItem* newItem = new QTableWidgetItem(debugName.c_str()); newItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); setItem(newRow, 1, newItem); - newItem = new QTableWidgetItem(QString().setNum(lineNumber + 1)); // +1 offset to match editor numbering + newItem = new QTableWidgetItem(QString().setNum(lineNumber)); newItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); setItem(newRow, 0, newItem); } From 5867e65720cc3b55fb049cf37df8670a7824fbeb Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 19:34:48 +0000 Subject: [PATCH 192/399] The search cursor on the Node Palette interface does not cover the (#6218) searched keywords completely Signed-off-by: T.J. McGrath-Daly --- .../GraphCanvas/Widgets/NodePalette/NodePaletteWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/NodePalette/NodePaletteWidget.cpp b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/NodePalette/NodePaletteWidget.cpp index 5a1aaedeb9..f6cec6de6b 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/NodePalette/NodePaletteWidget.cpp +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/NodePalette/NodePaletteWidget.cpp @@ -85,7 +85,7 @@ namespace GraphCanvas if (leftSpot < textRect.right()) { int visibleLength = AZStd::GetMin(selectedTextLength, textRect.right() - leftSpot); - QRect highlightRect(textRect.left() + preSelectedTextLength, textRect.top(), visibleLength, textRect.height()); + QRect highlightRect(textRect.left() + preSelectedTextLength + 4, textRect.top(), visibleLength, textRect.height()); // paint the highlight rect painter->fillRect(highlightRect, options.palette.highlight()); From 515e363151185c1270838f8155cf08e198549ed5 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 19:50:14 +0000 Subject: [PATCH 193/399] added pass class (#6244) Signed-off-by: T.J. McGrath-Daly --- .../Assets/Passes/DiffuseComposite.pass | 2 +- .../Code/Source/CommonSystemComponent.cpp | 2 + .../DiffuseCompositePass.cpp | 45 +++++++++++++++++++ .../DiffuseCompositePass.h | 36 +++++++++++++++ .../Code/atom_feature_common_files.cmake | 2 + 5 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp create mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.h diff --git a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseComposite.pass b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseComposite.pass index 615ee8a162..3ad5c06c90 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseComposite.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseComposite.pass @@ -5,7 +5,7 @@ "ClassData": { "PassTemplate": { "Name": "DiffuseCompositePassTemplate", - "PassClass": "FullScreenTriangle", + "PassClass": "DiffuseCompositePass", "Slots": [ { "Name": "DownsampledIrradianceInput", diff --git a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp index a06defff08..04098f5c20 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp @@ -96,6 +96,7 @@ #include #include #include +#include #include #include #include @@ -278,6 +279,7 @@ namespace AZ passSystem->AddPassCreator(Name("DiffuseProbeGridClassificationPass"), &Render::DiffuseProbeGridClassificationPass::Create); passSystem->AddPassCreator(Name("DiffuseProbeGridDownsamplePass"), &Render::DiffuseProbeGridDownsamplePass::Create); passSystem->AddPassCreator(Name("DiffuseProbeGridRenderPass"), &Render::DiffuseProbeGridRenderPass::Create); + passSystem->AddPassCreator(Name("DiffuseCompositePass"), &Render::DiffuseCompositePass::Create); passSystem->AddPassCreator(Name("LuminanceHistogramGeneratorPass"), &LuminanceHistogramGeneratorPass::Create); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp new file mode 100644 index 0000000000..0b0dfda391 --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace AZ +{ + namespace Render + { + // --- Dedicated class for disabling --- + + RPI::Ptr DiffuseCompositePass::Create(const RPI::PassDescriptor& descriptor) + { + RPI::Ptr pass = aznew DiffuseCompositePass(descriptor); + return AZStd::move(pass); + } + + DiffuseCompositePass::DiffuseCompositePass(const RPI::PassDescriptor& descriptor) + : RPI::FullscreenTrianglePass(descriptor) + { } + + bool DiffuseCompositePass::IsEnabled() const + { + const RPI::Scene* scene = GetScene(); + if (!scene) + { + return false; + } + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = + scene->GetFeatureProcessor(); + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) + { + // no diffuse probe grids + return false; + } + return true; + } + } // namespace Render +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.h new file mode 100644 index 0000000000..333c66ebea --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include + +namespace AZ +{ + namespace Render + { + //! A class for DiffuseComposite to allow for disabling + class DiffuseCompositePass final + : public RPI::FullscreenTrianglePass + { + AZ_RPI_PASS(DiffuseCompositePass); + + public: + AZ_RTTI(DiffuseCompositePass, "{F3DBEBCB-66F8-465C-A06B-DFA76B9D4856}", AZ::RPI::FullscreenTrianglePass); + AZ_CLASS_ALLOCATOR(DiffuseCompositePass, SystemAllocator, 0); + + ~DiffuseCompositePass() = default; + static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); + + bool IsEnabled() const override; + + private: + DiffuseCompositePass(const RPI::PassDescriptor& descriptor); + + }; + } // namespace Render +} // namespace AZ \ No newline at end of file diff --git a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake index 375dbd9724..952085e136 100644 --- a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake +++ b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake @@ -134,6 +134,8 @@ set(FILES Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.h Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.h + Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp + Source/DiffuseGlobalIllumination/DiffuseCompositePass.h Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h Source/DiffuseGlobalIllumination/DiffuseProbeGridTextureReadback.cpp From 457007e037090484306309d6e53d32ce4979d823 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 19:51:11 +0000 Subject: [PATCH 194/399] Negative distances invalid (#6288) Signed-off-by: T.J. McGrath-Daly Co-authored-by: Tobias Alexander Franke --- .../Code/Source/Integration/Components/SimpleLODComponent.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Gems/EMotionFX/Code/Source/Integration/Components/SimpleLODComponent.cpp b/Gems/EMotionFX/Code/Source/Integration/Components/SimpleLODComponent.cpp index fdc6426e4c..c673e14bce 100644 --- a/Gems/EMotionFX/Code/Source/Integration/Components/SimpleLODComponent.cpp +++ b/Gems/EMotionFX/Code/Source/Integration/Components/SimpleLODComponent.cpp @@ -53,6 +53,7 @@ namespace EMotionFX ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ->ElementAttribute(AZ::Edit::Attributes::Step, 0.01f) ->ElementAttribute(AZ::Edit::Attributes::Suffix, " m") + ->ElementAttribute(AZ::Edit::Attributes::Min, 0.00f) ->DataElement(0, &SimpleLODComponent::Configuration::m_enableLodSampling, "Enable LOD anim graph sampling", "AnimGraph sample rate will adjust based on LOD level.") ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::EntireTree) @@ -61,7 +62,8 @@ namespace EMotionFX ->Attribute(AZ::Edit::Attributes::Visibility, &SimpleLODComponent::Configuration::GetEnableLodSampling) ->Attribute(AZ::Edit::Attributes::ContainerCanBeModified, false) ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->ElementAttribute(AZ::Edit::Attributes::Step, 1.0f); + ->ElementAttribute(AZ::Edit::Attributes::Step, 1.0f) + ->ElementAttribute(AZ::Edit::Attributes::Min, 0.0f); } } } From a6240ff6bc547a1774c3beaea567cfeb6895c09f Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 19:51:33 +0000 Subject: [PATCH 195/399] Editor issue after clicking Find Layer in Asset Browser and (#6327) Find Slice in Asset Browser in Slice mode Signed-off-by: T.J. McGrath-Daly --- .../AssetBrowser/Views/AssetBrowserTableView.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.cpp index feab9a9e5a..cfcac579ff 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.cpp @@ -144,7 +144,10 @@ namespace AzToolsFramework { emit ClearStringFilter(); emit ClearTypeFilter(); - m_sourceFilterModel->FilterUpdatedSlotImmediate(); + if (m_sourceFilterModel) + { + m_sourceFilterModel->FilterUpdatedSlotImmediate(); + } } void AssetBrowserTableView::Update() From cb740a3b3ebb5d6f0bab2774435a88eb9cd8c866 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 22 Dec 2021 11:51:47 -0800 Subject: [PATCH 196/399] chore: remove "using namespace AZ" from AZCore Script (#6366) * chore: remove "using namespace AZ" from AZCore Script REF: https://github.com/o3de/o3de/issues/6281 Signed-off-by: Michael Pollind * chore: address changes Signed-off-by: Michael Pollind --- .../AzCore/AzCore/Script/ScriptContext.cpp | 6 ++++-- .../AzCore/AzCore/Script/ScriptContext.h | 4 +--- .../AzCore/AzCore/Script/ScriptContextDebug.cpp | 8 ++++---- .../AzCore/AzCore/Script/ScriptContextDebug.h | 6 +----- .../AzCore/Script/ScriptSystemComponent.cpp | 17 ++++++++++------- .../AzCore/Script/ScriptSystemComponent.h | 6 +----- 6 files changed, 21 insertions(+), 26 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp index 841387f14d..64822684da 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp @@ -1424,7 +1424,8 @@ namespace AZ } } -using namespace AZ; +namespace AZ +{ #ifndef AZ_USE_CUSTOM_SCRIPT_BIND @@ -2254,6 +2255,7 @@ LUA_API const Node* lua_getDummyNode() } #endif // AZ_USE_CUSTOM_SCRIPT_BIND +} // namespace AZ ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -5825,7 +5827,6 @@ LUA_API const Node* lua_getDummyNode() AllocatorWrapper m_luaAllocator; AZStd::thread::id m_ownerThreadId; // Check if Lua methods (including EBus handlers) are called from background threads. }; - } // namespace AZ ScriptContext::ScriptContext(ScriptContextId id, IAllocatorAllocate* allocator, lua_State* nativeContext) { @@ -6116,5 +6117,6 @@ LUA_API const Node* lua_getDummyNode() { return m_impl->ConstructScriptProperty(sdc, valueIndex, name, restrictToPropertyArrays); } +} // namespace AZ #undef AZ_DBG_NAME_FIXER diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContext.h b/Code/Framework/AzCore/AzCore/Script/ScriptContext.h index bb63a9368d..5a7fca704f 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContext.h +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContext.h @@ -5,8 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef AZCORE_SCRIPT_CONTEXT_H -#define AZCORE_SCRIPT_CONTEXT_H +#pragma once #include #include @@ -1032,4 +1031,3 @@ namespace AZ } } // namespace AZ -#endif // AZCORE_SCRIPT_CONTEXT_H diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContextDebug.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptContextDebug.cpp index 81ede7a5d3..698c5a0043 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContextDebug.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContextDebug.cpp @@ -25,10 +25,8 @@ extern "C" { namespace AZ { + void LuaHook(lua_State* l, lua_Debug* ar); -} - -using namespace AZ; /** * A temp class that will override the current script context error handler and store the error (without any messages) @@ -599,7 +597,7 @@ static ScriptContextDebug::BreakpointId MakeBreakpointId(const char* sourceName, // LuaHook // [6/28/2012] //========================================================================= -void AZ::LuaHook(lua_State* l, lua_Debug* ar) +void LuaHook(lua_State* l, lua_Debug* ar) { // Read contexts lua_rawgeti(l, LUA_REGISTRYINDEX, AZ_LUA_SCRIPT_CONTEXT_REF); @@ -1543,4 +1541,6 @@ ScriptContextDebug::SetValue(const DebugValue& sourceValue) return true; } +} // namespace AZ + #endif // #if !defined(AZCORE_EXCLUDE_LUA) diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContextDebug.h b/Code/Framework/AzCore/AzCore/Script/ScriptContextDebug.h index a8f0ba643c..a1d73352c4 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContextDebug.h +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContextDebug.h @@ -5,8 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef AZCORE_SCRIPT_CONTEXT_DEBUG_H -#define AZCORE_SCRIPT_CONTEXT_DEBUG_H +#pragma once #include #include @@ -213,6 +212,3 @@ namespace AZ ScriptContext& m_context; }; } - -#endif // AZCORE_SCRIPT_CONTEXT_DEBUG_H -#pragma once diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.cpp index 4b71c57682..32081afce7 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.cpp @@ -31,7 +31,8 @@ #include #include -using namespace AZ; +namespace AZ +{ /** * Script lifecycle: @@ -44,8 +45,7 @@ using namespace AZ; * If the script was loaded by a ScriptComponent, Load will be called once reload is complete. */ -namespace -{ +namespace LocalTU_ScriptSystemComponent { // Called when a module has already been loaded static int LuaRequireLoadedModule(lua_State* l) { @@ -54,8 +54,10 @@ namespace return 1; } + } + //========================================================================= // ScriptSystemComponent // [5/29/2012] @@ -479,7 +481,7 @@ int ScriptSystemComponent::DefaultRequireHook(lua_State* lua, ScriptContext* con scriptIt->second.m_scriptNames.emplace(module); // Push the value to a closure that will just return it lua_rawgeti(lua, LUA_REGISTRYINDEX, scriptIt->second.m_tableReference); - lua_pushcclosure(lua, LuaRequireLoadedModule, 1); + lua_pushcclosure(lua, LocalTU_ScriptSystemComponent::LuaRequireLoadedModule, 1); // If asset reference already populated, just return now. Otherwise, capture reference if (scriptIt->second.m_scriptAsset.GetId().IsValid()) @@ -519,7 +521,7 @@ int ScriptSystemComponent::DefaultRequireHook(lua_State* lua, ScriptContext* con } // Push function returning the result - lua_pushcclosure(lua, LuaRequireLoadedModule, 1); + lua_pushcclosure(lua, LocalTU_ScriptSystemComponent::LuaRequireLoadedModule, 1); // Set asset reference on the loaded script scriptIt = container->m_loadedScripts.find(scriptId.m_guid); @@ -565,7 +567,7 @@ int ScriptSystemComponent::InMemoryRequireHook(lua_State* lua, ScriptContext* co scriptIt->second.m_scriptNames.emplace(module); // Push the value to a closure that will just return it lua_rawgeti(lua, LUA_REGISTRYINDEX, scriptIt->second.m_tableReference); - lua_pushcclosure(lua, LuaRequireLoadedModule, 1); + lua_pushcclosure(lua, LocalTU_ScriptSystemComponent::LuaRequireLoadedModule, 1); // If asset reference already populated, just return now. Otherwise, capture reference if (scriptIt->second.m_scriptAsset.GetId().IsValid()) @@ -591,7 +593,7 @@ int ScriptSystemComponent::InMemoryRequireHook(lua_State* lua, ScriptContext* co } // Push function returning the result - lua_pushcclosure(lua, LuaRequireLoadedModule, 1); + lua_pushcclosure(lua, LocalTU_ScriptSystemComponent::LuaRequireLoadedModule, 1); // Set asset reference on the loaded script scriptIt = container->m_loadedScripts.find(scriptId.m_guid); @@ -996,4 +998,5 @@ void ScriptSystemComponent::Reflect(ReflectContext* reflection) } } +} // namespace AZ #endif // #if !defined(AZCORE_EXCLUDE_LUA) diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.h b/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.h index eb2e968a95..a7b1245546 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.h +++ b/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.h @@ -5,8 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef AZCORE_SCRIPT_SYSTEM_COMPONENT_H -#define AZCORE_SCRIPT_SYSTEM_COMPONENT_H +#pragma once #include #include @@ -182,6 +181,3 @@ namespace AZ void OnAssetReloaded(Data::Asset asset) override; }; } - -#endif // AZCORE_SCRIPT_SYSTEM_COMPONENT_H -#pragma once From 8732fab19284ca5736d30f1406659949bed02710 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Wed, 22 Dec 2021 12:35:44 -0800 Subject: [PATCH 197/399] One more compile fix Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index b7ed44f8de..210d1fa123 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -134,7 +134,7 @@ namespace AZ::Dom return VisitorFailure( VisitorErrorCode::InternalError, AZStd::string::format( - "AZ::Dom::ValueWriter: %s expected %llu attributes but received %llu attributes instead", endMethodName, attributeCount, + "AZ::Dom::ValueWriter: %s expected %llu attributes but received %zu attributes instead", endMethodName, attributeCount, buffer.m_attributes.size())); } @@ -143,7 +143,7 @@ namespace AZ::Dom return VisitorFailure( VisitorErrorCode::InternalError, AZStd::string::format( - "AZ::Dom::ValueWriter: %s expected %llu elements but received %llu elements instead", endMethodName, elementCount, + "AZ::Dom::ValueWriter: %s expected %llu elements but received %zu elements instead", endMethodName, elementCount, buffer.m_elements.size())); } From 7dac0bac0dfc75a5ff275e709a8d774b33c2ee81 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 22 Dec 2021 13:11:41 -0800 Subject: [PATCH 198/399] chore: remove "using namespace " from AZCore Math (#6372) * chore: remove "using namespace " from AZCore Math REF: https://github.com/o3de/o3de/issues/6281 Signed-off-by: Michael Pollind * chore: fix formatting Signed-off-by: Michael Pollind --- .../AzCore/AzCore/Math/IntersectSegment.cpp | 2496 +++++++++-------- Code/Framework/AzCore/AzCore/Math/Sfmt.cpp | 560 ++-- 2 files changed, 1551 insertions(+), 1505 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Math/IntersectSegment.cpp b/Code/Framework/AzCore/AzCore/Math/IntersectSegment.cpp index 5d13acc34c..4f143cde53 100644 --- a/Code/Framework/AzCore/AzCore/Math/IntersectSegment.cpp +++ b/Code/Framework/AzCore/AzCore/Math/IntersectSegment.cpp @@ -8,1558 +8,1608 @@ #include -using namespace AZ; -using namespace Intersect; - -//========================================================================= -// IntersectSegmentTriangleCCW -// [10/21/2009] -//========================================================================= -bool Intersect::IntersectSegmentTriangleCCW( - const Vector3& p, const Vector3& q, const Vector3& a, const Vector3& b, const Vector3& c, - /*float &u, float &v, float &w,*/ Vector3& normal, float& t) +namespace AZ { - float v, w; // comment this and enable input params if we need the barycentric coordinates + //========================================================================= + // IntersectSegmentTriangleCCW + // [10/21/2009] + //========================================================================= + bool Intersect::IntersectSegmentTriangleCCW( + const Vector3& p, + const Vector3& q, + const Vector3& a, + const Vector3& b, + const Vector3& c, + /*float &u, float &v, float &w,*/ Vector3& normal, + float& t) + { + float v, w; // comment this and enable input params if we need the barycentric coordinates + + Vector3 ab = b - a; + Vector3 ac = c - a; + Vector3 qp = p - q; + + // Compute triangle normal. Can be pre-calculated/cached if + // intersecting multiple segments against the same triangle + normal = ab.Cross(ac); // Right hand CCW + + // Compute denominator d. If d <= 0, segment is parallel to or points + // away from triangle, so exit early + float d = qp.Dot(normal); + if (d <= 0.0f) + { + return false; + } - Vector3 ab = b - a; - Vector3 ac = c - a; - Vector3 qp = p - q; + // Compute intersection t value of pq with plane of triangle. A ray + // intersects iff 0 <= t. Segment intersects iff 0 <= t <= 1. Delay + // dividing by d until intersection has been found to pierce triangle + Vector3 ap = p - a; + t = ap.Dot(normal); - // Compute triangle normal. Can be pre-calculated/cached if - // intersecting multiple segments against the same triangle - normal = ab.Cross(ac); // Right hand CCW + // range segment check t[0,1] (it this case [0,d]) + if (t < 0.0f || t > d) + { + return false; + } - // Compute denominator d. If d <= 0, segment is parallel to or points - // away from triangle, so exit early - float d = qp.Dot(normal); - if (d <= 0.0f) - { - return false; - } + // Compute barycentric coordinate components and test if within bounds + Vector3 e = qp.Cross(ap); + v = ac.Dot(e); + if (v < 0.0f || v > d) + { + return false; + } + w = -ab.Dot(e); + if (w < 0.0f || v + w > d) + { + return false; + } - // Compute intersection t value of pq with plane of triangle. A ray - // intersects iff 0 <= t. Segment intersects iff 0 <= t <= 1. Delay - // dividing by d until intersection has been found to pierce triangle - Vector3 ap = p - a; - t = ap.Dot(normal); + // Segment/ray intersects triangle. Perform delayed division and + // compute the last barycentric coordinate component + float ood = 1.0f / d; + t *= ood; + /*v *= ood; + w *= ood; + u = 1.0f - v - w;*/ - // range segment check t[0,1] (it this case [0,d]) - if (t < 0.0f || t > d) - { - return false; - } + normal.Normalize(); - // Compute barycentric coordinate components and test if within bounds - Vector3 e = qp.Cross(ap); - v = ac.Dot(e); - if (v < 0.0f || v > d) - { - return false; + return true; } - w = -ab.Dot(e); - if (w < 0.0f || v + w > d) + + //========================================================================= + // IntersectSegmentTriangle + // [10/21/2009] + //========================================================================= + bool Intersect::IntersectSegmentTriangle( + const Vector3& p, + const Vector3& q, + const Vector3& a, + const Vector3& b, + const Vector3& c, + /*float &u, float &v, float &w,*/ Vector3& normal, + float& t) { - return false; - } + float v, w; // comment this and enable input params if we need the barycentric coordinates - // Segment/ray intersects triangle. Perform delayed division and - // compute the last barycentric coordinate component - float ood = 1.0f / d; - t *= ood; - /*v *= ood; - w *= ood; - u = 1.0f - v - w;*/ + Vector3 ab = b - a; + Vector3 ac = c - a; + Vector3 qp = p - q; + Vector3 ap = p - a; - normal.Normalize(); + // Compute triangle normal. Can be pre-calculated or cached if + // intersecting multiple segments against the same triangle + normal = ab.Cross(ac); // Right hand CCW - return true; -} + // Compute denominator d. If d <= 0, segment is parallel to or points + // away from triangle, so exit early + float d = qp.Dot(normal); + Vector3 e; + if (d > Constants::FloatEpsilon) + { + // the normal is on the right side + e = qp.Cross(ap); + } + else + { + normal = -normal; -//========================================================================= -// IntersectSegmentTriangle -// [10/21/2009] -//========================================================================= -bool -Intersect::IntersectSegmentTriangle( - const Vector3& p, const Vector3& q, const Vector3& a, const Vector3& b, const Vector3& c, - /*float &u, float &v, float &w,*/ Vector3& normal, float& t) -{ - float v, w; // comment this and enable input params if we need the barycentric coordinates - - Vector3 ab = b - a; - Vector3 ac = c - a; - Vector3 qp = p - q; - Vector3 ap = p - a; - - // Compute triangle normal. Can be pre-calculated or cached if - // intersecting multiple segments against the same triangle - normal = ab.Cross(ac); // Right hand CCW - - // Compute denominator d. If d <= 0, segment is parallel to or points - // away from triangle, so exit early - float d = qp.Dot(normal); - Vector3 e; - if (d > Constants::FloatEpsilon) - { - // the normal is on the right side - e = qp.Cross(ap); - } - else - { - normal = -normal; + // so either have a parallel ray or our normal is flipped + if (d >= -Constants::FloatEpsilon) + { + return false; // parallel + } + d = -d; + e = ap.Cross(qp); + } + + // Compute intersection t value of pq with plane of triangle. A ray + // intersects iff 0 <= t. Segment intersects iff 0 <= t <= 1. Delay + // dividing by d until intersection has been found to pierce triangle + t = ap.Dot(normal); - // so either have a parallel ray or our normal is flipped - if (d >= -Constants::FloatEpsilon) + // range segment check t[0,1] (it this case [0,d]) + if (t < 0.0f || t > d) { - return false; // parallel + return false; } - d = -d; - e = ap.Cross(qp); - } - // Compute intersection t value of pq with plane of triangle. A ray - // intersects iff 0 <= t. Segment intersects iff 0 <= t <= 1. Delay - // dividing by d until intersection has been found to pierce triangle - t = ap.Dot(normal); + // Compute barycentric coordinate components and test if within bounds + v = ac.Dot(e); + if (v < 0.0f || v > d) + { + return false; + } + w = -ab.Dot(e); + if (w < 0.0f || v + w > d) + { + return false; + } - // range segment check t[0,1] (it this case [0,d]) - if (t < 0.0f || t > d) - { - return false; - } + // Segment/ray intersects the triangle. Perform delayed division and + // compute the last barycentric coordinate component + float ood = 1.0f / d; + t *= ood; + // v *= ood; + // w *= ood; + // u = 1.0f - v - w; - // Compute barycentric coordinate components and test if within bounds - v = ac.Dot(e); - if (v < 0.0f || v > d) - { - return false; + normal.Normalize(); + + return true; } - w = -ab.Dot(e); - if (w < 0.0f || v + w > d) + + //========================================================================= + // TestSegmentAABBOrigin + // [10/21/2009] + //========================================================================= + bool Intersect::TestSegmentAABBOrigin(const Vector3& midPoint, const Vector3& halfVector, const Vector3& aabbExtends) { - return false; - } + const Vector3 EPSILON(0.001f); // \todo this is slow load move to a const + Vector3 absHalfVector = halfVector.GetAbs(); + Vector3 absMidpoint = midPoint.GetAbs(); + Vector3 absHalfMidpoint = absHalfVector + aabbExtends; - // Segment/ray intersects the triangle. Perform delayed division and - // compute the last barycentric coordinate component - float ood = 1.0f / d; - t *= ood; - //v *= ood; - //w *= ood; - //u = 1.0f - v - w; + // Try world coordinate axes as separating axes + if (!absMidpoint.IsLessEqualThan(absHalfMidpoint)) + { + return false; + } - normal.Normalize(); + // Add in an epsilon term to counteract arithmetic errors when segment is + // (near) parallel to a coordinate axis (see text for detail) + absHalfVector += EPSILON; - return true; -} + // Try cross products of segment direction vector with coordinate axes + Vector3 absMDCross = midPoint.Cross(halfVector).GetAbs(); + // Vector3 eaDCross = absHalfVector.Cross(aabbExtends); + float ex = aabbExtends.GetX(); + float ey = aabbExtends.GetY(); + float ez = aabbExtends.GetZ(); + float adx = absHalfVector.GetX(); + float ady = absHalfVector.GetY(); + float adz = absHalfVector.GetZ(); -//========================================================================= -// TestSegmentAABBOrigin -// [10/21/2009] -//========================================================================= -bool -AZ::Intersect::TestSegmentAABBOrigin(const Vector3& midPoint, const Vector3& halfVector, const Vector3& aabbExtends) -{ - const Vector3 EPSILON(0.001f); // \todo this is slow load move to a const - Vector3 absHalfVector = halfVector.GetAbs(); - Vector3 absMidpoint = midPoint.GetAbs(); - Vector3 absHalfMidpoint = absHalfVector + aabbExtends; + Vector3 ead(ey * adz + ez * ady, ex * adz + ez * adx, ex * ady + ey * adx); + if (!absMDCross.IsLessEqualThan(ead)) + { + return false; + } - // Try world coordinate axes as separating axes - if (!absMidpoint.IsLessEqualThan(absHalfMidpoint)) - { - return false; + // No separating axis found; segment must be overlapping AABB + return true; } - // Add in an epsilon term to counteract arithmetic errors when segment is - // (near) parallel to a coordinate axis (see text for detail) - absHalfVector += EPSILON; - - // Try cross products of segment direction vector with coordinate axes - Vector3 absMDCross = midPoint.Cross(halfVector).GetAbs(); - //Vector3 eaDCross = absHalfVector.Cross(aabbExtends); - float ex = aabbExtends.GetX(); - float ey = aabbExtends.GetY(); - float ez = aabbExtends.GetZ(); - float adx = absHalfVector.GetX(); - float ady = absHalfVector.GetY(); - float adz = absHalfVector.GetZ(); - - Vector3 ead(ey * adz + ez * ady, ex * adz + ez * adx, ex * ady + ey * adx); - if (!absMDCross.IsLessEqualThan(ead)) + //========================================================================= + // IntersectRayAABB + // [10/21/2009] + //========================================================================= + Intersect::RayAABBIsectTypes Intersect::IntersectRayAABB( + const Vector3& rayStart, + const Vector3& dir, + const Vector3& dirRCP, + const Aabb& aabb, + float& tStart, + float& tEnd, + Vector3& startNormal /*, Vector3& inter*/) { - return false; - } - - // No separating axis found; segment must be overlapping AABB - return true; -} - + // we don't need to test with all 6 normals (just 3) -//========================================================================= -// IntersectRayAABB -// [10/21/2009] -//========================================================================= -RayAABBIsectTypes -AZ::Intersect::IntersectRayAABB( - const Vector3& rayStart, const Vector3& dir, const Vector3& dirRCP, const Aabb& aabb, - float& tStart, float& tEnd, Vector3& startNormal /*, Vector3& inter*/) -{ - // we don't need to test with all 6 normals (just 3) - - const float eps = 0.0001f; // \todo move to constant - float tmin = 0.0f; // set to -RR_FLT_MAX to get first hit on line - float tmax = std::numeric_limits::max(); // set to max distance ray can travel (for segment) + const float eps = 0.0001f; // \todo move to constant + float tmin = 0.0f; // set to -RR_FLT_MAX to get first hit on line + float tmax = std::numeric_limits::max(); // set to max distance ray can travel (for segment) - const Vector3& aabbMin = aabb.GetMin(); - const Vector3& aabbMax = aabb.GetMax(); + const Vector3& aabbMin = aabb.GetMin(); + const Vector3& aabbMax = aabb.GetMax(); - // we unroll manually because there is no way to get in efficient way vectors for - // each axis while getting it as a index - Vector3 time1 = (aabbMin - rayStart) * dirRCP; - Vector3 time2 = (aabbMax - rayStart) * dirRCP; + // we unroll manually because there is no way to get in efficient way vectors for + // each axis while getting it as a index + Vector3 time1 = (aabbMin - rayStart) * dirRCP; + Vector3 time2 = (aabbMax - rayStart) * dirRCP; - // X - if (std::fabs(dir.GetX()) < eps) - { - // Ray is parallel to slab. No hit if origin not within slab - if (rayStart.GetX() < aabbMin.GetX() || rayStart.GetX() > aabbMax.GetX()) + // X + if (std::fabs(dir.GetX()) < eps) { - return ISECT_RAY_AABB_NONE; + // Ray is parallel to slab. No hit if origin not within slab + if (rayStart.GetX() < aabbMin.GetX() || rayStart.GetX() > aabbMax.GetX()) + { + return ISECT_RAY_AABB_NONE; + } } - } - else - { - // Compute intersection t value of ray with near and far plane of slab - float t1 = time1.GetX(); - float t2 = time2.GetX(); - float nSign = -1.0f; - - // Make t1 be intersection with near plane, t2 with far plane - if (t1 > t2) + else { - AZStd::swap(t1, t2); - nSign = 1.0f; - } + // Compute intersection t value of ray with near and far plane of slab + float t1 = time1.GetX(); + float t2 = time2.GetX(); + float nSign = -1.0f; - // Compute the intersection of slab intersections intervals - if (tmin < t1) - { - tmin = t1; + // Make t1 be intersection with near plane, t2 with far plane + if (t1 > t2) + { + AZStd::swap(t1, t2); + nSign = 1.0f; + } - startNormal.Set(nSign, 0.0f, 0.0f); - } + // Compute the intersection of slab intersections intervals + if (tmin < t1) + { + tmin = t1; - tmax = AZ::GetMin(tmax, t2); + startNormal.Set(nSign, 0.0f, 0.0f); + } - // Exit with no collision as soon as slab intersection becomes empty - if (tmin > tmax) - { - return ISECT_RAY_AABB_NONE; - } - } + tmax = AZ::GetMin(tmax, t2); - // Y - if (std::fabs(dir.GetY()) < eps) - { - // Ray is parallel to slab. No hit if origin not within slab - if (rayStart.GetY() < aabbMin.GetY() || rayStart.GetY() > aabbMax.GetY()) - { - return ISECT_RAY_AABB_NONE; + // Exit with no collision as soon as slab intersection becomes empty + if (tmin > tmax) + { + return ISECT_RAY_AABB_NONE; + } } - } - else - { - // Compute intersection t value of ray with near and far plane of slab - float t1 = time1.GetY(); - float t2 = time2.GetY(); - float nSign = -1.0f; - // Make t1 be intersection with near plane, t2 with far plane - if (t1 > t2) + // Y + if (std::fabs(dir.GetY()) < eps) { - AZStd::swap(t1, t2); - nSign = 1.0f; + // Ray is parallel to slab. No hit if origin not within slab + if (rayStart.GetY() < aabbMin.GetY() || rayStart.GetY() > aabbMax.GetY()) + { + return ISECT_RAY_AABB_NONE; + } } - - // Compute the intersection of slab intersections intervals - if (tmin < t1) + else { - tmin = t1; + // Compute intersection t value of ray with near and far plane of slab + float t1 = time1.GetY(); + float t2 = time2.GetY(); + float nSign = -1.0f; - startNormal.Set(0.0f, nSign, 0.0f); - } + // Make t1 be intersection with near plane, t2 with far plane + if (t1 > t2) + { + AZStd::swap(t1, t2); + nSign = 1.0f; + } - tmax = AZ::GetMin(tmax, t2); + // Compute the intersection of slab intersections intervals + if (tmin < t1) + { + tmin = t1; - // Exit with no collision as soon as slab intersection becomes empty - if (tmin > tmax) - { - return ISECT_RAY_AABB_NONE; - } - } + startNormal.Set(0.0f, nSign, 0.0f); + } - // Z - if (std::fabs(dir.GetZ()) < eps) - { - // Ray is parallel to slab. No hit if origin not within slab - if (rayStart.GetZ() < aabbMin.GetZ() || rayStart.GetZ() > aabbMax.GetZ()) - { - return ISECT_RAY_AABB_NONE; - } - } - else - { - // Compute intersection t value of ray with near and far plane of slab - float t1 = time1.GetZ(); - float t2 = time2.GetZ(); - float nSign = -1.0f; + tmax = AZ::GetMin(tmax, t2); - // Make t1 be intersection with near plane, t2 with far plane - if (t1 > t2) - { - AZStd::swap(t1, t2); - nSign = 1.0f; + // Exit with no collision as soon as slab intersection becomes empty + if (tmin > tmax) + { + return ISECT_RAY_AABB_NONE; + } } - // Compute the intersection of slab intersections intervals - if (tmin < t1) + // Z + if (std::fabs(dir.GetZ()) < eps) { - tmin = t1; - - startNormal.Set(0.0f, 0.0f, nSign); + // Ray is parallel to slab. No hit if origin not within slab + if (rayStart.GetZ() < aabbMin.GetZ() || rayStart.GetZ() > aabbMax.GetZ()) + { + return ISECT_RAY_AABB_NONE; + } } - - tmax = AZ::GetMin(tmax, t2); - - // Exit with no collision as soon as slab intersection becomes empty - if (tmin > tmax) + else { - return ISECT_RAY_AABB_NONE; - } - } - - tStart = tmin; - tEnd = tmax; + // Compute intersection t value of ray with near and far plane of slab + float t1 = time1.GetZ(); + float t2 = time2.GetZ(); + float nSign = -1.0f; - if (tmin == 0.0f) // no intersect if the segments starts inside or coincident the aabb - { - return ISECT_RAY_AABB_SA_INSIDE; - } - - // Ray intersects all 3 slabs. Return point (q) and intersection t value (tmin) - //inter = rayStart + dir * tmin; - return ISECT_RAY_AABB_ISECT; -} - -//========================================================================= -// IntersectRayAABB2 -// [2/18/2011] -//========================================================================= -RayAABBIsectTypes -AZ::Intersect::IntersectRayAABB2(const Vector3& rayStart, const Vector3& dirRCP, const Aabb& aabb, float& start, float& end) -{ - float tmin, tmax, tymin, tymax, tzmin, tzmax; - Vector3 vZero = Vector3::CreateZero(); + // Make t1 be intersection with near plane, t2 with far plane + if (t1 > t2) + { + AZStd::swap(t1, t2); + nSign = 1.0f; + } - Vector3 min = (Vector3::CreateSelectCmpGreaterEqual(dirRCP, vZero, aabb.GetMin(), aabb.GetMax()) - rayStart) * dirRCP; - Vector3 max = (Vector3::CreateSelectCmpGreaterEqual(dirRCP, vZero, aabb.GetMax(), aabb.GetMin()) - rayStart) * dirRCP; + // Compute the intersection of slab intersections intervals + if (tmin < t1) + { + tmin = t1; - tmin = min.GetX(); - tmax = max.GetX(); - tymin = min.GetY(); - tymax = max.GetY(); + startNormal.Set(0.0f, 0.0f, nSign); + } - if (tmin > tymax || tymin > tmax) - { - return ISECT_RAY_AABB_NONE; - } + tmax = AZ::GetMin(tmax, t2); - if (tymin > tmin) - { - tmin = tymin; - } + // Exit with no collision as soon as slab intersection becomes empty + if (tmin > tmax) + { + return ISECT_RAY_AABB_NONE; + } + } - if (tymax < tmax) - { - tmax = tymax; - } + tStart = tmin; + tEnd = tmax; - tzmin = min.GetZ(); - tzmax = max.GetZ(); + if (tmin == 0.0f) // no intersect if the segments starts inside or coincident the aabb + { + return ISECT_RAY_AABB_SA_INSIDE; + } - if (tmin > tzmax || tzmin > tmax) - { - return ISECT_RAY_AABB_NONE; + // Ray intersects all 3 slabs. Return point (q) and intersection t value (tmin) + // inter = rayStart + dir * tmin; + return ISECT_RAY_AABB_ISECT; } - if (tzmin > tmin) - { - tmin = tzmin; - } - if (tzmax < tmax) + //========================================================================= + // IntersectRayAABB2 + // [2/18/2011] + //========================================================================= + Intersect::RayAABBIsectTypes Intersect::IntersectRayAABB2( + const Vector3& rayStart, const Vector3& dirRCP, const Aabb& aabb, float& start, float& end) { - tmax = tzmax; - } + float tmin, tmax, tymin, tymax, tzmin, tzmax; + Vector3 vZero = Vector3::CreateZero(); - start = tmin; - end = tmax; + Vector3 min = (Vector3::CreateSelectCmpGreaterEqual(dirRCP, vZero, aabb.GetMin(), aabb.GetMax()) - rayStart) * dirRCP; + Vector3 max = (Vector3::CreateSelectCmpGreaterEqual(dirRCP, vZero, aabb.GetMax(), aabb.GetMin()) - rayStart) * dirRCP; - return ISECT_RAY_AABB_ISECT; -} + tmin = min.GetX(); + tmax = max.GetX(); + tymin = min.GetY(); + tymax = max.GetY(); -bool AZ::Intersect::IntersectRayDisk( - const Vector3& rayOrigin, const Vector3& rayDir, const Vector3& diskCenter, const float diskRadius, const Vector3& diskNormal, float& t) -{ - // First intersect with the plane of the disk - float planeIntersectionDistance; - int intersectionCount = IntersectRayPlane(rayOrigin, rayDir, diskCenter, diskNormal, planeIntersectionDistance); - if (intersectionCount == 1) - { - // If the plane intersection point is inside the disk radius, then it intersected the disk. - Vector3 pointOnPlane = rayOrigin + rayDir * planeIntersectionDistance; - if (pointOnPlane.GetDistance(diskCenter) < diskRadius) + if (tmin > tymax || tymin > tmax) { - t = planeIntersectionDistance; - return true; + return ISECT_RAY_AABB_NONE; } - } - return false; -} -// Reference: Real-Time Collision Detection - 5.3.7 Intersecting Ray or Segment Against Cylinder, and the book's errata. -int AZ::Intersect::IntersectRayCappedCylinder( - const Vector3& rayOrigin, const Vector3& rayDir, - const Vector3& cylinderEnd1, const Vector3& cylinderDir, - float cylinderHeight, float cylinderRadius, float &t1, float &t2) -{ - // dr = rayDir - // dc = cylinderDir - // r = cylinderRadius - // Vector3 cylinderEnd2 = cylinderEnd1 + cylinderHeight * cylinderDir; - Vector3 m = rayOrigin - cylinderEnd1; // vector from cylinderEnd1 to rayOrigin - float dcm = cylinderDir.Dot(m); // projection of m on cylinderDir - float dcdr = cylinderDir.Dot(rayDir); // projection of rayDir on cylinderDir - float drm = rayDir.Dot(m); // projection of m on rayDir - float r2 = cylinderRadius * cylinderRadius; - - if (dcm < 0.0f && dcdr <= 0.0f) - { - return 0; // rayOrigin is outside cylinderEnd1 and rayDir is pointing away from cylinderEnd1 - } - if (dcm > cylinderHeight && dcdr >= 0.0f) - { - return 0; // rayOrigin is outside cylinderEnd2 and rayDir is pointing away from cylinderEnd2 - } - - // point RP on the ray: RP(t) = rayOrigin + t * rayDir - // point CP on the cylinder surface: |(CP - cylinderEnd1) - cylinderDir.Dot(cp - cylinderEnd1) * cylinderDir|^2 = cylinderRadius^2 - // substitute RP(t) for CP: a*t^2 + 2b*t + c = 0, solving for t = [-2b +/- sqrt(4b^2 - 4ac)] / 2a - float a = 1.0f - dcdr * dcdr; // always greater than or equal to 0 - float b = drm - dcm * dcdr; - float c = m.Dot(m) - dcm * dcm - r2; - - const float EPSILON = 0.00001f; + if (tymin > tmin) + { + tmin = tymin; + } - if (fabsf(a) < EPSILON) // the ray is parallel to the cylinder - { - if (c > EPSILON) // the ray is outside the cylinder + if (tymax < tmax) { - return 0; + tmax = tymax; } - else if (dcm < 0.0f) // the ray origin is on cylinderEnd1 side and ray is pointing to cylinderEnd2 + + tzmin = min.GetZ(); + tzmax = max.GetZ(); + + if (tmin > tzmax || tzmin > tmax) { - t1 = -dcm; - t2 = -dcm + cylinderHeight; - return 2; + return ISECT_RAY_AABB_NONE; } - else if (dcm > cylinderHeight) // the ray origin is on cylinderEnd2 side and ray is pointing to cylinderEnd1 + + if (tzmin > tmin) { - t1 = dcm - cylinderHeight; - t2 = dcm; - return 2; + tmin = tzmin; } - else // (dcm > 0.0f && dcm < cylinderHeight) // the ray origin is inside the cylinder + if (tzmax < tmax) { - if (dcdr > 0.0f) // the ray is pointing to cylinderEnd2 - { - t1 = cylinderHeight - dcm; - return 1; - } - else if (dcdr < 0.0f) // the ray is pointing to cylinderEnd1 - { - t2 = dcm; - return 1; - } - else // impossible in theory - { - return 0; - } + tmax = tzmax; } - } - - float discr = b * b - a * c; - if (discr < 0.0f) - { - return 0; - } - float sqrt_discr = sqrt(discr); - float tt1 = (-b - sqrt_discr) / a; - float tt2 = (-b + sqrt_discr) / a; + start = tmin; + end = tmax; - if (tt2 < 0.0f) // both intersections are behind the ray origin - { - return 0; + return ISECT_RAY_AABB_ISECT; } - // Vector3 AP2 = (rayOrigin + tt2 * rayDir) - cylinderEnd1; // vector from cylinderEnd1 to the intersecting point of parameter tt2 - // float s2 = cylinderDir.Dot(AP2); - float s2 = dcm + tt2 * dcdr; - - if (discr < EPSILON) // tt1 == tt2 + bool Intersect::IntersectRayDisk( + const Vector3& rayOrigin, + const Vector3& rayDir, + const Vector3& diskCenter, + const float diskRadius, + const Vector3& diskNormal, + float& t) { - if (s2 >= 0.0f && s2 <= cylinderHeight) + // First intersect with the plane of the disk + float planeIntersectionDistance; + int intersectionCount = IntersectRayPlane(rayOrigin, rayDir, diskCenter, diskNormal, planeIntersectionDistance); + if (intersectionCount == 1) { - t1 = tt1; - return 1; + // If the plane intersection point is inside the disk radius, then it intersected the disk. + Vector3 pointOnPlane = rayOrigin + rayDir * planeIntersectionDistance; + if (pointOnPlane.GetDistance(diskCenter) < diskRadius) + { + t = planeIntersectionDistance; + return true; + } } + return false; } - // Vector3 AP1 = (rayOrigin + tt1 * rayDir) - cylinderEnd1; // vector from cylinderEnd1 to the intersecting point of parameter tt1 - // float s1 = cylinderDir.Dot(AP1); - float s1 = dcm + tt1 * dcdr; - - if (s1 < 0.0f) // intersecting point of parameter tt1 is outside on cylinderEnd1 side + // Reference: Real-Time Collision Detection - 5.3.7 Intersecting Ray or Segment Against Cylinder, and the book's errata. + int Intersect::IntersectRayCappedCylinder( + const Vector3& rayOrigin, + const Vector3& rayDir, + const Vector3& cylinderEnd1, + const Vector3& cylinderDir, + float cylinderHeight, + float cylinderRadius, + float& t1, + float& t2) { - if (s2 < 0.0f) // intersecting point of parameter tt2 is outside on cylinderEnd1 side + // dr = rayDir + // dc = cylinderDir + // r = cylinderRadius + // Vector3 cylinderEnd2 = cylinderEnd1 + cylinderHeight * cylinderDir; + Vector3 m = rayOrigin - cylinderEnd1; // vector from cylinderEnd1 to rayOrigin + float dcm = cylinderDir.Dot(m); // projection of m on cylinderDir + float dcdr = cylinderDir.Dot(rayDir); // projection of rayDir on cylinderDir + float drm = rayDir.Dot(m); // projection of m on rayDir + float r2 = cylinderRadius * cylinderRadius; + + if (dcm < 0.0f && dcdr <= 0.0f) { - return 0; + return 0; // rayOrigin is outside cylinderEnd1 and rayDir is pointing away from cylinderEnd1 } - else if (s2 == 0.0f) // ray touching the brim of the cylinderEnd1 + if (dcm > cylinderHeight && dcdr >= 0.0f) { - t1 = tt2; - return 1; + return 0; // rayOrigin is outside cylinderEnd2 and rayDir is pointing away from cylinderEnd2 } - else + + // point RP on the ray: RP(t) = rayOrigin + t * rayDir + // point CP on the cylinder surface: |(CP - cylinderEnd1) - cylinderDir.Dot(cp - cylinderEnd1) * cylinderDir|^2 = cylinderRadius^2 + // substitute RP(t) for CP: a*t^2 + 2b*t + c = 0, solving for t = [-2b +/- sqrt(4b^2 - 4ac)] / 2a + float a = 1.0f - dcdr * dcdr; // always greater than or equal to 0 + float b = drm - dcm * dcdr; + float c = m.Dot(m) - dcm * dcm - r2; + + const float EPSILON = 0.00001f; + + if (fabsf(a) < EPSILON) // the ray is parallel to the cylinder { - if (s2 > cylinderHeight) // intersecting point of parameter tt2 is outside on cylinderEnd2 side + if (c > EPSILON) // the ray is outside the cylinder { - // t2 can be computed from the equation: dot(rayOrigin + t2 * rayDir - cylinderEnd1, cylinderDir) = cylinderHeight - t2 = (cylinderHeight - dcm) / dcdr; + return 0; } - else + else if (dcm < 0.0f) // the ray origin is on cylinderEnd1 side and ray is pointing to cylinderEnd2 { - t2 = tt2; + t1 = -dcm; + t2 = -dcm + cylinderHeight; + return 2; } - if (dcm > 0.0f) // ray origin inside cylinder + else if (dcm > cylinderHeight) // the ray origin is on cylinderEnd2 side and ray is pointing to cylinderEnd1 { - t1 = t2; - return 1; + t1 = dcm - cylinderHeight; + t2 = dcm; + return 2; } - else + else // (dcm > 0.0f && dcm < cylinderHeight) // the ray origin is inside the cylinder { - // t1 can be computed from the equation: dot(rayOrigin + t1 * rayDir - cylinderEnd1, cylinderDir) = 0 - t1 = -dcm / dcdr; - return 2; + if (dcdr > 0.0f) // the ray is pointing to cylinderEnd2 + { + t1 = cylinderHeight - dcm; + return 1; + } + else if (dcdr < 0.0f) // the ray is pointing to cylinderEnd1 + { + t2 = dcm; + return 1; + } + else // impossible in theory + { + return 0; + } } } - } - else if (s1 > cylinderHeight) // intersecting point of parameter tt1 is outside on cylinderEnd2 side - { - if (s2 > cylinderHeight) // intersecting point of parameter tt2 is outside on cylinderEnd2 side + + float discr = b * b - a * c; + if (discr < 0.0f) { return 0; } - else if (s2 == cylinderHeight) + + float sqrt_discr = sqrt(discr); + float tt1 = (-b - sqrt_discr) / a; + float tt2 = (-b + sqrt_discr) / a; + + if (tt2 < 0.0f) // both intersections are behind the ray origin { - t1 = tt2; - return 1; + return 0; } - else + + // Vector3 AP2 = (rayOrigin + tt2 * rayDir) - cylinderEnd1; // vector from cylinderEnd1 to the intersecting point of parameter tt2 + // float s2 = cylinderDir.Dot(AP2); + float s2 = dcm + tt2 * dcdr; + + if (discr < EPSILON) // tt1 == tt2 { - if (s2 < 0.0f) + if (s2 >= 0.0f && s2 <= cylinderHeight) { - t2 = -dcm / dcdr; + t1 = tt1; + return 1; } - else + } + + // Vector3 AP1 = (rayOrigin + tt1 * rayDir) - cylinderEnd1; // vector from cylinderEnd1 to the intersecting point of parameter tt1 + // float s1 = cylinderDir.Dot(AP1); + float s1 = dcm + tt1 * dcdr; + + if (s1 < 0.0f) // intersecting point of parameter tt1 is outside on cylinderEnd1 side + { + if (s2 < 0.0f) // intersecting point of parameter tt2 is outside on cylinderEnd1 side { - t2 = tt2; + return 0; } - if (dcm < cylinderHeight) + else if (s2 == 0.0f) // ray touching the brim of the cylinderEnd1 { - t1 = t2; + t1 = tt2; return 1; } else { - t1 = (cylinderHeight - dcm) / dcdr; - return 2; - } - } - } - else // intersecting point of parameter tt1 is in between two cylinder ends - { - if (s2 < 0.0f) - { - t2 = -dcm / dcdr; - } - else if (s2 > cylinderHeight) - { - t2 = (cylinderHeight - dcm) / dcdr; - } - else - { - t2 = tt2; + if (s2 > cylinderHeight) // intersecting point of parameter tt2 is outside on cylinderEnd2 side + { + // t2 can be computed from the equation: dot(rayOrigin + t2 * rayDir - cylinderEnd1, cylinderDir) = cylinderHeight + t2 = (cylinderHeight - dcm) / dcdr; + } + else + { + t2 = tt2; + } + if (dcm > 0.0f) // ray origin inside cylinder + { + t1 = t2; + return 1; + } + else + { + // t1 can be computed from the equation: dot(rayOrigin + t1 * rayDir - cylinderEnd1, cylinderDir) = 0 + t1 = -dcm / dcdr; + return 2; + } + } } - if (tt1 > 0.0f) + else if (s1 > cylinderHeight) // intersecting point of parameter tt1 is outside on cylinderEnd2 side { - t1 = tt1; - return 2; + if (s2 > cylinderHeight) // intersecting point of parameter tt2 is outside on cylinderEnd2 side + { + return 0; + } + else if (s2 == cylinderHeight) + { + t1 = tt2; + return 1; + } + else + { + if (s2 < 0.0f) + { + t2 = -dcm / dcdr; + } + else + { + t2 = tt2; + } + if (dcm < cylinderHeight) + { + t1 = t2; + return 1; + } + else + { + t1 = (cylinderHeight - dcm) / dcdr; + return 2; + } + } } - else + else // intersecting point of parameter tt1 is in between two cylinder ends { - t1 = t2; - return 1; + if (s2 < 0.0f) + { + t2 = -dcm / dcdr; + } + else if (s2 > cylinderHeight) + { + t2 = (cylinderHeight - dcm) / dcdr; + } + else + { + t2 = tt2; + } + if (tt1 > 0.0f) + { + t1 = tt1; + return 2; + } + else + { + t1 = t2; + return 1; + } } } -} -int AZ::Intersect::IntersectRayCone( - const Vector3& rayOrigin, const Vector3& rayDir, - const Vector3& coneApex, const Vector3& coneDir, float coneHeight, - float coneBaseRadius, float& t1, float& t2) -{ - // Q = rayOrgin, A = coneApex - Vector3 AQ = rayOrigin - coneApex; - float m = coneDir.Dot(AQ); // projection of m on cylinderDir - float k = coneDir.Dot(rayDir); // projection of rayDir on cylinderDir - - if (m < 0.0f && k <= 0.0f) - { - // rayOrigin is outside the cone on coneApex side and rayDir is pointing away - return 0; - } - if (m > coneHeight && k >= 0.0f) + int Intersect::IntersectRayCone( + const Vector3& rayOrigin, + const Vector3& rayDir, + const Vector3& coneApex, + const Vector3& coneDir, + float coneHeight, + float coneBaseRadius, + float& t1, + float& t2) { - // rayOrigin is outside the cone on coneBase side and rayDir is pointing away - return 0; - } - - float r2 = coneBaseRadius * coneBaseRadius; - float h2 = coneHeight * coneHeight; + // Q = rayOrgin, A = coneApex + Vector3 AQ = rayOrigin - coneApex; + float m = coneDir.Dot(AQ); // projection of m on cylinderDir + float k = coneDir.Dot(rayDir); // projection of rayDir on cylinderDir - float m2 = m * m; - float k2 = k * k; - float q2 = AQ.Dot(AQ); - - float n = rayDir.Dot(AQ); + if (m < 0.0f && k <= 0.0f) + { + // rayOrigin is outside the cone on coneApex side and rayDir is pointing away + return 0; + } + if (m > coneHeight && k >= 0.0f) + { + // rayOrigin is outside the cone on coneBase side and rayDir is pointing away + return 0; + } - const float EPSILON = 0.00001f; + float r2 = coneBaseRadius * coneBaseRadius; + float h2 = coneHeight * coneHeight; - // point RP on the ray: RP(t) = rayOrigin + t * rayDir - // point CP on the cone surface: similar triangle property - // |dot(CP - A, coneDir) * coneDir| / coneHeight = |(CP - A) - (dot(CP - A, coneDir) * coneDir)| coneRadius - // substitute RP(t) for CP: a*t^2 + 2b*t + c = 0, solving for t - float a = (r2 + h2) * k2 - h2; - float b = (r2 + h2) * m * k - h2 * n; - float c = (r2 + h2) * m2 - h2 * q2; + float m2 = m * m; + float k2 = k * k; + float q2 = AQ.Dot(AQ); - float discriminant = b * b - a * c; - if (discriminant < -EPSILON) - { - return 0; - } - discriminant = AZ::GetMax(discriminant, 0.0f); + float n = rayDir.Dot(AQ); - if (fabsf(a) < EPSILON) // the ray is parallel to the cone surface's tangent line - { - if (b < EPSILON && fabsf(c) < EPSILON) // ray overlapping with cone surface - { - t1 = rayDir.Dot(coneApex - rayOrigin); - } - else // ray has only one intersecting point with the cone - { - t1 = -c / (2 * b); - } + const float EPSILON = 0.00001f; - t2 = (coneHeight - m) / k; // t2 can be computed from the equation: dot(Q + t2 * rayDir - A, coneDir) = coneHeight + // point RP on the ray: RP(t) = rayOrigin + t * rayDir + // point CP on the cone surface: similar triangle property + // |dot(CP - A, coneDir) * coneDir| / coneHeight = |(CP - A) - (dot(CP - A, coneDir) * coneDir)| coneRadius + // substitute RP(t) for CP: a*t^2 + 2b*t + c = 0, solving for t + float a = (r2 + h2) * k2 - h2; + float b = (r2 + h2) * m * k - h2 * n; + float c = (r2 + h2) * m2 - h2 * q2; - if (t1 < 0.0f && t2 < 0.0f) + float discriminant = b * b - a * c; + if (discriminant < -EPSILON) { return 0; } + discriminant = AZ::GetMax(discriminant, 0.0f); - if (fabsf(t1 - t2) < EPSILON) // the ray intersects the brim of the circumference of the cone base + if (fabsf(a) < EPSILON) // the ray is parallel to the cone surface's tangent line { - return 1; - } + if (b < EPSILON && fabsf(c) < EPSILON) // ray overlapping with cone surface + { + t1 = rayDir.Dot(coneApex - rayOrigin); + } + else // ray has only one intersecting point with the cone + { + t1 = -c / (2 * b); + } - float s1 = m + t1 * k; // coneDir.Dot(rayOrigin + t1 * rayDir - coneApex); - if (s1 < 0.0f || s1 > coneHeight) - { - return 0; - } - else - { - if (k < 0.0f) // ray shooting from base to apex + t2 = (coneHeight - m) / k; // t2 can be computed from the equation: dot(Q + t2 * rayDir - A, coneDir) = coneHeight + + if (t1 < 0.0f && t2 < 0.0f) { - if (m >= coneHeight) // ray origin outside cone - { - float temp = t1; - t1 = t2; - t2 = temp; - return 2; - } - else if (t1 >= 0.0f) // ray origin inside cone - { - t1 = t2; - return 1; - } - else - { - return 0; - } + return 0; + } + + if (fabsf(t1 - t2) < EPSILON) // the ray intersects the brim of the circumference of the cone base + { + return 1; + } + + float s1 = m + t1 * k; // coneDir.Dot(rayOrigin + t1 * rayDir - coneApex); + if (s1 < 0.0f || s1 > coneHeight) + { + return 0; } else { - if (m > coneHeight) - { - return 0; - } - if (t1 >= 0.0f) // ray origin outside cone + if (k < 0.0f) // ray shooting from base to apex { - return 2; + if (m >= coneHeight) // ray origin outside cone + { + float temp = t1; + t1 = t2; + t2 = temp; + return 2; + } + else if (t1 >= 0.0f) // ray origin inside cone + { + t1 = t2; + return 1; + } + else + { + return 0; + } } else { - t1 = t2; - return 1; + if (m > coneHeight) + { + return 0; + } + if (t1 >= 0.0f) // ray origin outside cone + { + return 2; + } + else + { + t1 = t2; + return 1; + } } } } - } - if (discriminant < EPSILON) // two intersecting points coincide - { - if (fabsf(n * n - q2) < EPSILON) // the ray is through the apex + if (discriminant < EPSILON) // two intersecting points coincide { - float cosineA2 = h2 / (r2 + h2); - float cosineAQ2 = cosineA2 * q2; - - if (m2 > cosineAQ2) // the ray origin is inside the cone or its mirroring counterpart + if (fabsf(n * n - q2) < EPSILON) // the ray is through the apex { - if (m <= 0.0f) // the ray origin outside the cone on the apex side, shooting towards the base - { - t1 = -b / a; - t2 = (coneHeight - m) / k; - return 2; - } - else if (m >= coneHeight) // the ray origin is outside the cone on the base side, shooting towards towards the apex + float cosineA2 = h2 / (r2 + h2); + float cosineAQ2 = cosineA2 * q2; + + if (m2 > cosineAQ2) // the ray origin is inside the cone or its mirroring counterpart { - t1 = (coneHeight - m) / k; - t2 = -b / a; - return 2; + if (m <= 0.0f) // the ray origin outside the cone on the apex side, shooting towards the base + { + t1 = -b / a; + t2 = (coneHeight - m) / k; + return 2; + } + else if (m >= coneHeight) // the ray origin is outside the cone on the base side, shooting towards towards the apex + { + t1 = (coneHeight - m) / k; + t2 = -b / a; + return 2; + } + else + { + if (k > 0.0f) // the ray origin is inside the cone, shooting towards the base + { + t1 = (coneHeight - m) / k; + return 1; + } + else // the ray origin is inside the cone, shooting towards the apex + { + t1 = -b / a; + return 1; + } + } } - else + else // the ray origin is outside the cone { - if (k > 0.0f) // the ray origin is inside the cone, shooting towards the base + t1 = -b / a; + if (t1 > 0.0f) { - t1 = (coneHeight - m) / k; return 1; } - else // the ray origin is inside the cone, shooting towards the apex + else { - t1 = -b / a; - return 1; + return 0; } } } - else // the ray origin is outside the cone + else // the ray is touching the cone surface but not through the apex { t1 = -b / a; if (t1 > 0.0f) { - return 1; - } - else - { - return 0; - } - } - } - else // the ray is touching the cone surface but not through the apex - { - t1 = -b / a; - if (t1 > 0.0f) - { - float s1 = m + t1 * k; // projection length of the line segment from the apex to intersection_t1 onto the coneDir - if (s1 >= 0.0f && s1 <= coneHeight) - { - return 1; + float s1 = m + t1 * k; // projection length of the line segment from the apex to intersection_t1 onto the coneDir + if (s1 >= 0.0f && s1 <= coneHeight) + { + return 1; + } } + return 0; } - return 0; } - } - - float sqrtDiscr = sqrt(discriminant); - float tt1 = (-b - sqrtDiscr) / a; - float tt2 = (-b + sqrtDiscr) / a; - /* Test s1 and s2 to see the positions of the intersecting points relative to the cylinder's two ends. */ + float sqrtDiscr = sqrt(discriminant); + float tt1 = (-b - sqrtDiscr) / a; + float tt2 = (-b + sqrtDiscr) / a; - // s1 = coneDir.Dot(rayOrigin + tt1 * rayDir - coneApex), which expands into the following - float s1 = m + tt1 * k; - // s2 = coneDir.Dot(rayOrigin + tt2 * rayDir - coneApex), which expands into the following - float s2 = m + tt2 * k; + /* Test s1 and s2 to see the positions of the intersecting points relative to the cylinder's two ends. */ - if (s1 < 0.0f) - { - if (s2 < 0.0f || s2 > coneHeight) - { - return 0; - } - else + // s1 = coneDir.Dot(rayOrigin + tt1 * rayDir - coneApex), which expands into the following + float s1 = m + tt1 * k; + // s2 = coneDir.Dot(rayOrigin + tt2 * rayDir - coneApex), which expands into the following + float s2 = m + tt2 * k; + + if (s1 < 0.0f) { - if (tt2 >= 0.0f) // ray origin outside cone - { - t1 = tt2; - t2 = (coneHeight - m) / k; - return 2; - } - else if (m > coneHeight) // ray origin outside cone on the base side, the + if (s2 < 0.0f || s2 > coneHeight) { return 0; } else { - t1 = (coneHeight - m) / k; - return 1; - } - } - } - else if (s1 > coneHeight) - { - if (s2 < 0.0f || s2 > coneHeight ) - { - return 0; - } - else - { - if (tt2 < 0.0f) - { - return 0; - } - else if (m >= coneHeight) - { - t1 = (coneHeight - m) / k; - t2 = tt2; - return 2; - } - else // ray origin inside cone - { - t1 = tt2; - return 1; + if (tt2 >= 0.0f) // ray origin outside cone + { + t1 = tt2; + t2 = (coneHeight - m) / k; + return 2; + } + else if (m > coneHeight) // ray origin outside cone on the base side, the + { + return 0; + } + else + { + t1 = (coneHeight - m) / k; + return 1; + } } } - } - else - { - if (s2 < 0.0f) + else if (s1 > coneHeight) { - if (m >= coneHeight) - { - t1 = (coneHeight - m) / k; - t2 = tt1; - return 2; - } - else if (tt1 >= 0.0f) // ray origin inside cone - { - t1 = tt1; - return 1; - } - else + if (s2 < 0.0f || s2 > coneHeight) { return 0; } - } - else if (s2 > coneHeight) - { - if (tt1 >= 0.0f) - { - t1 = tt1; - t2 = (coneHeight - m) / k; - return 2; - } - else if (m <= coneHeight) - { - t1 = (coneHeight - m) / k; - return 1; - } else { - return 0; + if (tt2 < 0.0f) + { + return 0; + } + else if (m >= coneHeight) + { + t1 = (coneHeight - m) / k; + t2 = tt2; + return 2; + } + else // ray origin inside cone + { + t1 = tt2; + return 1; + } } } else { - if (tt1 >= 0.0f) + if (s2 < 0.0f) { - t1 = tt1; - t2 = tt2; - return 2; + if (m >= coneHeight) + { + t1 = (coneHeight - m) / k; + t2 = tt1; + return 2; + } + else if (tt1 >= 0.0f) // ray origin inside cone + { + t1 = tt1; + return 1; + } + else + { + return 0; + } } - else if (tt2 >= 0.0f) + else if (s2 > coneHeight) { - t1 = tt2; - return 1; + if (tt1 >= 0.0f) + { + t1 = tt1; + t2 = (coneHeight - m) / k; + return 2; + } + else if (m <= coneHeight) + { + t1 = (coneHeight - m) / k; + return 1; + } + else + { + return 0; + } } else { - return 0; - } - } - } -} - -int AZ::Intersect::IntersectRayPlane(const Vector3& rayOrigin, const Vector3& rayDir, const Vector3& planePos, const Vector3& planeNormal, float& t) -{ - // (rayOrigin + t * rayDir - planePos).dot(planeNormal) = 0 - - const float EPSILON = 0.00001f; - - float n = rayDir.Dot(planeNormal); - if (fabsf(n) < EPSILON) - { - return 0; - } - - t = planeNormal.Dot(planePos - rayOrigin) / n; - if (t < 0.0f) - { - return 0; - } - else - { - return 1; - } -} - -int AZ::Intersect::IntersectRayQuad( - const Vector3& rayOrigin, const Vector3& rayDir, const Vector3& vertexA, - const Vector3& vertexB, const Vector3& vertexC, const Vector3& vertexD, float& t) -{ - const float EPSILON = 0.0001f; - - Vector3 AC = vertexC - vertexA; - Vector3 AB = vertexB - vertexA; - Vector3 QA = vertexA - rayOrigin; - - Vector3 triN = AB.Cross(AC); // the normal of the triangle ABC - float dn = rayDir.Dot(triN); - - // Early-out if ray is facing away from ABC triangle - if (dn * triN.Dot(QA) < 0) - { - return 0; - } - - Vector3 E = rayDir.Cross(QA); - float dnAbs = 0.0f; - - if (dn < -EPSILON) // vertices have counter-clock wise winding when looking at the quad from rayOrigin - { - dnAbs = -dn; - } - else if (dn > EPSILON) - { - E = -E; - dnAbs = dn; - } - else // the ray is parallel to the quad plane - { - return 0; - } - - // compute barycentric coordinates - float v = E.Dot(AC); - - if (v >= 0.0f && v < dnAbs) - { - float w = -E.Dot(AB); - if (w < 0.0f || v + w > dnAbs) - { - return 0; - } - } - else if (v < 0.0f && v > -dnAbs) - { - Vector3 DA = vertexA - vertexD; - float w = E.Dot(DA); - if (w > 0.0f || v + w < -dnAbs) // v, w are negative - { - return 0; - } - } - else - { - return 0; - } - - t = triN.Dot(QA) / dn; - return 1; -} - -// reference: Real-Time Collision Detection, 5.3.3 Intersecting Ray or Segment Against Box -bool AZ::Intersect::IntersectRayBox( - const Vector3& rayOrigin, const Vector3& rayDir, const Vector3& boxCenter, const Vector3& boxAxis1, - const Vector3& boxAxis2, const Vector3& boxAxis3, float boxHalfExtent1, float boxHalfExtent2, float boxHalfExtent3, float& t) -{ - const float EPSILON = 0.00001f; - - float tmin = 0.0f; // the nearest to the ray origin - float tmax = AZ::Constants::FloatMax; // the farthest from the ray origin - - Vector3 P = boxCenter - rayOrigin; // precomputed variable for calculating the vector from rayOrigin to a point on each box facet - Vector3 QAp; // vector from rayOrigin to the center of the facet of boxAxis - Vector3 QAn; // vector from rayOrigin to the center of the facet of -boxAxis - float tp = 0.0f; - float tn = 0.0f; - bool isRayOriginInsideBox = true; - - /* Test the slab_1 formed by the planes with normals boxAxis1 and -boxAxis1. */ - - Vector3 axis1 = boxHalfExtent1 * boxAxis1; - - QAp = P + axis1; - tp = QAp.Dot(boxAxis1); - - QAn = P - axis1; - tn = -QAn.Dot(boxAxis1); - - float n = rayDir.Dot(boxAxis1); - if (fabsf(n) < EPSILON) - { - // If the ray is parallel to the slab and the ray origin is outside, return no intersection. - if (tp < 0.0f || tn < 0.0f) - { - return false; + if (tt1 >= 0.0f) + { + t1 = tt1; + t2 = tt2; + return 2; + } + else if (tt2 >= 0.0f) + { + t1 = tt2; + return 1; + } + else + { + return 0; + } + } } } - else + + int Intersect::IntersectRayPlane( + const Vector3& rayOrigin, const Vector3& rayDir, const Vector3& planePos, const Vector3& planeNormal, float& t) { - if (tp < 0.0f || tn < 0.0f) + // (rayOrigin + t * rayDir - planePos).dot(planeNormal) = 0 + + const float EPSILON = 0.00001f; + + float n = rayDir.Dot(planeNormal); + if (fabsf(n) < EPSILON) { - isRayOriginInsideBox = false; + return 0; } - float div = 1.0f / n; - float t1 = tp * div; - float t2 = tn * (-div); - if (t1 > t2) + t = planeNormal.Dot(planePos - rayOrigin) / n; + if (t < 0.0f) { - AZStd::swap(t1, t2); + return 0; } - tmin = AZ::GetMax(tmin, t1); - tmax = AZ::GetMin(tmax, t2); - if (tmin > tmax) + else { - return false; + return 1; } } - /* test the slab_2 formed by plane with normals boxAxis2 and -boxAxis2 */ + int Intersect::IntersectRayQuad( + const Vector3& rayOrigin, + const Vector3& rayDir, + const Vector3& vertexA, + const Vector3& vertexB, + const Vector3& vertexC, + const Vector3& vertexD, + float& t) + { + const float EPSILON = 0.0001f; + + Vector3 AC = vertexC - vertexA; + Vector3 AB = vertexB - vertexA; + Vector3 QA = vertexA - rayOrigin; - Vector3 axis2 = boxHalfExtent2 * boxAxis2; + Vector3 triN = AB.Cross(AC); // the normal of the triangle ABC + float dn = rayDir.Dot(triN); - QAp = P + axis2; - tp = QAp.Dot(boxAxis2); + // Early-out if ray is facing away from ABC triangle + if (dn * triN.Dot(QA) < 0) + { + return 0; + } - QAn = P - axis2; - tn = -QAn.Dot(boxAxis2); + Vector3 E = rayDir.Cross(QA); + float dnAbs = 0.0f; - n = rayDir.Dot(boxAxis2); - if (fabsf(n) < EPSILON) - { - // If the ray is parallel to the slab and the ray origin is outside, return no intersection. - if (tp < 0.0f || tn < 0.0f) + if (dn < -EPSILON) // vertices have counter-clock wise winding when looking at the quad from rayOrigin { - return false; + dnAbs = -dn; } - } - else - { - if (tp < 0.0f || tn < 0.0f) + else if (dn > EPSILON) + { + E = -E; + dnAbs = dn; + } + else // the ray is parallel to the quad plane { - isRayOriginInsideBox = false; + return 0; } - float div = 1.0f / n; - float t1 = tp * div; - float t2 = tn * (-div); - if (t1 > t2) + // compute barycentric coordinates + float v = E.Dot(AC); + + if (v >= 0.0f && v < dnAbs) { - AZStd::swap(t1, t2); + float w = -E.Dot(AB); + if (w < 0.0f || v + w > dnAbs) + { + return 0; + } } - tmin = AZ::GetMax(tmin, t1); - tmax = AZ::GetMin(tmax, t2); - if (tmin > tmax) + else if (v < 0.0f && v > -dnAbs) { - return false; + Vector3 DA = vertexA - vertexD; + float w = E.Dot(DA); + if (w > 0.0f || v + w < -dnAbs) // v, w are negative + { + return 0; + } } + else + { + return 0; + } + + t = triN.Dot(QA) / dn; + return 1; } - /* test the slab_3 formed by plane with normals boxAxis3 and -boxAxis3 */ + // reference: Real-Time Collision Detection, 5.3.3 Intersecting Ray or Segment Against Box + bool Intersect::IntersectRayBox( + const Vector3& rayOrigin, + const Vector3& rayDir, + const Vector3& boxCenter, + const Vector3& boxAxis1, + const Vector3& boxAxis2, + const Vector3& boxAxis3, + float boxHalfExtent1, + float boxHalfExtent2, + float boxHalfExtent3, + float& t) + { + const float EPSILON = 0.00001f; - Vector3 axis3 = boxHalfExtent3 * boxAxis3; + float tmin = 0.0f; // the nearest to the ray origin + float tmax = AZ::Constants::FloatMax; // the farthest from the ray origin - QAp = P + axis3; - tp = QAp.Dot(boxAxis3); + Vector3 P = boxCenter - rayOrigin; // precomputed variable for calculating the vector from rayOrigin to a point on each box facet + Vector3 QAp; // vector from rayOrigin to the center of the facet of boxAxis + Vector3 QAn; // vector from rayOrigin to the center of the facet of -boxAxis + float tp = 0.0f; + float tn = 0.0f; + bool isRayOriginInsideBox = true; - QAn = P - axis3; - tn = -QAn.Dot(boxAxis3); + /* Test the slab_1 formed by the planes with normals boxAxis1 and -boxAxis1. */ - n = rayDir.Dot(boxAxis3); - if (fabsf(n) < EPSILON) - { - // If the ray is parallel to the slab and the ray origin is outside, return no intersection. - if (tp < 0.0f || tn < 0.0f) - { - return false; - } - } - else - { - if (tp < 0.0f || tn < 0.0f) - { - isRayOriginInsideBox = false; - } + Vector3 axis1 = boxHalfExtent1 * boxAxis1; + + QAp = P + axis1; + tp = QAp.Dot(boxAxis1); - float div = 1.0f / n; - float t1 = tp * div; - float t2 = tn * (-div); - if (t1 > t2) + QAn = P - axis1; + tn = -QAn.Dot(boxAxis1); + + float n = rayDir.Dot(boxAxis1); + if (fabsf(n) < EPSILON) { - AZStd::swap(t1, t2); + // If the ray is parallel to the slab and the ray origin is outside, return no intersection. + if (tp < 0.0f || tn < 0.0f) + { + return false; + } } - tmin = AZ::GetMax(tmin, t1); - tmax = AZ::GetMin(tmax, t2); - if (tmin > tmax) + else { - return false; + if (tp < 0.0f || tn < 0.0f) + { + isRayOriginInsideBox = false; + } + + float div = 1.0f / n; + float t1 = tp * div; + float t2 = tn * (-div); + if (t1 > t2) + { + AZStd::swap(t1, t2); + } + tmin = AZ::GetMax(tmin, t1); + tmax = AZ::GetMin(tmax, t2); + if (tmin > tmax) + { + return false; + } } - } - t = (isRayOriginInsideBox ? tmax : tmin); - return true; -} + /* test the slab_2 formed by plane with normals boxAxis2 and -boxAxis2 */ -bool AZ::Intersect::IntersectRayObb(const Vector3& rayOrigin, const Vector3& rayDir, const Obb& obb, float& t) -{ - return AZ::Intersect::IntersectRayBox(rayOrigin, rayDir, obb.GetPosition(), - obb.GetAxisX(), obb.GetAxisY(), obb.GetAxisZ(), - obb.GetHalfLengthX(), obb.GetHalfLengthY(), obb.GetHalfLengthZ(), t); -} + Vector3 axis2 = boxHalfExtent2 * boxAxis2; -//========================================================================= -// IntersectSegmentCylinder -// [10/21/2009] -//========================================================================= -CylinderIsectTypes -AZ::Intersect::IntersectSegmentCylinder( - const Vector3& sa, const Vector3& dir, const Vector3& p, const Vector3& q, const float r, float& t) -{ - const float epsilon = 0.001f; - Vector3 d = q - p; // can be cached - Vector3 m = sa - p; // -"- - Vector3 n = /*sb - sa*/ dir; // -"- + QAp = P + axis2; + tp = QAp.Dot(boxAxis2); - float md = m.Dot(d); - float nd = n.Dot(d); - float dd = d.Dot(d); + QAn = P - axis2; + tn = -QAn.Dot(boxAxis2); - // Test if segment fully outside either endcap of cylinder - if (md < 0.0f && md + nd < 0.0f) - { - return RR_ISECT_RAY_CYL_NONE; // Segment outside 'p' side of cylinder - } - if (md > dd && md + nd > dd) - { - return RR_ISECT_RAY_CYL_NONE; // Segment outside 'q' side of cylinder - } - float nn = n.Dot(n); - float mn = m.Dot(n); - float a = dd * nn - nd * nd; - float k = m.Dot(m) - r * r; - float c = dd * k - md * md; - if (std::fabs(a) < epsilon) - { - // Segment runs parallel to cylinder axis - if (c > 0.0f) + n = rayDir.Dot(boxAxis2); + if (fabsf(n) < EPSILON) { - return RR_ISECT_RAY_CYL_NONE; // 'a' and thus the segment lie outside cylinder + // If the ray is parallel to the slab and the ray origin is outside, return no intersection. + if (tp < 0.0f || tn < 0.0f) + { + return false; + } } - // Now known that segment intersects cylinder; figure out how it intersects - if (md < 0.0f) + else { - t = -mn / nn; // Intersect segment against 'p' endcap - return RR_ISECT_RAY_CYL_P_SIDE; + if (tp < 0.0f || tn < 0.0f) + { + isRayOriginInsideBox = false; + } + + float div = 1.0f / n; + float t1 = tp * div; + float t2 = tn * (-div); + if (t1 > t2) + { + AZStd::swap(t1, t2); + } + tmin = AZ::GetMax(tmin, t1); + tmax = AZ::GetMin(tmax, t2); + if (tmin > tmax) + { + return false; + } } - else if (md > dd) + + /* test the slab_3 formed by plane with normals boxAxis3 and -boxAxis3 */ + + Vector3 axis3 = boxHalfExtent3 * boxAxis3; + + QAp = P + axis3; + tp = QAp.Dot(boxAxis3); + + QAn = P - axis3; + tn = -QAn.Dot(boxAxis3); + + n = rayDir.Dot(boxAxis3); + if (fabsf(n) < EPSILON) { - t = (nd - mn) / nn; // Intersect segment against 'q' endcap - return RR_ISECT_RAY_CYL_Q_SIDE; + // If the ray is parallel to the slab and the ray origin is outside, return no intersection. + if (tp < 0.0f || tn < 0.0f) + { + return false; + } } else { - // 'a' lies inside cylinder - t = 0.0f; - return RR_ISECT_RAY_CYL_SA_INSIDE; + if (tp < 0.0f || tn < 0.0f) + { + isRayOriginInsideBox = false; + } + + float div = 1.0f / n; + float t1 = tp * div; + float t2 = tn * (-div); + if (t1 > t2) + { + AZStd::swap(t1, t2); + } + tmin = AZ::GetMax(tmin, t1); + tmax = AZ::GetMin(tmax, t2); + if (tmin > tmax) + { + return false; + } } + + t = (isRayOriginInsideBox ? tmax : tmin); + return true; } - float b = dd * mn - nd * md; - float discr = b * b - a * c; - if (discr < 0.0f) + + bool Intersect::IntersectRayObb(const Vector3& rayOrigin, const Vector3& rayDir, const Obb& obb, float& t) { - return RR_ISECT_RAY_CYL_NONE; // No real roots; no intersection + return Intersect::IntersectRayBox( + rayOrigin, rayDir, obb.GetPosition(), obb.GetAxisX(), obb.GetAxisY(), obb.GetAxisZ(), obb.GetHalfLengthX(), + obb.GetHalfLengthY(), obb.GetHalfLengthZ(), t); } - t = (-b - Sqrt(discr)) / a; - CylinderIsectTypes result = RR_ISECT_RAY_CYL_PQ; // default along the PQ segment - if (md + t * nd < 0.0f) + //========================================================================= + // IntersectSegmentCylinder + // [10/21/2009] + //========================================================================= + Intersect::CylinderIsectTypes Intersect::IntersectSegmentCylinder( + const Vector3& sa, const Vector3& dir, const Vector3& p, const Vector3& q, const float r, float& t) { - // Intersection outside cylinder on 'p' side - if (nd <= 0.0f) + const float epsilon = 0.001f; + Vector3 d = q - p; // can be cached + Vector3 m = sa - p; // -"- + Vector3 n = /*sb - sa*/ dir; // -"- + + float md = m.Dot(d); + float nd = n.Dot(d); + float dd = d.Dot(d); + + // Test if segment fully outside either endcap of cylinder + if (md < 0.0f && md + nd < 0.0f) { - return RR_ISECT_RAY_CYL_NONE; // Segment pointing away from endcap + return RR_ISECT_RAY_CYL_NONE; // Segment outside 'p' side of cylinder } - float t0 = -md / nd; - // Keep intersection if Dot(S(t) - p, S(t) - p) <= r^2 - if (k + t0 * (2.0f * mn + t0 * nn) <= 0.0f) + if (md > dd && md + nd > dd) { - // if( t0 < 0.0f ) t0 = 0.0f; // it's inside the cylinder - t = t0; - result = RR_ISECT_RAY_CYL_P_SIDE; + return RR_ISECT_RAY_CYL_NONE; // Segment outside 'q' side of cylinder } - else + float nn = n.Dot(n); + float mn = m.Dot(n); + float a = dd * nn - nd * nd; + float k = m.Dot(m) - r * r; + float c = dd * k - md * md; + if (std::fabs(a) < epsilon) { - return RR_ISECT_RAY_CYL_NONE; + // Segment runs parallel to cylinder axis + if (c > 0.0f) + { + return RR_ISECT_RAY_CYL_NONE; // 'a' and thus the segment lie outside cylinder + } + // Now known that segment intersects cylinder; figure out how it intersects + if (md < 0.0f) + { + t = -mn / nn; // Intersect segment against 'p' endcap + return RR_ISECT_RAY_CYL_P_SIDE; + } + else if (md > dd) + { + t = (nd - mn) / nn; // Intersect segment against 'q' endcap + return RR_ISECT_RAY_CYL_Q_SIDE; + } + else + { + // 'a' lies inside cylinder + t = 0.0f; + return RR_ISECT_RAY_CYL_SA_INSIDE; + } } - } - else if (md + t * nd > dd) - { - // Intersection outside cylinder on 'q' side - if (nd >= 0.0f) + float b = dd * mn - nd * md; + float discr = b * b - a * c; + if (discr < 0.0f) { - return RR_ISECT_RAY_CYL_NONE; // Segment pointing away from endcap + return RR_ISECT_RAY_CYL_NONE; // No real roots; no intersection } - float t0 = (dd - md) / nd; - // Keep intersection if Dot(S(t) - q, S(t) - q) <= r^2 - if (k + dd - 2.0f * md + t0 * (2.0f * (mn - nd) + t0 * nn) <= 0.0f) + t = (-b - Sqrt(discr)) / a; + CylinderIsectTypes result = RR_ISECT_RAY_CYL_PQ; // default along the PQ segment + + if (md + t * nd < 0.0f) { - // if( t0 < 0.0f ) t0 = 0.0f; // it's inside the cylinder - t = t0; - result = RR_ISECT_RAY_CYL_Q_SIDE; + // Intersection outside cylinder on 'p' side + if (nd <= 0.0f) + { + return RR_ISECT_RAY_CYL_NONE; // Segment pointing away from endcap + } + float t0 = -md / nd; + // Keep intersection if Dot(S(t) - p, S(t) - p) <= r^2 + if (k + t0 * (2.0f * mn + t0 * nn) <= 0.0f) + { + // if( t0 < 0.0f ) t0 = 0.0f; // it's inside the cylinder + t = t0; + result = RR_ISECT_RAY_CYL_P_SIDE; + } + else + { + return RR_ISECT_RAY_CYL_NONE; + } } - else + else if (md + t * nd > dd) { - return RR_ISECT_RAY_CYL_NONE; + // Intersection outside cylinder on 'q' side + if (nd >= 0.0f) + { + return RR_ISECT_RAY_CYL_NONE; // Segment pointing away from endcap + } + float t0 = (dd - md) / nd; + // Keep intersection if Dot(S(t) - q, S(t) - q) <= r^2 + if (k + dd - 2.0f * md + t0 * (2.0f * (mn - nd) + t0 * nn) <= 0.0f) + { + // if( t0 < 0.0f ) t0 = 0.0f; // it's inside the cylinder + t = t0; + result = RR_ISECT_RAY_CYL_Q_SIDE; + } + else + { + return RR_ISECT_RAY_CYL_NONE; + } } - } - // Segment intersects cylinder between the end-caps; t is correct - if (t > 1.0f) - { - return RR_ISECT_RAY_CYL_NONE; // Intersection lies outside segment - } - else if (t < 0.0f) - { - if (c <= 0.0f) - { - t = 0.0f; - return RR_ISECT_RAY_CYL_SA_INSIDE; // Segment starts inside - } - else + // Segment intersects cylinder between the end-caps; t is correct + if (t > 1.0f) { return RR_ISECT_RAY_CYL_NONE; // Intersection lies outside segment } - } - else - { - return result; - } -} -//========================================================================= -// IntersectSegmentCapsule -// [10/21/2009] -//========================================================================= -CapsuleIsectTypes -AZ::Intersect::IntersectSegmentCapsule(const Vector3& sa, const Vector3& dir, const Vector3& p, const Vector3& q, const float r, float& t) -{ - int result = IntersectSegmentCylinder(sa, dir, p, q, r, t); - - if (result == RR_ISECT_RAY_CYL_SA_INSIDE) - { - return ISECT_RAY_CAPSULE_SA_INSIDE; - } - - if (result == RR_ISECT_RAY_CYL_PQ) - { - return ISECT_RAY_CAPSULE_PQ; - } - - Vector3 dirNorm = dir; - float len = dirNorm.NormalizeWithLength(); - - // check spheres - float timeLenTop, timeLenBottom; - int resultTop = IntersectRaySphere(sa, dirNorm, p, r, timeLenTop); - if (resultTop == ISECT_RAY_SPHERE_SA_INSIDE) - { - return ISECT_RAY_CAPSULE_SA_INSIDE; - } - int resultBottom = IntersectRaySphere(sa, dirNorm, q, r, timeLenBottom); - if (resultBottom == ISECT_RAY_SPHERE_SA_INSIDE) - { - return ISECT_RAY_CAPSULE_SA_INSIDE; - } - - if (resultTop == ISECT_RAY_SPHERE_ISECT) - { - if (resultBottom == ISECT_RAY_SPHERE_ISECT) + else if (t < 0.0f) { - // if we intersect both spheres pick the closest one - if (timeLenTop < timeLenBottom) + if (c <= 0.0f) { - t = timeLenTop / len; - return ISECT_RAY_CAPSULE_P_SIDE; + t = 0.0f; + return RR_ISECT_RAY_CYL_SA_INSIDE; // Segment starts inside } else { - t = timeLenBottom / len; - return ISECT_RAY_CAPSULE_Q_SIDE; + return RR_ISECT_RAY_CYL_NONE; // Intersection lies outside segment } } else { - t = timeLenTop / len; - return ISECT_RAY_CAPSULE_P_SIDE; + return result; } } - - if (resultBottom == ISECT_RAY_SPHERE_ISECT) + //========================================================================= + // IntersectSegmentCapsule + // [10/21/2009] + //========================================================================= + Intersect::CapsuleIsectTypes Intersect::IntersectSegmentCapsule( + const Vector3& sa, const Vector3& dir, const Vector3& p, const Vector3& q, const float r, float& t) { - t = timeLenBottom / len; - return ISECT_RAY_CAPSULE_Q_SIDE; - } + int result = IntersectSegmentCylinder(sa, dir, p, q, r, t); - return ISECT_RAY_CAPSULE_NONE; -} + if (result == RR_ISECT_RAY_CYL_SA_INSIDE) + { + return ISECT_RAY_CAPSULE_SA_INSIDE; + } -//========================================================================= -// IntersectSegmentPolyhedron -// [10/21/2009] -//========================================================================= -bool -AZ::Intersect::IntersectSegmentPolyhedron( - const Vector3& sa, const Vector3& dir, const Plane p[], int numPlanes, - float& tfirst, float& tlast, int& iFirstPlane, int& iLastPlane) -{ - // Compute direction vector for the segment - Vector3 d = /*b - a*/ dir; - // Set initial interval to being the whole segment. For a ray, tlast should be - // set to +RR_FLT_MAX. For a line, additionally tfirst should be set to -RR_FLT_MAX - tfirst = 0.0f; - tlast = 1.0f; - iFirstPlane = -1; - iLastPlane = -1; - // Intersect segment against each plane - for (int i = 0; i < numPlanes; i++) - { - const Vector4& plane = p[i].GetPlaneEquationCoefficients(); + if (result == RR_ISECT_RAY_CYL_PQ) + { + return ISECT_RAY_CAPSULE_PQ; + } - float denom = plane.Dot3(d); - // don't forget we store -D in the plane - float dist = (-plane.GetW()) - plane.Dot3(sa); - // Test if segment runs parallel to the plane - if (denom == 0.0f) + Vector3 dirNorm = dir; + float len = dirNorm.NormalizeWithLength(); + + // check spheres + float timeLenTop, timeLenBottom; + int resultTop = IntersectRaySphere(sa, dirNorm, p, r, timeLenTop); + if (resultTop == ISECT_RAY_SPHERE_SA_INSIDE) { - // If so, return "no intersection" if segment lies outside plane - if (dist < 0.0f) - { - return false; - } + return ISECT_RAY_CAPSULE_SA_INSIDE; } - else + int resultBottom = IntersectRaySphere(sa, dirNorm, q, r, timeLenBottom); + if (resultBottom == ISECT_RAY_SPHERE_SA_INSIDE) + { + return ISECT_RAY_CAPSULE_SA_INSIDE; + } + + if (resultTop == ISECT_RAY_SPHERE_ISECT) { - // Compute parameterized t value for intersection with current plane - float t = dist / denom; - if (denom < 0.0f) + if (resultBottom == ISECT_RAY_SPHERE_ISECT) { - // When entering half space, update tfirst if t is larger - if (t > tfirst) + // if we intersect both spheres pick the closest one + if (timeLenTop < timeLenBottom) + { + t = timeLenTop / len; + return ISECT_RAY_CAPSULE_P_SIDE; + } + else { - tfirst = t; - iFirstPlane = i; + t = timeLenBottom / len; + return ISECT_RAY_CAPSULE_Q_SIDE; } } else { - // When exiting half space, update tlast if t is smaller - if (t < tlast) + t = timeLenTop / len; + return ISECT_RAY_CAPSULE_P_SIDE; + } + } + + if (resultBottom == ISECT_RAY_SPHERE_ISECT) + { + t = timeLenBottom / len; + return ISECT_RAY_CAPSULE_Q_SIDE; + } + + return ISECT_RAY_CAPSULE_NONE; + } + + //========================================================================= + // IntersectSegmentPolyhedron + // [10/21/2009] + //========================================================================= + bool Intersect::IntersectSegmentPolyhedron( + const Vector3& sa, + const Vector3& dir, + const Plane p[], + int numPlanes, + float& tfirst, + float& tlast, + int& iFirstPlane, + int& iLastPlane) + { + // Compute direction vector for the segment + Vector3 d = /*b - a*/ dir; + // Set initial interval to being the whole segment. For a ray, tlast should be + // set to +RR_FLT_MAX. For a line, additionally tfirst should be set to -RR_FLT_MAX + tfirst = 0.0f; + tlast = 1.0f; + iFirstPlane = -1; + iLastPlane = -1; + // Intersect segment against each plane + for (int i = 0; i < numPlanes; i++) + { + const Vector4& plane = p[i].GetPlaneEquationCoefficients(); + + float denom = plane.Dot3(d); + // don't forget we store -D in the plane + float dist = (-plane.GetW()) - plane.Dot3(sa); + // Test if segment runs parallel to the plane + if (denom == 0.0f) + { + // If so, return "no intersection" if segment lies outside plane + if (dist < 0.0f) { - tlast = t; - iLastPlane = i; + return false; } } - - // Exit with "no intersection" if intersection becomes empty - if (tfirst > tlast) + else { - return false; + // Compute parameterized t value for intersection with current plane + float t = dist / denom; + if (denom < 0.0f) + { + // When entering half space, update tfirst if t is larger + if (t > tfirst) + { + tfirst = t; + iFirstPlane = i; + } + } + else + { + // When exiting half space, update tlast if t is smaller + if (t < tlast) + { + tlast = t; + iLastPlane = i; + } + } + + // Exit with "no intersection" if intersection becomes empty + if (tfirst > tlast) + { + return false; + } } } - } - - //DBG_Assert(iFirstPlane!=-1&&iLastPlane!=-1,("We have some bad border case to have only one plane, fix this function!")); - if (iFirstPlane == -1 && iLastPlane == -1) - { - return false; - } - // A nonzero logical intersection, so the segment intersects the polyhedron - return true; -} + // DBG_Assert(iFirstPlane!=-1&&iLastPlane!=-1,("We have some bad border case to have only one plane, fix this function!")); + if (iFirstPlane == -1 && iLastPlane == -1) + { + return false; + } -//========================================================================= -// ClosestSegmentSegment -// [10/21/2009] -//========================================================================= -void -AZ::Intersect::ClosestSegmentSegment( - const Vector3& segment1Start, const Vector3& segment1End, - const Vector3& segment2Start, const Vector3& segment2End, - float& segment1Proportion, float& segment2Proportion, - Vector3& closestPointSegment1, Vector3& closestPointSegment2, - float epsilon) -{ - const Vector3 segment1 = segment1End - segment1Start; - const Vector3 segment2 = segment2End - segment2Start; - const Vector3 segmentStartsVector = segment1Start - segment2Start; - const float segment1LengthSquared = segment1.Dot(segment1); - const float segment2LengthSquared = segment2.Dot(segment2); - - // Check if both segments degenerate into points - if (segment1LengthSquared <= epsilon && segment2LengthSquared <= epsilon) - { - segment1Proportion = 0.0f; - segment2Proportion = 0.0f; - closestPointSegment1 = segment1Start; - closestPointSegment2 = segment2Start; - return; + // A nonzero logical intersection, so the segment intersects the polyhedron + return true; } - float projSegment2SegmentStarts = segment2.Dot(segmentStartsVector); - - // Check if segment 1 degenerates into a point - if (segment1LengthSquared <= epsilon) - { - segment1Proportion = 0.0f; - segment2Proportion = AZ::GetClamp(projSegment2SegmentStarts / segment2LengthSquared, 0.0f, 1.0f); - } - else + //========================================================================= + // ClosestSegmentSegment + // [10/21/2009] + //========================================================================= + void Intersect::ClosestSegmentSegment( + const Vector3& segment1Start, + const Vector3& segment1End, + const Vector3& segment2Start, + const Vector3& segment2End, + float& segment1Proportion, + float& segment2Proportion, + Vector3& closestPointSegment1, + Vector3& closestPointSegment2, + float epsilon) { - float projSegment1SegmentStarts = segment1.Dot(segmentStartsVector); - // Check if segment 2 degenerates into a point - if (segment2LengthSquared <= epsilon) + const Vector3 segment1 = segment1End - segment1Start; + const Vector3 segment2 = segment2End - segment2Start; + const Vector3 segmentStartsVector = segment1Start - segment2Start; + const float segment1LengthSquared = segment1.Dot(segment1); + const float segment2LengthSquared = segment2.Dot(segment2); + + // Check if both segments degenerate into points + if (segment1LengthSquared <= epsilon && segment2LengthSquared <= epsilon) { - segment1Proportion = AZ::GetClamp(-projSegment1SegmentStarts / segment1LengthSquared, 0.0f, 1.0f); + segment1Proportion = 0.0f; segment2Proportion = 0.0f; + closestPointSegment1 = segment1Start; + closestPointSegment2 = segment2Start; + return; + } + + float projSegment2SegmentStarts = segment2.Dot(segmentStartsVector); + + // Check if segment 1 degenerates into a point + if (segment1LengthSquared <= epsilon) + { + segment1Proportion = 0.0f; + segment2Proportion = AZ::GetClamp(projSegment2SegmentStarts / segment2LengthSquared, 0.0f, 1.0f); } else { - // The general non-degenerate case starts here - float projSegment1Segment2 = segment1.Dot(segment2); - float denom = segment1LengthSquared * segment2LengthSquared - projSegment1Segment2 * projSegment1Segment2; // Always nonnegative - - // If segments not parallel, compute closest point on segment1 to segment2, and - // clamp to segment1. Else pick arbitrary segment1Proportion (here 0) - if (denom != 0.0f) + float projSegment1SegmentStarts = segment1.Dot(segmentStartsVector); + // Check if segment 2 degenerates into a point + if (segment2LengthSquared <= epsilon) { - segment1Proportion = AZ::GetClamp((projSegment1Segment2 * projSegment2SegmentStarts - projSegment1SegmentStarts * segment2LengthSquared) / denom, 0.0f, 1.0f); + segment1Proportion = AZ::GetClamp(-projSegment1SegmentStarts / segment1LengthSquared, 0.0f, 1.0f); + segment2Proportion = 0.0f; } else { - segment1Proportion = 0.0f; - } + // The general non-degenerate case starts here + float projSegment1Segment2 = segment1.Dot(segment2); + float denom = + segment1LengthSquared * segment2LengthSquared - projSegment1Segment2 * projSegment1Segment2; // Always nonnegative - // Compute point on segment2 closest to segment1 using - segment2Proportion = (projSegment1Segment2 * segment1Proportion + projSegment2SegmentStarts) / segment2LengthSquared; + // If segments not parallel, compute closest point on segment1 to segment2, and + // clamp to segment1. Else pick arbitrary segment1Proportion (here 0) + if (denom != 0.0f) + { + segment1Proportion = AZ::GetClamp( + (projSegment1Segment2 * projSegment2SegmentStarts - projSegment1SegmentStarts * segment2LengthSquared) / denom, + 0.0f, 1.0f); + } + else + { + segment1Proportion = 0.0f; + } - // If segment2Proportion in [0,1] done. Else clamp segment2Proportion, recompute segment1Proportion for the new value of segment2Proportion - // and clamp segment1Proportion to [0, 1] - if (segment2Proportion < 0.0f) - { - segment2Proportion = 0.0f; - segment1Proportion = AZ::GetClamp(-projSegment1SegmentStarts / segment1LengthSquared, 0.0f, 1.0f); - } - else if (segment2Proportion > 1.0f) - { - segment2Proportion = 1.0f; - segment1Proportion = AZ::GetClamp((projSegment1Segment2 - projSegment1SegmentStarts) / segment1LengthSquared, 0.0f, 1.0f); + // Compute point on segment2 closest to segment1 using + segment2Proportion = (projSegment1Segment2 * segment1Proportion + projSegment2SegmentStarts) / segment2LengthSquared; + + // If segment2Proportion in [0,1] done. Else clamp segment2Proportion, recompute segment1Proportion for the new value of + // segment2Proportion and clamp segment1Proportion to [0, 1] + if (segment2Proportion < 0.0f) + { + segment2Proportion = 0.0f; + segment1Proportion = AZ::GetClamp(-projSegment1SegmentStarts / segment1LengthSquared, 0.0f, 1.0f); + } + else if (segment2Proportion > 1.0f) + { + segment2Proportion = 1.0f; + segment1Proportion = + AZ::GetClamp((projSegment1Segment2 - projSegment1SegmentStarts) / segment1LengthSquared, 0.0f, 1.0f); + } } } - } - - closestPointSegment1 = segment1Start + segment1 * segment1Proportion; - closestPointSegment2 = segment2Start + segment2 * segment2Proportion; -} -void AZ::Intersect::ClosestSegmentSegment( - const Vector3& segment1Start, const Vector3& segment1End, - const Vector3& segment2Start, const Vector3& segment2End, - Vector3& closestPointSegment1, Vector3& closestPointSegment2, - float epsilon) -{ - float proportion1, proportion2; - AZ::Intersect::ClosestSegmentSegment( - segment1Start, segment1End, - segment2Start, segment2End, - proportion1, proportion2, - closestPointSegment1, closestPointSegment2, epsilon); -} + closestPointSegment1 = segment1Start + segment1 * segment1Proportion; + closestPointSegment2 = segment2Start + segment2 * segment2Proportion; + } -void AZ::Intersect::ClosestPointSegment( - const Vector3& point, const Vector3& segmentStart, const Vector3& segmentEnd, - float& proportion, Vector3& closestPointOnSegment) -{ - Vector3 segment = segmentEnd - segmentStart; - // Project point onto segment, but deferring divide by segment.Dot(segment) - proportion = (point - segmentStart).Dot(segment); - if (proportion <= 0.0f) + void Intersect::ClosestSegmentSegment( + const Vector3& segment1Start, + const Vector3& segment1End, + const Vector3& segment2Start, + const Vector3& segment2End, + Vector3& closestPointSegment1, + Vector3& closestPointSegment2, + float epsilon) { - // Point projects outside the [segmentStart, segmentEnd] interval, on the segmentStart side, clamp to segmentStart - proportion = 0.0f; - closestPointOnSegment = segmentStart; + float proportion1, proportion2; + Intersect::ClosestSegmentSegment( + segment1Start, segment1End, segment2Start, segment2End, proportion1, proportion2, closestPointSegment1, closestPointSegment2, + epsilon); } - else + + void Intersect::ClosestPointSegment( + const Vector3& point, const Vector3& segmentStart, const Vector3& segmentEnd, float& proportion, Vector3& closestPointOnSegment) { - float segmentLengthSquared = segment.Dot(segment); - if (proportion >= segmentLengthSquared) + Vector3 segment = segmentEnd - segmentStart; + // Project point onto segment, but deferring divide by segment.Dot(segment) + proportion = (point - segmentStart).Dot(segment); + if (proportion <= 0.0f) { - // Point projects outside the [segmentStart, segmentEnd] interval, on the segmentEnd side, clamp to segmentEnd - proportion = 1.0f; - closestPointOnSegment = segmentEnd; + // Point projects outside the [segmentStart, segmentEnd] interval, on the segmentStart side, clamp to segmentStart + proportion = 0.0f; + closestPointOnSegment = segmentStart; } else { - // Point projects inside the [segmentStart, segmentEnd] interval, must do deferred divide now - proportion = proportion / segmentLengthSquared; - closestPointOnSegment = segmentStart + (proportion * segment); + float segmentLengthSquared = segment.Dot(segment); + if (proportion >= segmentLengthSquared) + { + // Point projects outside the [segmentStart, segmentEnd] interval, on the segmentEnd side, clamp to segmentEnd + proportion = 1.0f; + closestPointOnSegment = segmentEnd; + } + else + { + // Point projects inside the [segmentStart, segmentEnd] interval, must do deferred divide now + proportion = proportion / segmentLengthSquared; + closestPointOnSegment = segmentStart + (proportion * segment); + } } } -} #if 0 ////////////////////////////////////////////////////////////////////////// @@ -2121,3 +2171,5 @@ namespace test } ////////////////////////////////////////////////////////////////////////// #endif + +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Math/Sfmt.cpp b/Code/Framework/AzCore/AzCore/Math/Sfmt.cpp index 5f4dc9e5df..96c1a6a420 100644 --- a/Code/Framework/AzCore/AzCore/Math/Sfmt.cpp +++ b/Code/Framework/AzCore/AzCore/Math/Sfmt.cpp @@ -9,39 +9,38 @@ #include #include -#include #include +#include #include // for memset namespace AZ::SfmtInternal { - static const int N32 = N * 4; - static const int N64 = N * 2; - static const int POS1 = 122; - static const int SL1 = 18; - static const int SR1 = 11; - static const int SL2 = 1; - static const int SR2 = 1; - static const unsigned int MSK1 = 0xdfffffefU; - static const unsigned int MSK2 = 0xddfecb7fU; - static const unsigned int MSK3 = 0xbffaffffU; - static const unsigned int MSK4 = 0xbffffff6U; - static const unsigned int PARITY1 = 0x00000001U; - static const unsigned int PARITY2 = 0x00000000U; - static const unsigned int PARITY3 = 0x00000000U; - static const unsigned int PARITY4 = 0x13c9e684U; + static const int N32 = N * 4; + static const int N64 = N * 2; + static const int POS1 = 122; + static const int SL1 = 18; + static const int SR1 = 11; + static const int SL2 = 1; + static const int SR2 = 1; + static const unsigned int MSK1 = 0xdfffffefU; + static const unsigned int MSK2 = 0xddfecb7fU; + static const unsigned int MSK3 = 0xbffaffffU; + static const unsigned int MSK4 = 0xbffffff6U; + static const unsigned int PARITY1 = 0x00000001U; + static const unsigned int PARITY2 = 0x00000000U; + static const unsigned int PARITY3 = 0x00000000U; + static const unsigned int PARITY4 = 0x13c9e684U; /** a parity check vector which certificate the period of 2^{MEXP} */ - static unsigned int parity[4] = {PARITY1, PARITY2, PARITY3, PARITY4}; + static unsigned int parity[4] = { PARITY1, PARITY2, PARITY3, PARITY4 }; #ifdef ONLY64 -# define idxof(_i) (_i ^ 1) +#define idxof(_i) (_i ^ 1) #else -# define idxof(_i) _i +#define idxof(_i) _i #endif // ONLY64 - #if AZ_TRAIT_USE_PLATFORM_SIMD_SSE /** * This function represents the recursion formula. @@ -52,7 +51,8 @@ namespace AZ::SfmtInternal * @param mask 128-bit mask * @return output */ - AZ_FORCE_INLINE static Simd::Vec4::Int32Type simd_recursion(Simd::Vec4::Int32Type* a, Simd::Vec4::Int32Type* b, Simd::Vec4::Int32Type c, Simd::Vec4::Int32Type d, Simd::Vec4::Int32Type mask) + AZ_FORCE_INLINE static Simd::Vec4::Int32Type simd_recursion( + Simd::Vec4::Int32Type* a, Simd::Vec4::Int32Type* b, Simd::Vec4::Int32Type c, Simd::Vec4::Int32Type d, Simd::Vec4::Int32Type mask) { Simd::Vec4::Int32Type v, x, y, z; x = *a; @@ -151,7 +151,7 @@ namespace AZ::SfmtInternal inline void rshift128(w128_t* out, w128_t const* in, int shift) { AZ::u64 th, tl, oh, ol; - #ifdef ONLY64 +#ifdef ONLY64 th = ((AZ::u64)in->u[2] << 32) | ((AZ::u64)in->u[3]); tl = ((AZ::u64)in->u[0] << 32) | ((AZ::u64)in->u[1]); @@ -204,7 +204,7 @@ namespace AZ::SfmtInternal #endif } - inline void do_recursion(w128_t* r, w128_t* a, w128_t* b, w128_t* c, w128_t* d) + inline void do_recursion(w128_t* r, w128_t* a, w128_t* b, w128_t* c, w128_t* d) { w128_t x; w128_t y; @@ -229,7 +229,7 @@ namespace AZ::SfmtInternal inline void gen_rand_all(Sfmt& g) { int i; - w128_t* r1, * r2; + w128_t *r1, *r2; r1 = &g.m_sfmt[N - 2]; r2 = &g.m_sfmt[N - 1]; @@ -257,7 +257,7 @@ namespace AZ::SfmtInternal inline void gen_rand_array(Sfmt& g, w128_t* array, int size) { int i, j; - w128_t* r1, * r2; + w128_t *r1, *r2; r1 = &g.m_sfmt[N - 2]; r2 = &g.m_sfmt[N - 1]; @@ -295,82 +295,80 @@ namespace AZ::SfmtInternal #endif } // namespace AZ::SfmtInternal -using namespace AZ; - ////////////////////////////////////////////////////////////////////////// // Statics ////////////////////////////////////////////////////////////////////////// +namespace AZ +{ + static EnvironmentVariable s_sfmt; + static const char* s_globalSfmtName = "GlobalSfmt"; -static EnvironmentVariable s_sfmt; -static const char* s_globalSfmtName = "GlobalSfmt"; + Sfmt& Sfmt::GetInstance() + { + if (!s_sfmt) + { + s_sfmt = AZ::Environment::FindVariable(s_globalSfmtName); + if (!s_sfmt) + { + Sfmt::Create(); + } + } -Sfmt& Sfmt::GetInstance() -{ - if (!s_sfmt) + return s_sfmt.Get(); + } + + void Sfmt::Create() { - s_sfmt = AZ::Environment::FindVariable(s_globalSfmtName); if (!s_sfmt) { - Sfmt::Create(); + s_sfmt = AZ::Environment::CreateVariable(s_globalSfmtName); } } - return s_sfmt.Get(); -} + void Sfmt::Destroy() + { + s_sfmt.Reset(); + } -void Sfmt::Create() -{ - if (!s_sfmt) + //========================================================================= + // Sfmt + // [4/10/2012] + //========================================================================= + Sfmt::Sfmt() { - s_sfmt = AZ::Environment::CreateVariable(s_globalSfmtName); + m_psfmt32 = &m_sfmt[0].u[0]; + m_psfmt64 = reinterpret_cast(m_psfmt32); + + Seed(); } -} -void Sfmt::Destroy() -{ - s_sfmt.Reset(); -} - -//========================================================================= -// Sfmt -// [4/10/2012] -//========================================================================= -Sfmt::Sfmt() -{ - m_psfmt32 = &m_sfmt[0].u[0]; - m_psfmt64 = reinterpret_cast(m_psfmt32); + //========================================================================= + // Seed + // [4/10/2012] + //========================================================================= + Sfmt::Sfmt(AZ::u32* keys, int numKeys) + { + m_psfmt32 = &m_sfmt[0].u[0]; + m_psfmt64 = reinterpret_cast(m_psfmt32); - Seed(); -} + Seed(keys, numKeys); + } -//========================================================================= -// Seed -// [4/10/2012] -//========================================================================= -Sfmt::Sfmt(AZ::u32* keys, int numKeys) -{ - m_psfmt32 = &m_sfmt[0].u[0]; - m_psfmt64 = reinterpret_cast(m_psfmt32); - - Seed(keys, numKeys); -} - -//========================================================================= -// Seed -// [4/10/2012] -//========================================================================= -void -Sfmt::Seed() -{ - // buffer with random values - AZ::u32 buffer[32]; - BetterPseudoRandom rnd; - bool result = rnd.GetRandom(buffer, sizeof(buffer)); - (void)result; - AZ_Warning("System", result, "Failed to seed properly the Smft generator!"); - Seed(buffer, AZ_ARRAY_SIZE(buffer)); -} + //========================================================================= + // Seed + // [4/10/2012] + //========================================================================= + void Sfmt::Seed() + { + // buffer with random values + AZ::u32 buffer[32]; + BetterPseudoRandom rnd; + bool result = rnd.GetRandom(buffer, sizeof(buffer)); + (void)result; + AZ_Warning("System", result, "Failed to seed properly the Smft generator!"); + Seed(buffer, AZ_ARRAY_SIZE(buffer)); + } /** * This function represents a function used in the initialization @@ -388,226 +386,222 @@ Sfmt::Seed() */ #define azsfmt_func2(x) ((x ^ (x >> 27)) * (AZ::u32)1566083941UL) -//========================================================================= -// Seed -// [4/10/2012] -//========================================================================= -void -Sfmt::Seed(AZ::u32* keys, int numKeys) -{ - using SfmtInternal::N; - using SfmtInternal::N32; - int i, j, count; - AZ::u32 r; - int lag; - int mid; - int size = N * 4; - - if (size >= 623) - { - lag = 11; - } - else if (size >= 68) - { - lag = 7; - } - else if (size >= 39) - { - lag = 5; - } - else + //========================================================================= + // Seed + // [4/10/2012] + //========================================================================= + void Sfmt::Seed(AZ::u32* keys, int numKeys) { - lag = 3; - } - mid = (size - lag) / 2; + using SfmtInternal::N; + using SfmtInternal::N32; + int i, j, count; + AZ::u32 r; + int lag; + int mid; + int size = N * 4; + + if (size >= 623) + { + lag = 11; + } + else if (size >= 68) + { + lag = 7; + } + else if (size >= 39) + { + lag = 5; + } + else + { + lag = 3; + } + mid = (size - lag) / 2; - memset(m_sfmt, 0x8b, sizeof(m_sfmt)); - if (numKeys + 1 > SfmtInternal::N32) - { - count = numKeys + 1; - } - else - { - count = N32; - } - r = azsfmt_func1((m_psfmt32[idxof(0)] ^ m_psfmt32[idxof(mid)] ^ m_psfmt32[idxof(N32 - 1)])); - m_psfmt32[idxof(mid)] += r; - r += numKeys; - m_psfmt32[idxof(mid + lag)] += r; - m_psfmt32[idxof(0)] = r; - - count--; - for (i = 1, j = 0; (j < count) && (j < numKeys); j++) - { - r = azsfmt_func1((m_psfmt32[idxof(i)] ^ m_psfmt32[idxof((i + mid) % N32)] ^ m_psfmt32[idxof((i + N32 - 1) % N32)])); - m_psfmt32[idxof((i + mid) % N32)] += r; - r += keys[j] + i; - m_psfmt32[idxof((i + mid + lag) % N32)] += r; - m_psfmt32[idxof(i)] = r; - i = (i + 1) % N32; - } - for (; j < count; j++) - { - r = azsfmt_func1((m_psfmt32[idxof(i)] ^ m_psfmt32[idxof((i + mid) % N32)] ^ m_psfmt32[idxof((i + N32 - 1) % N32)])); - m_psfmt32[idxof((i + mid) % N32)] += r; - r += i; - m_psfmt32[idxof((i + mid + lag) % N32)] += r; - m_psfmt32[idxof(i)] = r; - i = (i + 1) % N32; - } - for (j = 0; j < N32; j++) - { - r = azsfmt_func2((m_psfmt32[idxof(i)] + m_psfmt32[idxof((i + mid) % N32)] + m_psfmt32[idxof((i + N32 - 1) % N32)])); - m_psfmt32[idxof((i + mid) % N32)] ^= r; - r -= i; - m_psfmt32[idxof((i + mid + lag) % N32)] ^= r; - m_psfmt32[idxof(i)] = r; - i = (i + 1) % N32; - } + memset(m_sfmt, 0x8b, sizeof(m_sfmt)); + if (numKeys + 1 > SfmtInternal::N32) + { + count = numKeys + 1; + } + else + { + count = N32; + } + r = azsfmt_func1((m_psfmt32[idxof(0)] ^ m_psfmt32[idxof(mid)] ^ m_psfmt32[idxof(N32 - 1)])); + m_psfmt32[idxof(mid)] += r; + r += numKeys; + m_psfmt32[idxof(mid + lag)] += r; + m_psfmt32[idxof(0)] = r; + + count--; + for (i = 1, j = 0; (j < count) && (j < numKeys); j++) + { + r = azsfmt_func1((m_psfmt32[idxof(i)] ^ m_psfmt32[idxof((i + mid) % N32)] ^ m_psfmt32[idxof((i + N32 - 1) % N32)])); + m_psfmt32[idxof((i + mid) % N32)] += r; + r += keys[j] + i; + m_psfmt32[idxof((i + mid + lag) % N32)] += r; + m_psfmt32[idxof(i)] = r; + i = (i + 1) % N32; + } + for (; j < count; j++) + { + r = azsfmt_func1((m_psfmt32[idxof(i)] ^ m_psfmt32[idxof((i + mid) % N32)] ^ m_psfmt32[idxof((i + N32 - 1) % N32)])); + m_psfmt32[idxof((i + mid) % N32)] += r; + r += i; + m_psfmt32[idxof((i + mid + lag) % N32)] += r; + m_psfmt32[idxof(i)] = r; + i = (i + 1) % N32; + } + for (j = 0; j < N32; j++) + { + r = azsfmt_func2((m_psfmt32[idxof(i)] + m_psfmt32[idxof((i + mid) % N32)] + m_psfmt32[idxof((i + N32 - 1) % N32)])); + m_psfmt32[idxof((i + mid) % N32)] ^= r; + r -= i; + m_psfmt32[idxof((i + mid + lag) % N32)] ^= r; + m_psfmt32[idxof(i)] = r; + i = (i + 1) % N32; + } - m_index = N32; - PeriodCertification(); -} + m_index = N32; + PeriodCertification(); + } #undef azsfmt_func1 #undef azsfmt_func2 -//========================================================================= -// PeriodCertification -// [4/10/2012] -//========================================================================= -void -Sfmt::PeriodCertification() -{ - int inner = 0; - int i, j; - AZ::u32 work; - - for (i = 0; i < 4; i++) + //========================================================================= + // PeriodCertification + // [4/10/2012] + //========================================================================= + void Sfmt::PeriodCertification() { - inner ^= m_psfmt32[idxof(i)] & SfmtInternal::parity[i]; - } - for (i = 16; i > 0; i >>= 1) - { - inner ^= inner >> i; - } - inner &= 1; - /* check OK */ - if (inner == 1) - { - return; - } - /* check NG, and modification */ - for (i = 0; i < 4; i++) - { - work = 1; - for (j = 0; j < 32; j++) + int inner = 0; + int i, j; + AZ::u32 work; + + for (i = 0; i < 4; i++) + { + inner ^= m_psfmt32[idxof(i)] & SfmtInternal::parity[i]; + } + for (i = 16; i > 0; i >>= 1) + { + inner ^= inner >> i; + } + inner &= 1; + /* check OK */ + if (inner == 1) + { + return; + } + /* check NG, and modification */ + for (i = 0; i < 4; i++) { - if ((work & SfmtInternal::parity[i]) != 0) + work = 1; + for (j = 0; j < 32; j++) { - m_psfmt32[idxof(i)] ^= work; - return; + if ((work & SfmtInternal::parity[i]) != 0) + { + m_psfmt32[idxof(i)] ^= work; + return; + } + work = work << 1; } - work = work << 1; } } -} -//========================================================================= -// Rand32 -// [4/10/2012] -//========================================================================= -AZ::u32 Sfmt::Rand32() -{ - int index = m_index.fetch_add(1); - if (index >= SfmtInternal::N32) + //========================================================================= + // Rand32 + // [4/10/2012] + //========================================================================= + AZ::u32 Sfmt::Rand32() { - AZStd::lock_guard lock(m_generationMutex); - // if this thread is the one that sets m_index to 0, then this thread - // does the generation - index += 1; // compare against the result of fetch_add(1) above - if (m_index.compare_exchange_strong(index, 0)) + int index = m_index.fetch_add(1); + if (index >= SfmtInternal::N32) { - SfmtInternal::gen_rand_all(*this); + AZStd::lock_guard lock(m_generationMutex); + // if this thread is the one that sets m_index to 0, then this thread + // does the generation + index += 1; // compare against the result of fetch_add(1) above + if (m_index.compare_exchange_strong(index, 0)) + { + SfmtInternal::gen_rand_all(*this); + } + // try again, with the new table + return Rand32(); } - // try again, with the new table - return Rand32(); + return m_psfmt32[index]; } - return m_psfmt32[index]; -} - -//========================================================================= -// Rand64 -// [4/10/2012] -//========================================================================= -AZ::u64 Sfmt::Rand64() -{ - int index = m_index.fetch_add(2); - if (index >= (SfmtInternal::N32 - 1)) + + //========================================================================= + // Rand64 + // [4/10/2012] + //========================================================================= + AZ::u64 Sfmt::Rand64() { - AZStd::lock_guard lock(m_generationMutex); - // if this thread is the one that sets m_index to 0, then this thread - // does the generation - index += 2; // compare against the result of fetch_add(2) above - if (m_index.compare_exchange_strong(index, 0)) + int index = m_index.fetch_add(2); + if (index >= (SfmtInternal::N32 - 1)) { - SfmtInternal::gen_rand_all(*this); + AZStd::lock_guard lock(m_generationMutex); + // if this thread is the one that sets m_index to 0, then this thread + // does the generation + index += 2; // compare against the result of fetch_add(2) above + if (m_index.compare_exchange_strong(index, 0)) + { + SfmtInternal::gen_rand_all(*this); + } + // try again, with the new table + return Rand64(); } - // try again, with the new table - return Rand64(); + + AZ::u64 r; + r = m_psfmt64[index / 2]; + return r; } - AZ::u64 r; - r = m_psfmt64[index / 2]; - return r; -} - -//========================================================================= -// FillArray32 -// [4/10/2012] -//========================================================================= -void -Sfmt::FillArray32(AZ::u32* array, int size) -{ - AZ_MATH_ASSERT(m_index == SfmtInternal::N32, "Invalid m_index! Reinitialize!"); - AZ_MATH_ASSERT(size % 4 == 0, "Size must be multiple of 4!"); - AZ_MATH_ASSERT(size >= SfmtInternal::N32, "Size must be bigger than %d GetMinArray32Size()!", SfmtInternal::N32); - - SfmtInternal::gen_rand_array(*this, (SfmtInternal::w128_t*)array, size / 4); - m_index = SfmtInternal::N32; -} - -//========================================================================= -// FillArray64 -// [4/10/2012] -//========================================================================= -void -Sfmt::FillArray64(AZ::u64* array, int size) -{ - AZ_MATH_ASSERT(m_index == SfmtInternal::N32, "Invalid m_index! Reinitialize!"); - AZ_MATH_ASSERT(size % 4 == 0, "Size must be multiple of 4!"); - AZ_MATH_ASSERT(size >= SfmtInternal::N64, "Size must be bigger than %d GetMinArray64Size()!", SfmtInternal::N64); - - SfmtInternal::gen_rand_array(*this, (SfmtInternal::w128_t*)array, size / 2); - m_index = SfmtInternal::N32; -} - -//========================================================================= -// GetMinArray32Size -// [4/10/2012] -//========================================================================= -int -Sfmt::GetMinArray32Size() const -{ - return SfmtInternal::N32; -} - -//========================================================================= -// GetMinArray64Size -// [4/10/2012] -//========================================================================= -int -Sfmt::GetMinArray64Size() const -{ - return SfmtInternal::N64; -} + //========================================================================= + // FillArray32 + // [4/10/2012] + //========================================================================= + void Sfmt::FillArray32(AZ::u32* array, int size) + { + AZ_MATH_ASSERT(m_index == SfmtInternal::N32, "Invalid m_index! Reinitialize!"); + AZ_MATH_ASSERT(size % 4 == 0, "Size must be multiple of 4!"); + AZ_MATH_ASSERT(size >= SfmtInternal::N32, "Size must be bigger than %d GetMinArray32Size()!", SfmtInternal::N32); + + SfmtInternal::gen_rand_array(*this, (SfmtInternal::w128_t*)array, size / 4); + m_index = SfmtInternal::N32; + } + + //========================================================================= + // FillArray64 + // [4/10/2012] + //========================================================================= + void Sfmt::FillArray64(AZ::u64* array, int size) + { + AZ_MATH_ASSERT(m_index == SfmtInternal::N32, "Invalid m_index! Reinitialize!"); + AZ_MATH_ASSERT(size % 4 == 0, "Size must be multiple of 4!"); + AZ_MATH_ASSERT(size >= SfmtInternal::N64, "Size must be bigger than %d GetMinArray64Size()!", SfmtInternal::N64); + + SfmtInternal::gen_rand_array(*this, (SfmtInternal::w128_t*)array, size / 2); + m_index = SfmtInternal::N32; + } + + //========================================================================= + // GetMinArray32Size + // [4/10/2012] + //========================================================================= + int Sfmt::GetMinArray32Size() const + { + return SfmtInternal::N32; + } + + //========================================================================= + // GetMinArray64Size + // [4/10/2012] + //========================================================================= + int Sfmt::GetMinArray64Size() const + { + return SfmtInternal::N64; + } + +} // namespace AZ From ce709b99d04b77ae5134e8d1176d5a7e75041116 Mon Sep 17 00:00:00 2001 From: Mike Chang Date: Wed, 22 Dec 2021 14:58:31 -0800 Subject: [PATCH 199/399] Development dockerfile for Linux (#6532) This is the initial Dockerfile used for local development or for remote CI environments for Ubuntu. Build and test instructions are in the Dockerfile comments. Signed-off-by: Mike Chang --- .../build_node/Platform/Linux/Dockerfile | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 scripts/build/build_node/Platform/Linux/Dockerfile diff --git a/scripts/build/build_node/Platform/Linux/Dockerfile b/scripts/build/build_node/Platform/Linux/Dockerfile new file mode 100644 index 0000000000..0bbbcb3a5b --- /dev/null +++ b/scripts/build/build_node/Platform/Linux/Dockerfile @@ -0,0 +1,57 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# + +# This is a base Dockerfile to use for self-containing local or remote development environments +# +# Once docker is installed, build a local image with this command: +# `docker build /localDockerfilepath -t ubuntu-build:latest` +# +# To build using a local repo on disk, run this command: +# `docker run -it -v /localo3depath:/data/workspace/o3de -v /localbuildpath:/data/workspace/o3de/build -v /local3rdPartypath:/root/.o3de/3rdParty \ +# --name build-o3de -d ubuntu-build:latest /bin/sh -c 'cd /data/workspace/o3de && python/python.sh -u scripts/build/ci_build.py --platform Linux --type profile'` +# +# Attach to the running build to interact or view logs using this command: +# `docker attach build-o3de` + +FROM ubuntu:20.04 + +WORKDIR /data/workspace + +# Initilize apt cache +RUN apt-get clean && apt-get update + +# Setup time zone and locale data (necessary for SSL and HTTPS packages) +RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata locales keyboard-configuration + +RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ + dpkg-reconfigure --frontend=noninteractive locales && \ + update-locale LANG=en_US.UTF-8 + +ENV LANG=en_US.UTF-8 + +# Install common tools +RUN apt-get -y install tar sudo less vim lsof firewalld net-tools pciutils \ + file wget kmod xz-utils ca-certificates binutils kbd \ + python3-pip bind9-utils jq bc unzip git git-lfs lsb-release \ + software-properties-common + +# Install build and development tools +RUN git clone --no-checkout https://github.com/o3de/o3de.git .o3de && \ + cd .o3de && \ + git sparse-checkout init --cone && \ + git sparse-checkout set scripts/build/build_node && \ + cd scripts/build/build_node/Platform/Linux && \ + ./install-ubuntu.sh + +# Install supported version of cmake if build tool installation runs into issues +ENV CMAKE_VER=3.21.1-0kitware1ubuntu20.04.1 +RUN $(cmake --version) || apt-get -y install cmake=${CMAKE_VER} cmake-data=${CMAKE_VER} + +# Symlink clang version to non-versioned clang and set cc to clang +RUN find /usr/bin/ -name clang* | sed -E 's/^(\/usr\/bin\/.*)(\-[0-9]*)$/ln -s -v \1\2 \1/' | xargs -d '\n' -n 1 bash -c && \ + update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 && \ + update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100 From 227eea2cf6a35e1d5b6395c5b536d7ee95031957 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Thu, 23 Dec 2021 11:53:01 -0600 Subject: [PATCH 200/399] Restore BusDisconnect() that got accidentally removed on a recent commit. (#6557) Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp index a35fa50e65..dbaae0118a 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp @@ -251,6 +251,7 @@ namespace Terrain SurfaceData::SurfaceDataSystemRequestBus::Broadcast( &SurfaceData::SurfaceDataSystemRequestBus::Events::UnregisterSurfaceDataProvider, m_providerHandle); m_providerHandle = SurfaceData::InvalidSurfaceDataRegistryHandle; + SurfaceData::SurfaceDataProviderRequestBus::Handler::BusDisconnect(); } else { From 17f928cddd720951133164238ac5b429491b993d Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Thu, 23 Dec 2021 11:53:17 -0600 Subject: [PATCH 201/399] Removed chatty profile markers. (#6556) * Removed chatty profile markers. These 4 markers removed tens of thousands of events, which reduced an example capture from 1685 ms to 1614 ms and made it far more readable. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Restored one marker Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h | 1 - Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp | 2 -- .../RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp | 2 -- 3 files changed, 5 deletions(-) diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h index 580ca97b46..4a038276d1 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h @@ -100,7 +100,6 @@ namespace AZ template typename MemorySubAllocator::memory_allocation MemorySubAllocator::Allocate(size_t sizeInBytes, size_t alignmentInBytes) { - AZ_PROFILE_FUNCTION(RHI); if (RHI::AlignUp(sizeInBytes, alignmentInBytes) > m_descriptor.m_capacityInBytes) { return memory_allocation(); diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp index c1a7156362..7cca24d3de 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp @@ -57,8 +57,6 @@ namespace AZ CpuVirtualAddress MemoryView::Map(RHI::HostMemoryAccess hostAccess) const { - AZ_PROFILE_FUNCTION(RHI); - CpuVirtualAddress cpuAddress = nullptr; D3D12_RANGE readRange = {}; if (hostAccess == RHI::HostMemoryAccess::Read) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp index 7e43fba7a3..b927e864fc 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp @@ -74,8 +74,6 @@ namespace AZ RHI::ResultCode ShaderResourceGroup::Init(ShaderAsset& shaderAsset, const SupervariantIndex& supervariantIndex, const AZ::Name& srgName) { - AZ_PROFILE_FUNCTION(RPI); - const auto& lay = shaderAsset.FindShaderResourceGroupLayout(srgName, supervariantIndex); m_layout = lay.get(); From c2373f1f5965b490daa626dbf551782913270f53 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Thu, 23 Dec 2021 20:12:27 +0000 Subject: [PATCH 202/399] Fix: search results not expanded when searching for .lua files (#6211) Signed-off-by: T.J. McGrath-Daly Co-authored-by: Tobias Alexander Franke --- Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp b/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp index c05e11f575..65008f08bb 100644 --- a/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp +++ b/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp @@ -372,9 +372,17 @@ namespace LUAEditor StringFilter* stringFilter = new StringFilter(); stringFilter->SetFilterPropagation(AssetTypeFilter::PropagateDirection::Up); - connect(m_gui->m_assetBrowserSearchWidget, &AzQtComponents::FilteredSearchWidget::TextFilterChanged, this, [stringFilter](const QString& newString) + connect(m_gui->m_assetBrowserSearchWidget, &AzQtComponents::FilteredSearchWidget::TextFilterChanged, this, [&, stringFilter](const QString& newString) { stringFilter->SetFilterString(newString); + if (newString.isEmpty()) + { + m_gui->m_assetBrowserTreeView->collapseAll(); + } + else + { + m_gui->m_assetBrowserTreeView->expandAll(); + } }); // Construct the final filter where they are all and'd together From f1a1cb3ec0614b6bba9a822ee936e0006564c5a6 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Thu, 23 Dec 2021 20:12:40 +0000 Subject: [PATCH 203/399] Fix: Lua directory empty and always loading in editor (#6207) * Fix: Lua directory empty and always loading in editor Signed-off-by: T.J. McGrath-Daly * fixed naming convention errors Signed-off-by: T.J. McGrath-Daly * Tidy up Signed-off-by: T.J. McGrath-Daly Co-authored-by: Tobias Alexander Franke --- Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp b/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp index 65008f08bb..776e290042 100644 --- a/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp +++ b/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp @@ -346,7 +346,11 @@ namespace LUAEditor { auto selectedAsset = selectedAssets.front(); const AZStd::string filePath = selectedAsset->GetFullPath(); - EBUS_EVENT(Context_DocumentManagement::Bus, OnLoadDocument, filePath, true); + auto entryType = selectedAsset->GetEntryType(); + if (entryType == AzToolsFramework::AssetBrowser::AssetBrowserEntry::AssetEntryType::Source) + { + EBUS_EVENT(Context_DocumentManagement::Bus, OnLoadDocument, filePath, true); + } } }); } From 3e9b76cdeeb82b3eef98d62908ef6693780b7bf6 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Thu, 23 Dec 2021 14:16:22 -0600 Subject: [PATCH 204/399] Image Gradient: Switch to shared_mutex (#6558) * Improve lock contention by switching to a shared_lock. ImageGradient is accessed via a many-reader-one-writer pattern, so a shared_lock causes less contention in the common "read" case. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Remove chatty profile marker. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Code/Include/GradientSignal/GradientSampler.h | 2 -- .../Source/Components/ImageGradientComponent.cpp | 14 +++++++------- .../Source/Components/ImageGradientComponent.h | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h index c06265fb24..1dd7d44376 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h @@ -88,8 +88,6 @@ namespace GradientSignal inline float GradientSampler::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(Entity); - if (m_opacity <= 0.0f || !m_gradientId.IsValid()) { return 0.0f; diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp index 021e083ea6..065f0ace0f 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp @@ -135,7 +135,7 @@ namespace GradientSignal GradientRequestBus::Handler::BusConnect(GetEntityId()); AZ::Data::AssetBus::Handler::BusConnect(m_configuration.m_imageAsset.GetId()); - AZStd::lock_guard imageLock(m_imageMutex); + AZStd::unique_lock imageLock(m_imageMutex); m_configuration.m_imageAsset.QueueLoad(); } @@ -147,7 +147,7 @@ namespace GradientSignal m_dependencyMonitor.Reset(); - AZStd::lock_guard imageLock(m_imageMutex); + AZStd::unique_lock imageLock(m_imageMutex); m_configuration.m_imageAsset.Release(); } @@ -173,19 +173,19 @@ namespace GradientSignal void ImageGradientComponent::OnAssetReady(AZ::Data::Asset asset) { - AZStd::lock_guard imageLock(m_imageMutex); + AZStd::unique_lock imageLock(m_imageMutex); m_configuration.m_imageAsset = asset; } void ImageGradientComponent::OnAssetMoved(AZ::Data::Asset asset, [[maybe_unused]] void* oldDataPointer) { - AZStd::lock_guard imageLock(m_imageMutex); + AZStd::unique_lock imageLock(m_imageMutex); m_configuration.m_imageAsset = asset; } void ImageGradientComponent::OnAssetReloaded(AZ::Data::Asset asset) { - AZStd::lock_guard imageLock(m_imageMutex); + AZStd::unique_lock imageLock(m_imageMutex); m_configuration.m_imageAsset = asset; } @@ -200,7 +200,7 @@ namespace GradientSignal if (!wasPointRejected) { - AZStd::lock_guard imageLock(m_imageMutex); + AZStd::shared_lock imageLock(m_imageMutex); return GetValueFromImageAsset(m_configuration.m_imageAsset, uvw, m_configuration.m_tilingX, m_configuration.m_tilingY, 0.0f); } @@ -223,7 +223,7 @@ namespace GradientSignal AZ::Data::AssetBus::Handler::BusDisconnect(m_configuration.m_imageAsset.GetId()); { - AZStd::lock_guard imageLock(m_imageMutex); + AZStd::unique_lock imageLock(m_imageMutex); m_configuration.m_imageAsset = AZ::Data::AssetManager::Instance().FindOrCreateAsset(assetId, azrtti_typeid(), m_configuration.m_imageAsset.GetAutoLoadBehavior()); } diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h index 5033c44735..e73c8d0c4a 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h @@ -94,6 +94,6 @@ namespace GradientSignal private: ImageGradientConfig m_configuration; LmbrCentral::DependencyMonitor m_dependencyMonitor; - mutable AZStd::recursive_mutex m_imageMutex; + mutable AZStd::shared_mutex m_imageMutex; }; } From 6660c365b99d10037c9a32b5abc048ca98cbbc25 Mon Sep 17 00:00:00 2001 From: Jeremy Ong Date: Thu, 23 Dec 2021 16:25:44 -0700 Subject: [PATCH 205/399] Disambiguate null interface case In some cases, the interface being queried may be persistently nullptr (e.g. a gem isn't active, or a feature was disabled by a cvar). In this case, querying the interface would always enter the writer-lock branch with existing code because nullptr was synonmous with "we haven't queried for this variable yet." This PR adds an additional state variable that is set when s_instance is assigned to, so that after the variable is queried and found to be null, future queries can enter the read-lock branch. Signed-off-by: Jeremy Ong --- .../Framework/AzCore/AzCore/Interface/Interface.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Interface/Interface.h b/Code/Framework/AzCore/AzCore/Interface/Interface.h index 8664e2905f..8f72cfa109 100644 --- a/Code/Framework/AzCore/AzCore/Interface/Interface.h +++ b/Code/Framework/AzCore/AzCore/Interface/Interface.h @@ -109,6 +109,7 @@ namespace AZ */ static EnvironmentVariable s_instance; static AZStd::shared_mutex s_mutex; + static bool s_instanceAssigned; }; template @@ -117,6 +118,9 @@ namespace AZ template AZStd::shared_mutex Interface::s_mutex; + template + bool Interface::s_instanceAssigned; + template void Interface::Register(T* type) { @@ -135,18 +139,19 @@ namespace AZ AZStd::unique_lock lock(s_mutex); s_instance = Environment::CreateVariable(GetVariableName()); s_instance.Get() = type; + s_instanceAssigned = true; } template void Interface::Unregister(T* type) { - if (!s_instance || !s_instance.Get()) + if (!s_instanceAssigned) { AZ_Assert(false, "Interface '%s' not registered on this module!", AzTypeInfo::Name()); return; } - if (s_instance.Get() != type) + if (s_instance && s_instance.Get() != type) { AZ_Assert(false, "Interface '%s' is not the same instance that was registered! [Expected '%p', Found '%p']", AzTypeInfo::Name(), type, s_instance.Get()); return; @@ -156,6 +161,7 @@ namespace AZ AZStd::unique_lock lock(s_mutex); *s_instance = nullptr; s_instance.Reset(); + s_instanceAssigned = false; } template @@ -165,9 +171,9 @@ namespace AZ // This is the fast path which won't block. { AZStd::shared_lock lock(s_mutex); - if (s_instance) + if (s_instanceAssigned) { - return s_instance.Get(); + return s_instance ? s_instance.Get() : nullptr; } } @@ -175,6 +181,7 @@ namespace AZ // take the full lock and request it. AZStd::unique_lock lock(s_mutex); s_instance = Environment::FindVariable(GetVariableName()); + s_instanceAssigned = true; return s_instance ? s_instance.Get() : nullptr; } From 5b76d47e17b3ab7d80cfecc5fbfb85a03558e302 Mon Sep 17 00:00:00 2001 From: Jeremy Ong Date: Thu, 23 Dec 2021 17:15:49 -0700 Subject: [PATCH 206/399] Remove time tests that relied on main-thread sleeps Sleeping in tests and attempting to rely on fine-grained measurements to check code validity is intrinsically brittle. Wall-clock time is unreliable in an environment where tests are run under a hypervisor that may choose to suspend your VM at any point, or in situations where the OS cannot schedule your thread in time. The correct way to reintroduce these tests in the future is provide an override for the timestamp queries that can be injected in the test environment to control the wall time deterministically. Signed-off-by: Jeremy Ong --- .../Framework/AzCore/Tests/Time/TimeTests.cpp | 188 ------------------ 1 file changed, 188 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Time/TimeTests.cpp b/Code/Framework/AzCore/Tests/Time/TimeTests.cpp index 446368a8ca..164e72343b 100644 --- a/Code/Framework/AzCore/Tests/Time/TimeTests.cpp +++ b/Code/Framework/AzCore/Tests/Time/TimeTests.cpp @@ -76,192 +76,4 @@ namespace UnitTest int64_t delta = static_cast(timeMs) - static_cast(timeUsToMs); EXPECT_LT(abs(delta), 1); } - - class TimeSystemTests : public AllocatorsTestFixture - { - public: - void SetUp() override - { - SetupAllocator(); - m_controlTime = static_cast(AZStd::GetTimeNowMicroSecond()); - m_timeSystem = AZStd::make_unique(); - } - - void TearDown() override - { - m_controlTime = AZ::Time::ZeroTimeUs; - m_timeSystem.reset(); - TeardownAllocator(); - } - - AZ::TimeUs GetDiff(AZ::TimeUs time1, AZ::TimeUs time2) const - { - // AZ::TimeUs is unsigned so make sure to not underflow. - return time1 > time2 ? time1 - time2 : time2 - time1; - } - - AZ::TimeUs m_controlTime; - AZStd::unique_ptr m_timeSystem; - }; - - TEST_F(TimeSystemTests, GetRealElapsedTimeUs) - { - // sleep for a bit to advance time. - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); - - // find the delta for the control and from GetRealElapsedTimeUs - const AZ::TimeUs baseline = static_cast(AZStd::GetTimeNowMicroSecond()) - m_controlTime; - const AZ::TimeUs elapsedTime = m_timeSystem->GetRealElapsedTimeUs(); - - const AZ::TimeUs diff = GetDiff(baseline, elapsedTime); - - // elapsedTime should be within 10 microseconds from baseline. - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - } - - TEST_F(TimeSystemTests, GetElapsedTimeUs) - { - // sleep for a bit to advance time. - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); - - // find the delta for the control and from GetElapsedTimeUs - const AZ::TimeUs baseline = static_cast(AZStd::GetTimeNowMicroSecond()) - m_controlTime; - const AZ::TimeUs elapsedTime = m_timeSystem->GetElapsedTimeUs(); - - const AZ::TimeUs diff = GetDiff(baseline, elapsedTime); - - // elapsedTime should be within 10 microseconds from baseline. - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - } - - TEST_F(TimeSystemTests, ElapsedTimeScales) - { - // slow down 'time' - m_timeSystem->SetSimulationTickScale(0.5f); - - // sleep for a bit to advance time. - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); - - // find the delta for the control and from GetElapsedTimeUs - const AZ::TimeUs baseline = static_cast(AZStd::GetTimeNowMicroSecond()) - m_controlTime; - const AZ::TimeUs elapsedTime = m_timeSystem->GetElapsedTimeUs(); - const AZ::TimeUs halfBaseline = (baseline / AZ::TimeUs{ 2 }); - - // elapsedTime should be about half of the control. - const AZ::TimeUs diff = GetDiff(halfBaseline, elapsedTime); - - // elapsedTime should be within 10 microseconds from baseline. - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - - // reset time scale - m_timeSystem->SetSimulationTickScale(1.0f); - } - - TEST_F(TimeSystemTests, AdvanceTickDeltaTimes) - { - // advance the tick delta to get a clean base. - m_timeSystem->AdvanceTickDeltaTimes(); - const AZ::TimeUs baselineStart = static_cast(AZStd::GetTimeNowMicroSecond()); - - // sleep for a bit to advance time. - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); - - // advance the tick delta. - const AZ::TimeUs delta = m_timeSystem->AdvanceTickDeltaTimes(); - const AZ::TimeUs baselineDelta = static_cast(AZStd::GetTimeNowMicroSecond()) - baselineStart; - - // the delta should be close to the baselineDelta. - const AZ::TimeUs diff = GetDiff(delta, baselineDelta); - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - } - - TEST_F(TimeSystemTests, SimulationAndRealTickDeltaTimesWithNoTimeScale) - { - // advance the tick delta to get a clean base. - m_timeSystem->AdvanceTickDeltaTimes(); - const AZ::TimeUs baselineStart = static_cast(AZStd::GetTimeNowMicroSecond()); - - // sleep for a bit to advance time. - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); - - // advance the tick delta. - const AZ::TimeUs delta = m_timeSystem->AdvanceTickDeltaTimes(); - const AZ::TimeUs baselineDelta = static_cast(AZStd::GetTimeNowMicroSecond()) - baselineStart; - - // the delta should be close to the baselineDelta. - AZ::TimeUs diff = GetDiff(delta, baselineDelta); - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - - // the delta should be the same as GetSimulationTickDeltaTimeUs and near GetRealTickDeltaTimeUs - const AZ::TimeUs simDeltaTime = m_timeSystem->GetSimulationTickDeltaTimeUs(); - EXPECT_EQ(delta, simDeltaTime); - - const AZ::TimeUs realDeltaTime = m_timeSystem->GetRealTickDeltaTimeUs(); - diff = GetDiff(delta, realDeltaTime); - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - } - - TEST_F(TimeSystemTests, SimulationAndRealTickDeltaTimesWithTimeScale) - { - // advance the tick delta to get a clean base. - m_timeSystem->AdvanceTickDeltaTimes(); - const AZ::TimeUs baselineStart = static_cast(AZStd::GetTimeNowMicroSecond()); - - // slow down 'time'; - m_timeSystem->SetSimulationTickScale(0.5f); - - // sleep for a bit to advance time. - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); - - // advance the tick delta. - const AZ::TimeUs delta = m_timeSystem->AdvanceTickDeltaTimes(); - const AZ::TimeUs baselineDelta = static_cast(AZStd::GetTimeNowMicroSecond()) - baselineStart; - const AZ::TimeUs halfBaselineDelta = (baselineDelta / AZ::TimeUs{ 2 }); - - // the delta should be half the baselineDelta - AZ::TimeUs diff = GetDiff(delta, halfBaselineDelta); - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - - // the delta should be the same as GetSimulationTickDeltaTimeUs - const AZ::TimeUs simDeltaTime = m_timeSystem->GetSimulationTickDeltaTimeUs(); - EXPECT_EQ(delta, simDeltaTime); - - // the delta should be near half the GetRealTickDeltaTimeUs - const AZ::TimeUs realDeltaTime = m_timeSystem->GetRealTickDeltaTimeUs(); - const AZ::TimeUs halfRealDeltaTime = (realDeltaTime / AZ::TimeUs{ 2 }); - diff = GetDiff(delta, halfRealDeltaTime); - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - - // reset time scale - m_timeSystem->SetSimulationTickScale(1.0f); - } - - TEST_F(TimeSystemTests, SimulationTickDeltaOverride) - { - // advance the tick delta to get a clean base. - m_timeSystem->AdvanceTickDeltaTimes(); - const AZ::TimeUs baselineStart = static_cast(AZStd::GetTimeNowMicroSecond()); - - // set the tick delta override - const AZ::TimeMs tickOverride = AZ::TimeMs{ 3462 }; - m_timeSystem->SetSimulationTickDeltaOverride(tickOverride); - - // sleep for a bit to advance time. - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); - - // advance the tick delta. - const AZ::TimeUs delta = m_timeSystem->AdvanceTickDeltaTimes(); - const AZ::TimeUs baselineDelta = static_cast(AZStd::GetTimeNowMicroSecond()) - baselineStart; - - // the delta should be equal to the tickOverride - EXPECT_EQ(delta, AZ::TimeMsToUs(tickOverride)); - - // real tick delta should be near the baselineDelta - const AZ::TimeUs realDeltaTime = m_timeSystem->GetRealTickDeltaTimeUs(); - const AZ::TimeUs diff = GetDiff(realDeltaTime, baselineDelta); - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - - // reset the tick delta override - m_timeSystem->SetSimulationTickDeltaOverride(AZ::Time::ZeroTimeMs); - } } // namespace UnitTest From 0b78c377f8baa7941aad3094b513d069690168a4 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 27 Dec 2021 09:39:04 -0800 Subject: [PATCH 207/399] Minor: py method comment added Signed-off-by: Gene Walters --- .../EditorPythonTestTools/editor_python_test_tools/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py index 2ba692d89b..1674fba7be 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py @@ -138,7 +138,7 @@ class TestHelper: :param window: The log's window name. For example, logs printed via script-canvas use the "Script" window. :param unexpected_line: The log message we're hoping to not find. :param print_infos: A list of PrintInfos collected by Tracer to search. Example options: your_tracer.warnings, your_tracer.errors, your_tracer.asserts, or your_tracer.prints - :param time_out: The total amount of time to wait before giving up looking for the unexpected line. + :param time_out: The total amount of time to wait before giving up looking for the unexpected line. If time runs out and we don't see the unexpected line then report a success. :return: No return value, but if the unexpected message is found, a failed critical result is reported; otherwise success. """ From 451ebf2691a736d53331c35ed876984db8b1cf41 Mon Sep 17 00:00:00 2001 From: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> Date: Mon, 27 Dec 2021 12:32:24 -0800 Subject: [PATCH 208/399] Reflow Project Tiles Everytime They Are Updated Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> --- Code/Tools/ProjectManager/Source/ProjectsScreen.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp index 7e5675918d..15a6f22d85 100644 --- a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp @@ -284,13 +284,14 @@ namespace O3DE::ProjectManager { currentButton = projectButtonIter.value(); currentButton->RestoreDefaultState(); - m_projectsFlowLayout->addWidget(currentButton); } } // Check whether project manager has successfully built the project if (currentButton) { + m_projectsFlowLayout->addWidget(currentButton); + bool projectBuiltSuccessfully = false; SettingsInterface::Get()->GetProjectBuiltSuccessfully(projectBuiltSuccessfully, project); @@ -341,6 +342,7 @@ namespace O3DE::ProjectManager } m_stack->setCurrentWidget(m_projectsContent); + m_projectsFlowLayout->update(); } ProjectManagerScreen ProjectsScreen::GetScreenEnum() @@ -399,7 +401,6 @@ namespace O3DE::ProjectManager { if (ProjectUtils::AddProjectDialog(this)) { - ResetProjectsContent(); emit ChangeScreenRequest(ProjectManagerScreen::Projects); } } @@ -490,7 +491,6 @@ namespace O3DE::ProjectManager // Open file dialog and choose location for copied project then register copy with O3DE if (ProjectUtils::CopyProjectDialog(projectInfo.m_path, newProjectInfo, this)) { - ResetProjectsContent(); emit NotifyBuildProject(newProjectInfo); emit ChangeScreenRequest(ProjectManagerScreen::Projects); } @@ -503,7 +503,6 @@ namespace O3DE::ProjectManager // Unregister Project from O3DE and reload projects if (ProjectUtils::UnregisterProject(projectPath)) { - ResetProjectsContent(); emit ChangeScreenRequest(ProjectManagerScreen::Projects); } } From 81b2841bd2b75137b6e7b7ce6618d3a4c3245e3e Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Tue, 28 Dec 2021 09:16:48 -0800 Subject: [PATCH 209/399] chore: correct text for assertion Signed-off-by: Michael Pollind --- Code/Framework/AzCore/AzCore/Math/Plane.inl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Math/Plane.inl b/Code/Framework/AzCore/AzCore/Math/Plane.inl index bade6f1775..795ee8b4bc 100644 --- a/Code/Framework/AzCore/AzCore/Math/Plane.inl +++ b/Code/Framework/AzCore/AzCore/Math/Plane.inl @@ -19,14 +19,14 @@ namespace AZ AZ_MATH_INLINE Plane Plane::CreateFromNormalAndPoint(const Vector3& normal, const Vector3& point) { - AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not a normalized"); + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); return Plane(Simd::Vec4::ConstructPlane(normal.GetSimdValue(), point.GetSimdValue())); } AZ_MATH_INLINE Plane Plane::CreateFromNormalAndDistance(const Vector3& normal, float dist) { - AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not a normalized"); + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); Plane result; result.Set(normal, dist); return result; @@ -35,7 +35,7 @@ namespace AZ AZ_MATH_INLINE Plane Plane::CreateFromCoefficients(const float a, const float b, const float c, const float d) { - AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is not normalized"); + AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is notormalized"); Plane result; result.Set(a, b, c, d); return result; @@ -68,21 +68,21 @@ namespace AZ AZ_MATH_INLINE void Plane::Set(const Vector3& normal, float d) { - AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is notormalized"); m_plane.Set(normal, d); } AZ_MATH_INLINE void Plane::Set(float a, float b, float c, float d) { - AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is not normalized"); + AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is notormalized"); m_plane.Set(a, b, c, d); } AZ_MATH_INLINE void Plane::SetNormal(const Vector3& normal) { - AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is notormalized"); m_plane.SetX(normal.GetX()); m_plane.SetY(normal.GetY()); m_plane.SetZ(normal.GetZ()); From 49dd17f410a5ffefb55c1484e8a1bec9b257362e Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Wed, 29 Dec 2021 11:25:17 -0600 Subject: [PATCH 210/399] Optimized Terrain Debugger Wireframe rendering (#6572) * Optimized wireframe drawing. As a part of rearranging the code to make use of the upcoming ProcessHeightsFromRegion, the number of calls to GetHeight could be reduced, dropping the refresh time in my test case from 2550 ms to 1068 ms. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Change refresh to only happen on wireframe draws. This helps ensure that multiple data changes in a single frame don't cause multiple refreshes, and prevents us from taking a refresh penalty when the wireframe isn't being drawn at all. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Change debugger to update wireframes incrementally. This works by having a fixed NxN grid of sectors. The camera is always considered as being in the center of the grid, so anytime the camera's grid square changes, only a subset of sectors are updated to have the new wireframe data. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Bugfix - sector vertex count was 4x too high. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Bugfixes & comments. Fixed initial "mark dirty" refresh - the dirty region Z value needed to be ignored. Added copious comments for the math & logic, and simplified some of the math. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Small update to comment for better readability. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Addressed PR feedback. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../TerrainWorldDebuggerComponent.cpp | 364 +++++++++++------- .../TerrainWorldDebuggerComponent.h | 25 +- 2 files changed, 243 insertions(+), 146 deletions(-) diff --git a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp index 79fd5509f2..8daccd7d61 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp @@ -90,13 +90,28 @@ namespace Terrain void TerrainWorldDebuggerComponent::Activate() { - m_wireframeBounds = AZ::Aabb::CreateNull(); + // Given the AuxGeom vertex limits, MaxSectorsToDraw is the max number of wireframe sectors we can draw without exceeding the + // limits. Since we want an N x N sector grid, take the square root to get the number of sectors in each direction. + m_sectorGridSize = aznumeric_cast(sqrtf(MaxSectorsToDraw)); + + // We're always going to keep the camera in the center square, so "round" downwards to an odd number of sectors if we currently + // have an even number. (If we added a sector, we'll go above the max sectors that we can draw with our vertex limits) + m_sectorGridSize = (m_sectorGridSize & 0x01) ? m_sectorGridSize : m_sectorGridSize - 1; + + // Create our fixed set of sectors that we'll draw. By default, they'll all be constructed as dirty, so they'll get refreshed + // the first time we try to draw them. (If wireframe drawing is disabled, we'll never refresh them) + m_wireframeSectors.clear(); + m_wireframeSectors.resize(m_sectorGridSize * m_sectorGridSize); AzFramework::EntityDebugDisplayEventBus::Handler::BusConnect(GetEntityId()); AzFramework::BoundsRequestBus::Handler::BusConnect(GetEntityId()); AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusConnect(); - RefreshCachedWireframeGrid(AZ::Aabb::CreateNull()); + // Any time the world bounds potentially changes, notify that the terrain debugger's visibility bounds also changed. + // Otherwise, DisplayEntityViewport() won't get called at the appropriate times, since the visibility could get incorrectly + // culled out. + AzFramework::IEntityBoundsUnionRequestBus::Broadcast( + &AzFramework::IEntityBoundsUnionRequestBus::Events::RefreshEntityLocalBoundsUnion, GetEntityId()); } void TerrainWorldDebuggerComponent::Deactivate() @@ -105,7 +120,6 @@ namespace Terrain AzFramework::BoundsRequestBus::Handler::BusDisconnect(); AzFramework::EntityDebugDisplayEventBus::Handler::BusDisconnect(); - m_wireframeBounds = AZ::Aabb::CreateNull(); m_wireframeSectors.clear(); } @@ -144,170 +158,239 @@ namespace Terrain return GetWorldBounds(); } - void TerrainWorldDebuggerComponent::DisplayEntityViewport( - const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) + void TerrainWorldDebuggerComponent::MarkDirtySectors(const AZ::Aabb& dirtyRegion) { - // Draw a wireframe box around the entire terrain world bounds - if (m_configuration.m_drawWorldBounds) + // Create a 2D version of dirtyRegion that has Z set to min/max float values, so that we can just check for XY overlap with + // each sector. + const AZ::Aabb dirtyRegion2D = AZ::Aabb::CreateFromMinMaxValues( + dirtyRegion.GetMin().GetX(), dirtyRegion.GetMin().GetY(), AZStd::numeric_limits::lowest(), + dirtyRegion.GetMax().GetX(), dirtyRegion.GetMax().GetY(), AZStd::numeric_limits::max()); + + // For each sector that overlaps the dirty region (or all of them if the region is invalid), mark them as dirty so that + // they'll get refreshed the next time we need to draw them. + for (auto& sector : m_wireframeSectors) { - AZ::Color outlineColor(1.0f, 0.0f, 0.0f, 1.0f); - AZ::Aabb aabb = GetWorldBounds(); + if (!dirtyRegion2D.IsValid() || dirtyRegion2D.Overlaps(sector.m_aabb)) + { + sector.m_isDirty = true; + } + } + } - debugDisplay.SetColor(outlineColor); - debugDisplay.DrawWireBox(aabb.GetMin(), aabb.GetMax()); + void TerrainWorldDebuggerComponent::DrawWorldBounds(AzFramework::DebugDisplayRequests& debugDisplay) + { + if (!m_configuration.m_drawWorldBounds) + { + return; } - // Draw a wireframe representation of the terrain surface - if (m_configuration.m_drawWireframe && !m_wireframeSectors.empty()) + // Draw a wireframe box around the entire terrain world bounds + AZ::Color outlineColor(1.0f, 0.0f, 0.0f, 1.0f); + AZ::Aabb aabb = GetWorldBounds(); + + debugDisplay.SetColor(outlineColor); + debugDisplay.DrawWireBox(aabb.GetMin(), aabb.GetMax()); + } + + void TerrainWorldDebuggerComponent::DrawWireframe( + const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) + { + AZ_PROFILE_FUNCTION(Entity); + + if (!m_configuration.m_drawWireframe) { - // Start by assuming we'll draw the entire world. - AZ::Aabb drawingAabb = GetWorldBounds(); + return; + } - // Assuming we can get the camera, reduce the drawing bounds to a fixed distance around the camera. - if (auto viewportContextRequests = AZ::RPI::ViewportContextRequests::Get(); viewportContextRequests) - { - // Get the current camera position. - AZ::RPI::ViewportContextPtr viewportContext = viewportContextRequests->GetViewportContextById(viewportInfo.m_viewportId); - AZ::Vector3 cameraPos = viewportContext->GetCameraTransform().GetTranslation(); + /* This draws a wireframe centered on the camera that extends out to a certain distance at all times. To reduce the amount of + * recalculations we need to do on each camera movement, we divide the world into a conceptual grid of sectors, where each sector + * contains a fixed number of terrain height points. So for example, if the terrain has height data at 1 m spacing, the sectors + * might be 10 m x 10 m in size. If the height data is spaced at 0.5 m, the sectors might be 5 m x 5 m in size. The wireframe + * draws N x N sectors centered around the camera, as determined by m_sectorGridSize. So a gridSize of 7 with a sector size of + * 10 m means that we'll be drawing 7 x 7 sectors, or 70 m x 70 m, centered around the camera. Each time the camera moves into + * a new sector, we refresh the changed sectors before drawing them. + * + * The only tricky bit to this design is the way the sectors are stored and indexed. They're stored in a single vector as NxN + * entries, so they would normally be indexed as (y * N) + x. Since we want this to be centered on the camera, the easy answer + * would be to take the camera position - (N / 2) (since we're centering) as the relative offset to the first entry. But this + * would mean that the entire set of entries would change every time we move the camera. For example, if we had 5 entries, + * they might map to 0-4, 1-5, 2-6, 3-7, etc as the camera moves. + * + * Instead, we use mod (%) to rotate our indices around, so it would go (0 1 2 3 4), (5 1 2 3 4), (5 6 2 3 4), (5 6 7 3 4), etc + * as the camera moves. For negative entries, we rotate the indices in reverse, so that we get results like (0 1 2 3 4), + * (0 1 2 3 -1), (0 1 2 -2 -1), (0 1 -3 -2 -1), etc. This way we always have the correct range of sectors, and sectors that have + * remained visible are left alone and don't need to be updated again. + */ + + // Get the terrain world bounds + AZ::Aabb worldBounds = GetWorldBounds(); + float worldMinZ = worldBounds.GetMin().GetZ(); - // Determine how far to draw in each direction in world space based on our MaxSectorsToDraw - AZ::Vector2 queryResolution = AZ::Vector2(1.0f); - AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - queryResolution, &AzFramework::Terrain::TerrainDataRequests::GetTerrainHeightQueryResolution); - AZ::Vector3 viewDistance( - queryResolution.GetX() * SectorSizeInGridPoints * sqrtf(MaxSectorsToDraw), - queryResolution.GetY() * SectorSizeInGridPoints * sqrtf(MaxSectorsToDraw), - 0.0f); - - // Create an AABB around the camera based on how far we want to be able to draw in each direction and clamp the - // drawing AABB to it. - AZ::Aabb cameraAabb = AZ::Aabb::CreateFromMinMax( - AZ::Vector3( - cameraPos.GetX() - viewDistance.GetX(), cameraPos.GetY() - viewDistance.GetY(), drawingAabb.GetMin().GetZ()), - AZ::Vector3( - cameraPos.GetX() + viewDistance.GetX(), cameraPos.GetY() + viewDistance.GetY(), drawingAabb.GetMin().GetZ())); - drawingAabb.Clamp(cameraAabb); - } + // Get the terrain height data resolution + AZ::Vector2 heightDataResolution = AZ::Vector2(1.0f); + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + heightDataResolution, &AzFramework::Terrain::TerrainDataRequests::GetTerrainHeightQueryResolution); + + // Get the size of a wireframe sector in world space + const AZ::Vector2 sectorSize = heightDataResolution * SectorSizeInGridPoints; - // For each sector, if it appears within our view distance, draw it. - for (auto& sector : m_wireframeSectors) + // Try to get the current camera position, or default to (0,0) if we can't. + AZ::Vector3 cameraPos = AZ::Vector3::CreateZero(); + if (auto viewportContextRequests = AZ::RPI::ViewportContextRequests::Get(); viewportContextRequests) + { + AZ::RPI::ViewportContextPtr viewportContext = viewportContextRequests->GetViewportContextById(viewportInfo.m_viewportId); + cameraPos = viewportContext->GetCameraTransform().GetTranslation(); + } + + // Convert our camera position to a wireframe grid sector. We first convert from world space to sector space by dividing by + // sectorSize, so that integer values are sectors, and fractional values are the distance within the sector. Then we get the + // floor, so that we consistently get the next lowest integer - i.e. 2.3 -> 2, and -2.3 -> -3. This gives us consistent behavior + // across both positive and negative positions. + AZ::Vector2 gridPosition = AZ::Vector2(cameraPos.GetX(), cameraPos.GetY()) / sectorSize; + int32_t cameraSectorX = aznumeric_cast(gridPosition.GetFloor().GetX()); + int32_t cameraSectorY = aznumeric_cast(gridPosition.GetFloor().GetY()); + + // Loop through each sector that we *want* to draw, based on camera position. If the current sector at that index in + // m_wireframeSectors doesn't match the world position we want, update its world position and mark it as dirty. + // (We loop from -gridSize/2 to gridSize/2 so that the camera is always in the center sector.) + for (int32_t sectorY = cameraSectorY - (m_sectorGridSize / 2); sectorY <= cameraSectorY + (m_sectorGridSize / 2); sectorY++) + { + for (int32_t sectorX = cameraSectorX - (m_sectorGridSize / 2); sectorX <= cameraSectorX + (m_sectorGridSize / 2); sectorX++) { - if (drawingAabb.Overlaps(sector.m_aabb)) + + // Calculate the index in m_wireframeSectors for this sector. Our indices should rotate through 0 - gridSize, but just + // using a single mod will produce a negative result for negative sector indices. Using abs() will give us incorrect + // "backwards" indices for negative numbers, so instead we add the grid size and mod a second time. + // Ex: For a grid size of 5, we want the indices to map like this: + // Index 0 1 2 3 4 + // Values -10 -9 -8 -7 -6 + // -5 -4 -3 -2 -1 + // 0 1 2 3 4 + // 5 6 7 8 9 + // For -9, (-9 % 5) = -4, then (-4 + 5) % 5 = 1. If we used abs(), we'd get 4, which is backwards from what we want. + int32_t sectorYIndex = ((sectorY % m_sectorGridSize) + m_sectorGridSize) % m_sectorGridSize; + int32_t sectorXIndex = ((sectorX % m_sectorGridSize) + m_sectorGridSize) % m_sectorGridSize; + int32_t sectorIndex = (sectorYIndex * m_sectorGridSize) + sectorXIndex; + + WireframeSector& sector = m_wireframeSectors[sectorIndex]; + + // Calculate the new world space box for this sector. + AZ::Aabb sectorAabb = AZ::Aabb::CreateFromMinMax( + AZ::Vector3(sectorX * sectorSize.GetX(), sectorY * sectorSize.GetY(), worldMinZ), + AZ::Vector3((sectorX + 1) * sectorSize.GetX(), (sectorY + 1) * sectorSize.GetY(), worldMinZ)); + + // Clamp it to the terrain world bounds. + sectorAabb.Clamp(worldBounds); + + // If the world space box for the sector doesn't match, set it and mark the sector as dirty so we refresh the height data. + if (sector.m_aabb != sectorAabb) { - if (!sector.m_lineVertices.empty()) - { - const AZ::Color primaryColor = AZ::Color(0.25f, 0.25f, 0.25f, 1.0f); - debugDisplay.DrawLines(sector.m_lineVertices, primaryColor); - } - else - { - AZ_Warning("Debug", false, "empty sector!"); - } + sector.m_aabb = sectorAabb; + sector.m_isDirty = true; } } } + + // Finally, for each sector, rebuild the data if it's dirty, then draw it assuming it has valid data. + // (Sectors that are outside the world bounds won't have any valid data, so they'll get skipped) + for (auto& sector : m_wireframeSectors) + { + if (sector.m_isDirty) + { + RebuildSectorWireframe(sector, heightDataResolution, worldMinZ); + } + + if (!sector.m_lineVertices.empty()) + { + const AZ::Color primaryColor = AZ::Color(0.25f, 0.25f, 0.25f, 1.0f); + debugDisplay.DrawLines(sector.m_lineVertices, primaryColor); + } + } } - void TerrainWorldDebuggerComponent::RefreshCachedWireframeGrid(const AZ::Aabb& dirtyRegion) + + void TerrainWorldDebuggerComponent::DisplayEntityViewport( + const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) { - // Get the terrain world bounds and grid resolution. + DrawWorldBounds(debugDisplay); + DrawWireframe(viewportInfo, debugDisplay); - AZ::Aabb worldBounds = GetWorldBounds(); + } - AZ::Vector2 queryResolution = AZ::Vector2(1.0f); - AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - queryResolution, &AzFramework::Terrain::TerrainDataRequests::GetTerrainHeightQueryResolution); - - // Take the dirty region and adjust the Z values to the world min/max so that even if the dirty region falls outside the current - // world bounds, we still update the wireframe accordingly. - AZ::Aabb dirtyRegion2D = AZ::Aabb::CreateFromMinMaxValues( - dirtyRegion.GetMin().GetX(), dirtyRegion.GetMin().GetY(), worldBounds.GetMin().GetZ(), - dirtyRegion.GetMax().GetX(), dirtyRegion.GetMax().GetY(), worldBounds.GetMax().GetZ()); - - // Calculate the world size of each sector. Note that this size actually ends at the last point, not the last square. - // So for example, the sector size for 3 points will go from (*--*--*) even though it will be used to draw (*--*--*--). - const float xSectorSize = (queryResolution.GetX() * SectorSizeInGridPoints); - const float ySectorSize = (queryResolution.GetY() * SectorSizeInGridPoints); - - // Calculate the total number of sectors to cache. The world bounds might not be evenly divisible by sector bounds, so we add - // an extra sector's worth of size in each direction so that clamping down to an integer still accounts for that fractional sector. - const int32_t numSectorsX = aznumeric_cast((worldBounds.GetXExtent() + xSectorSize) / xSectorSize); - const int32_t numSectorsY = aznumeric_cast((worldBounds.GetYExtent() + ySectorSize) / ySectorSize); - - // If we haven't cached anything before, or if the world bounds has changed, clear our cache structure and repopulate it - // with WireframeSector entries with the proper AABB sizes. - if (!m_wireframeBounds.IsValid() || !dirtyRegion2D.IsValid() || !m_wireframeBounds.IsClose(worldBounds)) + void TerrainWorldDebuggerComponent::RebuildSectorWireframe(WireframeSector& sector, const AZ::Vector2& gridResolution, float worldMinZ) + { + if (!sector.m_isDirty) { - m_wireframeBounds = worldBounds; + return; + } - m_wireframeSectors.clear(); - m_wireframeSectors.reserve(numSectorsX * numSectorsY); + sector.m_isDirty = false; - for (int32_t ySector = 0; ySector < numSectorsY; ySector++) - { - for (int32_t xSector = 0; xSector < numSectorsX; xSector++) - { - // For each sector, set up the AABB for the sector and reserve memory for the line vertices. - WireframeSector sector; - sector.m_lineVertices.reserve(VerticesPerSector); - sector.m_aabb = AZ::Aabb::CreateFromMinMax( - AZ::Vector3( - worldBounds.GetMin().GetX() + (xSector * xSectorSize), worldBounds.GetMin().GetY() + (ySector * ySectorSize), - worldBounds.GetMin().GetZ()), - AZ::Vector3( - worldBounds.GetMin().GetX() + ((xSector + 1) * xSectorSize), - worldBounds.GetMin().GetY() + ((ySector + 1) * ySectorSize), worldBounds.GetMax().GetZ())); - - sector.m_aabb.Clamp(worldBounds); - - m_wireframeSectors.push_back(AZStd::move(sector)); - } - } + // To rebuild the wireframe, we walk through the sector by X, then by Y. For each point, we add two lines in a _| shape. + // To do that, we'll need to cache the height from the previous point to draw the _ line, and from the previous row to draw + // the | line. - // Notify the visibility system that our bounds have changed. - AzFramework::IEntityBoundsUnionRequestBus::Broadcast( - &AzFramework::IEntityBoundsUnionRequestBus::Events::RefreshEntityLocalBoundsUnion, GetEntityId()); - } + // When walking through the bounding box, the loops will be inclusive on one side, and exclusive on the other. However, since + // our box is exactly aligned with grid points, we want to get the grid points on both sides in each direction, so we need to + // expand our query region by one extra point. + // For example, if our AABB is 2 m and our grid resolution is 1 m, we'll want to query (*--*--*--), not (*--*--). + // Since we're processing lines based on the grid points and going backwards, this will give us (*--*--*). - // For each sector, if it overlaps with the dirty region, clear it out and recache the wireframe line data. - for (auto& sector : m_wireframeSectors) + AZ::Aabb region = sector.m_aabb; + region.SetMax(region.GetMax() + AZ::Vector3(gridResolution.GetX(), gridResolution.GetY(), 0.0f)); + + // This keeps track of the height from the previous point for the _ line. + float previousHeight = 0.0f; + + // This keeps track of the heights from the previous row for the | line. + AZStd::vector rowHeights(aznumeric_cast(ceil(region.GetExtents().GetX() / gridResolution.GetX()))); + + // We need 4 vertices for each grid point in our sector to hold the _| shape. + const uint32_t numSamplesX = static_cast((region.GetMax().GetX() - region.GetMin().GetX()) / gridResolution.GetX()); + const uint32_t numSamplesY = static_cast((region.GetMax().GetY() - region.GetMin().GetY()) / gridResolution.GetY()); + sector.m_lineVertices.clear(); + sector.m_lineVertices.reserve(numSamplesX * numSamplesY * 4); + + // For each terrain height value in the region, create the _| grid lines for that point and cache off the height value + // for use with subsequent grid line calculations. + auto ProcessHeightValue = [gridResolution, &previousHeight, &rowHeights, §or] + (uint32_t xIndex, uint32_t yIndex, const AZ::Vector3& position, [[maybe_unused]] bool terrainExists) { - if (dirtyRegion2D.IsValid() && !dirtyRegion2D.Overlaps(sector.m_aabb)) + // Don't add any vertices for the first column or first row. These grid lines will be handled by an adjacent sector, if + // there is one. + if ((xIndex > 0) && (yIndex > 0)) { - continue; + float x = position.GetX() - gridResolution.GetX(); + float y = position.GetY() - gridResolution.GetY(); + + sector.m_lineVertices.emplace_back(AZ::Vector3(x, position.GetY(), previousHeight)); + sector.m_lineVertices.emplace_back(position); + + sector.m_lineVertices.emplace_back(AZ::Vector3(position.GetX(), y, rowHeights[xIndex])); + sector.m_lineVertices.emplace_back(position); } - sector.m_lineVertices.clear(); + // Save off the heights so that we can use them to draw subsequent columns and rows. + previousHeight = position.GetZ(); + rowHeights[xIndex] = position.GetZ(); + }; - for (float y = sector.m_aabb.GetMin().GetY(); y < sector.m_aabb.GetMax().GetY(); y += queryResolution.GetY()) + // This set of nested loops will get replaced with a call to ProcessHeightsFromRegion once the API exists. + uint32_t yIndex = 0; + for (float y = region.GetMin().GetY(); y < region.GetMax().GetY(); y += gridResolution.GetY()) + { + uint32_t xIndex = 0; + for (float x = region.GetMin().GetX(); x < region.GetMax().GetX(); x += gridResolution.GetX()) { - for (float x = sector.m_aabb.GetMin().GetX(); x < sector.m_aabb.GetMax().GetX(); x += queryResolution.GetX()) - { - float x1 = x + queryResolution.GetX(); - float y1 = y + queryResolution.GetY(); - - float z00 = 0.0f; - float z01 = 0.0f; - float z10 = 0.0f; - bool terrainExists; - - AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - z00, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, x, y, - AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, &terrainExists); - AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - z01, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, x, y1, - AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, &terrainExists); - AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - z10, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, x1, y, - AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, &terrainExists); - - sector.m_lineVertices.push_back(AZ::Vector3(x, y, z00)); - sector.m_lineVertices.push_back(AZ::Vector3(x1, y, z10)); - - sector.m_lineVertices.push_back(AZ::Vector3(x, y, z00)); - sector.m_lineVertices.push_back(AZ::Vector3(x, y1, z01)); - } + float height = worldMinZ; + bool terrainExists = false; + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + height, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, x, y, + AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, &terrainExists); + ProcessHeightValue(xIndex, yIndex, AZ::Vector3(x, y, height), terrainExists); + xIndex++; } + yIndex++; } } @@ -315,7 +398,14 @@ namespace Terrain { if (dataChangedMask & (TerrainDataChangedMask::Settings | TerrainDataChangedMask::HeightData)) { - RefreshCachedWireframeGrid(dirtyRegion); + MarkDirtySectors(dirtyRegion); + } + + if (dataChangedMask & TerrainDataChangedMask::Settings) + { + // Any time the world bounds potentially changes, notify that the terrain debugger's visibility bounds also changed. + AzFramework::IEntityBoundsUnionRequestBus::Broadcast( + &AzFramework::IEntityBoundsUnionRequestBus::Events::RefreshEntityLocalBoundsUnion, GetEntityId()); } } diff --git a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.h b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.h index 5ec831c038..f3bcead8c3 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.h +++ b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.h @@ -82,33 +82,40 @@ namespace Terrain private: + TerrainWorldDebuggerConfig m_configuration; + // Cache our debug wireframe representation in "sectors" of data so that we can easily control how far out we draw // the wireframe representation in each direction. struct WireframeSector { - AZ::Aabb m_aabb; + AZ::Aabb m_aabb{ AZ::Aabb::CreateNull() }; AZStd::vector m_lineVertices; + bool m_isDirty{ true }; }; + void RebuildSectorWireframe(WireframeSector& sector, const AZ::Vector2& gridResolution, float worldMinZ); + void MarkDirtySectors(const AZ::Aabb& dirtyRegion); + void DrawWorldBounds(AzFramework::DebugDisplayRequests& debugDisplay); + void DrawWireframe(const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay); + // Each sector contains an N x N grid of squares that it will draw. Since this is a count of the number of terrain grid points // in each direction, the actual world size will depend on the terrain grid resolution in each direction. static constexpr int32_t SectorSizeInGridPoints = 10; - // For each grid point we will draw half a square (left-right, top-down), so we need 4 vertices for the two lines. + // For each grid point we will draw half a square ( _| ), so we need 4 vertices for the two lines. static constexpr int32_t VerticesPerGridPoint = 4; - // Pre-calculate the total number of vertices per sector. - static constexpr int32_t VerticesPerSector = - (SectorSizeInGridPoints * VerticesPerGridPoint) * (SectorSizeInGridPoints * VerticesPerGridPoint); + // Pre-calculate the total number of vertices per sector (N x N grid points, with 4 vertices per grid point) + static constexpr int32_t VerticesPerSector = (SectorSizeInGridPoints * SectorSizeInGridPoints) * VerticesPerGridPoint; // AuxGeom has limits to the number of lines it can draw in a frame, so we'll cap how many total sectors to draw. static constexpr int32_t MaxVerticesToDraw = 500000; static constexpr int32_t MaxSectorsToDraw = MaxVerticesToDraw / VerticesPerSector; - void RefreshCachedWireframeGrid(const AZ::Aabb& dirtyRegion); - - TerrainWorldDebuggerConfig m_configuration; + // Structure to keep track of all our current wireframe sectors, so that we don't have to recalculate them every frame. AZStd::vector m_wireframeSectors; - AZ::Aabb m_wireframeBounds; + + // The size in sectors of our wireframe grid in each direction (i.e. a 5 x 5 sector grid has a sectorGridSize of 5) + int32_t m_sectorGridSize{ 0 }; }; } From 26a5128576e169df7984146617598f1798a9b30e Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 29 Dec 2021 10:02:32 -0800 Subject: [PATCH 211/399] Renaming py util methods for reporting log lines based on feedback Signed-off-by: Gene Walters --- .../editor_python_test_tools/utils.py | 46 +++++++++---------- .../tests/Multiplayer_AutoComponent_RPC.py | 10 +++- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py index 1674fba7be..35a50b6090 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py @@ -101,49 +101,47 @@ class TestHelper: Report.critical_result(msgtuple_success_fail, general.is_in_game_mode()) @staticmethod - def find_expected_line(window, expected_message, print_infos): + def find_line(window, line, print_infos): """ Looks for an expected line in a list of tracer log lines :param window: The log's window name. For example, logs printed via script-canvas use the "Script" window. - :param expected_message: The log message to search. + :param line: The log message to search for. :param print_infos: A list of PrintInfos collected by Tracer to search. Example options: your_tracer.warnings, your_tracer.errors, your_tracer.asserts, or your_tracer.prints - :return: True if the message is found, otherwise false. + :return: True if the line is found, otherwise false. """ for printInfo in print_infos: - if printInfo.window == window.strip() and printInfo.message.strip() == expected_message: + if printInfo.window == window.strip() and printInfo.message.strip() == line: return True return False @staticmethod - def wait_for_critical_expected_line(window, expected_message, print_infos, time_out): + def succeed_if_log_line_found(window, line, print_infos, time_out): """ - Looks for an expected line in a list of tracer log lines for a period of time. - Reports a critical result based on if the expected line was found. The result is successful if the line is found. + Looks for a line in a list of tracer log lines and reports success if found. :param window: The log's window name. For example, logs printed via script-canvas use the "Script" window. - :param expected_message: The log message we're expecting to find. + :param line: The log message we're hoping to find. :param print_infos: A list of PrintInfos collected by Tracer to search. Example options: your_tracer.warnings, your_tracer.errors, your_tracer.asserts, or your_tracer.prints :param time_out: The total amount of time to wait before giving up looking for the expected line. - :return: No return value, but if the expected message is found, a successful critical result is reported; otherwise failure. + :return: No return value, but if the message is found, a successful critical result is reported; otherwise failure. """ - TestHelper.wait_for_condition(lambda : TestHelper.find_expected_line(window, expected_message, print_infos), time_out) - Report.critical_result(("Found expected line: " + expected_message, "Failed to find expected line: " + expected_message), TestHelper.find_expected_line(window, expected_message, print_infos)) + TestHelper.wait_for_condition(lambda : TestHelper.find_line(window, line, print_infos), time_out) + Report.critical_result(("Found expected line: " + line, "Failed to find expected line: " + line), TestHelper.find_line(window, line, print_infos)) @staticmethod - def wait_for_critical_unexpected_line(window, unexpected_line, print_infos, time_out): + def fail_if_log_line_found(window, line, print_infos, time_out): """ - Looks for an unexpected line in a list of tracer log lines over a period of time. - Reports a critical result based on if the unexpected line was found. The result is successful if the line is not found. + Reports a failure if a log line in a list of tracer log lines is found. :param window: The log's window name. For example, logs printed via script-canvas use the "Script" window. - :param unexpected_line: The log message we're hoping to not find. + :param line: The log message we're hoping to not find. :param print_infos: A list of PrintInfos collected by Tracer to search. Example options: your_tracer.warnings, your_tracer.errors, your_tracer.asserts, or your_tracer.prints :param time_out: The total amount of time to wait before giving up looking for the unexpected line. If time runs out and we don't see the unexpected line then report a success. - :return: No return value, but if the unexpected message is found, a failed critical result is reported; otherwise success. + :return: No return value, but if the line is found, a failed critical result is reported; otherwise success. """ - TestHelper.wait_for_condition(lambda : TestHelper.find_expected_line(window, unexpected_line, print_infos), time_out) - Report.critical_result(("Unexpected line not found: " + unexpected_line, "Unexpected line found: " + unexpected_line), not TestHelper.find_expected_line(window, unexpected_line, print_infos)) + TestHelper.wait_for_condition(lambda : TestHelper.find_line(window, line, print_infos), time_out) + Report.critical_result(("Unexpected line not found: " + line, "Unexpected line found: " + line), not TestHelper.find_line(window, line, print_infos)) @staticmethod def multiplayer_enter_game_mode(msgtuple_success_fail: Tuple[str, str], sv_default_player_spawn_asset: str) -> None: @@ -163,20 +161,20 @@ class TestHelper: multiplayer.PythonEditorFuncs_enter_game_mode() # make sure the server launcher binary exists - TestHelper.wait_for_critical_unexpected_line("MultiplayerEditor", "LaunchEditorServer failed! The ServerLauncher binary is missing!", section_tracer.errors, 0.5) + TestHelper.fail_if_log_line_found("MultiplayerEditor", "LaunchEditorServer failed! The ServerLauncher binary is missing!", section_tracer.errors, 0.5) # make sure the server launcher is running waiter.wait_for(lambda: process_utils.process_exists("AutomatedTesting.ServerLauncher", ignore_extensions=True), timeout=5.0, exc=AssertionError("AutomatedTesting.ServerLauncher has NOT launched!"), interval=1.0) - TestHelper.wait_for_critical_expected_line("EditorServer", "MultiplayerEditorConnection: Editor-server activation has found and connected to the editor.", section_tracer.prints, 15.0) + TestHelper.succeed_if_log_line_found("EditorServer", "MultiplayerEditorConnection: Editor-server activation has found and connected to the editor.", section_tracer.prints, 15.0) - TestHelper.wait_for_critical_expected_line("MultiplayerEditor", "Editor is sending the editor-server the level data packet.", section_tracer.prints, 5.0) + TestHelper.succeed_if_log_line_found("MultiplayerEditor", "Editor is sending the editor-server the level data packet.", section_tracer.prints, 5.0) - TestHelper.wait_for_critical_expected_line("EditorServer", "Logger: Editor Server completed receiving the editor's level assets, responding to Editor...", section_tracer.prints, 5.0) + TestHelper.succeed_if_log_line_found("EditorServer", "Logger: Editor Server completed receiving the editor's level assets, responding to Editor...", section_tracer.prints, 5.0) - TestHelper.wait_for_critical_expected_line("MultiplayerEditorConnection", "Editor-server ready. Editor has successfully connected to the editor-server's network simulation.", section_tracer.prints, 5.0) + TestHelper.succeed_if_log_line_found("MultiplayerEditorConnection", "Editor-server ready. Editor has successfully connected to the editor-server's network simulation.", section_tracer.prints, 5.0) - TestHelper.wait_for_critical_unexpected_line("EditorServer", f"MultiplayerSystemComponent: SpawnDefaultPlayerPrefab failed. Missing sv_defaultPlayerSpawnAsset at path '{sv_default_player_spawn_asset.lower()}'.", section_tracer.prints, 0.5) + TestHelper.fail_if_log_line_found("EditorServer", f"MultiplayerSystemComponent: SpawnDefaultPlayerPrefab failed. Missing sv_defaultPlayerSpawnAsset at path '{sv_default_player_spawn_asset.lower()}'.", section_tracer.prints, 0.5) TestHelper.wait_for_condition(lambda : multiplayer.PythonEditorFuncs_is_in_game_mode(), 5.0) Report.critical_result(msgtuple_success_fail, multiplayer.PythonEditorFuncs_is_in_game_mode()) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py index 8c13806a30..827826cbcc 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py @@ -63,8 +63,14 @@ def Multiplayer_AutoComponent_RPC(): # 4) Check the editor logs for expected and unexpected log output PLAYERID_RPC_WAIT_TIME_SECONDS = 1.0 # The player id is sent from the server as soon as the player script is spawned. 1 second should be more than enough time to send/receive that RPC. - helper.wait_for_critical_expected_line('EditorServer', 'Script: AutoComponent_RPC: Sending client PlayerNumber 1', section_tracer.prints, PLAYERID_RPC_WAIT_TIME_SECONDS) - helper.wait_for_critical_expected_line('Script', "AutoComponent_RPC: I'm Player #1", section_tracer.prints, PLAYERID_RPC_WAIT_TIME_SECONDS) + helper.succeed_if_log_line_found('EditorServer', 'Script: AutoComponent_RPC: Sending client PlayerNumber 1', section_tracer.prints, PLAYERID_RPC_WAIT_TIME_SECONDS) + helper.succeed_if_log_line_found('Script', "AutoComponent_RPC: I'm Player #1", section_tracer.prints, PLAYERID_RPC_WAIT_TIME_SECONDS) + + # Uncomment once editor game-play mode supports level entities with net-binding + #PLAYFX_RPC_WAIT_TIME_SECONDS = 1.1 # The server will send an RPC to play an fx on the client every second. + #helper.succeed_if_log_line_found('EditorServer', "Script: AutoComponent_RPC_NetLevelEntity Activated on entity: NetLevelEntity", section_tracer.prints, PLAYFX_RPC_WAIT_TIME_SECONDS) + #helper.succeed_if_log_line_found('EditorServer', "Script: AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some fx.", section_tracer.prints, PLAYFX_RPC_WAIT_TIME_SECONDS) + #helper.succeed_if_log_line_found('Script', "AutoComponent_RPC_NetLevelEntity: I'm a client playing some superficial fx.", section_tracer.prints, PLAYFX_RPC_WAIT_TIME_SECONDS) # Exit game mode From a10bf927393934821ea2df3986df6561e99e4a49 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Wed, 29 Dec 2021 13:44:03 -0600 Subject: [PATCH 212/399] Encapsulated gradient transform logic into separate class (#6586) * First version of GradientTransform class. The gradient transform logic is getting encapsulated into a class so that it can be cached and used by components in a much more optimal way than making ebus calls to the GradientTransform component on every transformed point. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Moved GradientTransform into its own source files. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Clean up and simplify GradientTransform logic. Added extensive commenting and split TransformPositionToUVW into a separate method for normalizing (TransformPositionToUVWNormalized) so that there doesn't need to be any conditional logic. There's no runtime variance as to which one needs to be called from a given call site. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added unit tests for GradientTransform. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Add comparison operators to GradientTransform so we can easily tell when it has changed. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Updated comments to be more Doxygen-friendly. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Source/FastNoiseGradientComponent.cpp | 3 +- Gems/FastNoise/Code/Tests/FastNoiseTest.cpp | 12 +- Gems/GradientSignal/Code/CMakeLists.txt | 2 + .../GradientTransformModifierRequestBus.h | 24 +- .../Ebuses/GradientTransformRequestBus.h | 3 +- .../GradientSignal/GradientTransform.h | 157 ++++++++++ .../Code/Include/GradientSignal/Util.h | 42 +-- .../Components/GradientTransformComponent.cpp | 59 +--- .../Components/GradientTransformComponent.h | 4 +- .../Components/ImageGradientComponent.cpp | 3 +- .../Components/PerlinGradientComponent.cpp | 3 +- .../Components/RandomGradientComponent.cpp | 3 +- .../Code/Source/GradientTransform.cpp | 163 ++++++++++ Gems/GradientSignal/Code/Source/Util.cpp | 77 ----- .../Tests/GradientSignalTransformTests.cpp | 284 ++++++++++++++++++ .../Code/gradientsignal_files.cmake | 3 +- .../Code/gradientsignal_tests_files.cmake | 1 + 17 files changed, 663 insertions(+), 180 deletions(-) create mode 100644 Gems/GradientSignal/Code/Include/GradientSignal/GradientTransform.h create mode 100644 Gems/GradientSignal/Code/Source/GradientTransform.cpp delete mode 100644 Gems/GradientSignal/Code/Source/Util.cpp create mode 100644 Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp diff --git a/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp b/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp index 0f8ce4c5da..bb4c337299 100644 --- a/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp +++ b/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp @@ -299,9 +299,8 @@ namespace FastNoiseGem AZ::Vector3 uvw = sampleParams.m_position; bool wasPointRejected = false; - const bool shouldNormalizeOutput = false; GradientSignal::GradientTransformRequestBus::Event( - GetEntityId(), &GradientSignal::GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, shouldNormalizeOutput, wasPointRejected); + GetEntityId(), &GradientSignal::GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, wasPointRejected); if (!wasPointRejected) { diff --git a/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp b/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp index bae1d424c7..620f538c71 100644 --- a/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp +++ b/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp @@ -46,8 +46,16 @@ public: //////////////////////////////////////////////////////////////////////////// //// GradientTransformRequestBus - void TransformPositionToUVW([[maybe_unused]] const AZ::Vector3& inPosition, [[maybe_unused]] AZ::Vector3& outUVW, [[maybe_unused]] const bool shouldNormalizeOutput, [[maybe_unused]] bool& wasPointRejected) const override {} - void GetGradientLocalBounds([[maybe_unused]] AZ::Aabb& bounds) const override {} + void TransformPositionToUVW([[maybe_unused]] const AZ::Vector3& inPosition, [[maybe_unused]] AZ::Vector3& outUVW, [[maybe_unused]] bool& wasPointRejected) const override {} + void TransformPositionToUVWNormalized( + [[maybe_unused]] const AZ::Vector3& inPosition, + [[maybe_unused]] AZ::Vector3& outUVW, + [[maybe_unused]] bool& wasPointRejected) const override + { + } + void GetGradientLocalBounds([[maybe_unused]] AZ::Aabb& bounds) const override + { + } void GetGradientEncompassingBounds([[maybe_unused]] AZ::Aabb& bounds) const override {} ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index c0b36f4b12..f5c0457c23 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -136,6 +136,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzTest + AZ::AzTestShared Gem::GradientSignal.Static Gem::LmbrCentral Gem::GradientSignal.Mocks @@ -157,6 +158,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzTest + AZ::AzTestShared Gem::GradientSignal.Static Gem::GradientSignal.Editor.Static Gem::LmbrCentral.Editor diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformModifierRequestBus.h b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformModifierRequestBus.h index 34cc8ef685..eba6aad12c 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformModifierRequestBus.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformModifierRequestBus.h @@ -13,14 +13,30 @@ namespace GradientSignal { + //! TransformType describes where the gradient's origin is mapped to. + enum class TransformType : AZ::u8 + { + //! The gradient's origin is the world position of this entity. + World_ThisEntity = 0, + //! The gradient's origin is the local position of this entity, but in world space. + //! i.e. If the parent is at (2, 2), and the gradient is at (3,3) in local space, the gradient entity itself will be at (5,5) in + //! world space but its origin will frozen at (3,3) in world space, no matter how much the parent moves around. + Local_ThisEntity, + //! The gradient's origin is the world position of the reference entity. + World_ReferenceEntity, + //! The gradient's origin is the local position of the reference entity, but in world space. + Local_ReferenceEntity, + //! The gradient's origin is at (0,0,0) in world space. + World_Origin, + //! The gradient's origin is in translated world space relative to the reference entity. + Relative, + }; + class GradientTransformModifierRequests : public AZ::ComponentBus { public: - /** - * Overrides the default AZ::EBusTraits handler policy to allow one - * listener only. - */ + //! Overrides the default AZ::EBusTraits handler policy to allow only one listener. static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; virtual bool GetAllowReference() const = 0; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformRequestBus.h b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformRequestBus.h index 426255efe7..ac2f1a9cb1 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformRequestBus.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformRequestBus.h @@ -27,7 +27,8 @@ namespace GradientSignal virtual ~GradientTransformRequests() = default; - virtual void TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, const bool shouldNormalizeOutput, bool& wasPointRejected) const = 0; + virtual void TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const = 0; + virtual void TransformPositionToUVWNormalized(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const = 0; virtual void GetGradientLocalBounds(AZ::Aabb& bounds) const = 0; virtual void GetGradientEncompassingBounds(AZ::Aabb& bounds) const = 0; }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/GradientTransform.h b/Gems/GradientSignal/Code/Include/GradientSignal/GradientTransform.h new file mode 100644 index 0000000000..c8073c2f4f --- /dev/null +++ b/Gems/GradientSignal/Code/Include/GradientSignal/GradientTransform.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include +#include +#include +#include +#include + +namespace GradientSignal +{ + //! Controls how the gradient repeats itself when queried outside the bounds of the shape. + enum class WrappingType : AZ::u8 + { + None = 0, //! Unbounded - the gradient ignores the shape bounds. + ClampToEdge, //! The values on the edge of the shape will be extended outward in each direction. + Mirror, //! The gradient signal will be repeated but mirrored on every repeat. + Repeat, //! The gradient signal will be repeated in every direction. + ClampToZero, //! The value will always be 0 outside of the shape. + }; + + class GradientTransform + { + public: + GradientTransform() = default; + + /** + * Create a GradientTransform with the given parameters. + * GradientTransform is a utility class that converts world space positions to gradient space UVW values which can be used + * to look up deterministic gradient values for the input spatial locations. + * \param shapeBounds The bounds of the shape associated with the gradient, in local space. + * \param transform The transform to use to convert from world space to gradient space. + * \param use3d True for 3D gradient lookup outputs, false for 2D gradient lookup outputs. (i.e. output W will be nonzero or zero) + * \param frequencyZoom Amount to scale the UVW results after wrapping is applied. + * \param wrappingType The way in which the gradient repeats itself outside the shape bounds. + */ + GradientTransform( + const AZ::Aabb& shapeBounds, + const AZ::Matrix3x4& transform, + bool use3d, + float frequencyZoom, + GradientSignal::WrappingType wrappingType); + + /** + * Checks to see if two GradientTransform instances are equivalent. + * Useful for being able to send out notifications when a GradientTransform has changed. + * \param rhs The second GradientTranform to compare against. + * \return True if they're equal, False if they aren't. + */ + bool operator==(const GradientTransform& rhs) const + { + return ( + (m_shapeBounds == rhs.m_shapeBounds) && + (m_inverseTransform == rhs.m_inverseTransform) && + (m_alwaysAcceptPoint == rhs.m_alwaysAcceptPoint) && + (m_frequencyZoom == rhs.m_frequencyZoom) && + (m_wrappingType == rhs.m_wrappingType) && + (m_normalizeExtentsReciprocal == rhs.m_normalizeExtentsReciprocal)); + } + + /** + * Checks to see if two GradientTransform instances aren't equivalent. + * Useful for being able to send out notifications when a GradientTransform has changed. + * \param rhs The second GradientTranform to compare against. + * \return True if they're not equal, False if they are. + */ + bool operator!=(const GradientTransform& rhs) const + { + return !(*this == rhs); + } + + + /** + * Transform the given world space position to a gradient space UVW lookup value. + * \param inPosition The input world space position to transform. + * \param outUVW [out] The UVW value that can be used to look up a deterministic gradient value. + * \param wasPointRejected [out] True if the input position doesn't have a gradient value, false if it does. + * Most gradients have values mapped to infinite world space, so wasPointRejected will almost always be false. + * It will only be true when using ClampToZero and the world space position falls outside the shape bounds. + */ + void TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const; + + /** + * Transform the given world space position to a gradient space UVW lookup value and normalize to the shape bounds. + * "Normalizing" in this context means that regardless of the world space coordinates, (0,0,0) represents the minimum + * shape bounds corner, and (1,1,1) represents the maximum shape bounds corner. Depending on the wrapping type, it's possible + * (and even likely) to get values outside the 0-1 range. + * \param inPosition The input world space position to transform. + * \param outUVW [out] The UVW value that can be used to look up a deterministic gradient value. + * \param wasPointRejected [out] True if the input position doesn't have a gradient value, false if it does. + * Most gradients have values mapped to infinite world space, so wasPointRejected will almost always be false. + * It will only be true when using ClampToZero and the world space position falls outside the shape bounds. + */ + void TransformPositionToUVWNormalized(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const; + + /** + * Epsilon value to allow our UVW range to go to [min, max) by using the range [min, max - epsilon]. + * To keep things behaving consistently between clamped and unbounded uv ranges, we want our clamped uvs to use a + * range of [min, max), so we'll actually clamp to [min, max - epsilon]. Since our floating-point numbers are likely in the + * -16384 to 16384 range, an epsilon of 0.001 will work without rounding to 0. + * (This constant is public so that it can be used from unit tests for validating transformation results) + */ + static constexpr float UvEpsilon = 0.001f; + + private: + + //! These are the various transformations that will be performed, based on wrapping type. + using WrappingTransformFunction = AZStd::function; + static AZ::Vector3 NoTransform(const AZ::Vector3& point, const AZ::Aabb& bounds); + static AZ::Vector3 GetUnboundedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); + static AZ::Vector3 GetClampedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); + static AZ::Vector3 GetMirroredPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); + static AZ::Vector3 GetRelativePointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); + static AZ::Vector3 GetWrappedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); + + //! The shape bounds are used for determining the wrapping bounds, and to normalize the UVW results into if requested. + AZ::Aabb m_shapeBounds = AZ::Aabb::CreateNull(); + + /** + * The relative transform to use for converting from world space to gradient space, stored as an inverse transform. + * We only ever need to use the inverse transform, so we compute it once and store it instead of keeping the original + * transform around. Note that the GradientTransformComponent has many options for choosing which relative space to use + * for the transform, so the transform passed in to this class might already have many modifications applied to it. + * The inverse transform will also get its 3rd row cleared out if "use3d" is false and we're only performing 2D gradient + * transformations, so that the W component of the UVW output will always be 0. + */ + AZ::Matrix3x4 m_inverseTransform = AZ::Matrix3x4::CreateIdentity(); + + /** + * Whether or not to always accept the input point as a valid output point. + * Most of the time, the gradient exists everywhere in world space, so we always accept the input point. + * The one exception is ClampToZero, which will return that the point is rejected if it falls outside the shape bounds. + */ + bool m_alwaysAcceptPoint = true; + + //! Apply a scale to the point *after* the wrapping is applied. + float m_frequencyZoom = 1.0f; + + //! How the gradient should repeat itself outside of the shape bounds. + WrappingType m_wrappingType = WrappingType::None; + WrappingTransformFunction m_wrappingTransform = NoTransform; + + /** + * Cached reciprocal for performing an inverse lerp back to shape bounds. + * When normalizing the output UVW back into the shape bounds, we perform an inverse lerp. The inverse lerp + * equation is (point - min) * (1 / (max-min)), so we save off the (1 / (max-min)) term to avoid recalculating it on every point. + */ + AZ::Vector3 m_normalizeExtentsReciprocal = AZ::Vector3(1.0f); + }; + +} // namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Util.h b/Gems/GradientSignal/Code/Include/GradientSignal/Util.h index a6dbe118af..fa1791c053 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Util.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Util.h @@ -13,49 +13,10 @@ #include #include #include +#include namespace GradientSignal { - enum class WrappingType : AZ::u8 - { - None = 0, - ClampToEdge, - Mirror, - Repeat, - ClampToZero, - }; - - enum class TransformType : AZ::u8 - { - World_ThisEntity = 0, - Local_ThisEntity, - World_ReferenceEntity, - Local_ReferenceEntity, - World_Origin, - Relative, - }; - - AZ::Vector3 GetUnboundedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); - AZ::Vector3 GetClampedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); - AZ::Vector3 GetMirroredPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); - AZ::Vector3 GetRelativePointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); - - inline AZ::Vector3 GetWrappedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) - { - return AZ::Vector3( - AZ::Wrap(point.GetX(), bounds.GetMin().GetX(), bounds.GetMax().GetX()), - AZ::Wrap(point.GetY(), bounds.GetMin().GetY(), bounds.GetMax().GetY()), - AZ::Wrap(point.GetZ(), bounds.GetMin().GetZ(), bounds.GetMax().GetZ())); - } - - inline AZ::Vector3 GetNormalizedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) - { - return AZ::Vector3( - AZ::LerpInverse(bounds.GetMin().GetX(), bounds.GetMax().GetX(), point.GetX()), - AZ::LerpInverse(bounds.GetMin().GetY(), bounds.GetMax().GetY(), point.GetY()), - AZ::LerpInverse(bounds.GetMin().GetZ(), bounds.GetMax().GetZ(), point.GetZ())); - } - inline void GetObbParamsFromShape(const AZ::EntityId& entity, AZ::Aabb& bounds, AZ::Matrix3x4& worldToBoundsTransform) { //get bound and transform data for associated shape @@ -115,4 +76,5 @@ namespace GradientSignal return AZ::Lerp(outputMin, outputMax, inputCorrected); } + } // namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp index 57de6f776a..8cd7dc56a1 100644 --- a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp @@ -322,55 +322,17 @@ namespace GradientSignal return false; } - void GradientTransformComponent::TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, const bool shouldNormalizeOutput, bool& wasPointRejected) const + void GradientTransformComponent::TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const { AZStd::lock_guard lock(m_cacheMutex); + m_gradientTransform.TransformPositionToUVW(inPosition, outUVW, wasPointRejected); + } - //transforming coordinate into "local" relative space of shape bounds - outUVW = m_shapeTransformInverse * inPosition; - - if (!m_configuration.m_advancedMode || !m_configuration.m_is3d) - { - outUVW.SetZ(0.0f); - } - - wasPointRejected = false; - if (m_shapeBounds.IsValid()) - { - //all wrap types and transformations are applied after the coordinate is transformed into shape relative space - //this allows all calculations to be simplified and done using the shapes untransformed aabb - //outputting a value that can be used to sample a gradient in its local space - switch (m_configuration.m_wrappingType) - { - default: - case WrappingType::None: - outUVW = GetUnboundedPointInAabb(outUVW, m_shapeBounds); - break; - case WrappingType::ClampToEdge: - outUVW = GetClampedPointInAabb(outUVW, m_shapeBounds); - break; - case WrappingType::ClampToZero: - // We don't want to use m_shapeBounds.Contains() here because Contains() is inclusive on all edges. - // For uv consistency between clamped and unclamped states, we only want to accept uv ranges of [min, max), - // so we specifically need to exclude the max edges here. - wasPointRejected = !(outUVW.IsGreaterEqualThan(m_shapeBounds.GetMin()) && outUVW.IsLessThan(m_shapeBounds.GetMax())); - outUVW = GetClampedPointInAabb(outUVW, m_shapeBounds); - break; - case WrappingType::Mirror: - outUVW = GetMirroredPointInAabb(outUVW, m_shapeBounds); - break; - case WrappingType::Repeat: - outUVW = GetWrappedPointInAabb(outUVW, m_shapeBounds); - break; - } - } - - outUVW *= m_configuration.m_frequencyZoom; - - if (shouldNormalizeOutput) - { - outUVW = GetNormalizedPointInAabb(outUVW, m_shapeBounds); - } + void GradientTransformComponent::TransformPositionToUVWNormalized( + const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const + { + AZStd::lock_guard lock(m_cacheMutex); + m_gradientTransform.TransformPositionToUVWNormalized(inPosition, outUVW, wasPointRejected); } void GradientTransformComponent::GetGradientLocalBounds(AZ::Aabb& bounds) const @@ -499,6 +461,11 @@ namespace GradientSignal shapeTransformFinal.SetTranslation(m_configuration.m_translate); shapeTransformFinal.MultiplyByScale(m_configuration.m_scale); m_shapeTransformInverse = shapeTransformFinal.GetInverseFull(); + + // Set everything up on the Gradient Transform + const bool use3dGradients = m_configuration.m_advancedMode && m_configuration.m_is3d; + m_gradientTransform = GradientTransform( + m_shapeBounds, shapeTransformFinal, use3dGradients, m_configuration.m_frequencyZoom, m_configuration.m_wrappingType); } AZ::EntityId GradientTransformComponent::GetShapeEntityId() const diff --git a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h index abaa245f15..50ae6fe475 100644 --- a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h +++ b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h @@ -101,7 +101,8 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientTransformRequestBus - void TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, const bool shouldNormalizeOutput, bool& wasPointRejected) const override; + void TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const override; + void TransformPositionToUVWNormalized(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const override; void GetGradientLocalBounds(AZ::Aabb& bounds) const override; void GetGradientEncompassingBounds(AZ::Aabb& bounds) const override; @@ -172,5 +173,6 @@ namespace GradientSignal AZ::Matrix3x4 m_shapeTransformInverse = AZ::Matrix3x4::CreateIdentity(); LmbrCentral::DependencyMonitor m_dependencyMonitor; AZStd::atomic_bool m_dirty{ false }; + GradientTransform m_gradientTransform; }; } //namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp index 065f0ace0f..2d594a201c 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp @@ -194,9 +194,8 @@ namespace GradientSignal AZ::Vector3 uvw = sampleParams.m_position; bool wasPointRejected = false; - const bool shouldNormalizeOutput = true; GradientTransformRequestBus::Event( - GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, shouldNormalizeOutput, wasPointRejected); + GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVWNormalized, sampleParams.m_position, uvw, wasPointRejected); if (!wasPointRejected) { diff --git a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp index e150ff4305..d5e846b9ef 100644 --- a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp @@ -179,9 +179,8 @@ namespace GradientSignal AZ::Vector3 uvw = sampleParams.m_position; bool wasPointRejected = false; - const bool shouldNormalizeOutput = false; GradientTransformRequestBus::Event( - GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, shouldNormalizeOutput, wasPointRejected); + GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, wasPointRejected); if (!wasPointRejected) { diff --git a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp index d28fe13aff..d320dbeb3d 100644 --- a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp @@ -142,9 +142,8 @@ namespace GradientSignal AZ::Vector3 uvw = sampleParams.m_position; bool wasPointRejected = false; - const bool shouldNormalizeOutput = false; GradientTransformRequestBus::Event( - GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, shouldNormalizeOutput, wasPointRejected); + GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, wasPointRejected); if (!wasPointRejected) { diff --git a/Gems/GradientSignal/Code/Source/GradientTransform.cpp b/Gems/GradientSignal/Code/Source/GradientTransform.cpp new file mode 100644 index 0000000000..acf9e2f150 --- /dev/null +++ b/Gems/GradientSignal/Code/Source/GradientTransform.cpp @@ -0,0 +1,163 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + + +#include +#include + + +namespace GradientSignal +{ + GradientTransform::GradientTransform( + const AZ::Aabb& shapeBounds, const AZ::Matrix3x4& transform, bool use3d, + float frequencyZoom, GradientSignal::WrappingType wrappingType) + : m_shapeBounds(shapeBounds) + , m_inverseTransform(transform.GetInverseFull()) + , m_frequencyZoom(frequencyZoom) + , m_wrappingType(wrappingType) + , m_wrappingTransform(NoTransform) + , m_alwaysAcceptPoint(true) + { + // If we want this to be a 2D gradient lookup, we always want to set the W result in the output to 0. + // The easiest / cheapest way to make this happen is just to clear out the third row in the inverseTransform. + if (!use3d) + { + m_inverseTransform.SetRow(2, AZ::Vector4::CreateZero()); + } + + // Set up the appropriate wrapping transform function for the the given wrapping type. + // Also note that ClampToZero is the only wrapping type that allows us to return a "pointIsRejected" result + // for points that fall outside the shape bounds. + if (m_shapeBounds.IsValid()) + { + switch (wrappingType) + { + default: + case WrappingType::None: + m_wrappingTransform = GetUnboundedPointInAabb; + break; + case WrappingType::ClampToEdge: + m_wrappingTransform = GetClampedPointInAabb; + break; + case WrappingType::ClampToZero: + m_alwaysAcceptPoint = false; + m_wrappingTransform = GetClampedPointInAabb; + break; + case WrappingType::Mirror: + m_wrappingTransform = GetMirroredPointInAabb; + break; + case WrappingType::Repeat: + m_wrappingTransform = GetWrappedPointInAabb; + break; + } + } + + m_normalizeExtentsReciprocal = AZ::Vector3( + AZ::IsClose(0.0f, m_shapeBounds.GetXExtent()) ? 0.0f : (1.0f / m_shapeBounds.GetXExtent()), + AZ::IsClose(0.0f, m_shapeBounds.GetYExtent()) ? 0.0f : (1.0f / m_shapeBounds.GetYExtent()), + AZ::IsClose(0.0f, m_shapeBounds.GetZExtent()) ? 0.0f : (1.0f / m_shapeBounds.GetZExtent())); + } + + void GradientTransform::TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const + { + // Transform coordinate into "local" relative space of shape bounds, and set W to 0 if this is a 2D gradient. + outUVW = m_inverseTransform * inPosition; + + // For most wrapping types, we always accept the point, but for ClampToZero we only accept it if it's within + // the shape bounds. We don't use m_shapeBounds.Contains() here because Contains() is inclusive on all edges. + // For uv consistency between clamped and unclamped states, we only want to accept uv ranges of [min, max), + // so we specifically need to exclude the max edges here. + bool wasPointAccepted = m_alwaysAcceptPoint || + (outUVW.IsGreaterEqualThan(m_shapeBounds.GetMin()) && outUVW.IsLessThan(m_shapeBounds.GetMax())); + wasPointRejected = !wasPointAccepted; + + outUVW = m_wrappingTransform(outUVW, m_shapeBounds); + outUVW *= m_frequencyZoom; + } + + void GradientTransform::TransformPositionToUVWNormalized(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const + { + TransformPositionToUVW(inPosition, outUVW, wasPointRejected); + + // This effectively does AZ::LerpInverse(bounds.GetMin(), bounds.GetMax(), point) if shouldNormalize is true, + // and just returns outUVW if shouldNormalize is false. + outUVW = m_normalizeExtentsReciprocal * (outUVW - m_shapeBounds.GetMin()); + } + + AZ::Vector3 GradientTransform::NoTransform(const AZ::Vector3& point, const AZ::Aabb& /*bounds*/) + { + return point; + } + + AZ::Vector3 GradientTransform::GetUnboundedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& /*bounds*/) + { + return point; + } + + AZ::Vector3 GradientTransform::GetClampedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) + { + // We want the clamped sampling states to clamp uvs to the [min, max) range. + return point.GetClamp(bounds.GetMin(), bounds.GetMax() - AZ::Vector3(UvEpsilon)); + } + + AZ::Vector3 GradientTransform::GetWrappedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) + { + return AZ::Vector3( + AZ::Wrap(point.GetX(), bounds.GetMin().GetX(), bounds.GetMax().GetX()), + AZ::Wrap(point.GetY(), bounds.GetMin().GetY(), bounds.GetMax().GetY()), + AZ::Wrap(point.GetZ(), bounds.GetMin().GetZ(), bounds.GetMax().GetZ())); + } + + AZ::Vector3 GradientTransform::GetMirroredPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) + { + /* For mirroring, we want to produce the following pattern: + * [min, max) : value + * [max, min) : max - value - epsilon + * [min, max) : value + * [max, min) : max - value - epsilon + * ... + * The epsilon is because we always want to keep our output values in the [min, max) range. We apply the epsilon to all + * the mirrored values so that we get consistent spacing between the values. + */ + + auto GetMirror = [](float value, float min, float max) -> float + { + // To calculate the mirror value, we move our value into relative space of [0, rangeX2), then use + // the first half of the range for our "[min, max)" range, and the second half for our "[max, min)" mirrored range. + + float relativeValue = value - min; + float range = max - min; + float rangeX2 = range * 2.0f; + + // A positive relativeValue will produce a value of [0, rangeX2) from a single mod, but a negative relativeValue + // will produce a value of (-rangeX2, 0]. Adding rangeX2 to the result and taking the mod again puts us back in + // the range of [0, rangeX2) for both negative and positive values. This keeps our mirroring pattern consistent and + // unbroken across both negative and positive coordinate space. + relativeValue = AZ::Mod(AZ::Mod(relativeValue, rangeX2) + rangeX2, rangeX2); + + // [range, rangeX2) is our mirrored range, so flip the value when we're in this range and apply the epsilon so that + // we never return the max value, and so that our mirrored values have consistent spacing in the results. + if (relativeValue >= range) + { + relativeValue = rangeX2 - (relativeValue + UvEpsilon); + } + + return relativeValue + min; + }; + + return AZ::Vector3( + GetMirror(point.GetX(), bounds.GetMin().GetX(), bounds.GetMax().GetX()), + GetMirror(point.GetY(), bounds.GetMin().GetY(), bounds.GetMax().GetY()), + GetMirror(point.GetZ(), bounds.GetMin().GetZ(), bounds.GetMax().GetZ())); + } + + AZ::Vector3 GradientTransform::GetRelativePointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) + { + return point - bounds.GetMin(); + } +} diff --git a/Gems/GradientSignal/Code/Source/Util.cpp b/Gems/GradientSignal/Code/Source/Util.cpp deleted file mode 100644 index d9ebf36aec..0000000000 --- a/Gems/GradientSignal/Code/Source/Util.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include -#include -#include -#include -#include - - -namespace GradientSignal -{ - // To keep things behaving consistently between clamped and unbounded uv ranges, we - // we want our clamped uvs to use a range of [min, max), so we'll actually clamp to - // [min, max - epsilon]. Since our floating-point numbers are likely in the - // -16384 to 16384 range, an epsilon of 0.001 will work without rounding to 0. - static const float uvEpsilon = 0.001f; - - AZ::Vector3 GetUnboundedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& /*bounds*/) - { - return point; - } - - AZ::Vector3 GetClampedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) - { - // We want the clamped sampling states to clamp uvs to the [min, max) range. - return AZ::Vector3( - AZ::GetClamp(point.GetX(), bounds.GetMin().GetX(), bounds.GetMax().GetX() - uvEpsilon), - AZ::GetClamp(point.GetY(), bounds.GetMin().GetY(), bounds.GetMax().GetY() - uvEpsilon), - AZ::GetClamp(point.GetZ(), bounds.GetMin().GetZ(), bounds.GetMax().GetZ() - uvEpsilon)); - } - - float GetMirror(float value, float min, float max) - { - float relativeValue = value - min; - float range = max - min; - float rangeX2 = range * 2.0f; - if (relativeValue < 0.0) - { - relativeValue = rangeX2 - fmod(-relativeValue, rangeX2); - } - else - { - relativeValue = fmod(relativeValue, rangeX2); - } - if (relativeValue >= range) - { - // Since we want our uv range to stay in the [min, max) range, - // it means that for mirroring, we want both the "forward" values - // and the "mirrored" values to be in [0, range). We don't want - // relativeValue == range, so we shift relativeValue by a small epsilon - // in the mirrored case. - relativeValue = rangeX2 - (relativeValue + uvEpsilon); - } - - return relativeValue + min; - } - - AZ::Vector3 GetMirroredPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) - { - return AZ::Vector3( - GetMirror(point.GetX(), bounds.GetMin().GetX(), bounds.GetMax().GetX()), - GetMirror(point.GetY(), bounds.GetMin().GetY(), bounds.GetMax().GetY()), - GetMirror(point.GetZ(), bounds.GetMin().GetZ(), bounds.GetMax().GetZ())); - } - - AZ::Vector3 GetRelativePointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) - { - return point - bounds.GetMin(); - } -} diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp new file mode 100644 index 0000000000..73dabf1d6a --- /dev/null +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp @@ -0,0 +1,284 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + + +#include "Tests/GradientSignalTestMocks.h" + +#include +#include +#include +#include +#include + +#include + +namespace UnitTest +{ + struct GradientSignalTransformTestsFixture : public GradientSignalTest + { + // By default, we'll use a shape half extents of (5, 10, 20) for every test, and a world translation of (100, 200, 300). + struct GradientTransformSetupData + { + GradientSignal::WrappingType m_wrappingType{ GradientSignal::WrappingType::None }; + AZ::Vector3 m_shapeHalfExtents{ 5.0f, 10.0f, 20.0f }; + AZ::Vector3 m_worldTranslation{ 100.0f, 200.0f, 300.0f }; + float m_frequencyZoom{ 1.0f }; + }; + + struct GradientTransformTestData + { + AZ::Vector3 m_positionToTest; + AZ::Vector3 m_expectedOutputUVW; + bool m_expectedOutputRejectionResult; + }; + + static constexpr float UvEpsilon = GradientSignal::GradientTransform::UvEpsilon; + + void TestGradientTransform(const GradientTransformSetupData& setup, const GradientTransformTestData& test) + { + AZ::Aabb shapeBounds = AZ::Aabb::CreateCenterHalfExtents(AZ::Vector3::CreateZero(), setup.m_shapeHalfExtents); + AZ::Matrix3x4 transform = AZ::Matrix3x4::CreateTranslation(setup.m_worldTranslation); + float frequencyZoom = setup.m_frequencyZoom; + GradientSignal::WrappingType wrappingType = setup.m_wrappingType; + + AZ::Vector3 outUVW; + bool wasPointRejected; + + // Perform the query with a 3D gradient and verify that the results match expectations. + GradientSignal::GradientTransform gradientTransform3d(shapeBounds, transform, true, frequencyZoom, wrappingType); + gradientTransform3d.TransformPositionToUVW(test.m_positionToTest, outUVW, wasPointRejected); + EXPECT_THAT(outUVW, IsClose(test.m_expectedOutputUVW)); + EXPECT_EQ(wasPointRejected, test.m_expectedOutputRejectionResult); + + // Perform the query with a 2D gradient and verify that the results match, but always returns a W value of 0. + GradientSignal::GradientTransform gradientTransform2d(shapeBounds, transform, false, frequencyZoom, wrappingType); + gradientTransform2d.TransformPositionToUVW(test.m_positionToTest, outUVW, wasPointRejected); + EXPECT_THAT(outUVW, IsClose(AZ::Vector3(test.m_expectedOutputUVW.GetX(), test.m_expectedOutputUVW.GetY(), 0.0f))); + EXPECT_EQ(wasPointRejected, test.m_expectedOutputRejectionResult); + } + }; + + TEST_F(GradientSignalTransformTestsFixture, UnboundedWrappingReturnsTranslatedInput) + { + GradientTransformSetupData setup = { GradientSignal::WrappingType::None }; + GradientTransformTestData test = { + // Input position to query + { 0.0f, 0.0f, 0.0f }, + + // Output: For no wrapping, the output is just the input position offset by the world translation. + { -100.0f, -200.0f, -300.0f }, false + }; + + TestGradientTransform(setup, test); + } + + TEST_F(GradientSignalTransformTestsFixture, ClampToEdgeReturnsValuesClampedToShapeBounds) + { + GradientTransformSetupData setup = { GradientSignal::WrappingType::ClampToEdge }; + GradientTransformTestData tests[] = { + // Test: Input point far below minimum shape bounds + // Our input point is below the minimum of shape bounds, so the result should be the minimum corner of the shape. + { { 0.0f, 0.0f, 0.0f }, { -5.0f, -10.0f, -20.0f }, false }, + + // Test: Input point directly on minimum shape bounds + // Our input point is directly on the minimum of shape bounds, so the result should be the minimum corner of the shape. + { { 95.0f, 190.0f, 280.0f }, { -5.0f, -10.0f, -20.0f }, false }, + + // Test: Input point inside shape bounds + // Our input point is inside the shape bounds, so the result is just input - translation. + { { 101.0f, 202.0f, 303.0f }, { 1.0f, 2.0f, 3.0f }, false }, + + // Test: Input point directly on maximum shape bounds + // On the maximum side, GradientTransform clamps to "max - epsilon" for consistency with other wrapping types, so our + // expected results are the max shape corner - epsilon. + { { 105.0f, 210.0f, 320.0f }, { 5.0f - UvEpsilon, 10.0f - UvEpsilon, 20.0f - UvEpsilon }, false }, + + // Test: Input point far above maximum shape bounds + // On the maximum side, GradientTransform clamps to "max - epsilon" for consistency with other wrapping types, so our + // expected results are the max shape corner - epsilon. + { { 1000.0f, 1000.0f, 1000.0f }, { 5.0f - UvEpsilon, 10.0f - UvEpsilon, 20.0f - UvEpsilon }, false }, + }; + + for (auto& test : tests) + { + TestGradientTransform(setup, test); + } + } + + TEST_F(GradientSignalTransformTestsFixture, MirrorReturnsValuesMirroredBasedOnShapeBounds) + { + /* Here's how the results are expected to work for various inputs when using Mirror wrapping. + * This assumes shape half extents of (5, 10, 20), and a center translation of (100, 200, 300): + * Inputs: Outputs: + * ... ... + * (75, 150, 200) - (85, 170, 240) (-5, -10, -20) to (5, 10, 20) // forward mirror + * (85, 170, 240) - (95, 190, 280) (5, 10, 20) to (-5, -10, -20) // back mirror + * (95, 190, 280) - (105, 210, 320) (-5, -10, -20) to (5, 10, 20) // starting point + * (105, 210, 320) - (115, 230, 360) (5, 10, 20) to (-5, -10, -20) // back mirror + * (115, 230, 360) - (125, 250, 400) (-5, -10, -20) to (5, 10, 20) // forward mirror + * ... ... + * When below the starting point, both forward and back mirrors will be adjusted by UvEpsilon except for points that fall on the + * shape minimums. + * When above the starting point, only back mirrors will be adjusted by UvEpsilon. + */ + + GradientTransformSetupData setup = { GradientSignal::WrappingType::Mirror }; + GradientTransformTestData tests[] = { + // Test: Input exactly 2x below minimum bounds + // When landing exactly on the 2x boundary, we return the minumum shape bounds. There is no adjustment by epsilon + // on the minimum side of the bounds, even when we're in a mirror below the shape bounds. + { { 75.0f, 150.0f, 200.0f }, { -5.0f, -10.0f, -20.0f }, false }, + + // Test: Input within 2nd mirror repeat below minimum bounds + // The second mirror repeat should go forward in values, but will be adjusted by UvEpsilon since we're below the + // minimum bounds. + { { 84.0f, 168.0f, 237.0f }, { 4.0f - UvEpsilon, 8.0f - UvEpsilon, 17.0f - UvEpsilon }, false }, + + // Test: Input exactly 1x below minimum bounds. + // When landing exactly on the 1x boundary, we return the maximum shape bounds minus epsilon. + { { 85.0f, 170.0f, 240.0f }, { 5.0f - UvEpsilon, 10.0f - UvEpsilon, 20.0f - UvEpsilon }, false }, + + // Test: Input within 1st mirror repeat below minimum bounds + // The first mirror repeat should go backwards in values, but will be adjusted by UvEpsilon since we're below the + // minimum bounds. + { { 94.0f, 188.0f, 277.0f }, { -4.0f - UvEpsilon, -8.0f - UvEpsilon, -17.0f - UvEpsilon }, false }, + + // Test: Input inside shape bounds + // The translated input position is (1, 2, 3) is inside the shape bounds, so we should just get the translated + // position back as output. + { { 101.0f, 202.0f, 303.0f }, { 1.0f, 2.0f, 3.0f }, false }, + + // Test: Input within 1st mirror repeat above maximum bounds + // The first mirror repeat should go backwards in values. We're above the maximum bounds, so the expected result + // is (4, 8, 17) minus an epsilon. + { { 106.0f, 212.0f, 323.0f }, { 4.0f - UvEpsilon, 8.0f - UvEpsilon, 17.0f - UvEpsilon }, false }, + + // Test: Input exactly 2x above minimum bounds. + // When landing exactly on the 2x boundary, we return the exact minimum value again. + { { 115.0f, 230.0f, 360.0f }, { -5.0f, -10.0f, -20.0f }, false }, + + // Test: Input within 2nd mirror repeat above maximum bounds + // The second mirror repeat should go forwards in values. We're above the maximum bounds, so the expected result + // is (-4, -8, -17) with no epsilon. + { { 116.0f, 232.0f, 363.0f }, { -4.0f, -8.0f, -17.0f }, false }, + + // Test: Input exactly 2x above maximum bounds + // When landing exactly on the 2x boundary, we return the maximum adjusted by the epsilon again. + { { 125.0f, 250.0f, 400.0f }, { 5.0f - UvEpsilon, 10.0f - UvEpsilon, 20.0f - UvEpsilon }, false } + }; + + for (auto& test : tests) + { + TestGradientTransform(setup, test); + } + } + + TEST_F(GradientSignalTransformTestsFixture, RepeatReturnsRepeatingValuesBasedOnShapeBounds) + { + /* Here's how the results are expected to work for various inputs when using Repeat wrapping. + * This assumes shape half extents of (5, 10, 20), and a center translation of (100, 200, 300): + * Inputs: Outputs: + * ... ... + * (75, 150, 200) - (85, 170, 240) (-5, -10, -20) to (5, 10, 20) + * (85, 170, 240) - (95, 190, 280) (-5, -10, -20) to (5, 10, 20) + * (95, 190, 280) - (105, 210, 320) (-5, -10, -20) to (5, 10, 20) // starting point + * (105, 210, 320) - (115, 230, 360) (-5, -10, -20) to (5, 10, 20) + * (115, 230, 360) - (125, 250, 400) (-5, -10, -20) to (5, 10, 20) + * ... ... + * Every shape min/max boundary point below the starting point will have the max shape value. + * Every shape min/max boundary point above the starting point with have the min shape value. + */ + + + GradientTransformSetupData setup = { GradientSignal::WrappingType::Repeat }; + GradientTransformTestData tests[] = { + // Test: 2x below minimum shape bounds + // We're on a shape boundary below the minimum bounds, so it should return the maximum. + { { 75.0f, 150.0f, 200.0f }, { 5.0f, 10.0f, 20.0f }, false }, + + // Test: Input within 2nd repeat below minimum shape bounds + // Every repeat should go forwards in values. + { { 76.0f, 152.0f, 203.0f }, { -4.0f, -8.0f, -17.0f }, false }, + + // Test: 1x below minimum shape bounds + // We're on a shape boundary below the minimum bounds, so it should return the maximum. + { { 85.0f, 170.0f, 240.0f }, { 5.0f, 10.0f, 20.0f }, false }, + + // Test: Input within 1st repeat below minimum shape bounds + // Every repeat should go forwards in values. + { { 86.0f, 172.0f, 243.0f }, { -4.0f, -8.0f, -17.0f }, false }, + + // Test: Input exactly on minimum shape bounds + // This should return the actual minimum bounds. + { { 95.0f, 190.0f, 280.0f }, { -5.0f, -10.0f, -20.0f }, false }, + + // Test: Input inside shape bounds + // This should return the mapped value. + { { 101.0f, 202.0f, 303.0f }, { 1.0f, 2.0f, 3.0f }, false }, + + // Test: Input exactly on maximum shape bounds + // We're on a shape boundary above the minimum bounds, so it should return the minimum. + { { 105.0f, 210.0f, 320.0f }, { -5.0f, -10.0f, -20.0f }, false }, + + // Test: Input within 1st repeat above maximum shape bounds + // Every repeat should go forwards in values. + { { 106.0f, 212.0f, 323.0f }, { -4.0f, -8.0f, -17.0f }, false }, + + // Test: 1x above maximum shape bounds + // We're on a shape boundary above the minimum bounds, so it should return the minimum. + { { 105.0f, 210.0f, 320.0f }, { -5.0f, -10.0f, -20.0f }, false }, + + // Test: Input within 2nd repeat above maximum shape bounds + // Every repeat should go forwards in values. + { { 106.0f, 212.0f, 323.0f }, { -4.0f, -8.0f, -17.0f }, false }, + }; + + for (auto& test : tests) + { + TestGradientTransform(setup, test); + } + } + + TEST_F(GradientSignalTransformTestsFixture, ClampToZeroReturnsClampedValuesBasedOnShapeBounds) + { + GradientTransformSetupData setup = { GradientSignal::WrappingType::ClampToZero }; + GradientTransformTestData tests[] = { + // Test: Input point far below minimum shape bounds + // Our input point is below the minimum of shape bounds, so the result should be the minimum corner of the shape. + // Points outside the shape bounds should return "true" for rejected. + { { 0.0f, 0.0f, 0.0f }, { -5.0f, -10.0f, -20.0f }, true }, + + // Test: Input point directly on minimum shape bounds + // Our input point is directly on the minimum of shape bounds, so the result should be the minimum corner of the shape. + { { 95.0f, 190.0f, 280.0f }, { -5.0f, -10.0f, -20.0f }, false }, + + // Test: Input point inside shape bounds + // Our input point is inside the shape bounds, so the result is just input - translation. + { { 101.0f, 202.0f, 303.0f }, { 1.0f, 2.0f, 3.0f }, false }, + + // Test: Input point directly on maximum shape bounds + // On the maximum side, GradientTransform clamps to "max - epsilon" for consistency with other wrapping types, so our + // expected results are the max shape corner - epsilon. + // Points outside the shape bounds (which includes the maximum edge of the shape bounds) should return "true" for rejected. + { { 105.0f, 210.0f, 320.0f }, { 5.0f - UvEpsilon, 10.0f - UvEpsilon, 20.0f - UvEpsilon }, true }, + + // Test: Input point far above maximum shape bounds + // On the maximum side, GradientTransform clamps to "max - epsilon" for consistency with other wrapping types, so our + // expected results are the max shape corner - epsilon. + // Points outside the shape bounds should return "true" for rejected. + { { 1000.0f, 1000.0f, 1000.0f }, { 5.0f - UvEpsilon, 10.0f - UvEpsilon, 20.0f - UvEpsilon }, true }, + }; + + for (auto& test : tests) + { + TestGradientTransform(setup, test); + } + } +} + + diff --git a/Gems/GradientSignal/Code/gradientsignal_files.cmake b/Gems/GradientSignal/Code/gradientsignal_files.cmake index 5b28150eb4..7318f18739 100644 --- a/Gems/GradientSignal/Code/gradientsignal_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_files.cmake @@ -8,6 +8,7 @@ set(FILES Include/GradientSignal/GradientSampler.h + Include/GradientSignal/GradientTransform.h Include/GradientSignal/SmoothStep.h Include/GradientSignal/ImageAsset.h Include/GradientSignal/ImageSettings.h @@ -77,10 +78,10 @@ set(FILES Source/GradientSampler.cpp Source/GradientSignalSystemComponent.cpp Source/GradientSignalSystemComponent.h + Source/GradientTransform.cpp Source/SmoothStep.cpp Source/ImageAsset.cpp Source/ImageSettings.cpp Source/PerlinImprovedNoise.cpp - Source/Util.cpp Source/GradientImageConversion.cpp ) diff --git a/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake b/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake index 8c8a4c25e1..5f8ffe2ebb 100644 --- a/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake @@ -11,6 +11,7 @@ set(FILES Tests/GradientSignalReferencesTests.cpp Tests/GradientSignalServicesTests.cpp Tests/GradientSignalSurfaceTests.cpp + Tests/GradientSignalTransformTests.cpp Tests/GradientSignalTestMocks.h Tests/GradientSignalTest.cpp Tests/ImageAssetTests.cpp From 2f1346c719d5e6ed9c2c9a878bb13e9a75d34c69 Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Wed, 29 Dec 2021 16:38:28 -0600 Subject: [PATCH 213/399] Terrain Feature Processor separated into several classes. Macro materials abstracted from meshes. (#6350) * Breaking up terrain FP wip - macro materials decoupled from meshes. Mesh creation and rendering pulled out from MeshFeatureProcessor into TerrainMeshManager. Stubs added for macro and detail material managers. Signed-off-by: Ken Pruiksma * Separated macro material management from the terrain feature processor. Also separated bindless image array handling from terrain feature processor. Signed-off-by: Ken Pruiksma * Detail materials separated from terrain feature processor. Also pulled out Aabb2i and Vector2i into their own simple classes Signed-off-by: Ken Pruiksma * Changed some classes so that when the SRG changes the classes don't need to be completely reinitialized and can instead just update their indices and push data to the new srg. Fixed an issue where MacroMaterialData wasn't being exposed to ScriptCanvas. Terrain shader reloads should now work correctly. Also added some debug logging to help catch an issue where sometimes detail materials don't seem to load. Signed-off-by: Ken Pruiksma * Terrain PR reveiw updates Signed-off-by: Ken Pruiksma * Some small PR review fixes. More comments in TerrainDetailMaterialManager.h Signed-off-by: Ken Pruiksma * Fixing unused variable causing clang failure Signed-off-by: Ken Pruiksma * Fixing unused variable in release. Signed-off-by: Ken Pruiksma * Fixing a forward declare that oddly didn't work on linux. Signed-off-by: Ken Pruiksma * Fixing linux missing include... not sure why only linux failed on this. Signed-off-by: Ken Pruiksma * Adding missing include Signed-off-by: Ken Pruiksma --- .../ShaderResourceGroups/SceneSrgAll.azsli | 1 + .../ShaderResourceGroups/ViewSrgAll.azsli | 1 - .../Code/Source/Utils/GpuBufferHandler.cpp | 6 +- .../Terrain/DefaultPbrTerrain.material | 2 +- .../Materials/Terrain/PbrTerrain.materialtype | 2 +- .../Assets/Shaders/Terrain/SceneSrg.azsli | 35 + .../Shaders/Terrain/TerrainCommon.azsli | 237 +-- .../Terrain/TerrainDetailHelpers.azsli | 14 +- .../Terrain/TerrainPBR_ForwardPass.azsl | 117 +- .../Assets/Shaders/Terrain/TerrainSrg.azsli | 28 +- .../Shaders/Terrain/Terrain_DepthPass.azsl | 28 +- .../Assets/Shaders/Terrain/ViewSrg.azsli | 80 - .../Code/Source/TerrainRenderer/Aabb2i.cpp | 44 + .../Code/Source/TerrainRenderer/Aabb2i.h | 34 + .../BindlessImageArrayHandler.cpp | 101 ++ .../BindlessImageArrayHandler.h | 48 + .../TerrainDetailMaterialManager.cpp | 912 ++++++++++ .../TerrainDetailMaterialManager.h | 226 +++ .../TerrainFeatureProcessor.cpp | 1614 ++--------------- .../TerrainRenderer/TerrainFeatureProcessor.h | 314 +--- .../TerrainMacroMaterialBus.cpp | 19 + .../TerrainRenderer/TerrainMacroMaterialBus.h | 6 +- .../TerrainMacroMaterialManager.cpp | 412 +++++ .../TerrainMacroMaterialManager.h | 116 ++ .../TerrainRenderer/TerrainMeshManager.cpp | 354 ++++ .../TerrainRenderer/TerrainMeshManager.h | 117 ++ .../Code/Source/TerrainRenderer/Vector2i.cpp | 41 + .../Code/Source/TerrainRenderer/Vector2i.h | 29 + Gems/Terrain/Code/terrain_files.cmake | 12 + 29 files changed, 2965 insertions(+), 1985 deletions(-) create mode 100644 Gems/Terrain/Assets/Shaders/Terrain/SceneSrg.azsli delete mode 100644 Gems/Terrain/Assets/Shaders/Terrain/ViewSrg.azsli create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.cpp create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.h create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.cpp create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.h create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.h create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialManager.cpp create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialManager.h create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.cpp create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.h create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.cpp create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.h diff --git a/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/SceneSrgAll.azsli b/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/SceneSrgAll.azsli index 421178bb01..4480524468 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/SceneSrgAll.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/SceneSrgAll.azsli @@ -13,4 +13,5 @@ #ifdef AZ_COLLECTING_PARTIAL_SRGS #include #include +#include // Temporary until gem partial view srgs can be included automatically. #endif diff --git a/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/ViewSrgAll.azsli b/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/ViewSrgAll.azsli index 9253885cfc..3e90e1a441 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/ViewSrgAll.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/ViewSrgAll.azsli @@ -12,5 +12,4 @@ #ifdef AZ_COLLECTING_PARTIAL_SRGS #include -#include // Temporary until gem partial view srgs can be included automatically. #endif diff --git a/Gems/Atom/Feature/Common/Code/Source/Utils/GpuBufferHandler.cpp b/Gems/Atom/Feature/Common/Code/Source/Utils/GpuBufferHandler.cpp index 7a2827bebe..65bdf655a7 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Utils/GpuBufferHandler.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Utils/GpuBufferHandler.cpp @@ -24,14 +24,14 @@ namespace AZ { m_elementSize = descriptor.m_elementSize; m_elementCount = 0; - + m_bufferIndex = descriptor.m_srgLayout->FindShaderInputBufferIndex(Name(descriptor.m_bufferSrgName)); - AZ_Error(ClassName, m_bufferIndex.IsValid(), "Unable to find %s in view shader resource group.", descriptor.m_bufferSrgName.c_str()); + AZ_Error(ClassName, m_bufferIndex.IsValid(), "Unable to find %s in %s shader resource group.", descriptor.m_bufferSrgName.c_str(), descriptor.m_srgLayout->GetName().GetCStr()); if (!descriptor.m_elementCountSrgName.empty()) { m_elementCountIndex = descriptor.m_srgLayout->FindShaderInputConstantIndex(Name(descriptor.m_elementCountSrgName)); - AZ_Error(ClassName, m_elementCountIndex.IsValid(), "Unable to find %s in view shader resource group.", descriptor.m_elementCountSrgName.c_str()); + AZ_Error(ClassName, m_elementCountIndex.IsValid(), "Unable to find %s in %s shader resource group.", descriptor.m_elementCountSrgName.c_str(), descriptor.m_srgLayout->GetName().GetCStr()); } if (m_bufferIndex.IsValid()) diff --git a/Gems/Terrain/Assets/Materials/Terrain/DefaultPbrTerrain.material b/Gems/Terrain/Assets/Materials/Terrain/DefaultPbrTerrain.material index 53f6fd5b9e..da2fc95293 100644 --- a/Gems/Terrain/Assets/Materials/Terrain/DefaultPbrTerrain.material +++ b/Gems/Terrain/Assets/Materials/Terrain/DefaultPbrTerrain.material @@ -5,7 +5,7 @@ "propertyLayoutVersion": 1, "properties": { "baseColor": { - "color": [ 0.18, 0.18, 0.18 ] + "color": [ 0.18, 0.18, 0.18 ] } } } diff --git a/Gems/Terrain/Assets/Materials/Terrain/PbrTerrain.materialtype b/Gems/Terrain/Assets/Materials/Terrain/PbrTerrain.materialtype index 1e7305cc11..836e85661d 100644 --- a/Gems/Terrain/Assets/Materials/Terrain/PbrTerrain.materialtype +++ b/Gems/Terrain/Assets/Materials/Terrain/PbrTerrain.materialtype @@ -107,7 +107,7 @@ "displayName": "Detail Texture UV Multiplier", "description": "How many times to repeat the detail texture per sector", "type": "Float", - "defaultValue": 8.0, + "defaultValue": 0.5, "connection": { "type": "ShaderInput", "id": "m_detailTextureMultiplier" diff --git a/Gems/Terrain/Assets/Shaders/Terrain/SceneSrg.azsli b/Gems/Terrain/Assets/Shaders/Terrain/SceneSrg.azsli new file mode 100644 index 0000000000..2545db7c93 --- /dev/null +++ b/Gems/Terrain/Assets/Shaders/Terrain/SceneSrg.azsli @@ -0,0 +1,35 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#ifndef AZ_COLLECTING_PARTIAL_SRGS +#error Do not include this file directly. Include the main .srgi file instead. +#endif + +partial ShaderResourceGroup SceneSrg +{ + Sampler HeightmapSampler + { + MinFilter = Linear; + MagFilter = Linear; + MipFilter = Point; + AddressU = Clamp; + AddressV = Clamp; + AddressW = Clamp; + }; + + struct TerrainWorldData + { + float3 m_min; + float m_padding1; + float3 m_max; + float m_padding2; + }; + + Texture2D m_heightmapImage; + TerrainWorldData m_terrainWorldData; +} diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainCommon.azsli b/Gems/Terrain/Assets/Shaders/Terrain/TerrainCommon.azsli index 770f877ea8..ee3e9b2a5f 100644 --- a/Gems/Terrain/Assets/Shaders/Terrain/TerrainCommon.azsli +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainCommon.azsli @@ -15,34 +15,13 @@ ShaderResourceGroup ObjectSrg : SRG_PerObject { - struct TerrainData + struct PatchData { - float2 m_uvMin; - float2 m_uvMax; - float2 m_uvStep; - float m_sampleSpacing; - float m_heightScale; + float2 m_xyTranslation; + float m_xyScale; }; - struct MacroMaterialData - { - float2 m_uvMin; - float2 m_uvMax; - float m_normalFactor; - bool m_flipNormalX; - bool m_flipNormalY; - uint m_mapsInUse; - }; - - row_major float3x4 m_modelToWorld; - - TerrainData m_terrainData; - - MacroMaterialData m_macroMaterialData[4]; - uint m_macroMaterialCount; - - Texture2D m_macroColorMap[4]; - Texture2D m_macroNormalMap[4]; + PatchData m_patchData; // The below shouldn't be in this SRG but needs to be for now because the lighting functions depend on them. @@ -117,109 +96,137 @@ option bool o_useTerrainSmoothing = false; struct VertexInput { float2 m_position : POSITION; - float2 m_uv : UV; }; -// Sample a texture with a 5 tap B-Spline. Consider ripping this out and putting in a more general location. -// This function samples a 4x4 neighborhood around the uv. Normally this would take 16 samples, but by taking -// advantage of bilinear filtering this can be done with 9 taps on the edges between pixels. The cost is further -// reduced by dropping the diagonals. -float SampleBSpline5Tap(Texture2D texture, SamplerState textureSampler, float2 uv, float2 textureSize, float2 rcpTextureSize) +// This class is used to calculate heights and normals for terrain. Using a class for this was the easiest way to +// de-duplicate code between the forward and depth shaders. +class HeightContext { - // Think of sample locations in the 4x4 neighborhood as having a top left coordinate of 0,0 and - // a bottom right coordinate of 3,3. - - // Find the position in texture space then round it to get the center of the 1,1 pixel (tc1) - float2 texelPos = uv * textureSize; - float2 tc1= floor(texelPos - 0.5) + 0.5; - - // Offset from center position to texel - float2 f = texelPos - tc1; - - // Compute B-Spline weights based on the offset - float2 OneMinusF = (1.0 - f); - float2 OneMinusF2 = OneMinusF * OneMinusF; - float2 OneMinusF3 = OneMinusF2 * OneMinusF; - float2 w0 = OneMinusF3; - float2 w1 = 4.0 + 3.0 * f * f * f - 6.0 * f * f; - float2 w2 = 4.0 + 3.0 * OneMinusF3 - 6.0 * OneMinusF2; - float2 w3 = f * f * f; - - float2 w12 = w1 + w2; - - // Compute uv coordinates for sampling the texture - float2 tc0 = (tc1 - 1.0f) * rcpTextureSize; - float2 tc3 = (tc1 + 2.0f) * rcpTextureSize; - float2 tc12 = (tc1 + w2 / w12) * rcpTextureSize; - - // Compute sample weights - float sw0 = w12.x * w12.y; // middle - float sw1 = w12.x * w0.y; // top - float sw2 = w0.x * w12.y; // left - float sw3 = w12.x * w3.y; // bottom - float sw4 = w3.x * w12.y; // right - - // total weight of samples to normalize result. - float totalWeight = sw0 + sw1 + sw2 + sw3 + sw4; - - float result = 0.0f; - result += texture.SampleLevel(textureSampler, float2(tc12.x, tc12.y), 0.0).r * sw0; - result += texture.SampleLevel(textureSampler, float2(tc12.x, tc0.y), 0.0).r * sw1; - result += texture.SampleLevel(textureSampler, float2( tc0.x, tc12.y), 0.0).r * sw2; - result += texture.SampleLevel(textureSampler, float2(tc12.x, tc3.y), 0.0).r * sw3; - result += texture.SampleLevel(textureSampler, float2( tc3.x, tc12.y), 0.0).r * sw4; - - return result / totalWeight; -} + float3 m_worldMin; + float3 m_worldMax; + float2 m_xyPosition; -float4x4 GetObject_WorldMatrix() -{ - float4x4 modelToWorld = float4x4( - float4(1, 0, 0, 0), - float4(0, 1, 0, 0), - float4(0, 0, 1, 0), - float4(0, 0, 0, 1)); - - modelToWorld[0] = ObjectSrg::m_modelToWorld[0]; - modelToWorld[1] = ObjectSrg::m_modelToWorld[1]; - modelToWorld[2] = ObjectSrg::m_modelToWorld[2]; - return modelToWorld; -} + float2 m_textureSize; + float2 m_rcpTextureSize; + float2 m_sampleSpacing; + float2 m_rcpSampleSpacing; -float GetHeight(float2 origUv) -{ - float2 halfStep = ObjectSrg::m_terrainData.m_uvStep * 0.5; - float2 uv = origUv * (1.0 - ObjectSrg::m_terrainData.m_uvStep) + halfStep; + float m_heightScale; + int2 m_heightmapCoord; - float height = 0.0f; - if (o_useTerrainSmoothing) + + // Sample a texture with a 5 tap B-Spline. Consider ripping this out and putting in a more general location. + // This function samples a 4x4 neighborhood around the uv. Normally this would take 16 samples, but by taking + // advantage of bilinear filtering this can be done with 9 taps on the edges between pixels. The cost is further + // reduced by dropping the diagonals. + float SampleBSpline5Tap(Texture2D texture, SamplerState textureSampler, float2 uv, float2 textureSize, float2 rcpTextureSize) { - float2 textureSize; - ViewSrg::m_heightmapImage.GetDimensions(textureSize.x, textureSize.y); - height = SampleBSpline5Tap(ViewSrg::m_heightmapImage, ViewSrg::HeightmapSampler, uv, textureSize, rcp(textureSize)); + // Think of sample locations in the 4x4 neighborhood as having a top left coordinate of 0,0 and + // a bottom right coordinate of 3,3. + + // Find the position in texture space then round it to get the center of the 1,1 pixel (tc1) + float2 texelPos = uv * textureSize; + float2 tc1= floor(texelPos - 0.5) + 0.5; + + // Offset from center position to texel + float2 f = texelPos - tc1; + + // Compute B-Spline weights based on the offset + float2 OneMinusF = (1.0 - f); + float2 OneMinusF2 = OneMinusF * OneMinusF; + float2 OneMinusF3 = OneMinusF2 * OneMinusF; + float2 w0 = OneMinusF3; + float2 w1 = 4.0 + 3.0 * f * f * f - 6.0 * f * f; + float2 w2 = 4.0 + 3.0 * OneMinusF3 - 6.0 * OneMinusF2; + float2 w3 = f * f * f; + + float2 w12 = w1 + w2; + + // Compute uv coordinates for sampling the texture + float2 tc0 = (tc1 - 1.0f) * rcpTextureSize; + float2 tc3 = (tc1 + 2.0f) * rcpTextureSize; + float2 tc12 = (tc1 + w2 / w12) * rcpTextureSize; + + // Compute sample weights + float sw0 = w12.x * w12.y; // middle + float sw1 = w12.x * w0.y; // top + float sw2 = w0.x * w12.y; // left + float sw3 = w12.x * w3.y; // bottom + float sw4 = w3.x * w12.y; // right + + // total weight of samples to normalize result. + float totalWeight = sw0 + sw1 + sw2 + sw3 + sw4; + + float result = 0.0f; + result += texture.SampleLevel(textureSampler, float2(tc12.x, tc12.y), 0.0).r * sw0; + result += texture.SampleLevel(textureSampler, float2(tc12.x, tc0.y), 0.0).r * sw1; + result += texture.SampleLevel(textureSampler, float2( tc0.x, tc12.y), 0.0).r * sw2; + result += texture.SampleLevel(textureSampler, float2(tc12.x, tc3.y), 0.0).r * sw3; + result += texture.SampleLevel(textureSampler, float2( tc3.x, tc12.y), 0.0).r * sw4; + + return result / totalWeight; } - else + + float2 GetWorldXYPosition(in ObjectSrg::PatchData patchData, in float2 vertexPosition) { - height = ViewSrg::m_heightmapImage.SampleLevel(ViewSrg::HeightmapSampler, uv, 0).r; + return float2(patchData.m_xyTranslation + vertexPosition * patchData.m_xyScale); } - return ObjectSrg::m_terrainData.m_heightScale * (height - 0.5f); -} + float2 GetHeightmapUv(in float2 position, in float2 worldMin, in float2 worldMax) + { + return (position - worldMin) / (worldMax - worldMin); + } -float3 GetTerrainWorldPosition(ObjectSrg::TerrainData terrainData, float2 vertexPosition, float2 uv) -{ - // Remove all vertices outside our bounds by turning them into NaN positions. - if (any(uv > 1.0) || any (uv < 0.0)) + int2 GetHeightmapCoord(in float2 position, in float2 rcpSampleSpacing, in float2 worldMin) { - return asfloat(0x7fc00000); // NaN + return int2((position - worldMin) * rcpSampleSpacing); } - // Loop up the height and calculate our final position. - float height = GetHeight(uv); - return mul(GetObject_WorldMatrix(), float4(vertexPosition, height, 1.0f)).xyz; -} + float GetHeight(Texture2D heightmapImage, int2 offset = int2(0, 0)) + { + float height = heightmapImage.Load(int3(m_heightmapCoord + offset, 0)).r; + return m_worldMin.z + height * m_heightScale; + } -float4 GetTerrainProjectedPosition(ObjectSrg::TerrainData terrainData, float2 vertexPosition, float2 uv) -{ - return mul(ViewSrg::m_viewProjectionMatrix, float4(GetTerrainWorldPosition(terrainData, vertexPosition, uv), 1.0)); -} + float GetSmoothedHeight(Texture2D heightmapImage, SamplerState heightmapSampler) + { + float2 uv = GetHeightmapUv(m_xyPosition, m_worldMin.xy, m_worldMax.xy); + float2 halfStep = m_rcpTextureSize * 0.5; + uv = uv * (1.0 - m_rcpTextureSize) + halfStep; + float height = SampleBSpline5Tap(heightmapImage, heightmapSampler, uv, m_textureSize, m_rcpTextureSize); + return m_worldMin.z + height * (m_worldMax.z - m_worldMin.z); + } + + float3 CalculateNormal(Texture2D heightmapImage) + { + float up = GetHeight(heightmapImage, int2( 0, -1)); + float right = GetHeight(heightmapImage, int2( 1, 0)); + float down = GetHeight(heightmapImage, int2( 0, 1)); + float left = GetHeight(heightmapImage, int2(-1, 0)); + + float3 bitangent = normalize(float3(0.0, m_sampleSpacing.y * 2.0f, down - up)); + float3 tangent = normalize(float3(m_sampleSpacing.x * 2.0f, 0.0, right - left)); + return normalize(cross(tangent, bitangent)); + } + + bool IsVertexOutsideOfTerrainBounds() + { + return (any(m_xyPosition < m_worldMin.xy) || + any(m_xyPosition > m_worldMax.xy)); + } + + void Initialize(Texture2D heightmapImage, float2 vertexPosition, ObjectSrg::PatchData patchData, float3 worldMin, float3 worldMax) + { + m_worldMin = worldMin; + m_worldMax = worldMax; + m_xyPosition = GetWorldXYPosition(patchData, vertexPosition); + + heightmapImage.GetDimensions(m_textureSize.x, m_textureSize.y); + m_rcpTextureSize = rcp(m_textureSize); + m_sampleSpacing = (worldMax.xy - worldMin.xy) * m_rcpTextureSize; + m_rcpSampleSpacing = rcp(m_sampleSpacing); + + m_heightScale = worldMax.z - worldMin.z; + m_heightmapCoord = GetHeightmapCoord(m_xyPosition, m_rcpSampleSpacing, worldMin.xy); + } +}; diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailHelpers.azsli b/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailHelpers.azsli index 33c817c0f9..b18f2885db 100644 --- a/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailHelpers.azsli +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailHelpers.azsli @@ -123,7 +123,7 @@ float3 GetDetailColor(TerrainSrg::DetailMaterialData materialData, float2 uv, fl float3 color = materialData.m_baseColor; if ((materialData.m_flags & DetailTextureFlags::UseTextureBaseColor) > 0) { - color = TerrainSrg::m_detailTextures[GetDetailColorIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).rgb; + color = TerrainSrg::m_textures[GetDetailColorIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).rgb; } return color * materialData.m_baseColorFactor; } @@ -133,7 +133,7 @@ float3 GetDetailNormal(TerrainSrg::DetailMaterialData materialData, float2 uv, f float2 normal = float2(0.0, 0.0); if ((materialData.m_flags & DetailTextureFlags::UseTextureNormal) > 0) { - normal = TerrainSrg::m_detailTextures[GetDetailNormalIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).rg; + normal = TerrainSrg::m_textures[GetDetailNormalIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).rg; } // X and Y are inverted here to be consistent with SampleNormalXY in NormalInput.azsli. @@ -153,7 +153,7 @@ float GetDetailRoughness(TerrainSrg::DetailMaterialData materialData, float2 uv, float roughness = materialData.m_roughnessScale; if ((materialData.m_flags & DetailTextureFlags::UseTextureRoughness) > 0) { - roughness = TerrainSrg::m_detailTextures[GetDetailRoughnessIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; + roughness = TerrainSrg::m_textures[GetDetailRoughnessIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; roughness = materialData.m_roughnessBias + roughness * materialData.m_roughnessScale; } return roughness; @@ -164,7 +164,7 @@ float GetDetailMetalness(TerrainSrg::DetailMaterialData materialData, float2 uv, float metalness = 1.0; if ((materialData.m_flags & DetailTextureFlags::UseTextureMetallic) > 0) { - metalness = TerrainSrg::m_detailTextures[GetDetailMetalnessIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; + metalness = TerrainSrg::m_textures[GetDetailMetalnessIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; } return metalness * materialData.m_metalFactor; } @@ -174,7 +174,7 @@ float GetDetailSpecularF0(TerrainSrg::DetailMaterialData materialData, float2 uv float specularF0 = 1.0; if ((materialData.m_flags & DetailTextureFlags::UseTextureSpecularF0) > 0) { - specularF0 = TerrainSrg::m_detailTextures[GetDetailSpecularF0Index(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; + specularF0 = TerrainSrg::m_textures[GetDetailSpecularF0Index(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; } return specularF0 * materialData.m_specularF0Factor; } @@ -184,7 +184,7 @@ float GetDetailOcclusion(TerrainSrg::DetailMaterialData materialData, float2 uv, float occlusion = 1.0; if ((materialData.m_flags & DetailTextureFlags::UseTextureOcclusion) > 0) { - occlusion = TerrainSrg::m_detailTextures[GetDetailOcclusionIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; + occlusion = TerrainSrg::m_textures[GetDetailOcclusionIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; } return occlusion * materialData.m_occlusionFactor; } @@ -194,7 +194,7 @@ float GetDetailHeight(TerrainSrg::DetailMaterialData materialData, float2 uv, fl float height = materialData.m_heightFactor; if ((materialData.m_flags & DetailTextureFlags::UseTextureHeight) > 0) { - height = TerrainSrg::m_detailTextures[GetDetailHeightIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; + height = TerrainSrg::m_textures[GetDetailHeightIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; height = materialData.m_heightOffset + height * materialData.m_heightFactor; } return height; diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainPBR_ForwardPass.azsl b/Gems/Terrain/Assets/Shaders/Terrain/TerrainPBR_ForwardPass.azsl index ab9064e740..741f45d775 100644 --- a/Gems/Terrain/Assets/Shaders/Terrain/TerrainPBR_ForwardPass.azsl +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainPBR_ForwardPass.azsl @@ -8,6 +8,7 @@ #include +#include #include #include #include @@ -26,7 +27,6 @@ struct VSOutput float4 m_position : SV_Position; float3 m_normal: NORMAL; float3 m_worldPosition : UV0; - float2 m_uv : UV1; float3 m_shadowCoords[ViewSrg::MaxCascadeCount] : UV2; }; @@ -34,24 +34,30 @@ VSOutput TerrainPBR_MainPassVS(VertexInput IN) { VSOutput OUT; - ObjectSrg::TerrainData terrainData = ObjectSrg::m_terrainData; + HeightContext heightContext; + heightContext.Initialize(SceneSrg::m_heightmapImage, IN.m_position, ObjectSrg::m_patchData, SceneSrg::m_terrainWorldData.m_min, SceneSrg::m_terrainWorldData.m_max); - float2 uv = IN.m_uv; - float2 origUv = lerp(terrainData.m_uvMin, terrainData.m_uvMax, uv); - float3 worldPosition = GetTerrainWorldPosition(terrainData, IN.m_position, origUv); - OUT.m_position = mul(ViewSrg::m_viewProjectionMatrix, float4(worldPosition, 1.0)); - OUT.m_worldPosition = worldPosition; + if (heightContext.IsVertexOutsideOfTerrainBounds()) + { + // Output a NaN to remove this vertex. + OUT.m_position = 1.0 / 0.0; + return OUT; + } - // Calculate normal - float up = GetHeight(origUv + terrainData.m_uvStep * float2( 0.0f, -1.0f)); - float right = GetHeight(origUv + terrainData.m_uvStep * float2( 1.0f, 0.0f)); - float down = GetHeight(origUv + terrainData.m_uvStep * float2( 0.0f, 1.0f)); - float left = GetHeight(origUv + terrainData.m_uvStep * float2(-1.0f, 0.0f)); + float height = 0.0; - float3 bitangent = normalize(float3(0.0, terrainData.m_sampleSpacing * 2.0f, down - up)); - float3 tangent = normalize(float3(terrainData.m_sampleSpacing * 2.0f, 0.0, right - left)); - OUT.m_normal = normalize(cross(tangent, bitangent)); - OUT.m_uv = uv; + if (o_useTerrainSmoothing) + { + height = heightContext.GetSmoothedHeight(SceneSrg::m_heightmapImage, SceneSrg::HeightmapSampler); + } + else + { + height = heightContext.GetHeight(SceneSrg::m_heightmapImage); + } + + OUT.m_worldPosition = float3(heightContext.m_xyPosition, height); + OUT.m_position = mul(ViewSrg::m_viewProjectionMatrix, float4(OUT.m_worldPosition, 1.0)); + OUT.m_normal = heightContext.CalculateNormal(SceneSrg::m_heightmapImage); // directional light shadow const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; @@ -59,7 +65,7 @@ VSOutput TerrainPBR_MainPassVS(VertexInput IN) { DirectionalLightShadow::GetShadowCoords( shadowIndex, - worldPosition, + OUT.m_worldPosition, OUT.m_normal, OUT.m_shadowCoords); } @@ -76,7 +82,7 @@ ForwardPassOutput TerrainPBR_MainPassPS(VSOutput IN) float viewDistance = length(ViewSrg::m_worldPosition - surface.position); float detailFactor = saturate((viewDistance - TerrainMaterialSrg::m_detailFadeDistance) / max(TerrainMaterialSrg::m_detailFadeLength, EPSILON)); - float2 detailUv = IN.m_uv * TerrainMaterialSrg::m_detailTextureMultiplier; + float2 detailUv = IN.m_worldPosition.xy * TerrainMaterialSrg::m_detailTextureMultiplier; // ------- Normal ------- float3 macroNormal = normalize(IN.m_normal); @@ -84,39 +90,54 @@ ForwardPassOutput TerrainPBR_MainPassPS(VSOutput IN) // ------- Macro Color / Normal ------- float3 macroColor = TerrainMaterialSrg::m_baseColor.rgb; - // There's a bug that shows up with an NVidia GTX 1660 Super card happening on driver versions as recent as 496.49 (10/26/21) in which - // the IN.m_uv values will intermittently "flicker" to 0.0 after entering and exiting game mode. - // (See https://github.com/o3de/o3de/issues/5014) - // This bug has only shown up on PCs when using the DX12 RHI. It doesn't show up with Vulkan or when capturing frames with PIX or - // RenderDoc. Our best guess is that it is a driver bug. The workaround is to use the IN.m_uv values in a calculation prior to the - // point that we actually use them for macroUv below. The "if(any(!isnan(IN.m_uv)))" seems to be sufficient for the workaround. The - // if statement will always be true, but just the act of reading these values in the if statement makes the values stable. Removing - // the if statement causes the flickering to occur using the steps documented in the bug. - if (any(!isnan(IN.m_uv))) + uint2 macroGridResolution = uint2(TerrainSrg::m_macroMaterialGrid.m_resolution >> 16, TerrainSrg::m_macroMaterialGrid.m_resolution & 0xFFFF); + float macroTileSize = TerrainSrg::m_macroMaterialGrid.m_tileSize; + float2 macroGridOffset = TerrainSrg::m_macroMaterialGrid.m_offset; + uint2 macroGridPosition = (surface.position.xy - macroGridOffset) / macroTileSize; + + uint macroTileIndex = macroGridResolution.x * macroGridPosition.y + macroGridPosition.x; + static const uint NumMacroMaterialsPerTile = 4; + macroTileIndex *= NumMacroMaterialsPerTile; + + [unroll] for (uint i = 0; i < NumMacroMaterialsPerTile; ++i) { - [unroll] for (uint i = 0; i < 4 && (i < ObjectSrg::m_macroMaterialCount); ++i) + TerrainSrg::MacroMaterialData macroMaterialData = TerrainSrg::m_macroMaterialData[macroTileIndex + i]; + if ((macroMaterialData.m_flags & 1) == 0) + { + break; // No more macro materials for this tile + } + + if (any(surface.position.xy < macroMaterialData.m_boundsMin) || any (surface.position.xy > macroMaterialData.m_boundsMax)) + { + continue; // Macro material exists for this tile but is out of the bounds of this particular position + } + + float2 macroUvSize = macroMaterialData.m_boundsMax - macroMaterialData.m_boundsMin; + macroUvSize.x = -macroUvSize.x; + float2 macroUv = (macroMaterialData.m_boundsMin - surface.position.xy) / macroUvSize; + + // The macro uv gradient can vary massively over the quad because different pixels may choose different macro materials with different UVs. + // To fix, we use the world position scaled by the macro uv scale which should be fairly uniform across macro materials. + float2 macroUvScale = IN.m_worldPosition.xy / macroUvSize; + float2 ddx_macroUv = ddx(macroUvScale); + float2 ddy_macroUv = ddy(macroUvScale); + + if (macroMaterialData.m_colorMapId != 0xFFFF) + { + macroColor = TerrainSrg::m_textures[macroMaterialData.m_colorMapId].SampleGrad(TerrainMaterialSrg::m_sampler, macroUv, ddx_macroUv, ddy_macroUv).rgb; + macroColor = TransformColor(macroColor, ColorSpaceId::LinearSRGB, ColorSpaceId::ACEScg); + } + + if (macroMaterialData.m_normalMapId != 0xFFFF) { - float2 macroUvMin = ObjectSrg::m_macroMaterialData[i].m_uvMin; - float2 macroUvMax = ObjectSrg::m_macroMaterialData[i].m_uvMax; - float2 macroUv = lerp(macroUvMin, macroUvMax, IN.m_uv); - if (macroUv.x >= 0.0 && macroUv.x <= 1.0 && macroUv.y >= 0.0 && macroUv.y <= 1.0) - { - if ((ObjectSrg::m_macroMaterialData[i].m_mapsInUse & 1) > 0) - { - macroColor = GetBaseColorInput(ObjectSrg::m_macroColorMap[i], TerrainMaterialSrg::m_sampler, macroUv, macroColor, true); - } - if ((ObjectSrg::m_macroMaterialData[i].m_mapsInUse & 2) > 0) - { - bool flipX = ObjectSrg::m_macroMaterialData[i].m_flipNormalX; - bool flipY = ObjectSrg::m_macroMaterialData[i].m_flipNormalY; - float factor = ObjectSrg::m_macroMaterialData[i].m_normalFactor; - - float2 sampledValue = SampleNormalXY(ObjectSrg::m_macroNormalMap[i], TerrainMaterialSrg::m_sampler, macroUv, flipX, flipY); - macroNormal = normalize(GetTangentSpaceNormal_Unnormalized(sampledValue.xy, factor)); - } - break; - } + bool flipX = macroMaterialData.m_flags & 2; + bool flipY = macroMaterialData.m_flags & 4; + float factor = macroMaterialData.m_normalFactor; + + float2 sampledValue = SampleNormalXY(TerrainSrg::m_textures[macroMaterialData.m_normalMapId], TerrainMaterialSrg::m_sampler, macroUv, flipX, flipY); + macroNormal = normalize(GetTangentSpaceNormal_Unnormalized(sampledValue, factor)); } + break; } // ------- Base Color ------- diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainSrg.azsli b/Gems/Terrain/Assets/Shaders/Terrain/TerrainSrg.azsli index f980e02b9d..3fcf8d75ca 100644 --- a/Gems/Terrain/Assets/Shaders/Terrain/TerrainSrg.azsli +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainSrg.azsli @@ -53,12 +53,38 @@ ShaderResourceGroup TerrainSrg : SRG_Terrain uint2 m_padding; }; + struct MacroMaterialData + { + // bit 1 : Is this macro material used. + // bit 2 : flip normal x + // bit 3 : flip normal y + uint m_flags; + + uint m_colorMapId; + uint m_normalMapId; + float m_normalFactor; + float2 m_boundsMin; + float2 m_boundsMax; + }; + + struct MacroMaterialGrid + { + uint m_resolution; // How many x/y tiles in grid. x & y stored in 16 bits each. Total number of entries in m_macroMaterialData will be x * y + float m_tileSize; // Size of a tile in meters. + float2 m_offset; // x/y offset of min x/y corner of grid. + }; + Texture2D m_detailMaterialIdImage; StructuredBuffer m_detailMaterialData; - Texture2D m_detailTextures[]; // bindless array of all textures for detail materials + StructuredBuffer m_macroMaterialData; + MacroMaterialGrid m_macroMaterialGrid; + + Texture2D m_textures[]; // bindless array of all textures for detail and macro materials float2 m_detailMaterialIdImageCenter; float m_detailHalfPixelUv; float4 m_detailAabb; } + +static const float MacroMaterialsPerTile = 4; diff --git a/Gems/Terrain/Assets/Shaders/Terrain/Terrain_DepthPass.azsl b/Gems/Terrain/Assets/Shaders/Terrain/Terrain_DepthPass.azsl index fd855a1bcd..c74a0646ee 100644 --- a/Gems/Terrain/Assets/Shaders/Terrain/Terrain_DepthPass.azsl +++ b/Gems/Terrain/Assets/Shaders/Terrain/Terrain_DepthPass.azsl @@ -6,6 +6,7 @@ */ #include +#include #include #include "TerrainCommon.azsli" #include @@ -18,9 +19,30 @@ struct VSDepthOutput VSDepthOutput MainVS(in VertexInput input) { VSDepthOutput output; - ObjectSrg::TerrainData terrainData = ObjectSrg::m_terrainData; - float2 origUv = lerp(terrainData.m_uvMin, terrainData.m_uvMax, input.m_uv); - output.m_position = GetTerrainProjectedPosition(terrainData, input.m_position, origUv); + HeightContext heightContext; + heightContext.Initialize(SceneSrg::m_heightmapImage, input.m_position, ObjectSrg::m_patchData, SceneSrg::m_terrainWorldData.m_min, SceneSrg::m_terrainWorldData.m_max); + + if (heightContext.IsVertexOutsideOfTerrainBounds()) + { + // Output a NaN to remove this vertex. + output.m_position = 1.0 / 0.0; + return output; + } + + float height = 0.0; + + if (o_useTerrainSmoothing) + { + height = heightContext.GetSmoothedHeight(SceneSrg::m_heightmapImage, SceneSrg::HeightmapSampler); + } + else + { + height = heightContext.GetHeight(SceneSrg::m_heightmapImage); + } + + float3 worldPosition = float3(heightContext.m_xyPosition, height); + output.m_position = mul(ViewSrg::m_viewProjectionMatrix, float4(worldPosition, 1.0)); + return output; } diff --git a/Gems/Terrain/Assets/Shaders/Terrain/ViewSrg.azsli b/Gems/Terrain/Assets/Shaders/Terrain/ViewSrg.azsli deleted file mode 100644 index 144f2abf6b..0000000000 --- a/Gems/Terrain/Assets/Shaders/Terrain/ViewSrg.azsli +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#ifndef AZ_COLLECTING_PARTIAL_SRGS -#error Do not include this file directly. Include the main .srgi file instead. -#endif - -partial ShaderResourceGroup ViewSrg -{ - Sampler HeightmapSampler - { - MinFilter = Linear; - MagFilter = Linear; - MipFilter = Point; - AddressU = Clamp; - AddressV = Clamp; - AddressW = Clamp; - }; - - Sampler DetailSampler - { - AddressU = Wrap; - AddressV = Wrap; - MinFilter = Point; - MagFilter = Point; - MipFilter = Point; - }; - - struct DetailMaterialData - { - // Uv - row_major float3x4 m_uvTransform; - - float3 m_baseColor; - - // Factor / Scale / Bias for input textures - float m_baseColorFactor; - - float m_normalFactor; - float m_metalFactor; - float m_roughnessScale; - float m_roughnessBias; - - float m_specularF0Factor; - float m_occlusionFactor; - float m_heightFactor; - float m_heightOffset; - - float m_heightBlendFactor; - - // Flags - uint m_flags; // see DetailTextureFlags - - // Image indices - uint m_colorNormalImageIndices; - uint m_roughnessMetalnessImageIndices; - - uint m_specularF0OcclusionImageIndices; - uint m_heightImageIndex; // only first 16 bits used - - // 16 byte aligned - uint2 m_padding; - }; - - Texture2D m_heightmapImage; - Texture2D m_detailMaterialIdImage; - StructuredBuffer m_detailMaterialData; - - Texture2D m_detailTextures[]; // bindless array of all textures for detail materials - - float2 m_detailMaterialIdImageCenter; - float m_detailHalfPixelUv; - - float4 m_detailAabb; -} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.cpp new file mode 100644 index 0000000000..c38651f296 --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace Terrain +{ + Aabb2i::Aabb2i(const Vector2i& min, const Vector2i& max) + : m_min(min) + , m_max(max) + {} + + Aabb2i Aabb2i::operator+(const Vector2i& rhs) const + { + return { m_min + rhs, m_max + rhs }; + } + + Aabb2i Aabb2i::operator-(const Vector2i& rhs) const + { + return *this + -rhs; + } + + Aabb2i Aabb2i::GetClamped(Aabb2i rhs) const + { + Aabb2i ret; + ret.m_min.m_x = AZ::GetMax(m_min.m_x, rhs.m_min.m_x); + ret.m_min.m_y = AZ::GetMax(m_min.m_y, rhs.m_min.m_y); + ret.m_max.m_x = AZ::GetMin(m_max.m_x, rhs.m_max.m_x); + ret.m_max.m_y = AZ::GetMin(m_max.m_y, rhs.m_max.m_y); + return ret; + } + + bool Aabb2i::IsValid() const + { + // Intentionally strict, equal min/max not valid. + return m_min.m_x < m_max.m_x && m_min.m_y < m_max.m_y; + } +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.h b/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.h new file mode 100644 index 0000000000..88f735564d --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include + +namespace Terrain +{ + class Aabb2i + { + public: + + Aabb2i() = default; + Aabb2i(const Vector2i& min, const Vector2i& max); + + Aabb2i operator+(const Vector2i& offset) const; + Aabb2i operator-(const Vector2i& offset) const; + + Aabb2i GetClamped(Aabb2i rhs) const; + bool IsValid() const; + + + Vector2i m_min{AZStd::numeric_limits::min(), AZStd::numeric_limits::min()}; + Vector2i m_max{AZStd::numeric_limits::max(), AZStd::numeric_limits::max()}; + + }; +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.cpp new file mode 100644 index 0000000000..595877c88b --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.cpp @@ -0,0 +1,101 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include + +namespace AZ::Render +{ + namespace + { + [[maybe_unused]] const char* BindlessImageArrayHandlerName = "TerrainFeatureProcessor"; + } + + void BindlessImageArrayHandler::Initialize(AZ::Data::Instance& srg, const AZ::Name& propertyName) + { + if (!m_isInitialized) + { + m_isInitialized = UpdateSrgIndices(srg, propertyName); + } + else + { + AZ_Error(BindlessImageArrayHandlerName, false, "Already initialized."); + } + } + + void BindlessImageArrayHandler::Reset() + { + m_texturesIndex = {}; + m_isInitialized = false; + } + + bool BindlessImageArrayHandler::IsInitialized() const + { + return m_isInitialized; + } + + bool BindlessImageArrayHandler::UpdateSrgIndices(AZ::Data::Instance& srg, const AZ::Name& propertyName) + { + if (srg) + { + m_texturesIndex = srg->GetLayout()->FindShaderInputImageUnboundedArrayIndex(propertyName); + AZ_Error(BindlessImageArrayHandlerName, m_texturesIndex.IsValid(), "Failed to find srg input constant %s.", propertyName.GetCStr()); + } + else + { + AZ_Error(BindlessImageArrayHandlerName, false, "Cannot initialize using a null shader resource group."); + } + return m_texturesIndex.IsValid(); + } + + uint16_t BindlessImageArrayHandler::AppendBindlessImage(const AZ::RHI::ImageView* imageView) + { + uint16_t imageIndex = 0xFFFF; + + AZStd::unique_lock lock(m_updateMutex); + if (m_bindlessImageViewFreeList.size() > 0) + { + imageIndex = m_bindlessImageViewFreeList.back(); + m_bindlessImageViewFreeList.pop_back(); + m_bindlessImageViews.at(imageIndex) = imageView; + } + else + { + imageIndex = aznumeric_cast(m_bindlessImageViews.size()); + m_bindlessImageViews.push_back(imageView); + } + return imageIndex; + } + + void BindlessImageArrayHandler::UpdateBindlessImage(uint16_t index, const AZ::RHI::ImageView* imageView) + { + AZStd::shared_lock lock(m_updateMutex); + m_bindlessImageViews.at(index) = imageView; + } + + void BindlessImageArrayHandler::RemoveBindlessImage(uint16_t index) + { + AZStd::unique_lock lock(m_updateMutex); + m_bindlessImageViews.at(index) = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Magenta)->GetImageView(); + m_bindlessImageViewFreeList.push_back(index); + } + + bool BindlessImageArrayHandler::UpdateSrg(AZ::Data::Instance& srg) const + { + if (!m_isInitialized) + { + AZ_Error("BindlessImageArrayHandler", false, "BindlessImageArrayHandler not initialized") + return false; + } + + AZStd::array_view imageViews(m_bindlessImageViews.data(), m_bindlessImageViews.size()); + return srg->SetImageViewUnboundedArray(m_texturesIndex, imageViews); + } + +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.h b/Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.h new file mode 100644 index 0000000000..5315e8526d --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +#include +#include +#include + +namespace AZ::Render +{ + class BindlessImageArrayHandler + { + public: + + static constexpr uint16_t InvalidImageIndex = 0xFFFF; + + BindlessImageArrayHandler() = default; + ~BindlessImageArrayHandler() = default; + + void Initialize(AZ::Data::Instance& srg, const AZ::Name& propertyName); + void Reset(); + bool IsInitialized() const; + bool UpdateSrgIndices(AZ::Data::Instance& srg, const AZ::Name& propertyName); + + uint16_t AppendBindlessImage(const RHI::ImageView* imageView); + void UpdateBindlessImage(uint16_t index, const RHI::ImageView* imageView); + void RemoveBindlessImage(uint16_t index); + + bool UpdateSrg(AZ::Data::Instance& srg) const; + + private: + + AZStd::vector m_bindlessImageViews; + AZStd::vector m_bindlessImageViewFreeList; + RHI::ShaderInputImageUnboundedArrayIndex m_texturesIndex; + AZStd::shared_mutex m_updateMutex; + bool m_isInitialized{ false }; + }; +} + diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp new file mode 100644 index 0000000000..2bc9e42bff --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp @@ -0,0 +1,912 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +#include + +#include +#include +#include + +#include + +namespace Terrain +{ + namespace + { + [[maybe_unused]] static const char* TerrainDetailMaterialManagerName = "TerrainDetailMaterialManager"; + static const char* TerrainDetailChars = "TerrainDetail"; + } + + namespace DetailMaterialInputs + { + static const char* const BaseColorColor("baseColor.color"); + static const char* const BaseColorMap("baseColor.textureMap"); + static const char* const BaseColorUseTexture("baseColor.useTexture"); + static const char* const BaseColorFactor("baseColor.factor"); + static const char* const BaseColorBlendMode("baseColor.textureBlendMode"); + static const char* const MetallicMap("metallic.textureMap"); + static const char* const MetallicUseTexture("metallic.useTexture"); + static const char* const MetallicFactor("metallic.factor"); + static const char* const RoughnessMap("roughness.textureMap"); + static const char* const RoughnessUseTexture("roughness.useTexture"); + static const char* const RoughnessFactor("roughness.factor"); + static const char* const RoughnessLowerBound("roughness.lowerBound"); + static const char* const RoughnessUpperBound("roughness.upperBound"); + static const char* const SpecularF0Map("specularF0.textureMap"); + static const char* const SpecularF0UseTexture("specularF0.useTexture"); + static const char* const SpecularF0Factor("specularF0.factor"); + static const char* const NormalMap("normal.textureMap"); + static const char* const NormalUseTexture("normal.useTexture"); + static const char* const NormalFactor("normal.factor"); + static const char* const NormalFlipX("normal.flipX"); + static const char* const NormalFlipY("normal.flipY"); + static const char* const DiffuseOcclusionMap("occlusion.diffuseTextureMap"); + static const char* const DiffuseOcclusionUseTexture("occlusion.diffuseUseTexture"); + static const char* const DiffuseOcclusionFactor("occlusion.diffuseFactor"); + static const char* const HeightMap("parallax.textureMap"); + static const char* const HeightUseTexture("parallax.useTexture"); + static const char* const HeightFactor("parallax.factor"); + static const char* const HeightOffset("parallax.offset"); + static const char* const HeightBlendFactor("parallax.blendFactor"); + } + + namespace TerrainSrgInputs + { + static const char* const DetailMaterialIdImage("m_detailMaterialIdImage"); + static const char* const DetailMaterialData("m_detailMaterialData"); + static const char* const DetailMaterialIdImageCenter("m_detailMaterialIdImageCenter"); + static const char* const DetailHalfPixelUv("m_detailHalfPixelUv"); + static const char* const DetailAabb("m_detailAabb"); + } + + AZ_CVAR(bool, + r_terrainDebugDetailMaterials, + false, + [](const bool& value) + { + AZ::RPI::ShaderSystemInterface::Get()->SetGlobalShaderOption(AZ::Name{ "o_debugDetailMaterialIds" }, AZ::RPI::ShaderOptionValue{ value }); + }, + AZ::ConsoleFunctorFlags::Null, + "Turns on debugging for detail material ids for terrain." + ); + + AZ_CVAR(bool, + r_terrainDebugDetailImageUpdates, + false, + nullptr, + AZ::ConsoleFunctorFlags::Null, + "Turns on debugging for detail material update regions for terrain." + ); + + void TerrainDetailMaterialManager::Initialize( + const AZStd::shared_ptr& bindlessImageHandler, + AZ::Data::Instance& terrainSrg) + { + AZ_Error(TerrainDetailMaterialManagerName, bindlessImageHandler, "bindlessImageHandler must not be null."); + AZ_Error(TerrainDetailMaterialManagerName, terrainSrg, "terrainSrg must not be null."); + AZ_Error(TerrainDetailMaterialManagerName, !m_isInitialized, "Already initialized."); + + if (!bindlessImageHandler || !terrainSrg || m_isInitialized) + { + return; + } + + if (UpdateSrgIndices(terrainSrg)) + { + m_bindlessImageHandler = bindlessImageHandler; + + // Find any detail material areas that have already been created. + TerrainAreaMaterialRequestBus::EnumerateHandlers( + [&](TerrainAreaMaterialRequests* handler) + { + const AZ::Aabb& bounds = handler->GetTerrainSurfaceMaterialRegion(); + const AZStd::vector materialMappings = handler->GetSurfaceMaterialMappings(); + AZ::EntityId entityId = *(Terrain::TerrainAreaMaterialRequestBus::GetCurrentBusId()); + + DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); + materialRegion.m_region = bounds; + + for (const auto& materialMapping : materialMappings) + { + if (materialMapping.m_materialInstance) + { + OnTerrainSurfaceMaterialMappingCreated(entityId, materialMapping.m_surfaceTag, materialMapping.m_materialInstance); + } + } + return true; + } + ); + TerrainAreaMaterialNotificationBus::Handler::BusConnect(); + + AZ::Aabb worldBounds = AZ::Aabb::CreateNull(); + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + worldBounds, &AzFramework::Terrain::TerrainDataRequests::GetTerrainAabb); + + OnTerrainDataChanged(worldBounds, TerrainDataChangedMask::SurfaceData); + AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusConnect(); + + m_isInitialized = true; + } + } + + bool TerrainDetailMaterialManager::UpdateSrgIndices(AZ::Data::Instance& terrainSrg) + { + const AZ::RHI::ShaderResourceGroupLayout* terrainSrgLayout = terrainSrg->GetLayout(); + + m_detailMaterialIdPropertyIndex = terrainSrgLayout->FindShaderInputImageIndex(AZ::Name(TerrainSrgInputs::DetailMaterialIdImage)); + AZ_Error(TerrainDetailMaterialManagerName, m_detailMaterialIdPropertyIndex.IsValid(), "Failed to find terrain srg input constant %s.", TerrainSrgInputs::DetailMaterialIdImage); + + m_detailCenterPropertyIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::DetailMaterialIdImageCenter)); + AZ_Error(TerrainDetailMaterialManagerName, m_detailCenterPropertyIndex.IsValid(), "Failed to find terrain srg input constant %s.", TerrainSrgInputs::DetailMaterialIdImageCenter); + + m_detailHalfPixelUvPropertyIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::DetailHalfPixelUv)); + AZ_Error(TerrainDetailMaterialManagerName, m_detailHalfPixelUvPropertyIndex.IsValid(), "Failed to find terrain srg input constant %s.", TerrainSrgInputs::DetailHalfPixelUv); + + m_detailAabbPropertyIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::DetailAabb)); + AZ_Error(TerrainDetailMaterialManagerName, m_detailAabbPropertyIndex.IsValid(), "Failed to find terrain srg input constant %s.", TerrainSrgInputs::DetailAabb); + + // Set up the gpu buffer for detail material data + AZ::Render::GpuBufferHandler::Descriptor desc; + desc.m_bufferName = "Detail Material Data"; + desc.m_bufferSrgName = TerrainSrgInputs::DetailMaterialData; + desc.m_elementSize = sizeof(DetailMaterialShaderData); + desc.m_srgLayout = terrainSrgLayout; + m_detailMaterialDataBuffer = AZ::Render::GpuBufferHandler(desc); + + bool IndicesValid = + m_detailMaterialIdPropertyIndex.IsValid() && + m_detailCenterPropertyIndex.IsValid() && + m_detailHalfPixelUvPropertyIndex.IsValid() && + m_detailAabbPropertyIndex.IsValid(); + + m_detailImageNeedsUpdate = true; + m_detailMaterialBufferNeedsUpdate = true; + + return IndicesValid && m_detailMaterialDataBuffer.IsValid(); + } + + void TerrainDetailMaterialManager::RemoveAllImages() + { + for (const DetailMaterialData& materialData: m_detailMaterials.GetDataVector()) + { + DetailMaterialShaderData& shaderData = m_detailMaterialShaderData.GetElement(materialData.m_detailMaterialBufferIndex); + + auto checkRemoveImage = [&](uint16_t index) + { + if (index != 0xFFFF) + { + m_bindlessImageHandler->RemoveBindlessImage(index); + } + }; + + checkRemoveImage(shaderData.m_colorImageIndex); + checkRemoveImage(shaderData.m_normalImageIndex); + checkRemoveImage(shaderData.m_roughnessImageIndex); + checkRemoveImage(shaderData.m_metalnessImageIndex); + checkRemoveImage(shaderData.m_specularF0ImageIndex); + checkRemoveImage(shaderData.m_occlusionImageIndex); + checkRemoveImage(shaderData.m_heightImageIndex); + } + } + + bool TerrainDetailMaterialManager::IsInitialized() const + { + return m_isInitialized; + } + + void TerrainDetailMaterialManager::Reset() + { + RemoveAllImages(); + m_bindlessImageHandler.reset(); + + m_detailTextureImage = {}; + m_detailMaterials.Clear(); + m_detailMaterialRegions.Clear(); + m_detailMaterialShaderData.Clear(); + m_detailMaterialDataBuffer.Release(); + + m_dirtyDetailRegion = AZ::Aabb::CreateNull(); + m_previousCameraPosition = AZ::Vector3(AZStd::numeric_limits::max(), 0.0, 0.0); + m_detailTextureBounds = {}; + m_detailTextureCenter = {}; + + m_detailMaterialBufferNeedsUpdate = false; + m_detailImageNeedsUpdate = false; + + TerrainAreaMaterialNotificationBus::Handler::BusDisconnect(); + AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusDisconnect(); + + m_isInitialized = false; + } + + void TerrainDetailMaterialManager::Update(const AZ::Vector3& cameraPosition, AZ::Data::Instance& terrainSrg) + { + if (m_detailMaterialBufferNeedsUpdate) + { + m_detailMaterialBufferNeedsUpdate = false; + m_detailMaterialDataBuffer.UpdateBuffer(m_detailMaterialShaderData.GetRawData(), aznumeric_cast(m_detailMaterialShaderData.GetSize())); + } + + if (m_dirtyDetailRegion.IsValid() || !cameraPosition.IsClose(m_previousCameraPosition) || m_detailImageNeedsUpdate) + { + if (r_terrainDebugDetailImageUpdates) + { + AZ_Printf("TerrainDetailMaterialManager", "Previous Camera: (%f, %f, %f) New Cameara: (%f, %f, %f)", + m_previousCameraPosition.GetX(), m_previousCameraPosition.GetY(), m_previousCameraPosition.GetZ(), + cameraPosition.GetX(), cameraPosition.GetY(), cameraPosition.GetZ()); + } + int32_t newDetailTexturePosX = aznumeric_cast(AZStd::roundf(cameraPosition.GetX() / DetailTextureScale)); + int32_t newDetailTexturePosY = aznumeric_cast(AZStd::roundf(cameraPosition.GetY() / DetailTextureScale)); + + Aabb2i newBounds; + newBounds.m_min.m_x = newDetailTexturePosX - DetailTextureSizeHalf; + newBounds.m_min.m_y = newDetailTexturePosY - DetailTextureSizeHalf; + newBounds.m_max.m_x = newDetailTexturePosX + DetailTextureSizeHalf; + newBounds.m_max.m_y = newDetailTexturePosY + DetailTextureSizeHalf; + + // Use modulo to find the center point in texture space. Care must be taken so negative values are + // handled appropriately (ie, we want -1 % 1024 to equal 1023, not -1) + Vector2i newCenter; + newCenter.m_x = (DetailTextureSize + (newDetailTexturePosX % DetailTextureSize)) % DetailTextureSize; + newCenter.m_y = (DetailTextureSize + (newDetailTexturePosY % DetailTextureSize)) % DetailTextureSize; + + CheckUpdateDetailTexture(newBounds, newCenter); + + m_detailTextureBounds = newBounds; + m_dirtyDetailRegion = AZ::Aabb::CreateNull(); + + m_previousCameraPosition = cameraPosition; + + AZ::Vector4 detailAabb = AZ::Vector4( + m_detailTextureBounds.m_min.m_x * DetailTextureScale, + m_detailTextureBounds.m_min.m_y * DetailTextureScale, + m_detailTextureBounds.m_max.m_x * DetailTextureScale, + m_detailTextureBounds.m_max.m_y * DetailTextureScale + ); + AZ::Vector2 detailUvOffset = AZ::Vector2(float(newCenter.m_x) / DetailTextureSize, float(newCenter.m_y) / DetailTextureSize); + + terrainSrg->SetConstant(m_detailAabbPropertyIndex, detailAabb); + terrainSrg->SetConstant(m_detailHalfPixelUvPropertyIndex, 0.5f / DetailTextureSize); + terrainSrg->SetConstant(m_detailCenterPropertyIndex, detailUvOffset); + terrainSrg->SetImage(m_detailMaterialIdPropertyIndex, m_detailTextureImage); + + m_detailMaterialDataBuffer.UpdateSrg(terrainSrg.get()); + } + + m_detailImageNeedsUpdate = false; + } + + void TerrainDetailMaterialManager::OnTerrainDataChanged(const AZ::Aabb& dirtyRegion, TerrainDataChangedMask dataChangedMask) + { + if ((dataChangedMask & TerrainDataChangedMask::SurfaceData) != 0) + { + m_dirtyDetailRegion.AddAabb(dirtyRegion); + } + } + + void TerrainDetailMaterialManager::OnTerrainSurfaceMaterialMappingCreated(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag, MaterialInstance material) + { + DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); + + // Validate that the surface tag is new + for (DetailMaterialSurface& surface : materialRegion.m_materialsForSurfaces) + { + if (surface.m_surfaceTag == surfaceTag) + { + AZ_Error(TerrainDetailMaterialManagerName, false, "Already have a surface material mapping for this surface tag."); + return; + } + } + + uint16_t detailMaterialId = CreateOrUpdateDetailMaterial(material); + materialRegion.m_materialsForSurfaces.push_back({ surfaceTag, detailMaterialId }); + m_detailMaterials.GetData(detailMaterialId).refCount++; + m_dirtyDetailRegion.AddAabb(materialRegion.m_region); + } + + void TerrainDetailMaterialManager::OnTerrainSurfaceMaterialMappingDestroyed(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag) + { + DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); + + for (DetailMaterialSurface& surface : materialRegion.m_materialsForSurfaces) + { + if (surface.m_surfaceTag == surfaceTag) + { + CheckDetailMaterialForDeletion(surface.m_detailMaterialId); + + if (surface.m_surfaceTag != materialRegion.m_materialsForSurfaces.back().m_surfaceTag) + { + AZStd::swap(surface, materialRegion.m_materialsForSurfaces.back()); + } + materialRegion.m_materialsForSurfaces.pop_back(); + m_dirtyDetailRegion.AddAabb(materialRegion.m_region); + return; + } + } + AZ_Error(TerrainDetailMaterialManagerName, false, "Could not find surface tag to destroy for OnTerrainSurfaceMaterialMappingDestroyed()."); + } + + void TerrainDetailMaterialManager::OnTerrainSurfaceMaterialMappingChanged(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag, MaterialInstance material) + { + DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); + + bool found = false; + uint16_t materialId = CreateOrUpdateDetailMaterial(material); + for (DetailMaterialSurface& surface : materialRegion.m_materialsForSurfaces) + { + if (surface.m_surfaceTag == surfaceTag) + { + found = true; + if (surface.m_detailMaterialId != materialId) + { + ++m_detailMaterials.GetData(materialId).refCount; + CheckDetailMaterialForDeletion(surface.m_detailMaterialId); + surface.m_detailMaterialId = materialId; + } + break; + } + } + + if (!found) + { + ++m_detailMaterials.GetData(materialId).refCount; + materialRegion.m_materialsForSurfaces.push_back({ surfaceTag, materialId }); + } + m_dirtyDetailRegion.AddAabb(materialRegion.m_region); + } + + void TerrainDetailMaterialManager::OnTerrainSurfaceMaterialMappingRegionChanged(AZ::EntityId entityId, const AZ::Aabb& oldRegion, const AZ::Aabb& newRegion) + { + DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); + materialRegion.m_region = newRegion; + m_dirtyDetailRegion.AddAabb(oldRegion); + m_dirtyDetailRegion.AddAabb(newRegion); + } + + void TerrainDetailMaterialManager::CheckDetailMaterialForDeletion(uint16_t detailMaterialId) + { + auto& detailMaterialData = m_detailMaterials.GetData(detailMaterialId); + if (--detailMaterialData.refCount == 0) + { + uint16_t bufferIndex = detailMaterialData.m_detailMaterialBufferIndex; + DetailMaterialShaderData& shaderData = m_detailMaterialShaderData.GetElement(bufferIndex); + + for (uint16_t imageIndex : + { + shaderData.m_colorImageIndex, + shaderData.m_normalImageIndex, + shaderData.m_roughnessImageIndex, + shaderData.m_metalnessImageIndex, + shaderData.m_specularF0ImageIndex, + shaderData.m_occlusionImageIndex, + shaderData.m_heightImageIndex + }) + { + if (imageIndex != InvalidImageIndex) + { + m_bindlessImageHandler->RemoveBindlessImage(imageIndex); + } + } + + m_detailMaterialShaderData.Release(bufferIndex); + m_detailMaterials.RemoveIndex(detailMaterialId); + + m_detailMaterialBufferNeedsUpdate = true; + } + } + + uint16_t TerrainDetailMaterialManager::CreateOrUpdateDetailMaterial(MaterialInstance material) + { + static constexpr uint16_t InvalidDetailMaterial = 0xFFFF; + uint16_t detailMaterialId = InvalidDetailMaterial; + + for (auto& detailMaterialData : m_detailMaterials.GetDataVector()) + { + if (detailMaterialData.m_assetId == material->GetAssetId()) + { + detailMaterialId = m_detailMaterials.GetIndexForData(&detailMaterialData); + UpdateDetailMaterialData(detailMaterialId, material); + break; + } + } + + AZ_Assert(m_detailMaterialShaderData.GetSize() < 0xFF, "Only 255 detail materials supported."); + + if (detailMaterialId == InvalidDetailMaterial && m_detailMaterialShaderData.GetSize() < 0xFF) + { + detailMaterialId = m_detailMaterials.GetFreeSlotIndex(); + auto& detailMaterialData = m_detailMaterials.GetData(detailMaterialId); + detailMaterialData.m_detailMaterialBufferIndex = aznumeric_cast(m_detailMaterialShaderData.Reserve()); + UpdateDetailMaterialData(detailMaterialId, material); + } + return detailMaterialId; + } + + void TerrainDetailMaterialManager::UpdateDetailMaterialData(uint16_t detailMaterialIndex, MaterialInstance material) + { + DetailMaterialData& materialData = m_detailMaterials.GetData(detailMaterialIndex); + DetailMaterialShaderData& shaderData = m_detailMaterialShaderData.GetElement(materialData.m_detailMaterialBufferIndex); + + if (materialData.m_materialChangeId == material->GetCurrentChangeId()) + { + return; // material hasn't changed, nothing to do + } + + materialData.m_materialChangeId = material->GetCurrentChangeId(); + materialData.m_assetId = material->GetAssetId(); + + DetailTextureFlags& flags = shaderData.m_flags; + + auto getIndex = [&](const char* const indexName) -> AZ::RPI::MaterialPropertyIndex + { + const AZ::RPI::MaterialPropertyIndex index = material->FindPropertyIndex(AZ::Name(indexName)); + AZ_Warning(TerrainDetailMaterialManagerName, index.IsValid(), "Failed to find shader input constant %s.", indexName); + return index; + }; + + auto applyProperty = [&](const char* const indexName, auto& ref) -> void + { + const auto index = getIndex(indexName); + if (index.IsValid()) + { + // GetValue() expects the actaul type, not a reference type, so the reference needs to be removed. + using TypeRefRemoved = AZStd::remove_cvref_t; + ref = material->GetPropertyValue(index).GetValue(); + } + }; + + auto applyImage = [&](const char* const indexName, AZ::Data::Instance& ref, const char* const usingFlagName, DetailTextureFlags flagToSet, uint16_t& imageIndex) -> void + { + // Determine if an image exists and if its using flag allows it to be used. + const auto index = getIndex(indexName); + const auto useTextureIndex = getIndex(usingFlagName); + bool useTextureValue = true; + if (useTextureIndex.IsValid()) + { + useTextureValue = material->GetPropertyValue(useTextureIndex).GetValue(); + } + if (index.IsValid() && useTextureValue) + { + ref = material->GetPropertyValue(index).GetValue>(); + } + useTextureValue = useTextureValue && ref; + flags = DetailTextureFlags(useTextureValue ? (flags | flagToSet) : (flags & ~flagToSet)); + + // Update queues to add/remove textures depending on if the image is used + if (ref) + { + if (imageIndex == InvalidImageIndex) + { + imageIndex = m_bindlessImageHandler->AppendBindlessImage(ref->GetImageView()); + } + else + { + m_bindlessImageHandler->UpdateBindlessImage(imageIndex, ref->GetImageView()); + } + } + else if (imageIndex != InvalidImageIndex) + { + m_bindlessImageHandler->RemoveBindlessImage(imageIndex); + imageIndex = InvalidImageIndex; + } + }; + + auto applyFlag = [&](const char* const indexName, DetailTextureFlags flagToSet) -> void + { + const auto index = getIndex(indexName); + if (index.IsValid()) + { + bool flagValue = material->GetPropertyValue(index).GetValue(); + flags = DetailTextureFlags(flagValue ? flags | flagToSet : flags); + } + }; + + auto getEnumName = [&](const char* const indexName) -> const AZStd::string_view + { + const auto index = getIndex(indexName); + if (index.IsValid()) + { + uint32_t enumIndex = material->GetPropertyValue(index).GetValue(); + const AZ::Name& enumName = material->GetMaterialPropertiesLayout()->GetPropertyDescriptor(index)->GetEnumName(enumIndex); + return enumName.GetStringView(); + } + return ""; + }; + + using namespace DetailMaterialInputs; + applyImage(BaseColorMap, materialData.m_colorImage, BaseColorUseTexture, DetailTextureFlags::UseTextureBaseColor, shaderData.m_colorImageIndex); + applyProperty(BaseColorFactor, shaderData.m_baseColorFactor); + + const auto index = getIndex(BaseColorColor); + if (index.IsValid()) + { + AZ::Color baseColor = material->GetPropertyValue(index).GetValue(); + shaderData.m_baseColorRed = baseColor.GetR(); + shaderData.m_baseColorGreen = baseColor.GetG(); + shaderData.m_baseColorBlue = baseColor.GetB(); + } + + const AZStd::string_view& blendModeString = getEnumName(BaseColorBlendMode); + if (blendModeString == "Multiply") + { + flags = DetailTextureFlags(flags | DetailTextureFlags::BlendModeMultiply); + } + else if (blendModeString == "LinearLight") + { + flags = DetailTextureFlags(flags | DetailTextureFlags::BlendModeLinearLight); + } + else if (blendModeString == "Lerp") + { + flags = DetailTextureFlags(flags | DetailTextureFlags::BlendModeLerp); + } + else if (blendModeString == "Overlay") + { + flags = DetailTextureFlags(flags | DetailTextureFlags::BlendModeOverlay); + } + + applyImage(MetallicMap, materialData.m_metalnessImage, MetallicUseTexture, DetailTextureFlags::UseTextureMetallic, shaderData.m_metalnessImageIndex); + applyProperty(MetallicFactor, shaderData.m_metalFactor); + + applyImage(RoughnessMap, materialData.m_roughnessImage, RoughnessUseTexture, DetailTextureFlags::UseTextureRoughness, shaderData.m_roughnessImageIndex); + + if ((flags & DetailTextureFlags::UseTextureRoughness) > 0) + { + float lowerBound = 0.0; + float upperBound = 1.0; + applyProperty(RoughnessLowerBound, lowerBound); + applyProperty(RoughnessUpperBound, upperBound); + shaderData.m_roughnessBias = lowerBound; + shaderData.m_roughnessScale = upperBound - lowerBound; + } + else + { + shaderData.m_roughnessBias = 0.0; + applyProperty(RoughnessFactor, shaderData.m_roughnessScale); + } + + applyImage(SpecularF0Map, materialData.m_specularF0Image, SpecularF0UseTexture, DetailTextureFlags::UseTextureSpecularF0, shaderData.m_specularF0ImageIndex); + applyProperty(SpecularF0Factor, shaderData.m_specularF0Factor); + + applyImage(NormalMap, materialData.m_normalImage, NormalUseTexture, DetailTextureFlags::UseTextureNormal, shaderData.m_normalImageIndex); + applyProperty(NormalFactor, shaderData.m_normalFactor); + applyFlag(NormalFlipX, DetailTextureFlags::FlipNormalX); + applyFlag(NormalFlipY, DetailTextureFlags::FlipNormalY); + + applyImage(DiffuseOcclusionMap, materialData.m_occlusionImage, DiffuseOcclusionUseTexture, DetailTextureFlags::UseTextureOcclusion, shaderData.m_occlusionImageIndex); + applyProperty(DiffuseOcclusionFactor, shaderData.m_occlusionFactor); + + applyImage(HeightMap, materialData.m_heightImage, HeightUseTexture, DetailTextureFlags::UseTextureHeight, shaderData.m_heightImageIndex); + applyProperty(HeightFactor, shaderData.m_heightFactor); + applyProperty(HeightOffset, shaderData.m_heightOffset); + applyProperty(HeightBlendFactor, shaderData.m_heightBlendFactor); + + m_detailMaterialBufferNeedsUpdate = true; + } + + void TerrainDetailMaterialManager::CheckUpdateDetailTexture(const Aabb2i& newBounds, const Vector2i& newCenter) + { + if (r_terrainDebugDetailImageUpdates) + { + AZ_Printf("TerrainDetailMaterialManager", "Old Bounds: m(%i, %i)M(%i, %i) New Bounds: m(%i, %i)M(%i, %i)", + m_detailTextureBounds.m_min.m_x, m_detailTextureBounds.m_min.m_y, m_detailTextureBounds.m_max.m_x, m_detailTextureBounds.m_max.m_y, + newBounds.m_min.m_x, newBounds.m_min.m_y, newBounds.m_max.m_x, newBounds.m_max.m_y + ); + } + if (!m_detailTextureImage) + { + // If the m_detailTextureImage doesn't exist, create it and populate the entire texture + + const AZ::Data::Instance imagePool = AZ::RPI::ImageSystemInterface::Get()->GetSystemAttachmentPool(); + AZ::RHI::ImageDescriptor imageDescriptor = AZ::RHI::ImageDescriptor::Create2D( + AZ::RHI::ImageBindFlags::ShaderRead, DetailTextureSize, DetailTextureSize, AZ::RHI::Format::R8G8B8A8_UINT + ); + const AZ::Name TerrainDetailName = AZ::Name(TerrainDetailChars); + m_detailTextureImage = AZ::RPI::AttachmentImage::Create(*imagePool.get(), imageDescriptor, TerrainDetailName, nullptr, nullptr); + AZ_Error(TerrainDetailMaterialManagerName, m_detailTextureImage, "Failed to initialize the detail texture image."); + + UpdateDetailTexture(newBounds, newBounds, newCenter); + } + else + { + // If the new bounds of the detail texture are different than the old bounds, then the edges of the texture need to be updated. + + int32_t offsetX = m_detailTextureBounds.m_min.m_x - newBounds.m_min.m_x; + + // Horizontal edge update + if (newBounds.m_min.m_x != m_detailTextureBounds.m_min.m_x) + { + Aabb2i updateBounds; + if (newBounds.m_min.m_x < m_detailTextureBounds.m_min.m_x) + { + updateBounds.m_min.m_x = newBounds.m_min.m_x; + updateBounds.m_max.m_x = m_detailTextureBounds.m_min.m_x; + } + else + { + updateBounds.m_min.m_x = m_detailTextureBounds.m_max.m_x; + updateBounds.m_max.m_x = newBounds.m_max.m_x; + } + updateBounds.m_min.m_y = newBounds.m_min.m_y; + updateBounds.m_max.m_y = newBounds.m_max.m_y; + + if (r_terrainDebugDetailImageUpdates) + { + AZ_Printf("TerrainDetailMaterialManager", "Updating horizontal edge: m(%i, %i)M(%i, %i)", + updateBounds.m_min.m_x, updateBounds.m_min.m_y, updateBounds.m_max.m_x, updateBounds.m_max.m_y); + } + UpdateDetailTexture(updateBounds, newBounds, newCenter); + } + + // Vertical edge update + if (newBounds.m_min.m_y != m_detailTextureBounds.m_min.m_y) + { + Aabb2i updateBounds; + // Don't update areas that have already been updated in the horizontal update. + updateBounds.m_min.m_x = newBounds.m_min.m_x + AZ::GetMax(0, offsetX); + updateBounds.m_max.m_x = newBounds.m_max.m_x + AZ::GetMin(0, offsetX); + if (newBounds.m_min.m_y < m_detailTextureBounds.m_min.m_y) + { + updateBounds.m_min.m_y = newBounds.m_min.m_y; + updateBounds.m_max.m_y = m_detailTextureBounds.m_min.m_y; + } + else + { + updateBounds.m_min.m_y = m_detailTextureBounds.m_max.m_y; + updateBounds.m_max.m_y = newBounds.m_max.m_y; + } + + if (r_terrainDebugDetailImageUpdates) + { + AZ_Printf("TerrainDetailMaterialManager", "Updating vertical edge: m(%i, %i)M(%i, %i)", + updateBounds.m_min.m_x, updateBounds.m_min.m_y, updateBounds.m_max.m_x, updateBounds.m_max.m_y); + } + UpdateDetailTexture(updateBounds, newBounds, newCenter); + } + + if (m_dirtyDetailRegion.IsValid()) + { + if (r_terrainDebugDetailImageUpdates) + { + AZ_Printf("TerrainDetailMaterialManager", "m_dirtyDetailRegion: m(%f, %f)M(%f, %f)", + m_dirtyDetailRegion.GetMin().GetX(), m_dirtyDetailRegion.GetMin().GetY(), m_dirtyDetailRegion.GetMax().GetX(), m_dirtyDetailRegion.GetMax().GetY()); + } + // If any regions are marked as dirty, then they should be updated. + + AZ::Vector3 currentMin = AZ::Vector3(newBounds.m_min.m_x * DetailTextureScale, newBounds.m_min.m_y * DetailTextureScale, -0.5f); + AZ::Vector3 currentMax = AZ::Vector3(newBounds.m_max.m_x * DetailTextureScale, newBounds.m_max.m_y * DetailTextureScale, 0.5f); + AZ::Aabb detailTextureCoverage = AZ::Aabb::CreateFromMinMax(currentMin, currentMax); + AZ::Vector3 previousMin = AZ::Vector3(m_detailTextureBounds.m_min.m_x * DetailTextureScale, m_detailTextureBounds.m_min.m_y * DetailTextureScale, -0.5f); + AZ::Vector3 previousMax = AZ::Vector3(m_detailTextureBounds.m_max.m_x * DetailTextureScale, m_detailTextureBounds.m_max.m_y * DetailTextureScale, 0.5f); + AZ::Aabb previousCoverage = AZ::Aabb::CreateFromMinMax(previousMin, previousMax); + + // Area of texture not already updated by camera movement above. + AZ::Aabb clampedCoverage = previousCoverage.GetClamped(detailTextureCoverage); + + // Clamp the dirty region to the area of the detail texture that is visible and not already updated. + clampedCoverage.Clamp(m_dirtyDetailRegion); + + if (clampedCoverage.IsValid()) + { + Aabb2i updateBounds; + updateBounds.m_min.m_x = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMin().GetX() / DetailTextureScale)); + updateBounds.m_min.m_y = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMin().GetY() / DetailTextureScale)); + updateBounds.m_max.m_x = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMax().GetX() / DetailTextureScale)); + updateBounds.m_max.m_y = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMax().GetY() / DetailTextureScale)); + if (updateBounds.m_min.m_x < updateBounds.m_max.m_x && updateBounds.m_min.m_y < updateBounds.m_max.m_y) + { + + if (r_terrainDebugDetailImageUpdates) + { + AZ_Printf("TerrainDetailMaterialManager", "Updating dirty region: m(%i, %i)M(%i, %i)", + updateBounds.m_min.m_x, updateBounds.m_min.m_y, updateBounds.m_max.m_x, updateBounds.m_max.m_y); + } + UpdateDetailTexture(updateBounds, newBounds, newCenter); + } + } + } + } + } + + void TerrainDetailMaterialManager::UpdateDetailTexture(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel) + { + if (!m_detailTextureImage) + { + return; + } + + struct DetailMaterialPixel + { + uint8_t m_material1{ 255 }; + uint8_t m_material2{ 255 }; + uint8_t m_blend{ 0 }; // 0 = full weight on material1, 255 = full weight on material2 + uint8_t m_padding{ 0 }; + }; + + // Because the center of the detail texture may be offset, each update area may actually need to be split into + // up to 4 separate update areas in each sector of the quadrant. + AZStd::array textureSpaceAreas; + AZStd::array scaledWorldSpaceAreas; + uint8_t updateAreaCount = CalculateUpdateRegions(updateArea, textureBounds, centerPixel, textureSpaceAreas, scaledWorldSpaceAreas); + + if (updateAreaCount > 0) + { + m_detailImageNeedsUpdate = true; + } + + // Pull the data for each area updated and use it to construct an update for the detail material id texture. + for (uint8_t i = 0; i < updateAreaCount; ++i) + { + const Aabb2i& quadrantTextureArea = textureSpaceAreas[i]; + const Aabb2i& quadrantWorldArea = scaledWorldSpaceAreas[i]; + + AZStd::vector pixels; + pixels.resize((quadrantWorldArea.m_max.m_x - quadrantWorldArea.m_min.m_x) * (quadrantWorldArea.m_max.m_y - quadrantWorldArea.m_min.m_y)); + uint32_t index = 0; + + for (int yPos = quadrantWorldArea.m_min.m_y; yPos < quadrantWorldArea.m_max.m_y; ++yPos) + { + for (int xPos = quadrantWorldArea.m_min.m_x; xPos < quadrantWorldArea.m_max.m_x; ++xPos) + { + AZ::Vector2 position = AZ::Vector2(xPos * DetailTextureScale, yPos * DetailTextureScale); + AzFramework::SurfaceData::SurfaceTagWeightList surfaceWeights; + AzFramework::Terrain::TerrainDataRequestBus::Broadcast(&AzFramework::Terrain::TerrainDataRequests::GetSurfaceWeightsFromVector2, position, surfaceWeights, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, nullptr); + + // Store the top two surface weights in the texture with m_blend storing the relative weight. + bool isFirstMaterial = true; + float firstWeight = 0.0f; + for (const auto& surfaceTagWeight : surfaceWeights) + { + if (surfaceTagWeight.m_weight > 0.0f) + { + AZ::Crc32 surfaceType = surfaceTagWeight.m_surfaceType; + uint16_t materialId = GetDetailMaterialForSurfaceTypeAndPosition(surfaceType, position); + if (materialId != m_detailMaterials.NoFreeSlot && materialId < 255) + { + if (isFirstMaterial) + { + pixels.at(index).m_material1 = aznumeric_cast(materialId); + firstWeight = surfaceTagWeight.m_weight; + // m_blend only needs to be calculated is material 2 is found, otherwise the initial value of 0 is correct. + isFirstMaterial = false; + } + else + { + pixels.at(index).m_material2 = aznumeric_cast(materialId); + float totalWeight = firstWeight + surfaceTagWeight.m_weight; + float blendWeight = 1.0f - (firstWeight / totalWeight); + pixels.at(index).m_blend = aznumeric_cast(AZStd::round(blendWeight * 255.0f)); + break; + } + } + } + else + { + break; // since the list is ordered, no other materials are in the list with positive weights. + } + } + ++index; + } + } + + const int32_t left = quadrantTextureArea.m_min.m_x; + const int32_t top = quadrantTextureArea.m_min.m_y; + const int32_t width = quadrantTextureArea.m_max.m_x - quadrantTextureArea.m_min.m_x; + const int32_t height = quadrantTextureArea.m_max.m_y - quadrantTextureArea.m_min.m_y; + + AZ::RHI::ImageUpdateRequest imageUpdateRequest; + imageUpdateRequest.m_imageSubresourcePixelOffset.m_left = aznumeric_cast(left); + imageUpdateRequest.m_imageSubresourcePixelOffset.m_top = aznumeric_cast(top); + imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerRow = width * sizeof(DetailMaterialPixel); + imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerImage = width * height * sizeof(DetailMaterialPixel); + imageUpdateRequest.m_sourceSubresourceLayout.m_rowCount = height; + imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_width = width; + imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_height = height; + imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_depth = 1; + imageUpdateRequest.m_sourceData = pixels.data(); + imageUpdateRequest.m_image = m_detailTextureImage->GetRHIImage(); + + m_detailTextureImage->UpdateImageContents(imageUpdateRequest); + } + } + + uint8_t TerrainDetailMaterialManager::CalculateUpdateRegions(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel, + AZStd::array& textureSpaceAreas, AZStd::array& scaledWorldSpaceAreas) + { + Vector2i centerOffset = { centerPixel.m_x - DetailTextureSizeHalf, centerPixel.m_y - DetailTextureSizeHalf }; + + int32_t quadrantXOffset = centerPixel.m_x < DetailTextureSizeHalf ? DetailTextureSize : -DetailTextureSize; + int32_t quadrantYOffset = centerPixel.m_y < DetailTextureSizeHalf ? DetailTextureSize : -DetailTextureSize; + + uint8_t numQuadrants = 0; + + // For each of the 4 quadrants: + auto calculateQuadrant = [&](Vector2i quadrantOffset) + { + Aabb2i offsetUpdateArea = updateArea + centerOffset + quadrantOffset; + Aabb2i updateSectionBounds = textureBounds.GetClamped(offsetUpdateArea); + if (updateSectionBounds.IsValid()) + { + textureSpaceAreas[numQuadrants] = updateSectionBounds - textureBounds.m_min; + scaledWorldSpaceAreas[numQuadrants] = updateSectionBounds - centerOffset - quadrantOffset; + ++numQuadrants; + } + }; + + calculateQuadrant({ 0, 0 }); + calculateQuadrant({ quadrantXOffset, 0 }); + calculateQuadrant({ 0, quadrantYOffset }); + calculateQuadrant({ quadrantXOffset, quadrantYOffset }); + + return numQuadrants; + } + + uint16_t TerrainDetailMaterialManager::GetDetailMaterialForSurfaceTypeAndPosition(AZ::Crc32 surfaceType, const AZ::Vector2& position) + { + for (const auto& materialRegion : m_detailMaterialRegions.GetDataVector()) + { + if (materialRegion.m_region.Contains(AZ::Vector3(position.GetX(), position.GetY(), 0.0f))) + { + for (const auto& materialSurface : materialRegion.m_materialsForSurfaces) + { + if (materialSurface.m_surfaceTag == surfaceType) + { + return m_detailMaterials.GetData(materialSurface.m_detailMaterialId).m_detailMaterialBufferIndex; + } + } + } + } + return m_detailMaterials.NoFreeSlot; + } + + auto TerrainDetailMaterialManager::FindByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container) + -> DetailMaterialListRegion* + { + for (DetailMaterialListRegion& data : container.GetDataVector()) + { + if (data.m_entityId == entityId) + { + return &data; + } + } + return nullptr; + } + + auto TerrainDetailMaterialManager::FindOrCreateByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container) + -> DetailMaterialListRegion& + { + DetailMaterialListRegion* dataPtr = FindByEntityId(entityId, container); + if (dataPtr != nullptr) + { + return *dataPtr; + } + + const uint16_t slotId = container.GetFreeSlotIndex(); + AZ_Assert(slotId != AZ::Render::IndexedDataVector::NoFreeSlot, "Ran out of indices"); + + DetailMaterialListRegion& data = container.GetData(slotId); + data.m_entityId = entityId; + return data; + } + + void TerrainDetailMaterialManager::RemoveByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container) + { + for (DetailMaterialListRegion& data : container.GetDataVector()) + { + if (data.m_entityId == entityId) + { + container.RemoveData(&data); + return; + } + } + AZ_Assert(false, "Entity Id not found in container.") + } + +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.h b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.h new file mode 100644 index 0000000000..98f2c26dd8 --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.h @@ -0,0 +1,226 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace Terrain +{ + class TerrainDetailMaterialManager + : private AzFramework::Terrain::TerrainDataNotificationBus::Handler + , private TerrainAreaMaterialNotificationBus::Handler + { + public: + + AZ_RTTI(TerrainDetailMaterialManager, "{3CBAF88F-E3B1-43B8-97A5-999133188BCC}"); + AZ_DISABLE_COPY_MOVE(TerrainDetailMaterialManager); + + TerrainDetailMaterialManager() = default; + ~TerrainDetailMaterialManager() = default; + + void Initialize( + const AZStd::shared_ptr& bindlessImageHandler, + AZ::Data::Instance& terrainSrg); + bool IsInitialized() const; + void Reset(); + bool UpdateSrgIndices(AZ::Data::Instance& srg); + + void Update(const AZ::Vector3& cameraPosition, AZ::Data::Instance& terrainSrg); + + private: + + using MaterialInstance = AZ::Data::Instance; + static constexpr auto InvalidImageIndex = AZ::Render::BindlessImageArrayHandler::InvalidImageIndex; + + enum DetailTextureFlags : uint32_t + { + UseTextureBaseColor = 0b0000'0000'0000'0000'0000'0000'0000'0001, + UseTextureNormal = 0b0000'0000'0000'0000'0000'0000'0000'0010, + UseTextureMetallic = 0b0000'0000'0000'0000'0000'0000'0000'0100, + UseTextureRoughness = 0b0000'0000'0000'0000'0000'0000'0000'1000, + UseTextureOcclusion = 0b0000'0000'0000'0000'0000'0000'0001'0000, + UseTextureHeight = 0b0000'0000'0000'0000'0000'0000'0010'0000, + UseTextureSpecularF0 = 0b0000'0000'0000'0000'0000'0000'0100'0000, + + FlipNormalX = 0b0000'0000'0000'0001'0000'0000'0000'0000, + FlipNormalY = 0b0000'0000'0000'0010'0000'0000'0000'0000, + + BlendModeMask = 0b0000'0000'0000'1100'0000'0000'0000'0000, + BlendModeLerp = 0b0000'0000'0000'0000'0000'0000'0000'0000, + BlendModeLinearLight = 0b0000'0000'0000'0100'0000'0000'0000'0000, + BlendModeMultiply = 0b0000'0000'0000'1000'0000'0000'0000'0000, + BlendModeOverlay = 0b0000'0000'0000'1100'0000'0000'0000'0000, + }; + + struct DetailMaterialShaderData + { + // Uv + AZStd::array m_uvTransform + { + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + }; + + float m_baseColorRed{ 1.0f }; + float m_baseColorGreen{ 1.0f }; + float m_baseColorBlue{ 1.0f }; + + // Factor / Scale / Bias for input textures + float m_baseColorFactor{ 1.0f }; + + float m_normalFactor{ 1.0f }; + float m_metalFactor{ 1.0f }; + float m_roughnessScale{ 1.0f }; + float m_roughnessBias{ 0.0f }; + + float m_specularF0Factor{ 1.0f }; + float m_occlusionFactor{ 1.0f }; + float m_heightFactor{ 1.0f }; + float m_heightOffset{ 0.0f }; + + float m_heightBlendFactor{ 0.5f }; + + // Flags + DetailTextureFlags m_flags{ 0 }; + + // Image indices + uint16_t m_colorImageIndex{ InvalidImageIndex }; + uint16_t m_normalImageIndex{ InvalidImageIndex }; + uint16_t m_roughnessImageIndex{ InvalidImageIndex }; + uint16_t m_metalnessImageIndex{ InvalidImageIndex }; + + uint16_t m_specularF0ImageIndex{ InvalidImageIndex }; + uint16_t m_occlusionImageIndex{ InvalidImageIndex }; + uint16_t m_heightImageIndex{ InvalidImageIndex }; + + // 16 byte aligned + uint16_t m_padding1; + uint32_t m_padding2; + uint32_t m_padding3; + }; + static_assert(sizeof(DetailMaterialShaderData) % 16 == 0, "DetailMaterialShaderData must be 16 byte aligned."); + + struct DetailMaterialData + { + AZ::Data::AssetId m_assetId; + AZ::RPI::Material::ChangeId m_materialChangeId{AZ::RPI::Material::DEFAULT_CHANGE_ID}; + uint32_t refCount = 0; + uint16_t m_detailMaterialBufferIndex{ 0xFFFF }; + + AZ::Data::Instance m_colorImage; + AZ::Data::Instance m_normalImage; + AZ::Data::Instance m_roughnessImage; + AZ::Data::Instance m_metalnessImage; + AZ::Data::Instance m_specularF0Image; + AZ::Data::Instance m_occlusionImage; + AZ::Data::Instance m_heightImage; + }; + + struct DetailMaterialSurface + { + AZ::Crc32 m_surfaceTag; + uint16_t m_detailMaterialId; + }; + + struct DetailMaterialListRegion + { + AZ::EntityId m_entityId; + AZ::Aabb m_region{AZ::Aabb::CreateNull()}; + AZStd::vector m_materialsForSurfaces; + }; + + // System-level parameters + static constexpr int32_t DetailTextureSize{ 1024 }; + static constexpr int32_t DetailTextureSizeHalf{ DetailTextureSize / 2 }; + static constexpr float DetailTextureScale{ 0.5f }; + + // AzFramework::Terrain::TerrainDataNotificationBus overrides... + void OnTerrainDataChanged(const AZ::Aabb& dirtyRegion, TerrainDataChangedMask dataChangedMask) override; + + // TerrainAreaMaterialNotificationBus overrides... + void OnTerrainSurfaceMaterialMappingCreated(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag, MaterialInstance material) override; + void OnTerrainSurfaceMaterialMappingDestroyed(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag) override; + void OnTerrainSurfaceMaterialMappingChanged(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag, MaterialInstance material) override; + void OnTerrainSurfaceMaterialMappingRegionChanged(AZ::EntityId entityId, const AZ::Aabb& oldRegion, const AZ::Aabb& newRegion) override; + + //! Removes all images from all detail materials from the bindless image array + void RemoveAllImages(); + + //! Creates or updates an existing detail material with settings from a material instance + uint16_t CreateOrUpdateDetailMaterial(MaterialInstance material); + + //! Decrements the ref count on a detail material and removes it if it reaches 0 + void CheckDetailMaterialForDeletion(uint16_t detailMaterialId); + + //! Updates a specific detail material with settings from a material instance + void UpdateDetailMaterialData(uint16_t detailMaterialIndex, MaterialInstance material); + + //! Checks to see if the detail material id texture needs to update based on new center and bounds. Any + //! required updates are then executed. + void CheckUpdateDetailTexture(const Aabb2i& newBounds, const Vector2i& newCenter); + + //! Updates the detail texture in a given area + void UpdateDetailTexture(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel); + + //! Finds the detail material Id for a surface type and position + uint16_t GetDetailMaterialForSurfaceTypeAndPosition(AZ::Crc32 surfaceType, const AZ::Vector2& position); + + //! Calculates which regions of the detail material id texture need to be updated based on the update area. Since + //! the "center" of the detail material id texture can move, a single update region in contiguous world space may + //! map to up to 4 different areas on teh detail material id texture. + uint8_t CalculateUpdateRegions(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel, + AZStd::array& textureSpaceAreas, AZStd::array& scaledWorldSpaceAreas); + + DetailMaterialListRegion* FindByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container); + DetailMaterialListRegion& FindOrCreateByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container); + void RemoveByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container); + + AZStd::shared_ptr m_bindlessImageHandler; + + AZ::Data::Instance m_detailTextureImage; + + AZ::Render::IndexedDataVector m_detailMaterials; + AZ::Render::IndexedDataVector m_detailMaterialRegions; + AZ::Render::SparseVector m_detailMaterialShaderData; + AZ::Render::GpuBufferHandler m_detailMaterialDataBuffer; + + AZ::Aabb m_dirtyDetailRegion{ AZ::Aabb::CreateNull() }; + AZ::Vector3 m_previousCameraPosition = AZ::Vector3(AZStd::numeric_limits::max(), 0.0, 0.0); + Aabb2i m_detailTextureBounds; + Vector2i m_detailTextureCenter; + + AZ::RHI::ShaderInputImageIndex m_detailMaterialIdPropertyIndex; + AZ::RHI::ShaderInputBufferIndex m_detailMaterialDataIndex; + AZ::RHI::ShaderInputConstantIndex m_detailCenterPropertyIndex; + AZ::RHI::ShaderInputConstantIndex m_detailAabbPropertyIndex; + AZ::RHI::ShaderInputConstantIndex m_detailHalfPixelUvPropertyIndex; + + bool m_isInitialized{ false }; + bool m_detailMaterialBufferNeedsUpdate{ false }; + bool m_detailImageNeedsUpdate{ false }; + + }; +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp index 9f83844243..351c34308a 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp @@ -7,38 +7,22 @@ */ #include -#include - -#include -#include -#include -#include -#include #include -#include -#include -#include #include #include #include #include -#include -#include #include #include -#include #include #include #include #include #include -#include -#include -#include #include @@ -50,79 +34,19 @@ namespace Terrain { [[maybe_unused]] const char* TerrainFPName = "TerrainFeatureProcessor"; const char* TerrainHeightmapChars = "TerrainHeightmap"; - const char* TerrainDetailChars = "TerrainDetail"; } - namespace ViewSrgInputs + namespace SceneSrgInputs { static const char* const HeightmapImage("m_heightmapImage"); + static const char* const TerrainWorldData("m_terrainWorldData"); } namespace TerrainSrgInputs { - static const char* const DetailMaterialIdImage("m_detailMaterialIdImage"); - static const char* const DetailMaterialData("m_detailMaterialData"); - static const char* const DetailMaterialIdImageCenter("m_detailMaterialIdImageCenter"); - static const char* const DetailHalfPixelUv("m_detailHalfPixelUv"); - static const char* const DetailAabb("m_detailAabb"); - static const char* const DetailTextures("m_detailTextures"); - } - - namespace DetailMaterialInputs - { - static const char* const BaseColorColor("baseColor.color"); - static const char* const BaseColorMap("baseColor.textureMap"); - static const char* const BaseColorUseTexture("baseColor.useTexture"); - static const char* const BaseColorFactor("baseColor.factor"); - static const char* const BaseColorBlendMode("baseColor.textureBlendMode"); - static const char* const MetallicMap("metallic.textureMap"); - static const char* const MetallicUseTexture("metallic.useTexture"); - static const char* const MetallicFactor("metallic.factor"); - static const char* const RoughnessMap("roughness.textureMap"); - static const char* const RoughnessUseTexture("roughness.useTexture"); - static const char* const RoughnessFactor("roughness.factor"); - static const char* const RoughnessLowerBound("roughness.lowerBound"); - static const char* const RoughnessUpperBound("roughness.upperBound"); - static const char* const SpecularF0Map("specularF0.textureMap"); - static const char* const SpecularF0UseTexture("specularF0.useTexture"); - static const char* const SpecularF0Factor("specularF0.factor"); - static const char* const NormalMap("normal.textureMap"); - static const char* const NormalUseTexture("normal.useTexture"); - static const char* const NormalFactor("normal.factor"); - static const char* const NormalFlipX("normal.flipX"); - static const char* const NormalFlipY("normal.flipY"); - static const char* const DiffuseOcclusionMap("occlusion.diffuseTextureMap"); - static const char* const DiffuseOcclusionUseTexture("occlusion.diffuseUseTexture"); - static const char* const DiffuseOcclusionFactor("occlusion.diffuseFactor"); - static const char* const HeightMap("parallax.textureMap"); - static const char* const HeightUseTexture("parallax.useTexture"); - static const char* const HeightFactor("parallax.factor"); - static const char* const HeightOffset("parallax.offset"); - static const char* const HeightBlendFactor("parallax.blendFactor"); + static const char* const Textures("m_textures"); } - namespace ShaderInputs - { - static const char* const ModelToWorld("m_modelToWorld"); - static const char* const TerrainData("m_terrainData"); - static const char* const MacroMaterialData("m_macroMaterialData"); - static const char* const MacroMaterialCount("m_macroMaterialCount"); - static const char* const MacroColorMap("m_macroColorMap"); - static const char* const MacroNormalMap("m_macroNormalMap"); - } - - AZ_CVAR(bool, - r_terrainDebugDetailMaterials, - false, - [](const bool& value) - { - AZ::RPI::ShaderSystemInterface::Get()->SetGlobalShaderOption(AZ::Name{ "o_debugDetailMaterialIds" }, AZ::RPI::ShaderOptionValue{ value }); - }, - AZ::ConsoleFunctorFlags::Null, - "Turns on debugging for detail material ids for terrain." - ); - - void TerrainFeatureProcessor::Reflect(AZ::ReflectContext* context) { if (AZ::SerializeContext* serialize = azrtti_cast(context)) @@ -150,13 +74,17 @@ namespace Terrain void TerrainFeatureProcessor::Initialize() { - // Load indices for the View Srg. + m_meshManager.Initialize(); + m_imageArrayHandler = AZStd::make_shared(); - auto viewSrgLayout = AZ::RPI::RPISystemInterface::Get()->GetViewSrgLayout(); + auto sceneSrgLayout = AZ::RPI::RPISystemInterface::Get()->GetSceneSrgLayout(); - m_heightmapPropertyIndex = viewSrgLayout->FindShaderInputImageIndex(AZ::Name(ViewSrgInputs::HeightmapImage)); - AZ_Error(TerrainFPName, m_heightmapPropertyIndex.IsValid(), "Failed to find view srg input constant %s.", ViewSrgInputs::HeightmapImage); + m_heightmapPropertyIndex = sceneSrgLayout->FindShaderInputImageIndex(AZ::Name(SceneSrgInputs::HeightmapImage)); + AZ_Error(TerrainFPName, m_heightmapPropertyIndex.IsValid(), "Failed to find scene srg input constant %s.", SceneSrgInputs::HeightmapImage); + m_worldDataIndex = sceneSrgLayout->FindShaderInputConstantIndex(AZ::Name(SceneSrgInputs::TerrainWorldData)); + AZ_Error(TerrainFPName, m_worldDataIndex.IsValid(), "Failed to find scene srg input constant %s.", SceneSrgInputs::TerrainWorldData); + // Load the terrain material asynchronously const AZStd::string materialFilePath = "Materials/Terrain/DefaultPbrTerrain.azmaterial"; m_materialAssetLoader = AZStd::make_unique(); @@ -179,31 +107,24 @@ namespace Terrain } } ); - if (!InitializePatchModel()) - { - AZ_Error(TerrainFPName, false, "Failed to create Terrain render buffers!"); - return; - } OnTerrainDataChanged(AZ::Aabb::CreateNull(), TerrainDataChangedMask::HeightData); } void TerrainFeatureProcessor::Deactivate() { - TerrainMacroMaterialNotificationBus::Handler::BusDisconnect(); AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusDisconnect(); AZ::RPI::MaterialReloadNotificationBus::Handler::BusDisconnect(); DisableSceneNotification(); + OnTerrainDataDestroyBegin(); - m_patchModel = {}; - m_areaData = {}; - m_dirtyRegion = AZ::Aabb::CreateNull(); - m_sectorData.clear(); - m_macroMaterials.Clear(); m_materialAssetLoader = {}; m_materialInstance = {}; + m_meshManager.Reset(); + m_macroMaterialManager.Reset(); + m_detailMaterialManager.Reset(); } void TerrainFeatureProcessor::Render(const AZ::RPI::FeatureProcessor::RenderPacket& packet) @@ -213,7 +134,10 @@ namespace Terrain void TerrainFeatureProcessor::OnTerrainDataDestroyBegin() { - m_areaData = {}; + m_heightmapImage = {}; + m_terrainBounds = AZ::Aabb::CreateNull(); + m_dirtyRegion = AZ::Aabb::CreateNull(); + m_heightmapNeedsUpdate = false; } void TerrainFeatureProcessor::OnTerrainDataChanged(const AZ::Aabb& dirtyRegion, TerrainDataChangedMask dataChangedMask) @@ -222,10 +146,6 @@ namespace Terrain { TerrainHeightOrSettingsUpdated(dirtyRegion); } - if ((dataChangedMask & TerrainDataChangedMask::SurfaceData) != 0) - { - TerrainSurfaceDataUpdated(dirtyRegion); - } } void TerrainFeatureProcessor::TerrainHeightOrSettingsUpdated(const AZ::Aabb& dirtyRegion) @@ -239,1335 +159,263 @@ namespace Terrain m_dirtyRegion.AddAabb(regionToUpdate); m_dirtyRegion.Clamp(worldBounds); - const AZ::Transform transform = AZ::Transform::CreateTranslation(worldBounds.GetCenter()); - AZ::Vector2 queryResolution2D = AZ::Vector2(1.0f); AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( queryResolution2D, &AzFramework::Terrain::TerrainDataRequests::GetTerrainHeightQueryResolution); // Currently query resolution is multidimensional but the rendering system only supports this changing in one dimension. float queryResolution = queryResolution2D.GetX(); - // Sectors need to be rebuilt if the world bounds change in the x/y, or the sample spacing changes. - m_areaData.m_rebuildSectors = m_areaData.m_rebuildSectors || - m_areaData.m_terrainBounds.GetMin().GetX() != worldBounds.GetMin().GetX() || - m_areaData.m_terrainBounds.GetMin().GetY() != worldBounds.GetMin().GetY() || - m_areaData.m_terrainBounds.GetMax().GetX() != worldBounds.GetMax().GetX() || - m_areaData.m_terrainBounds.GetMax().GetY() != worldBounds.GetMax().GetY() || - m_areaData.m_sampleSpacing != queryResolution; - - m_areaData.m_transform = transform; - m_areaData.m_terrainBounds = worldBounds; - m_areaData.m_sampleSpacing = queryResolution; - m_areaData.m_heightmapUpdated = true; + m_terrainBounds = worldBounds; + m_sampleSpacing = queryResolution; + m_heightmapNeedsUpdate = true; } - void TerrainFeatureProcessor::TerrainSurfaceDataUpdated(const AZ::Aabb& dirtyRegion) + void TerrainFeatureProcessor::OnRenderPipelinePassesChanged([[maybe_unused]] AZ::RPI::RenderPipeline* renderPipeline) { - m_dirtyDetailRegion.AddAabb(dirtyRegion); + CacheForwardPass(); } - void TerrainFeatureProcessor::OnTerrainMacroMaterialCreated(AZ::EntityId entityId, const MacroMaterialData& newMaterialData) + void TerrainFeatureProcessor::UpdateHeightmapImage() { - MacroMaterialData& materialData = FindOrCreateByEntityId(entityId, m_macroMaterials); - - UpdateMacroMaterialData(materialData, newMaterialData); + int32_t heightmapImageXStart = aznumeric_cast(AZStd::ceilf(m_terrainBounds.GetMin().GetX() / m_sampleSpacing)); + int32_t heightmapImageXEnd = aznumeric_cast(AZStd::floorf(m_terrainBounds.GetMax().GetX() / m_sampleSpacing)) + 1; + int32_t heightmapImageYStart = aznumeric_cast(AZStd::ceilf(m_terrainBounds.GetMin().GetY() / m_sampleSpacing)); + int32_t heightmapImageYEnd = aznumeric_cast(AZStd::floorf(m_terrainBounds.GetMax().GetY() / m_sampleSpacing)) + 1; + uint32_t heightmapImageWidth = heightmapImageXEnd - heightmapImageXStart; + uint32_t heightmapImageHeight = heightmapImageYEnd - heightmapImageYStart; - // Update all sectors in region. - ForOverlappingSectors(materialData.m_bounds, - [&](SectorData& sectorData) { - if (sectorData.m_macroMaterials.size() < sectorData.m_macroMaterials.max_size()) - { - sectorData.m_macroMaterials.push_back(m_macroMaterials.GetIndexForData(&materialData)); - } - } - ); - } + const AZ::RHI::Size heightmapSize = AZ::RHI::Size(heightmapImageWidth, heightmapImageHeight, 1); - void TerrainFeatureProcessor::OnTerrainMacroMaterialChanged(AZ::EntityId entityId, const MacroMaterialData& newMaterialData) - { - MacroMaterialData& data = FindOrCreateByEntityId(entityId, m_macroMaterials); - UpdateMacroMaterialData(data, newMaterialData); - } - - void TerrainFeatureProcessor::OnTerrainMacroMaterialRegionChanged( - AZ::EntityId entityId, [[maybe_unused]] const AZ::Aabb& oldRegion, const AZ::Aabb& newRegion) - { - MacroMaterialData& materialData = FindOrCreateByEntityId(entityId, m_macroMaterials); - for (SectorData& sectorData : m_sectorData) + if (!m_heightmapImage || m_heightmapImage->GetDescriptor().m_size != heightmapSize) { - bool overlapsOld = sectorData.m_aabb.Overlaps(materialData.m_bounds); - bool overlapsNew = sectorData.m_aabb.Overlaps(newRegion); - if (overlapsOld && !overlapsNew) - { - // Remove the macro material from this sector - for (uint16_t& idx : sectorData.m_macroMaterials) - { - if (m_macroMaterials.GetData(idx).m_entityId == entityId) - { - idx = sectorData.m_macroMaterials.back(); - sectorData.m_macroMaterials.pop_back(); - } - } - } - else if (overlapsNew && !overlapsOld) - { - // Add the macro material to this sector - if (sectorData.m_macroMaterials.size() < MaxMaterialsPerSector) - { - sectorData.m_macroMaterials.push_back(m_macroMaterials.GetIndexForData(&materialData)); - } - } - } - m_areaData.m_macroMaterialsUpdated = true; - materialData.m_bounds = newRegion; - } + const AZ::Data::Instance imagePool = AZ::RPI::ImageSystemInterface::Get()->GetSystemAttachmentPool(); + AZ::RHI::ImageDescriptor imageDescriptor = AZ::RHI::ImageDescriptor::Create2D( + AZ::RHI::ImageBindFlags::ShaderRead, heightmapSize.m_width, heightmapSize.m_height, AZ::RHI::Format::R16_UNORM + ); - void TerrainFeatureProcessor::OnTerrainMacroMaterialDestroyed(AZ::EntityId entityId) - { - const MacroMaterialData* materialData = FindByEntityId(entityId, m_macroMaterials); + const AZ::Name TerrainHeightmapName = AZ::Name(TerrainHeightmapChars); + m_heightmapImage = AZ::RPI::AttachmentImage::Create(*imagePool.get(), imageDescriptor, TerrainHeightmapName, nullptr, nullptr); + AZ_Error(TerrainFPName, m_heightmapImage, "Failed to initialize the heightmap image."); + + // World size changed, so the whole height map needs updating. + m_dirtyRegion = m_terrainBounds; + m_imageBindingsNeedUpdate = true; + } - if (materialData) + if (!m_dirtyRegion.IsValid()) { - uint16_t destroyedMaterialIndex = m_macroMaterials.GetIndexForData(materialData); - ForOverlappingSectors(materialData->m_bounds, - [&](SectorData& sectorData) { - for (uint16_t& idx : sectorData.m_macroMaterials) - { - if (idx == destroyedMaterialIndex) - { - idx = sectorData.m_macroMaterials.back(); - sectorData.m_macroMaterials.pop_back(); - } - } - }); + return; } - m_areaData.m_macroMaterialsUpdated = true; - RemoveByEntityId(entityId, m_macroMaterials); - } - - void TerrainFeatureProcessor::OnTerrainSurfaceMaterialMappingCreated(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag, MaterialInstance material) - { - DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); + int32_t xStart = aznumeric_cast(AZStd::ceilf(m_dirtyRegion.GetMin().GetX() / m_sampleSpacing)); + int32_t xEnd = aznumeric_cast(AZStd::floorf(m_dirtyRegion.GetMax().GetX() / m_sampleSpacing)) + 1; + int32_t yStart = aznumeric_cast(AZStd::ceilf(m_dirtyRegion.GetMin().GetY() / m_sampleSpacing)); + int32_t yEnd = aznumeric_cast(AZStd::floorf(m_dirtyRegion.GetMax().GetY() / m_sampleSpacing)) + 1; + uint32_t updateWidth = xEnd - xStart; + uint32_t updateHeight = yEnd - yStart; - // Validate that the surface tag is new - for (DetailMaterialSurface& surface : materialRegion.m_materialsForSurfaces) + AZStd::vector pixels; + pixels.reserve(updateWidth * updateHeight); { - if (surface.m_surfaceTag == surfaceTag) - { - AZ_Error(TerrainFPName, false, "Already have a surface material mapping for this surface tag."); - return; - } - } - - uint16_t detailMaterialId = CreateOrUpdateDetailMaterial(material); - materialRegion.m_materialsForSurfaces.push_back({ surfaceTag, detailMaterialId }); - m_detailMaterials.GetData(detailMaterialId).refCount++; - m_dirtyDetailRegion.AddAabb(materialRegion.m_region); - } - - void TerrainFeatureProcessor::OnRenderPipelinePassesChanged([[maybe_unused]] AZ::RPI::RenderPipeline* renderPipeline) - { - CacheForwardPass(); - } + // Block other threads from accessing the surface data bus while we are in GetHeightFromFloats (which may call into the SurfaceData bus). + // We lock our surface data mutex *before* checking / setting "isRequestInProgress" so that we prevent race conditions + // that create false detection of cyclic dependencies when multiple requests occur on different threads simultaneously. + // (One case where this was previously able to occur was in rapid updating of the Preview widget on the + // GradientSurfaceDataComponent in the Editor when moving the threshold sliders back and forth rapidly) - void TerrainFeatureProcessor::CheckDetailMaterialForDeletion(uint16_t detailMaterialId) - { - auto& detailMaterialData = m_detailMaterials.GetData(detailMaterialId); - if (--detailMaterialData.refCount == 0) - { - uint16_t bufferIndex = detailMaterialData.m_detailMaterialBufferIndex; - DetailMaterialShaderData& shaderData = m_detailMaterialShaderData.GetElement(bufferIndex); + auto& surfaceDataContext = SurfaceData::SurfaceDataSystemRequestBus::GetOrCreateContext(false); + typename SurfaceData::SurfaceDataSystemRequestBus::Context::DispatchLockGuard scopeLock(surfaceDataContext.m_contextMutex); - for (uint16_t imageIndex : - { - shaderData.m_colorImageIndex, - shaderData.m_normalImageIndex, - shaderData.m_roughnessImageIndex, - shaderData.m_metalnessImageIndex, - shaderData.m_specularF0ImageIndex, - shaderData.m_occlusionImageIndex, - shaderData.m_heightImageIndex - }) + for (int32_t y = yStart; y < yEnd; y++) { - if (imageIndex != InvalidDetailImageIndex) + for (int32_t x = xStart; x < xEnd; x++) { - m_detailImageViews.at(imageIndex) = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Magenta)->GetImageView(); - m_detailImageViewFreeList.push_back(imageIndex); - m_detailImagesNeedUpdate = true; - } - } - - m_detailMaterialShaderData.Release(bufferIndex); - m_detailMaterials.RemoveIndex(detailMaterialId); - } - } - - void TerrainFeatureProcessor::OnTerrainSurfaceMaterialMappingDestroyed(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag) - { - DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); + bool terrainExists = true; + float terrainHeight = 0.0f; + float xPos = x * m_sampleSpacing; + float yPos = y * m_sampleSpacing; + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + terrainHeight, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, + xPos, yPos, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, &terrainExists); - for (DetailMaterialSurface& surface : materialRegion.m_materialsForSurfaces) - { - if (surface.m_surfaceTag == surfaceTag) - { - CheckDetailMaterialForDeletion(surface.m_detailMaterialId); + const float clampedHeight = AZ::GetClamp((terrainHeight - m_terrainBounds.GetMin().GetZ()) / m_terrainBounds.GetExtents().GetZ(), 0.0f, 1.0f); + const float expandedHeight = AZStd::roundf(clampedHeight * AZStd::numeric_limits::max()); + const uint16_t uint16Height = aznumeric_cast(expandedHeight); - if (surface.m_surfaceTag != materialRegion.m_materialsForSurfaces.back().m_surfaceTag) - { - AZStd::swap(surface, materialRegion.m_materialsForSurfaces.back()); + pixels.push_back(uint16Height); } - materialRegion.m_materialsForSurfaces.pop_back(); - m_dirtyDetailRegion.AddAabb(materialRegion.m_region); - return; } } - AZ_Error(TerrainFPName, false, "Could not find surface tag to destroy for OnTerrainSurfaceMaterialMappingDestroyed()."); - } - - void TerrainFeatureProcessor::OnTerrainSurfaceMaterialMappingChanged(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag, MaterialInstance material) - { - DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); - bool found = false; - uint16_t materialId = CreateOrUpdateDetailMaterial(material); - for (DetailMaterialSurface& surface : materialRegion.m_materialsForSurfaces) + if (m_heightmapImage) { - if (surface.m_surfaceTag == surfaceTag) - { - found = true; - if (surface.m_detailMaterialId != materialId) - { - ++m_detailMaterials.GetData(materialId).refCount; - CheckDetailMaterialForDeletion(surface.m_detailMaterialId); - surface.m_detailMaterialId = materialId; - } - break; - } - } + constexpr uint32_t BytesPerPixel = sizeof(uint16_t); + const float left = xStart - (m_terrainBounds.GetMin().GetX() / m_sampleSpacing); + const float top = yStart - (m_terrainBounds.GetMin().GetY() / m_sampleSpacing); - if (!found) - { - ++m_detailMaterials.GetData(materialId).refCount; - materialRegion.m_materialsForSurfaces.push_back({ surfaceTag, materialId }); - } - m_dirtyDetailRegion.AddAabb(materialRegion.m_region); - } + AZ::RHI::ImageUpdateRequest imageUpdateRequest; + imageUpdateRequest.m_imageSubresourcePixelOffset.m_left = aznumeric_cast(left); + imageUpdateRequest.m_imageSubresourcePixelOffset.m_top = aznumeric_cast(top); + imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerRow = updateWidth * BytesPerPixel; + imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerImage = updateWidth * updateHeight * BytesPerPixel; + imageUpdateRequest.m_sourceSubresourceLayout.m_rowCount = updateHeight; + imageUpdateRequest.m_sourceSubresourceLayout.m_size = AZ::RHI::Size(updateWidth, updateHeight, 1); + imageUpdateRequest.m_sourceData = pixels.data(); + imageUpdateRequest.m_image = m_heightmapImage->GetRHIImage(); - void TerrainFeatureProcessor::OnTerrainSurfaceMaterialMappingRegionChanged(AZ::EntityId entityId, const AZ::Aabb& oldRegion, const AZ::Aabb& newRegion) - { - DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); - materialRegion.m_region = newRegion; - m_dirtyDetailRegion.AddAabb(oldRegion); - m_dirtyDetailRegion.AddAabb(newRegion); + m_heightmapImage->UpdateImageContents(imageUpdateRequest); + } + + m_dirtyRegion = AZ::Aabb::CreateNull(); } - uint16_t TerrainFeatureProcessor::CreateOrUpdateDetailMaterial(MaterialInstance material) + void TerrainFeatureProcessor::PrepareMaterialData() { - static constexpr uint16_t InvalidDetailMaterial = 0xFFFF; - uint16_t detailMaterialId = InvalidDetailMaterial; + m_terrainSrg = {}; - for (auto& detailMaterialData : m_detailMaterials.GetDataVector()) + for (auto& shaderItem : m_materialInstance->GetShaderCollection()) { - if (detailMaterialData.m_assetId == material->GetAssetId()) + if (shaderItem.GetShaderAsset()->GetDrawListName() == AZ::Name("forward")) { - detailMaterialId = m_detailMaterials.GetIndexForData(&detailMaterialData); - UpdateDetailMaterialData(detailMaterialId, material); + const auto& shaderAsset = shaderItem.GetShaderAsset(); + m_terrainSrg = AZ::RPI::ShaderResourceGroup::Create(shaderItem.GetShaderAsset(), shaderAsset->GetSupervariantIndex(AZ::Name()), AZ::Name{"TerrainSrg"}); + AZ_Error(TerrainFPName, m_terrainSrg, "Failed to create Terrain shader resource group"); break; } } - AZ_Assert(m_detailMaterialShaderData.GetSize() < 0xFF, "Only 255 detail materials supported."); - - if (detailMaterialId == InvalidDetailMaterial && m_detailMaterialShaderData.GetSize() < 0xFF) - { - detailMaterialId = m_detailMaterials.GetFreeSlotIndex(); - auto& detailMaterialData = m_detailMaterials.GetData(detailMaterialId); - detailMaterialData.m_detailMaterialBufferIndex = aznumeric_cast(m_detailMaterialShaderData.Reserve()); - UpdateDetailMaterialData(detailMaterialId, material); - } - return detailMaterialId; - } - - void TerrainFeatureProcessor::UpdateDetailMaterialData(uint16_t detailMaterialIndex, MaterialInstance material) - { - DetailMaterialData& materialData = m_detailMaterials.GetData(detailMaterialIndex); - DetailMaterialShaderData& shaderData = m_detailMaterialShaderData.GetElement(materialData.m_detailMaterialBufferIndex); - - if (materialData.m_materialChangeId == material->GetCurrentChangeId()) - { - return; // material hasn't changed, nothing to do - } - - materialData.m_materialChangeId = material->GetCurrentChangeId(); - materialData.m_assetId = material->GetAssetId(); - - DetailTextureFlags& flags = shaderData.m_flags; - - auto getIndex = [&](const char* const indexName) -> AZ::RPI::MaterialPropertyIndex - { - const AZ::RPI::MaterialPropertyIndex index = material->FindPropertyIndex(AZ::Name(indexName)); - AZ_Warning(TerrainFPName, index.IsValid(), "Failed to find shader input constant %s.", indexName); - return index; - }; - - auto applyProperty = [&](const char* const indexName, auto& ref) -> void - { - const auto index = getIndex(indexName); - if (index.IsValid()) - { - // GetValue() expects the actaul type, not a reference type, so the reference needs to be removed. - using TypeRefRemoved = AZStd::remove_cvref_t; - ref = material->GetPropertyValue(index).GetValue(); - } - }; + AZ_Error(TerrainFPName, m_terrainSrg, "Terrain Srg not found on any shader in the terrain material"); - auto applyImage = [&](const char* const indexName, AZ::Data::Instance& ref, const char* const usingFlagName, DetailTextureFlags flagToSet, uint16_t& imageIndex) -> void + if (m_terrainSrg) { - // Determine if an image exists and if its using flag allows it to be used. - const auto index = getIndex(indexName); - const auto useTextureIndex = getIndex(usingFlagName); - bool useTextureValue = true; - if (useTextureIndex.IsValid()) + if (m_imageArrayHandler->IsInitialized()) { - useTextureValue = material->GetPropertyValue(useTextureIndex).GetValue(); + m_imageArrayHandler->UpdateSrgIndices(m_terrainSrg, AZ::Name(TerrainSrgInputs::Textures)); } - if (index.IsValid() && useTextureValue) + else { - ref = material->GetPropertyValue(index).GetValue>(); + m_imageArrayHandler->Initialize(m_terrainSrg, AZ::Name(TerrainSrgInputs::Textures)); } - useTextureValue = useTextureValue && ref; - flags = DetailTextureFlags(useTextureValue ? (flags | flagToSet) : (flags & ~flagToSet)); - // Update queues to add/remove textures depending on if the image is used - if (ref) + if (m_macroMaterialManager.IsInitialized()) { - if (imageIndex == InvalidDetailImageIndex) - { - if (m_detailImageViewFreeList.size() > 0) - { - imageIndex = m_detailImageViewFreeList.back(); - m_detailImageViewFreeList.pop_back(); - } - else - { - imageIndex = aznumeric_cast(m_detailImageViews.size()); - m_detailImageViews.push_back(); - } - } - m_detailImageViews.at(imageIndex) = ref->GetImageView(); - m_detailImagesNeedUpdate = true; + m_macroMaterialManager.UpdateSrgIndices(m_terrainSrg); } - else if (imageIndex != InvalidDetailImageIndex) + else { - m_detailImageViews.at(imageIndex) = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Magenta)->GetImageView(); - m_detailImageViewFreeList.push_back(imageIndex); - m_detailImagesNeedUpdate = true; - imageIndex = InvalidDetailImageIndex; + m_macroMaterialManager.Initialize(m_imageArrayHandler, m_terrainSrg); } - }; - auto applyFlag = [&](const char* const indexName, DetailTextureFlags flagToSet) -> void - { - const auto index = getIndex(indexName); - if (index.IsValid()) + if (m_detailMaterialManager.IsInitialized()) { - bool flagValue = material->GetPropertyValue(index).GetValue(); - flags = DetailTextureFlags(flagValue ? flags | flagToSet : flags); + m_detailMaterialManager.UpdateSrgIndices(m_terrainSrg); } - }; - - auto getEnumName = [&](const char* const indexName) -> const AZStd::string_view - { - const auto index = getIndex(indexName); - if (index.IsValid()) + else { - uint32_t enumIndex = material->GetPropertyValue(index).GetValue(); - const AZ::Name& enumName = material->GetMaterialPropertiesLayout()->GetPropertyDescriptor(index)->GetEnumName(enumIndex); - return enumName.GetStringView(); + m_detailMaterialManager.Initialize(m_imageArrayHandler, m_terrainSrg); } - return ""; - }; - - using namespace DetailMaterialInputs; - applyImage(BaseColorMap, materialData.m_colorImage, BaseColorUseTexture, DetailTextureFlags::UseTextureBaseColor, shaderData.m_colorImageIndex); - applyProperty(BaseColorFactor, shaderData.m_baseColorFactor); - - const auto index = getIndex(BaseColorColor); - if (index.IsValid()) - { - AZ::Color baseColor = material->GetPropertyValue(index).GetValue(); - shaderData.m_baseColorRed = baseColor.GetR(); - shaderData.m_baseColorGreen = baseColor.GetG(); - shaderData.m_baseColorBlue = baseColor.GetB(); - } - - const AZStd::string_view& blendModeString = getEnumName(BaseColorBlendMode); - if (blendModeString == "Multiply") - { - flags = DetailTextureFlags(flags | DetailTextureFlags::BlendModeMultiply); - } - else if (blendModeString == "LinearLight") - { - flags = DetailTextureFlags(flags | DetailTextureFlags::BlendModeLinearLight); - } - else if (blendModeString == "Lerp") - { - flags = DetailTextureFlags(flags | DetailTextureFlags::BlendModeLerp); - } - else if (blendModeString == "Overlay") - { - flags = DetailTextureFlags(flags | DetailTextureFlags::BlendModeOverlay); - } - - applyImage(MetallicMap, materialData.m_metalnessImage, MetallicUseTexture, DetailTextureFlags::UseTextureMetallic, shaderData.m_metalnessImageIndex); - applyProperty(MetallicFactor, shaderData.m_metalFactor); - - applyImage(RoughnessMap, materialData.m_roughnessImage, RoughnessUseTexture, DetailTextureFlags::UseTextureRoughness, shaderData.m_roughnessImageIndex); - - if ((flags & DetailTextureFlags::UseTextureRoughness) > 0) - { - float lowerBound = 0.0; - float upperBound = 1.0; - applyProperty(RoughnessLowerBound, lowerBound); - applyProperty(RoughnessUpperBound, upperBound); - shaderData.m_roughnessBias = lowerBound; - shaderData.m_roughnessScale = upperBound - lowerBound; } else { - shaderData.m_roughnessBias = 0.0; - applyProperty(RoughnessFactor, shaderData.m_roughnessScale); + m_imageArrayHandler->Reset(); + m_macroMaterialManager.Reset(); + m_detailMaterialManager.Reset(); } - - applyImage(SpecularF0Map, materialData.m_specularF0Image, SpecularF0UseTexture, DetailTextureFlags::UseTextureSpecularF0, shaderData.m_specularF0ImageIndex); - applyProperty(SpecularF0Factor, shaderData.m_specularF0Factor); - - applyImage(NormalMap, materialData.m_normalImage, NormalUseTexture, DetailTextureFlags::UseTextureNormal, shaderData.m_normalImageIndex); - applyProperty(NormalFactor, shaderData.m_normalFactor); - applyFlag(NormalFlipX, DetailTextureFlags::FlipNormalX); - applyFlag(NormalFlipY, DetailTextureFlags::FlipNormalY); - - applyImage(DiffuseOcclusionMap, materialData.m_occlusionImage, DiffuseOcclusionUseTexture, DetailTextureFlags::UseTextureOcclusion, shaderData.m_occlusionImageIndex); - applyProperty(DiffuseOcclusionFactor, shaderData.m_occlusionFactor); - - applyImage(HeightMap, materialData.m_heightImage, HeightUseTexture, DetailTextureFlags::UseTextureHeight, shaderData.m_heightImageIndex); - applyProperty(HeightFactor, shaderData.m_heightFactor); - applyProperty(HeightOffset, shaderData.m_heightOffset); - applyProperty(HeightBlendFactor, shaderData.m_heightBlendFactor); - - m_updateDetailMaterialBuffer = true; } - void TerrainFeatureProcessor::CheckUpdateDetailTexture(const Aabb2i& newBounds, const Vector2i& newCenter) + void TerrainFeatureProcessor::ProcessSurfaces(const FeatureProcessor::RenderPacket& process) { - if (!m_detailTextureImage) + AZ_PROFILE_FUNCTION(AzRender); + + if (!m_terrainBounds.IsValid()) { - // If the m_detailTextureImage doesn't exist, create it and populate the entire texture - - const AZ::Data::Instance imagePool = AZ::RPI::ImageSystemInterface::Get()->GetSystemAttachmentPool(); - AZ::RHI::ImageDescriptor imageDescriptor = AZ::RHI::ImageDescriptor::Create2D( - AZ::RHI::ImageBindFlags::ShaderRead, DetailTextureSize, DetailTextureSize, AZ::RHI::Format::R8G8B8A8_UINT - ); - const AZ::Name TerrainDetailName = AZ::Name(TerrainDetailChars); - m_detailTextureImage = AZ::RPI::AttachmentImage::Create(*imagePool.get(), imageDescriptor, TerrainDetailName, nullptr, nullptr); - AZ_Error(TerrainFPName, m_detailTextureImage, "Failed to initialize the detail texture image."); - - UpdateDetailTexture(newBounds, newBounds, newCenter); + return; } - else - { - // If the new bounds of the detail texture are different than the old bounds, then the edges of the texture need to be updated. - int32_t offsetX = m_detailTextureBounds.m_min.m_x - newBounds.m_min.m_x; - - // Horizontal edge update - if (newBounds.m_min.m_x != m_detailTextureBounds.m_min.m_x) + if (m_materialInstance && m_materialInstance->CanCompile()) + { + AZ::Vector3 cameraPosition = AZ::Vector3::CreateZero(); + for (auto& view : process.m_views) { - Aabb2i updateBounds; - if (newBounds.m_min.m_x < m_detailTextureBounds.m_min.m_x) + if ((view->GetUsageFlags() & AZ::RPI::View::UsageFlags::UsageCamera) > 0) { - updateBounds.m_min.m_x = newBounds.m_min.m_x; - updateBounds.m_max.m_x = m_detailTextureBounds.m_min.m_x; + cameraPosition = view->GetCameraTransform().GetTranslation(); + break; } - else - { - updateBounds.m_min.m_x = m_detailTextureBounds.m_max.m_x; - updateBounds.m_max.m_x = newBounds.m_max.m_x; + } + + if (m_meshManager.IsInitialized()) + { + bool surfacesRebuilt = false; + surfacesRebuilt = m_meshManager.CheckRebuildSurfaces(m_materialInstance, *GetParentScene()); + if (m_forceRebuildDrawPackets && !surfacesRebuilt) + { + m_meshManager.RebuildDrawPackets(*GetParentScene()); } - updateBounds.m_min.m_y = newBounds.m_min.m_y; - updateBounds.m_max.m_y = newBounds.m_max.m_y; - UpdateDetailTexture(updateBounds, newBounds, newCenter); + m_forceRebuildDrawPackets = false; } - // Vertical edge update - if (newBounds.m_min.m_y != m_detailTextureBounds.m_min.m_y) + if (m_terrainSrg) { - Aabb2i updateBounds; - // Don't update areas that have already been updated in the horizontal update. - updateBounds.m_min.m_x = newBounds.m_min.m_x + AZ::GetMax(0, offsetX); - updateBounds.m_max.m_x = newBounds.m_max.m_x + AZ::GetMin(0, offsetX); - if (newBounds.m_min.m_y < m_detailTextureBounds.m_min.m_y) + if (m_macroMaterialManager.IsInitialized()) { - updateBounds.m_min.m_y = newBounds.m_min.m_y; - updateBounds.m_max.m_y = m_detailTextureBounds.m_min.m_y; + m_macroMaterialManager.Update(m_terrainSrg); } - else + + if (m_detailMaterialManager.IsInitialized()) { - updateBounds.m_min.m_y = m_detailTextureBounds.m_max.m_y; - updateBounds.m_max.m_y = newBounds.m_max.m_y; + m_detailMaterialManager.Update(cameraPosition, m_terrainSrg); } - UpdateDetailTexture(updateBounds, newBounds, newCenter); } - if (m_dirtyDetailRegion.IsValid()) + if (m_heightmapNeedsUpdate) { - // If any regions are marked as dirty, then they should be updated. - - AZ::Vector3 currentMin = AZ::Vector3(newBounds.m_min.m_x * DetailTextureScale, newBounds.m_min.m_y * DetailTextureScale, -0.5f); - AZ::Vector3 currentMax = AZ::Vector3(newBounds.m_max.m_x * DetailTextureScale, newBounds.m_max.m_y * DetailTextureScale, 0.5f); - AZ::Aabb detailTextureCoverage = AZ::Aabb::CreateFromMinMax(currentMin, currentMax); - AZ::Vector3 previousMin = AZ::Vector3(m_detailTextureBounds.m_min.m_x * DetailTextureScale, m_detailTextureBounds.m_min.m_y * DetailTextureScale, -0.5f); - AZ::Vector3 previousMax = AZ::Vector3(m_detailTextureBounds.m_max.m_x * DetailTextureScale, m_detailTextureBounds.m_max.m_y * DetailTextureScale, 0.5f); - AZ::Aabb previousCoverage = AZ::Aabb::CreateFromMinMax(previousMin, previousMax); - - // Area of texture not already updated by camera movement above. - AZ::Aabb clampedCoverage = previousCoverage.GetClamped(detailTextureCoverage); - - // Clamp the dirty region to the area of the detail texture that is visible and not already updated. - clampedCoverage.Clamp(m_dirtyDetailRegion); - - if (clampedCoverage.IsValid()) - { - Aabb2i updateBounds; - updateBounds.m_min.m_x = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMin().GetX() / DetailTextureScale)); - updateBounds.m_min.m_y = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMin().GetY() / DetailTextureScale)); - updateBounds.m_max.m_x = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMax().GetX() / DetailTextureScale)); - updateBounds.m_max.m_y = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMax().GetY() / DetailTextureScale)); - if (updateBounds.m_min.m_x < updateBounds.m_max.m_x && updateBounds.m_min.m_y < updateBounds.m_max.m_y) - { - UpdateDetailTexture(updateBounds, newBounds, newCenter); - } - } + UpdateHeightmapImage(); + m_heightmapNeedsUpdate = false; + } + + if (m_imageArrayHandler->IsInitialized()) + { + bool result [[maybe_unused]] = m_imageArrayHandler->UpdateSrg(m_terrainSrg); + AZ_Error(TerrainFPName, result, "Failed to set image view unbounded array into shader resource group."); } } + + if (m_meshManager.IsInitialized()) + { + m_meshManager.DrawMeshes(process); + } - } - - uint8_t TerrainFeatureProcessor::CalculateUpdateRegions(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel, - AZStd::array& textureSpaceAreas, AZStd::array& scaledWorldSpaceAreas) - { - Vector2i centerOffset = { centerPixel.m_x - DetailTextureSizeHalf, centerPixel.m_y - DetailTextureSizeHalf }; - - int32_t quadrantXOffset = centerPixel.m_x < DetailTextureSizeHalf ? DetailTextureSize : -DetailTextureSize; - int32_t quadrantYOffset = centerPixel.m_y < DetailTextureSizeHalf ? DetailTextureSize : -DetailTextureSize; - - uint8_t numQuadrants = 0; - - // For each of the 4 quadrants: - auto calculateQuadrant = [&](Vector2i quadrantOffset) + if (m_heightmapImage && m_imageBindingsNeedUpdate) { - Aabb2i offsetUpdateArea = updateArea + centerOffset + quadrantOffset; - Aabb2i updateSectionBounds = textureBounds.GetClamped(offsetUpdateArea); - if (updateSectionBounds.IsValid()) - { - textureSpaceAreas[numQuadrants] = updateSectionBounds - textureBounds.m_min; - scaledWorldSpaceAreas[numQuadrants] = updateSectionBounds - centerOffset - quadrantOffset; - ++numQuadrants; - } - }; + WorldShaderData worldData; + m_terrainBounds.GetMin().StoreToFloat3(worldData.m_min.data()); + m_terrainBounds.GetMax().StoreToFloat3(worldData.m_max.data()); - calculateQuadrant({ 0, 0 }); - calculateQuadrant({ quadrantXOffset, 0 }); - calculateQuadrant({ 0, quadrantYOffset }); - calculateQuadrant({ quadrantXOffset, quadrantYOffset }); + m_imageBindingsNeedUpdate = false; - return numQuadrants; - } + auto sceneSrg = GetParentScene()->GetShaderResourceGroup(); + sceneSrg->SetImage(m_heightmapPropertyIndex, m_heightmapImage); + sceneSrg->SetConstant(m_worldDataIndex, worldData); + } - void TerrainFeatureProcessor::UpdateDetailTexture(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel) - { - if (!m_detailTextureImage) + if (m_materialInstance) { - return; + m_materialInstance->Compile(); } - struct DetailMaterialPixel + if (m_terrainSrg && m_forwardPass) { - uint8_t m_material1{ 255 }; - uint8_t m_material2{ 255 }; - uint8_t m_blend{ 0 }; // 0 = full weight on material1, 255 = full weight on material2 - uint8_t m_padding{ 0 }; - }; + m_terrainSrg->Compile(); + m_forwardPass->BindSrg(m_terrainSrg->GetRHIShaderResourceGroup()); + } + } - // Because the center of the detail texture may be offset, each update area may actually need to be split into - // up to 4 separate update areas in each sector of the quadrant. - AZStd::array textureSpaceAreas; - AZStd::array scaledWorldSpaceAreas; - uint8_t updateAreaCount = CalculateUpdateRegions(updateArea, textureBounds, centerPixel, textureSpaceAreas, scaledWorldSpaceAreas); - - // Pull the data for each area updated and use it to construct an update for the detail material id texture. - for (uint8_t i = 0; i < updateAreaCount; ++i) - { - const Aabb2i& quadrantTextureArea = textureSpaceAreas[i]; - const Aabb2i& quadrantWorldArea = scaledWorldSpaceAreas[i]; - - AZStd::vector pixels; - pixels.resize((quadrantWorldArea.m_max.m_x - quadrantWorldArea.m_min.m_x) * (quadrantWorldArea.m_max.m_y - quadrantWorldArea.m_min.m_y)); - uint32_t index = 0; - - for (int yPos = quadrantWorldArea.m_min.m_y; yPos < quadrantWorldArea.m_max.m_y; ++yPos) - { - for (int xPos = quadrantWorldArea.m_min.m_x; xPos < quadrantWorldArea.m_max.m_x; ++xPos) - { - AZ::Vector2 position = AZ::Vector2(xPos * DetailTextureScale, yPos * DetailTextureScale); - AzFramework::SurfaceData::SurfaceTagWeightList surfaceWeights; - AzFramework::Terrain::TerrainDataRequestBus::Broadcast(&AzFramework::Terrain::TerrainDataRequests::GetSurfaceWeightsFromVector2, position, surfaceWeights, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, nullptr); - - // Store the top two surface weights in the texture with m_blend storing the relative weight. - bool isFirstMaterial = true; - float firstWeight = 0.0f; - for (const auto& surfaceTagWeight : surfaceWeights) - { - if (surfaceTagWeight.m_weight > 0.0f) - { - AZ::Crc32 surfaceType = surfaceTagWeight.m_surfaceType; - uint16_t materialId = GetDetailMaterialForSurfaceTypeAndPosition(surfaceType, position); - if (materialId != m_detailMaterials.NoFreeSlot && materialId < 255) - { - if (isFirstMaterial) - { - pixels.at(index).m_material1 = aznumeric_cast(materialId); - firstWeight = surfaceTagWeight.m_weight; - // m_blend only needs to be calculated is material 2 is found, otherwise the initial value of 0 is correct. - isFirstMaterial = false; - } - else - { - pixels.at(index).m_material2 = aznumeric_cast(materialId); - float totalWeight = firstWeight + surfaceTagWeight.m_weight; - float blendWeight = 1.0f - (firstWeight / totalWeight); - pixels.at(index).m_blend = aznumeric_cast(AZStd::round(blendWeight * 255.0f)); - break; - } - } - } - else - { - break; // since the list is ordered, no other materials are in the list with positive weights. - } - } - ++index; - } - } - - const int32_t left = quadrantTextureArea.m_min.m_x; - const int32_t top = quadrantTextureArea.m_min.m_y; - const int32_t width = quadrantTextureArea.m_max.m_x - quadrantTextureArea.m_min.m_x; - const int32_t height = quadrantTextureArea.m_max.m_y - quadrantTextureArea.m_min.m_y; - - AZ::RHI::ImageUpdateRequest imageUpdateRequest; - imageUpdateRequest.m_imageSubresourcePixelOffset.m_left = aznumeric_cast(left); - imageUpdateRequest.m_imageSubresourcePixelOffset.m_top = aznumeric_cast(top); - imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerRow = width * sizeof(DetailMaterialPixel); - imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerImage = width * height * sizeof(DetailMaterialPixel); - imageUpdateRequest.m_sourceSubresourceLayout.m_rowCount = height; - imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_width = width; - imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_height = height; - imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_depth = 1; - imageUpdateRequest.m_sourceData = pixels.data(); - imageUpdateRequest.m_image = m_detailTextureImage->GetRHIImage(); - - m_detailTextureImage->UpdateImageContents(imageUpdateRequest); - } - } - - uint16_t TerrainFeatureProcessor::GetDetailMaterialForSurfaceTypeAndPosition(AZ::Crc32 surfaceType, const AZ::Vector2& position) - { - for (const auto& materialRegion : m_detailMaterialRegions.GetDataVector()) - { - if (materialRegion.m_region.Contains(AZ::Vector3(position.GetX(), position.GetY(), 0.0f))) - { - for (const auto& materialSurface : materialRegion.m_materialsForSurfaces) - { - if (materialSurface.m_surfaceTag == surfaceType) - { - return m_detailMaterials.GetData(materialSurface.m_detailMaterialId).m_detailMaterialBufferIndex; - } - } - } - } - return m_detailMaterials.NoFreeSlot; - } - - void TerrainFeatureProcessor::UpdateTerrainData() - { - - const float queryResolution = m_areaData.m_sampleSpacing; - const AZ::Aabb& worldBounds = m_areaData.m_terrainBounds; - - int32_t heightmapImageXStart = aznumeric_cast(AZStd::ceilf(worldBounds.GetMin().GetX() / queryResolution)); - int32_t heightmapImageXEnd = aznumeric_cast(AZStd::floorf(worldBounds.GetMax().GetX() / queryResolution)) + 1; - int32_t heightmapImageYStart = aznumeric_cast(AZStd::ceilf(worldBounds.GetMin().GetY() / queryResolution)); - int32_t heightmapImageYEnd = aznumeric_cast(AZStd::floorf(worldBounds.GetMax().GetY() / queryResolution)) + 1; - uint32_t heightmapImageWidth = heightmapImageXEnd - heightmapImageXStart; - uint32_t heightmapImageHeight = heightmapImageYEnd - heightmapImageYStart; - - const AZ::RHI::Size heightmapSize = AZ::RHI::Size(heightmapImageWidth, heightmapImageHeight, 1); - - if (!m_areaData.m_heightmapImage || m_areaData.m_heightmapImage->GetDescriptor().m_size != heightmapSize) - { - const AZ::Data::Instance imagePool = AZ::RPI::ImageSystemInterface::Get()->GetSystemAttachmentPool(); - AZ::RHI::ImageDescriptor imageDescriptor = AZ::RHI::ImageDescriptor::Create2D( - AZ::RHI::ImageBindFlags::ShaderRead, heightmapSize.m_width, heightmapSize.m_height, AZ::RHI::Format::R16_UNORM - ); - - const AZ::Name TerrainHeightmapName = AZ::Name(TerrainHeightmapChars); - m_areaData.m_heightmapImage = AZ::RPI::AttachmentImage::Create(*imagePool.get(), imageDescriptor, TerrainHeightmapName, nullptr, nullptr); - AZ_Error(TerrainFPName, m_areaData.m_heightmapImage, "Failed to initialize the heightmap image."); - - // World size changed, so the whole height map needs updating. - m_dirtyRegion = worldBounds; - m_imagesNeedUpdate = true; - } - - int32_t xStart = aznumeric_cast(AZStd::ceilf(m_dirtyRegion.GetMin().GetX() / queryResolution)); - int32_t xEnd = aznumeric_cast(AZStd::floorf(m_dirtyRegion.GetMax().GetX() / queryResolution)) + 1; - int32_t yStart = aznumeric_cast(AZStd::ceilf(m_dirtyRegion.GetMin().GetY() / queryResolution)); - int32_t yEnd = aznumeric_cast(AZStd::floorf(m_dirtyRegion.GetMax().GetY() / queryResolution)) + 1; - uint32_t updateWidth = xEnd - xStart; - uint32_t updateHeight = yEnd - yStart; - - AZStd::vector pixels; - pixels.reserve(updateWidth * updateHeight); - - { - // Block other threads from accessing the surface data bus while we are in GetHeightFromFloats (which may call into the SurfaceData bus). - // We lock our surface data mutex *before* checking / setting "isRequestInProgress" so that we prevent race conditions - // that create false detection of cyclic dependencies when multiple requests occur on different threads simultaneously. - // (One case where this was previously able to occur was in rapid updating of the Preview widget on the - // GradientSurfaceDataComponent in the Editor when moving the threshold sliders back and forth rapidly) - - auto& surfaceDataContext = SurfaceData::SurfaceDataSystemRequestBus::GetOrCreateContext(false); - typename SurfaceData::SurfaceDataSystemRequestBus::Context::DispatchLockGuard scopeLock(surfaceDataContext.m_contextMutex); - - for (int32_t y = yStart; y < yEnd; y++) - { - for (int32_t x = xStart; x < xEnd; x++) - { - bool terrainExists = true; - float terrainHeight = 0.0f; - float xPos = x * queryResolution; - float yPos = y * queryResolution; - AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - terrainHeight, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, - xPos, yPos, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, &terrainExists); - - const float clampedHeight = AZ::GetClamp((terrainHeight - worldBounds.GetMin().GetZ()) / worldBounds.GetExtents().GetZ(), 0.0f, 1.0f); - const float expandedHeight = AZStd::roundf(clampedHeight * AZStd::numeric_limits::max()); - const uint16_t uint16Height = aznumeric_cast(expandedHeight); - - pixels.push_back(uint16Height); - } - } - } - - if (m_areaData.m_heightmapImage) - { - constexpr uint32_t BytesPerPixel = sizeof(uint16_t); - const float left = xStart - (worldBounds.GetMin().GetX() / queryResolution); - const float top = yStart - (worldBounds.GetMin().GetY() / queryResolution); - - AZ::RHI::ImageUpdateRequest imageUpdateRequest; - imageUpdateRequest.m_imageSubresourcePixelOffset.m_left = aznumeric_cast(left); - imageUpdateRequest.m_imageSubresourcePixelOffset.m_top = aznumeric_cast(top); - imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerRow = updateWidth * BytesPerPixel; - imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerImage = updateWidth * updateHeight * BytesPerPixel; - imageUpdateRequest.m_sourceSubresourceLayout.m_rowCount = updateHeight; - imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_width = updateWidth; - imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_height = updateHeight; - imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_depth = 1; - imageUpdateRequest.m_sourceData = pixels.data(); - imageUpdateRequest.m_image = m_areaData.m_heightmapImage->GetRHIImage(); - - m_areaData.m_heightmapImage->UpdateImageContents(imageUpdateRequest); - } - - m_dirtyRegion = AZ::Aabb::CreateNull(); - } - - void TerrainFeatureProcessor::PrepareMaterialData() - { - const auto layout = m_materialInstance->GetAsset()->GetObjectSrgLayout(); - - m_modelToWorldIndex = layout->FindShaderInputConstantIndex(AZ::Name(ShaderInputs::ModelToWorld)); - AZ_Error(TerrainFPName, m_modelToWorldIndex.IsValid(), "Failed to find shader input constant %s.", ShaderInputs::ModelToWorld); - - m_terrainDataIndex = layout->FindShaderInputConstantIndex(AZ::Name(ShaderInputs::TerrainData)); - AZ_Error(TerrainFPName, m_terrainDataIndex.IsValid(), "Failed to find shader input constant %s.", ShaderInputs::TerrainData); - - m_macroMaterialDataIndex = layout->FindShaderInputConstantIndex(AZ::Name(ShaderInputs::MacroMaterialData)); - AZ_Error(TerrainFPName, m_macroMaterialDataIndex.IsValid(), "Failed to find shader input constant %s.", ShaderInputs::MacroMaterialData); - - m_macroMaterialCountIndex = layout->FindShaderInputConstantIndex(AZ::Name(ShaderInputs::MacroMaterialCount)); - AZ_Error(TerrainFPName, m_macroMaterialCountIndex.IsValid(), "Failed to find shader input constant %s.", ShaderInputs::MacroMaterialCount); - - m_macroColorMapIndex = layout->FindShaderInputImageIndex(AZ::Name(ShaderInputs::MacroColorMap)); - AZ_Error(TerrainFPName, m_macroColorMapIndex.IsValid(), "Failed to find shader input constant %s.", ShaderInputs::MacroColorMap); - - m_macroNormalMapIndex = layout->FindShaderInputImageIndex(AZ::Name(ShaderInputs::MacroNormalMap)); - AZ_Error(TerrainFPName, m_macroNormalMapIndex.IsValid(), "Failed to find shader input constant %s.", ShaderInputs::MacroNormalMap); - - m_terrainSrg = {}; - for (auto& shaderItem : m_materialInstance->GetShaderCollection()) - { - if (shaderItem.GetShaderAsset()->GetDrawListName() == AZ::Name("forward")) - { - const auto& shaderAsset = shaderItem.GetShaderAsset(); - m_terrainSrg = AZ::RPI::ShaderResourceGroup::Create(shaderItem.GetShaderAsset(), shaderAsset->GetSupervariantIndex(AZ::Name()), AZ::Name{"TerrainSrg"}); - AZ_Error(TerrainFPName, m_terrainSrg, "Failed to create Terrain shader resource group"); - break; - } - } - - AZ_Error(TerrainFPName, m_terrainSrg, "Terrain Srg not found on any shader in the terrain material"); - - if (m_terrainSrg) - { - const AZ::RHI::ShaderResourceGroupLayout* terrainSrgLayout = m_terrainSrg->GetLayout(); - - m_detailMaterialIdPropertyIndex = terrainSrgLayout->FindShaderInputImageIndex(AZ::Name(TerrainSrgInputs::DetailMaterialIdImage)); - AZ_Error(TerrainFPName, m_detailMaterialIdPropertyIndex.IsValid(), "Failed to find view srg input constant %s.", TerrainSrgInputs::DetailMaterialIdImage); - - m_detailCenterPropertyIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::DetailMaterialIdImageCenter)); - AZ_Error(TerrainFPName, m_detailCenterPropertyIndex.IsValid(), "Failed to find view srg input constant %s.", TerrainSrgInputs::DetailMaterialIdImageCenter); - - m_detailHalfPixelUvPropertyIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::DetailHalfPixelUv)); - AZ_Error(TerrainFPName, m_detailHalfPixelUvPropertyIndex.IsValid(), "Failed to find view srg input constant %s.", TerrainSrgInputs::DetailHalfPixelUv); - - m_detailAabbPropertyIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::DetailAabb)); - AZ_Error(TerrainFPName, m_detailAabbPropertyIndex.IsValid(), "Failed to find view srg input constant %s.", TerrainSrgInputs::DetailAabb); - - m_detailTexturesIndex = terrainSrgLayout->FindShaderInputImageUnboundedArrayIndex(AZ::Name(TerrainSrgInputs::DetailTextures)); - AZ_Error(TerrainFPName, m_detailTexturesIndex.IsValid(), "Failed to find view srg input constant %s.", TerrainSrgInputs::DetailTextures); - - // Set up the gpu buffer for detail material data - AZ::Render::GpuBufferHandler::Descriptor desc; - desc.m_bufferName = "Detail Material Data"; - desc.m_bufferSrgName = TerrainSrgInputs::DetailMaterialData; - desc.m_elementSize = sizeof(DetailMaterialShaderData); - desc.m_srgLayout = terrainSrgLayout; - m_detailMaterialDataBuffer = AZ::Render::GpuBufferHandler(desc); - } - - // Find any macro materials that have already been created. - TerrainMacroMaterialRequestBus::EnumerateHandlers( - [&](TerrainMacroMaterialRequests* handler) - { - MacroMaterialData macroMaterial = handler->GetTerrainMacroMaterialData(); - AZ::EntityId entityId = *(Terrain::TerrainMacroMaterialRequestBus::GetCurrentBusId()); - OnTerrainMacroMaterialCreated(entityId, macroMaterial); - return true; - } - ); - TerrainMacroMaterialNotificationBus::Handler::BusConnect(); - - // Find any detail material areas that have already been created. - TerrainAreaMaterialRequestBus::EnumerateHandlers( - [&](TerrainAreaMaterialRequests* handler) - { - const AZ::Aabb& bounds = handler->GetTerrainSurfaceMaterialRegion(); - const AZStd::vector materialMappings = handler->GetSurfaceMaterialMappings(); - AZ::EntityId entityId = *(Terrain::TerrainAreaMaterialRequestBus::GetCurrentBusId()); - - DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); - materialRegion.m_region = bounds; - - for (const auto& materialMapping : materialMappings) - { - if (materialMapping.m_materialInstance) - { - OnTerrainSurfaceMaterialMappingCreated(entityId, materialMapping.m_surfaceTag, materialMapping.m_materialInstance); - } - } - return true; - } - ); - TerrainAreaMaterialNotificationBus::Handler::BusConnect(); - - } - - void TerrainFeatureProcessor::UpdateMacroMaterialData(MacroMaterialData& macroMaterialData, const MacroMaterialData& newMaterialData) - { - macroMaterialData = newMaterialData; - - if (macroMaterialData.m_bounds.IsValid()) - { - m_areaData.m_macroMaterialsUpdated = true; - } - } - - void TerrainFeatureProcessor::ProcessSurfaces(const FeatureProcessor::RenderPacket& process) - { - AZ_PROFILE_FUNCTION(AzRender); - - const AZ::Aabb& terrainBounds = m_areaData.m_terrainBounds; - - if (!terrainBounds.IsValid()) - { - return; - } - - if (m_materialInstance && m_materialInstance->CanCompile()) - { - if (m_areaData.m_rebuildSectors) - { - // Something about the whole world changed, so the sectors need to be rebuilt - - m_areaData.m_rebuildSectors = false; - - m_sectorData.clear(); - const float xFirstPatchStart = AZStd::floorf(terrainBounds.GetMin().GetX() / GridMeters) * GridMeters; - const float xLastPatchStart = AZStd::floorf(terrainBounds.GetMax().GetX() / GridMeters) * GridMeters; - const float yFirstPatchStart = AZStd::floorf(terrainBounds.GetMin().GetY() / GridMeters) * GridMeters; - const float yLastPatchStart = AZStd::floorf(terrainBounds.GetMax().GetY() / GridMeters) * GridMeters; - - const auto& materialAsset = m_materialInstance->GetAsset(); - const auto& shaderAsset = materialAsset->GetMaterialTypeAsset()->GetShaderAssetForObjectSrg(); - - for (float yPatch = yFirstPatchStart; yPatch <= yLastPatchStart; yPatch += GridMeters) - { - for (float xPatch = xFirstPatchStart; xPatch <= xLastPatchStart; xPatch += GridMeters) - { - auto objectSrg = AZ::RPI::ShaderResourceGroup::Create(shaderAsset, materialAsset->GetObjectSrgLayout()->GetName()); - if (!objectSrg) - { - AZ_Warning(TerrainFPName, false, "Failed to create a new shader resource group, skipping."); - continue; - } - - m_sectorData.push_back(); - SectorData& sectorData = m_sectorData.back(); - - for (auto& lod : m_patchModel->GetLods()) - { - AZ::RPI::ModelLod& modelLod = *lod.get(); - sectorData.m_drawPackets.emplace_back(modelLod, 0, m_materialInstance, objectSrg); - AZ::RPI::MeshDrawPacket& drawPacket = sectorData.m_drawPackets.back(); - - // set the shader option to select forward pass IBL specular if necessary - if (!drawPacket.SetShaderOption(AZ::Name("o_meshUseForwardPassIBLSpecular"), AZ::RPI::ShaderOptionValue{ false })) - { - AZ_Warning(TerrainFPName, false, "Failed to set o_meshUseForwardPassIBLSpecular on mesh draw packet"); - } - const uint8_t stencilRef = AZ::Render::StencilRefs::UseDiffuseGIPass | AZ::Render::StencilRefs::UseIBLSpecularPass; - drawPacket.SetStencilRef(stencilRef); - drawPacket.Update(*GetParentScene(), true); - } - - sectorData.m_aabb = - AZ::Aabb::CreateFromMinMax( - AZ::Vector3(xPatch, yPatch, terrainBounds.GetMin().GetZ()), - AZ::Vector3(xPatch + GridMeters, yPatch + GridMeters, terrainBounds.GetMax().GetZ()) - ); - sectorData.m_srg = objectSrg; - } - } - - if (m_areaData.m_macroMaterialsUpdated) - { - // sectors were rebuilt, so any cached macro material data needs to be regenerated - for (SectorData& sectorData : m_sectorData) - { - for (MacroMaterialData& macroMaterialData : m_macroMaterials.GetDataVector()) - { - if (macroMaterialData.m_bounds.Overlaps(sectorData.m_aabb)) - { - sectorData.m_macroMaterials.push_back(m_macroMaterials.GetIndexForData(¯oMaterialData)); - if (sectorData.m_macroMaterials.size() == MaxMaterialsPerSector) - { - break; - } - } - } - } - } - } - else if (m_forceRebuildDrawPackets) - { - for (auto& sectorData : m_sectorData) - { - for (auto& drawPacket : sectorData.m_drawPackets) - { - drawPacket.Update(*GetParentScene(), true); - } - } - } - m_forceRebuildDrawPackets = false; - - if (m_areaData.m_heightmapUpdated) - { - UpdateTerrainData(); - } - - if (m_updateDetailMaterialBuffer) - { - m_updateDetailMaterialBuffer = false; - m_detailMaterialDataBuffer.UpdateBuffer(m_detailMaterialShaderData.GetRawData(), aznumeric_cast(m_detailMaterialShaderData.GetSize())); - } - - AZ::Vector3 cameraPosition = AZ::Vector3::CreateZero(); - for (auto& view : process.m_views) - { - if ((view->GetUsageFlags() & AZ::RPI::View::UsageFlags::UsageCamera) > 0) - { - cameraPosition = view->GetCameraTransform().GetTranslation(); - break; - } - } - - if (m_dirtyDetailRegion.IsValid() || !cameraPosition.IsClose(m_previousCameraPosition) || m_detailImagesNeedUpdate) - { - int32_t newDetailTexturePosX = aznumeric_cast(AZStd::roundf(cameraPosition.GetX() / DetailTextureScale)); - int32_t newDetailTexturePosY = aznumeric_cast(AZStd::roundf(cameraPosition.GetY() / DetailTextureScale)); - - Aabb2i newBounds; - newBounds.m_min.m_x = newDetailTexturePosX - DetailTextureSizeHalf; - newBounds.m_min.m_y = newDetailTexturePosY - DetailTextureSizeHalf; - newBounds.m_max.m_x = newDetailTexturePosX + DetailTextureSizeHalf; - newBounds.m_max.m_y = newDetailTexturePosY + DetailTextureSizeHalf; - - // Use modulo to find the center point in texture space. Care must be taken so negative values are - // handled appropriately (ie, we want -1 % 1024 to equal 1023, not -1) - Vector2i newCenter; - newCenter.m_x = (DetailTextureSize + (newDetailTexturePosX % DetailTextureSize)) % DetailTextureSize; - newCenter.m_y = (DetailTextureSize + (newDetailTexturePosY % DetailTextureSize)) % DetailTextureSize; - - CheckUpdateDetailTexture(newBounds, newCenter); - - m_detailTextureBounds = newBounds; - m_dirtyDetailRegion = AZ::Aabb::CreateNull(); - - m_previousCameraPosition = cameraPosition; - - AZ::Vector4 detailAabb = AZ::Vector4( - m_detailTextureBounds.m_min.m_x * DetailTextureScale, - m_detailTextureBounds.m_min.m_y * DetailTextureScale, - m_detailTextureBounds.m_max.m_x * DetailTextureScale, - m_detailTextureBounds.m_max.m_y * DetailTextureScale - ); - AZ::Vector2 detailUvOffset = AZ::Vector2(float(newCenter.m_x) / DetailTextureSize, float(newCenter.m_y) / DetailTextureSize); - - if (m_terrainSrg) - { - m_terrainSrg->SetConstant(m_detailAabbPropertyIndex, detailAabb); - m_terrainSrg->SetConstant(m_detailHalfPixelUvPropertyIndex, 0.5f / DetailTextureSize); - m_terrainSrg->SetConstant(m_detailCenterPropertyIndex, detailUvOffset); - - m_detailMaterialDataBuffer.UpdateSrg(m_terrainSrg.get()); - } - } - - if (m_areaData.m_heightmapUpdated || m_areaData.m_macroMaterialsUpdated) - { - // Currently when anything in the heightmap changes we're updating all the srgs, but this could probably - // be optimized to only update the srgs that changed. - - m_areaData.m_heightmapUpdated = false; - m_areaData.m_macroMaterialsUpdated = false; - - AZStd::array uvStep = - { - 1.0f / aznumeric_cast(m_areaData.m_terrainBounds.GetXExtent() / m_areaData.m_sampleSpacing), - 1.0f / aznumeric_cast(m_areaData.m_terrainBounds.GetYExtent() / m_areaData.m_sampleSpacing), - }; - - for (SectorData& sectorData : m_sectorData) - { - ShaderTerrainData terrainDataForSrg; - - const float xPatch = sectorData.m_aabb.GetMin().GetX(); - const float yPatch = sectorData.m_aabb.GetMin().GetY(); - - terrainDataForSrg.m_uvMin = { - (xPatch - terrainBounds.GetMin().GetX()) / terrainBounds.GetXExtent(), - (yPatch - terrainBounds.GetMin().GetY()) / terrainBounds.GetYExtent() - }; - - terrainDataForSrg.m_uvMax = { - ((xPatch + GridMeters) - terrainBounds.GetMin().GetX()) / terrainBounds.GetXExtent(), - ((yPatch + GridMeters) - terrainBounds.GetMin().GetY()) / terrainBounds.GetYExtent() - }; - - terrainDataForSrg.m_uvStep = uvStep; - - AZ::Transform transform = m_areaData.m_transform; - transform.SetTranslation(xPatch, yPatch, m_areaData.m_transform.GetTranslation().GetZ()); - - terrainDataForSrg.m_sampleSpacing = m_areaData.m_sampleSpacing; - terrainDataForSrg.m_heightScale = terrainBounds.GetZExtent(); - - sectorData.m_srg->SetConstant(m_terrainDataIndex, terrainDataForSrg); - - AZStd::array macroMaterialData; - - uint32_t i = 0; - for (; i < sectorData.m_macroMaterials.size(); ++i) - { - const MacroMaterialData& materialData = m_macroMaterials.GetData(sectorData.m_macroMaterials.at(i)); - ShaderMacroMaterialData& shaderData = macroMaterialData.at(i); - const AZ::Aabb& materialBounds = materialData.m_bounds; - - // Use reverse coordinates (1 - y) for the y direction so that the lower left corner of the macro material images - // map to the lower left corner in world space. This will match up with the height uv coordinate mapping. - shaderData.m_uvMin = { - (xPatch - materialBounds.GetMin().GetX()) / materialBounds.GetXExtent(), - 1.0f - ((yPatch - materialBounds.GetMin().GetY()) / materialBounds.GetYExtent()) - }; - shaderData.m_uvMax = { - ((xPatch + GridMeters) - materialBounds.GetMin().GetX()) / materialBounds.GetXExtent(), - 1.0f - (((yPatch + GridMeters) - materialBounds.GetMin().GetY()) / materialBounds.GetYExtent()) - }; - shaderData.m_normalFactor = materialData.m_normalFactor; - shaderData.m_flipNormalX = materialData.m_normalFlipX; - shaderData.m_flipNormalY = materialData.m_normalFlipY; - - const AZ::RHI::ImageView* colorImageView = materialData.m_colorImage ? materialData.m_colorImage->GetImageView() : nullptr; - sectorData.m_srg->SetImageView(m_macroColorMapIndex, colorImageView, i); - - const AZ::RHI::ImageView* normalImageView = materialData.m_normalImage ? materialData.m_normalImage->GetImageView() : nullptr; - sectorData.m_srg->SetImageView(m_macroNormalMapIndex, normalImageView, i); - - // set flags for which images are used. - shaderData.m_mapsInUse = (colorImageView ? ColorImageUsed : 0) | (normalImageView ? NormalImageUsed : 0); - } - for (; i < sectorData.m_macroMaterials.capacity(); ++i) - { - sectorData.m_srg->SetImageView(m_macroColorMapIndex, nullptr, i); - sectorData.m_srg->SetImageView(m_macroNormalMapIndex, nullptr, i); - } - - sectorData.m_srg->SetConstantArray(m_macroMaterialDataIndex, macroMaterialData); - sectorData.m_srg->SetConstant(m_macroMaterialCountIndex, aznumeric_cast(sectorData.m_macroMaterials.size())); - - const AZ::Matrix3x4 matrix3x4 = AZ::Matrix3x4::CreateFromTransform(transform); - sectorData.m_srg->SetConstant(m_modelToWorldIndex, matrix3x4); - - sectorData.m_srg->Compile(); - } - } - - // Currently there seems to be a bug in unbounded image arrays where flickering can occur if this isn't updated every frame. - if (m_terrainSrg/* && m_detailImagesUpdated*/) - { - AZStd::array_view imageViews(m_detailImageViews.data(), m_detailImageViews.size()); - [[maybe_unused]] bool result = m_terrainSrg->SetImageViewUnboundedArray(m_detailTexturesIndex, imageViews); - AZ_Error(TerrainFPName, result, "Failed to set image view unbounded array into shader resource group."); - m_detailImagesNeedUpdate = false; - } - } - - for (auto& sectorData : m_sectorData) - { - uint8_t lodChoice = AZ::RPI::ModelLodAsset::LodCountMax; - - // Go through all cameras and choose an LOD based on the closest camera. - for (auto& view : process.m_views) - { - if ((view->GetUsageFlags() & AZ::RPI::View::UsageFlags::UsageCamera) > 0) - { - const AZ::Vector3 cameraPosition = view->GetCameraTransform().GetTranslation(); - const AZ::Vector2 cameraPositionXY = AZ::Vector2(cameraPosition.GetX(), cameraPosition.GetY()); - const AZ::Vector2 sectorCenterXY = AZ::Vector2(sectorData.m_aabb.GetCenter().GetX(), sectorData.m_aabb.GetCenter().GetY()); - - const float sectorDistance = sectorCenterXY.GetDistance(cameraPositionXY); - - // This will be configurable later - const float minDistanceForLod0 = (GridMeters * 4.0f); - - // For every distance doubling beyond a minDistanceForLod0, we only need half the mesh density. Each LOD - // is exactly half the resolution of the last. - const float lodForCamera = AZStd::floorf(AZ::GetMax(0.0f, log2f(sectorDistance / minDistanceForLod0))); - - // All cameras should render the same LOD so effects like shadows are consistent. - lodChoice = AZ::GetMin(lodChoice, aznumeric_cast(lodForCamera)); - } - } - - // Add the correct LOD draw packet for visible sectors. - for (auto& view : process.m_views) - { - AZ::Frustum viewFrustum = AZ::Frustum::CreateFromMatrixColumnMajor(view->GetWorldToClipMatrix()); - if (viewFrustum.IntersectAabb(sectorData.m_aabb) != AZ::IntersectResult::Exterior) - { - const uint8_t lodToRender = AZ::GetMin(lodChoice, aznumeric_cast(sectorData.m_drawPackets.size() - 1)); - view->AddDrawPacket(sectorData.m_drawPackets.at(lodToRender).GetRHIDrawPacket()); - } - } - } - - if (m_detailTextureImage && m_areaData.m_heightmapImage && m_imagesNeedUpdate) - { - m_imagesNeedUpdate = false; - for (auto& view : process.m_views) - { - auto viewSrg = view->GetShaderResourceGroup(); - viewSrg->SetImage(m_heightmapPropertyIndex, m_areaData.m_heightmapImage); - } - if (m_terrainSrg) - { - m_terrainSrg->SetImage(m_detailMaterialIdPropertyIndex, m_detailTextureImage); - } - } - - if (m_materialInstance) - { - m_materialInstance->Compile(); - } - - if (m_terrainSrg && m_forwardPass) - { - m_terrainSrg->Compile(); - m_forwardPass->BindSrg(m_terrainSrg->GetRHIShaderResourceGroup()); - } - } - - void TerrainFeatureProcessor::InitializeTerrainPatch(uint16_t gridSize, float gridSpacing, PatchData& patchdata) - { - patchdata.m_positions.clear(); - patchdata.m_uvs.clear(); - patchdata.m_indices.clear(); - - const uint16_t gridVertices = gridSize + 1; // For m_gridSize quads, (m_gridSize + 1) vertices are needed. - const size_t size = gridVertices * gridVertices; - - patchdata.m_positions.reserve(size); - patchdata.m_uvs.reserve(size); - - for (uint16_t y = 0; y < gridVertices; ++y) - { - for (uint16_t x = 0; x < gridVertices; ++x) - { - patchdata.m_positions.push_back({ aznumeric_cast(x) * gridSpacing, aznumeric_cast(y) * gridSpacing }); - patchdata.m_uvs.push_back({ aznumeric_cast(x) / gridSize, aznumeric_cast(y) / gridSize }); - } - } - - patchdata.m_indices.reserve(gridSize * gridSize * 6); // total number of quads, 2 triangles with 6 indices per quad. - - for (uint16_t y = 0; y < gridSize; ++y) - { - for (uint16_t x = 0; x < gridSize; ++x) - { - const uint16_t topLeft = y * gridVertices + x; - const uint16_t topRight = topLeft + 1; - const uint16_t bottomLeft = (y + 1) * gridVertices + x; - const uint16_t bottomRight = bottomLeft + 1; - - patchdata.m_indices.emplace_back(topLeft); - patchdata.m_indices.emplace_back(topRight); - patchdata.m_indices.emplace_back(bottomLeft); - patchdata.m_indices.emplace_back(bottomLeft); - patchdata.m_indices.emplace_back(topRight); - patchdata.m_indices.emplace_back(bottomRight); - } - } - } - - AZ::Outcome> TerrainFeatureProcessor::CreateBufferAsset( - const void* data, const AZ::RHI::BufferViewDescriptor& bufferViewDescriptor, const AZStd::string& bufferName) - { - AZ::RPI::BufferAssetCreator creator; - creator.Begin(AZ::Uuid::CreateRandom()); - - AZ::RHI::BufferDescriptor bufferDescriptor; - bufferDescriptor.m_bindFlags = AZ::RHI::BufferBindFlags::InputAssembly | AZ::RHI::BufferBindFlags::ShaderRead; - bufferDescriptor.m_byteCount = static_cast(bufferViewDescriptor.m_elementSize) * static_cast(bufferViewDescriptor.m_elementCount); - - creator.SetBuffer(data, bufferDescriptor.m_byteCount, bufferDescriptor); - creator.SetBufferViewDescriptor(bufferViewDescriptor); - creator.SetUseCommonPool(AZ::RPI::CommonBufferPoolType::StaticInputAssembly); - - AZ::Data::Asset bufferAsset; - if (creator.End(bufferAsset)) - { - bufferAsset.SetHint(bufferName); - return AZ::Success(bufferAsset); - } - - return AZ::Failure(); - } - - bool TerrainFeatureProcessor::InitializePatchModel() - { - AZ::RPI::ModelAssetCreator modelAssetCreator; - modelAssetCreator.Begin(AZ::Uuid::CreateRandom()); - - uint16_t gridSize = GridSize; - float gridSpacing = GridSpacing; - - for (uint32_t i = 0; i < AZ::RPI::ModelLodAsset::LodCountMax && gridSize > 0; ++i) - { - PatchData patchData; - InitializeTerrainPatch(gridSize, gridSpacing, patchData); - - const auto positionBufferViewDesc = AZ::RHI::BufferViewDescriptor::CreateTyped(0, aznumeric_cast(patchData.m_positions.size()), AZ::RHI::Format::R32G32_FLOAT); - const auto positionsOutcome = CreateBufferAsset(patchData.m_positions.data(), positionBufferViewDesc, "TerrainPatchPositions"); - - const auto uvBufferViewDesc = AZ::RHI::BufferViewDescriptor::CreateTyped(0, aznumeric_cast(patchData.m_uvs.size()), AZ::RHI::Format::R32G32_FLOAT); - const auto uvsOutcome = CreateBufferAsset(patchData.m_uvs.data(), uvBufferViewDesc, "TerrainPatchUvs"); - - const auto indexBufferViewDesc = AZ::RHI::BufferViewDescriptor::CreateTyped(0, aznumeric_cast(patchData.m_indices.size()), AZ::RHI::Format::R16_UINT); - const auto indicesOutcome = CreateBufferAsset(patchData.m_indices.data(), indexBufferViewDesc, "TerrainPatchIndices"); - - if (!positionsOutcome.IsSuccess() || !uvsOutcome.IsSuccess() || !indicesOutcome.IsSuccess()) - { - AZ_Error(TerrainFPName, false, "Failed to create GPU buffers for Terrain"); - return false; - } - - AZ::RPI::ModelLodAssetCreator modelLodAssetCreator; - modelLodAssetCreator.Begin(AZ::Uuid::CreateRandom()); - - modelLodAssetCreator.BeginMesh(); - modelLodAssetCreator.AddMeshStreamBuffer(AZ::RHI::ShaderSemantic{ "POSITION" }, AZ::Name(), {positionsOutcome.GetValue(), positionBufferViewDesc}); - modelLodAssetCreator.AddMeshStreamBuffer(AZ::RHI::ShaderSemantic{ "UV" }, AZ::Name(), {uvsOutcome.GetValue(), uvBufferViewDesc}); - modelLodAssetCreator.SetMeshIndexBuffer({indicesOutcome.GetValue(), indexBufferViewDesc}); - - AZ::Aabb aabb = AZ::Aabb::CreateFromMinMax(AZ::Vector3(0.0, 0.0, 0.0), AZ::Vector3(GridMeters, GridMeters, 0.0)); - modelLodAssetCreator.SetMeshAabb(AZStd::move(aabb)); - modelLodAssetCreator.SetMeshName(AZ::Name("Terrain Patch")); - modelLodAssetCreator.EndMesh(); - - AZ::Data::Asset modelLodAsset; - modelLodAssetCreator.End(modelLodAsset); - - modelAssetCreator.AddLodAsset(AZStd::move(modelLodAsset)); - - gridSize = gridSize / 2; - gridSpacing *= 2.0f; - } - - AZ::Data::Asset modelAsset; - bool success = modelAssetCreator.End(modelAsset); - - m_patchModel = AZ::RPI::Model::FindOrCreate(modelAsset); - - return success; - } - void TerrainFeatureProcessor::OnMaterialReinitialized([[maybe_unused]] const MaterialInstance& material) { PrepareMaterialData(); - for (auto& sectorData : m_sectorData) - { - for (auto& drawPacket : sectorData.m_drawPackets) - { - drawPacket.Update(*GetParentScene()); - } - } - m_imagesNeedUpdate = true; - m_detailImagesNeedUpdate = true; + m_forceRebuildDrawPackets = true; + m_imageBindingsNeedUpdate = true; } void TerrainFeatureProcessor::SetWorldSize([[maybe_unused]] AZ::Vector2 sizeInMeters) @@ -1576,62 +424,6 @@ namespace Terrain // larger but this will limit how much is rendered. } - template - T* TerrainFeatureProcessor::FindByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container) - { - for (T& data : container.GetDataVector()) - { - if (data.m_entityId == entityId) - { - return &data; - } - } - return nullptr; - } - - template - T& TerrainFeatureProcessor::FindOrCreateByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container) - { - T* dataPtr = FindByEntityId(entityId, container); - if (dataPtr != nullptr) - { - return *dataPtr; - } - - const uint16_t slotId = container.GetFreeSlotIndex(); - AZ_Assert(slotId != AZ::Render::IndexedDataVector::NoFreeSlot, "Ran out of indices"); - - T& data = container.GetData(slotId); - data.m_entityId = entityId; - return data; - } - - template - void TerrainFeatureProcessor::RemoveByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container) - { - for (T& data : container.GetDataVector()) - { - if (data.m_entityId == entityId) - { - container.RemoveData(&data); - return; - } - } - AZ_Assert(false, "Entity Id not found in container.") - } - - template - void TerrainFeatureProcessor::ForOverlappingSectors(const AZ::Aabb& bounds, Callback callback) - { - for (SectorData& sectorData : m_sectorData) - { - if (sectorData.m_aabb.Overlaps(bounds)) - { - callback(sectorData); - } - } - } - void TerrainFeatureProcessor::CacheForwardPass() { auto rasterPassFilter = AZ::RPI::PassFilter::CreateWithPassClass(); @@ -1653,59 +445,5 @@ namespace Terrain ); } - auto TerrainFeatureProcessor::Vector2i::operator+(const Vector2i& rhs) const -> Vector2i - { - Vector2i offsetPoint = *this; - offsetPoint += rhs; - return offsetPoint; - } - - auto TerrainFeatureProcessor::Vector2i::operator+=(const Vector2i& rhs) -> Vector2i& - { - m_x += rhs.m_x; - m_y += rhs.m_y; - return *this; - } - - auto TerrainFeatureProcessor::Vector2i::operator-(const Vector2i& rhs) const -> Vector2i - { - return *this + -rhs; - } - - auto TerrainFeatureProcessor::Vector2i::operator-=(const Vector2i& rhs) -> Vector2i& - { - return *this += -rhs; - } - - auto TerrainFeatureProcessor::Vector2i::operator-() const -> Vector2i - { - return {-m_x, -m_y}; - } - - auto TerrainFeatureProcessor::Aabb2i::operator+(const Vector2i& rhs) const -> Aabb2i - { - return { m_min + rhs, m_max + rhs }; - } - - auto TerrainFeatureProcessor::Aabb2i::operator-(const Vector2i& rhs) const -> Aabb2i - { - return *this + -rhs; - } - - auto TerrainFeatureProcessor::Aabb2i::GetClamped(Aabb2i rhs) const -> Aabb2i - { - Aabb2i ret; - ret.m_min.m_x = AZ::GetMax(m_min.m_x, rhs.m_min.m_x); - ret.m_min.m_y = AZ::GetMax(m_min.m_y, rhs.m_min.m_y); - ret.m_max.m_x = AZ::GetMin(m_max.m_x, rhs.m_max.m_x); - ret.m_max.m_y = AZ::GetMin(m_max.m_y, rhs.m_max.m_y); - return ret; - } - - bool TerrainFeatureProcessor::Aabb2i::IsValid() const - { - // Intentionally strict, equal min/max not valid. - return m_min.m_x < m_max.m_x && m_min.m_y < m_max.m_y; - } } diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.h b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.h index 7d68e6b185..016c0d478a 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.h +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.h @@ -8,20 +8,17 @@ #pragma once -#include - #include -#include -#include + +#include +#include +#include +#include #include #include -#include #include #include -#include -#include -#include namespace AZ::RPI { @@ -30,9 +27,7 @@ namespace AZ::RPI class AsyncAssetLoader; } class Material; - class Model; class RenderPass; - class StreamingImage; } namespace Terrain @@ -41,8 +36,6 @@ namespace Terrain : public AZ::RPI::FeatureProcessor , private AZ::RPI::MaterialReloadNotificationBus::Handler , private AzFramework::Terrain::TerrainDataNotificationBus::Handler - , private TerrainMacroMaterialNotificationBus::Handler - , private TerrainAreaMaterialNotificationBus::Handler { public: AZ_RTTI(TerrainFeatureProcessor, "{D7DAC1F9-4A9F-4D3C-80AE-99579BF8AB1C}", AZ::RPI::FeatureProcessor); @@ -62,189 +55,16 @@ namespace Terrain void SetWorldSize(AZ::Vector2 sizeInMeters); private: - - using MaterialInstance = AZ::Data::Instance; - static constexpr uint32_t MaxMaterialsPerSector = 4; - - enum MacroMaterialFlags - { - ColorImageUsed = 0b01, - NormalImageUsed = 0b10, - }; - - struct ShaderTerrainData // Must align with struct in Object Srg - { - AZStd::array m_uvMin{ 0.0f, 0.0f }; - AZStd::array m_uvMax{ 1.0f, 1.0f }; - AZStd::array m_uvStep{ 1.0f, 1.0f }; - float m_sampleSpacing{ 1.0f }; - float m_heightScale{ 1.0f }; - }; - - struct ShaderMacroMaterialData // Must align with struct in Object Srg - { - AZStd::array m_uvMin{ 0.0f, 0.0f }; - AZStd::array m_uvMax{ 1.0f, 1.0f }; - float m_normalFactor{ 0.0f }; - uint32_t m_flipNormalX{ 0 }; // bool in shader - uint32_t m_flipNormalY{ 0 }; // bool in shader - uint32_t m_mapsInUse{ 0b00 }; // 0b01 = color, 0b10 = normal - }; - - struct VertexPosition - { - float m_posx; - float m_posy; - }; - - struct VertexUv - { - float m_u; - float m_v; - }; - - struct PatchData - { - AZStd::vector m_positions; - AZStd::vector m_uvs; - AZStd::vector m_indices; - }; - - struct SectorData - { - AZ::Data::Instance m_srg; // Hold on to ref so it's not dropped - AZ::Aabb m_aabb; - AZStd::fixed_vector m_drawPackets; - AZStd::fixed_vector m_macroMaterials; - }; - - enum DetailTextureFlags : uint32_t - { - UseTextureBaseColor = 0b0000'0000'0000'0000'0000'0000'0000'0001, - UseTextureNormal = 0b0000'0000'0000'0000'0000'0000'0000'0010, - UseTextureMetallic = 0b0000'0000'0000'0000'0000'0000'0000'0100, - UseTextureRoughness = 0b0000'0000'0000'0000'0000'0000'0000'1000, - UseTextureOcclusion = 0b0000'0000'0000'0000'0000'0000'0001'0000, - UseTextureHeight = 0b0000'0000'0000'0000'0000'0000'0010'0000, - UseTextureSpecularF0 = 0b0000'0000'0000'0000'0000'0000'0100'0000, - - FlipNormalX = 0b0000'0000'0000'0001'0000'0000'0000'0000, - FlipNormalY = 0b0000'0000'0000'0010'0000'0000'0000'0000, - - BlendModeMask = 0b0000'0000'0000'1100'0000'0000'0000'0000, - BlendModeLerp = 0b0000'0000'0000'0000'0000'0000'0000'0000, - BlendModeLinearLight = 0b0000'0000'0000'0100'0000'0000'0000'0000, - BlendModeMultiply = 0b0000'0000'0000'1000'0000'0000'0000'0000, - BlendModeOverlay = 0b0000'0000'0000'1100'0000'0000'0000'0000, - }; - - static constexpr uint16_t InvalidDetailImageIndex = 0xFFFF; - - struct DetailMaterialShaderData - { - // Uv - AZStd::array m_uvTransform - { - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - }; - - float m_baseColorRed{ 1.0f }; - float m_baseColorGreen{ 1.0f }; - float m_baseColorBlue{ 1.0f }; - - // Factor / Scale / Bias for input textures - float m_baseColorFactor{ 1.0f }; - - float m_normalFactor{ 1.0f }; - float m_metalFactor{ 1.0f }; - float m_roughnessScale{ 1.0f }; - float m_roughnessBias{ 0.0f }; - - float m_specularF0Factor{ 1.0f }; - float m_occlusionFactor{ 1.0f }; - float m_heightFactor{ 1.0f }; - float m_heightOffset{ 0.0f }; - - float m_heightBlendFactor{ 0.5f }; - - // Flags - DetailTextureFlags m_flags{ 0 }; - - // Image indices - uint16_t m_colorImageIndex{ InvalidDetailImageIndex }; - uint16_t m_normalImageIndex{ InvalidDetailImageIndex }; - uint16_t m_roughnessImageIndex{ InvalidDetailImageIndex }; - uint16_t m_metalnessImageIndex{ InvalidDetailImageIndex }; - - uint16_t m_specularF0ImageIndex{ InvalidDetailImageIndex }; - uint16_t m_occlusionImageIndex{ InvalidDetailImageIndex }; - uint16_t m_heightImageIndex{ InvalidDetailImageIndex }; - // 16 byte aligned - uint16_t m_padding1; - uint32_t m_padding2; - uint32_t m_padding3; - }; - - struct DetailMaterialData - { - AZ::Data::AssetId m_assetId; - AZ::RPI::Material::ChangeId m_materialChangeId{AZ::RPI::Material::DEFAULT_CHANGE_ID}; - uint32_t refCount = 0; - uint16_t m_detailMaterialBufferIndex{ 0xFFFF }; - - AZ::Data::Instance m_colorImage; - AZ::Data::Instance m_normalImage; - AZ::Data::Instance m_roughnessImage; - AZ::Data::Instance m_metalnessImage; - AZ::Data::Instance m_specularF0Image; - AZ::Data::Instance m_occlusionImage; - AZ::Data::Instance m_heightImage; - }; - - struct DetailMaterialSurface - { - AZ::Crc32 m_surfaceTag; - uint16_t m_detailMaterialId; - }; - - struct DetailMaterialListRegion - { - AZ::EntityId m_entityId; - AZ::Aabb m_region{AZ::Aabb::CreateNull()}; - AZStd::vector m_materialsForSurfaces; - }; - - struct Vector2i - { - int32_t m_x{ 0 }; - int32_t m_y{ 0 }; - - Vector2i operator+(const Vector2i& rhs) const; - Vector2i& operator+=(const Vector2i& rhs); - Vector2i operator-(const Vector2i& rhs) const; - Vector2i& operator-=(const Vector2i& rhs); - Vector2i operator-() const; - }; - - struct Aabb2i - { - Vector2i m_min; - Vector2i m_max; - - Aabb2i operator+(const Vector2i& offset) const; - Aabb2i operator-(const Vector2i& offset) const; - - Aabb2i GetClamped(Aabb2i rhs) const; - bool IsValid() const; - }; + static constexpr auto InvalidImageIndex = AZ::Render::BindlessImageArrayHandler::InvalidImageIndex; + using MaterialInstance = AZ::Data::Instance; - struct DetailTextureLocation + struct WorldShaderData { - uint16_t m_index; - AZ::Data::Instance m_image; + AZStd::array m_min{ 0.0f, 0.0f, 0.0f }; + float padding1{ 0.0f }; + AZStd::array m_max{ 0.0f, 0.0f, 0.0f }; + float padding2{ 0.0f }; }; // AZ::RPI::MaterialReloadNotificationBus::Handler overrides... @@ -254,122 +74,46 @@ namespace Terrain void OnTerrainDataDestroyBegin() override; void OnTerrainDataChanged(const AZ::Aabb& dirtyRegion, TerrainDataChangedMask dataChangedMask) override; - // TerrainMacroMaterialNotificationBus overrides... - void OnTerrainMacroMaterialCreated(AZ::EntityId entityId, const MacroMaterialData& material) override; - void OnTerrainMacroMaterialChanged(AZ::EntityId entityId, const MacroMaterialData& material) override; - void OnTerrainMacroMaterialRegionChanged(AZ::EntityId entityId, const AZ::Aabb& oldRegion, const AZ::Aabb& newRegion) override; - void OnTerrainMacroMaterialDestroyed(AZ::EntityId entityId) override; - - // TerrainAreaMaterialNotificationBus overrides... - void OnTerrainSurfaceMaterialMappingCreated(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag, MaterialInstance material) override; - void OnTerrainSurfaceMaterialMappingDestroyed(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag) override; - void OnTerrainSurfaceMaterialMappingChanged(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag, MaterialInstance material) override; - void OnTerrainSurfaceMaterialMappingRegionChanged(AZ::EntityId entityId, const AZ::Aabb& oldRegion, const AZ::Aabb& newRegion) override; - // AZ::RPI::SceneNotificationBus overrides... void OnRenderPipelinePassesChanged(AZ::RPI::RenderPipeline* renderPipeline) override; void Initialize(); - void InitializeTerrainPatch(uint16_t gridSize, float gridSpacing, PatchData& patchdata); - bool InitializePatchModel(); - void UpdateTerrainData(); + void UpdateHeightmapImage(); void PrepareMaterialData(); - void UpdateMacroMaterialData(MacroMaterialData& macroMaterialData, const MacroMaterialData& newMaterialData); - - void TerrainHeightOrSettingsUpdated(const AZ::Aabb& dirtyRegion); - void TerrainSurfaceDataUpdated(const AZ::Aabb& dirtyRegion); - uint16_t CreateOrUpdateDetailMaterial(MaterialInstance material); - void CheckDetailMaterialForDeletion(uint16_t detailMaterialId); - void UpdateDetailMaterialData(uint16_t detailMaterialIndex, MaterialInstance material); - void CheckUpdateDetailTexture(const Aabb2i& newBounds, const Vector2i& newCenter); - void UpdateDetailTexture(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel); - uint16_t GetDetailMaterialForSurfaceTypeAndPosition(AZ::Crc32 surfaceType, const AZ::Vector2& position); - uint8_t CalculateUpdateRegions(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel, - AZStd::array& textureSpaceAreas, AZStd::array& scaledWorldSpaceAreas); + void TerrainHeightOrSettingsUpdated(const AZ::Aabb& dirtyRegion); void ProcessSurfaces(const FeatureProcessor::RenderPacket& process); - template - T* FindByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container); - template - T& FindOrCreateByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container); - template - void RemoveByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container); - - template - void ForOverlappingSectors(const AZ::Aabb& bounds, Callback callback); - - AZ::Outcome> CreateBufferAsset( - const void* data, const AZ::RHI::BufferViewDescriptor& bufferViewDescriptor, const AZStd::string& bufferName); - void CacheForwardPass(); - // System-level parameters - static constexpr float GridSpacing{ 1.0f }; - static constexpr int32_t GridSize{ 64 }; // number of terrain quads (vertices are m_gridSize + 1) - static constexpr float GridMeters{ GridSpacing * GridSize }; - static constexpr int32_t DetailTextureSize{ 1024 }; - static constexpr int32_t DetailTextureSizeHalf{ DetailTextureSize / 2 }; - static constexpr float DetailTextureScale{ 0.5f }; + TerrainMeshManager m_meshManager; + TerrainMacroMaterialManager m_macroMaterialManager; + TerrainDetailMaterialManager m_detailMaterialManager; + + AZStd::shared_ptr m_imageArrayHandler; AZStd::unique_ptr m_materialAssetLoader; MaterialInstance m_materialInstance; + AZ::Data::Instance m_terrainSrg; + AZ::Data::Instance m_heightmapImage; - AZ::RHI::ShaderInputConstantIndex m_modelToWorldIndex; - AZ::RHI::ShaderInputConstantIndex m_terrainDataIndex; - AZ::RHI::ShaderInputConstantIndex m_macroMaterialDataIndex; - AZ::RHI::ShaderInputConstantIndex m_macroMaterialCountIndex; - AZ::RHI::ShaderInputImageIndex m_macroColorMapIndex; - AZ::RHI::ShaderInputImageIndex m_macroNormalMapIndex; AZ::RHI::ShaderInputImageIndex m_heightmapPropertyIndex; - AZ::RHI::ShaderInputImageIndex m_detailMaterialIdPropertyIndex; - AZ::RHI::ShaderInputBufferIndex m_detailMaterialDataIndex; - AZ::RHI::ShaderInputConstantIndex m_detailCenterPropertyIndex; - AZ::RHI::ShaderInputConstantIndex m_detailAabbPropertyIndex; - AZ::RHI::ShaderInputConstantIndex m_detailHalfPixelUvPropertyIndex; - AZ::RHI::ShaderInputImageUnboundedArrayIndex m_detailTexturesIndex; + AZ::RHI::ShaderInputConstantIndex m_worldDataIndex; - AZ::Data::Instance m_patchModel; - AZ::Vector3 m_previousCameraPosition = AZ::Vector3(AZStd::numeric_limits::max(), 0.0, 0.0); - - // Per-area data - struct TerrainAreaData - { - AZ::Transform m_transform{ AZ::Transform::CreateIdentity() }; - AZ::Aabb m_terrainBounds{ AZ::Aabb::CreateNull() }; - AZ::Data::Instance m_heightmapImage; - float m_sampleSpacing{ 0.0f }; - bool m_heightmapUpdated{ true }; - bool m_macroMaterialsUpdated{ true }; - bool m_rebuildSectors{ true }; - }; - - TerrainAreaData m_areaData; + AZ::Aabb m_terrainBounds{ AZ::Aabb::CreateNull() }; AZ::Aabb m_dirtyRegion{ AZ::Aabb::CreateNull() }; - AZ::Aabb m_dirtyDetailRegion{ AZ::Aabb::CreateNull() }; - bool m_updateDetailMaterialBuffer{ false }; - - Aabb2i m_detailTextureBounds; - Vector2i m_detailTextureCenter; - AZ::Data::Instance m_detailTextureImage; - AZ::RPI::ShaderSystemInterface::GlobalShaderOptionUpdatedEvent::Handler m_handleGlobalShaderOptionUpdate; + + float m_sampleSpacing{ 0.0f }; + + bool m_heightmapNeedsUpdate{ false }; bool m_forceRebuildDrawPackets{ false }; - bool m_imagesNeedUpdate{ false }; + bool m_imageBindingsNeedUpdate{ false }; - AZStd::vector m_sectorData; + AZ::RPI::ShaderSystemInterface::GlobalShaderOptionUpdatedEvent::Handler m_handleGlobalShaderOptionUpdate; - AZ::Render::IndexedDataVector m_macroMaterials; - AZ::Render::IndexedDataVector m_detailMaterials; - AZ::Render::IndexedDataVector m_detailMaterialRegions; - AZ::Render::SparseVector m_detailMaterialShaderData; - AZ::Render::GpuBufferHandler m_detailMaterialDataBuffer; AZ::RPI::RenderPass* m_forwardPass; - - AZStd::vector m_detailImageViews; - AZStd::vector m_detailImageViewFreeList; - bool m_detailImagesNeedUpdate{ false }; }; } diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialBus.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialBus.cpp index b1c6f2d54b..7f84874e63 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialBus.cpp +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialBus.cpp @@ -66,8 +66,27 @@ namespace Terrain } }; + void MacroMaterialData::Reflect(AZ::ReflectContext* context) + { + if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) + { + behaviorContext->Class() + ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common) + ->Attribute(AZ::Script::Attributes::Category, "Terrain") + ->Attribute(AZ::Script::Attributes::Module, "terrain") + ->Property("EntityId", BehaviorValueProperty(&MacroMaterialData::m_entityId)) + ->Property("Bounds", BehaviorValueProperty(&MacroMaterialData::m_bounds)) + ->Property("NormalFlipX", BehaviorValueProperty(&MacroMaterialData::m_normalFlipX)) + ->Property("NormalFlipY", BehaviorValueProperty(&MacroMaterialData::m_normalFlipY)) + ->Property("NormalFactor", BehaviorValueProperty(&MacroMaterialData::m_normalFactor)) + ; + } + } + void TerrainMacroMaterialRequests::Reflect(AZ::ReflectContext* context) { + MacroMaterialData::Reflect(context); + if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) { behaviorContext->EBus("TerrainMacroMaterialRequestBus") diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialBus.h b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialBus.h index 9a7151da56..abcf4d4df0 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialBus.h +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialBus.h @@ -18,8 +18,10 @@ namespace Terrain { struct MacroMaterialData final { - AZ_RTTI(MacroMaterialData, "{DC68E20A-3251-4E4E-8BC7-F6A2521FEF46}"); - + AZ_TYPE_INFO(MacroMaterialData, "{DC68E20A-3251-4E4E-8BC7-F6A2521FEF46}"); + + static void Reflect(AZ::ReflectContext* context); + AZ::EntityId m_entityId; AZ::Aabb m_bounds = AZ::Aabb::CreateNull(); diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialManager.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialManager.cpp new file mode 100644 index 0000000000..82349cdcdb --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialManager.cpp @@ -0,0 +1,412 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +namespace Terrain +{ + namespace + { + [[maybe_unused]] static const char* TerrainMacroMaterialManagerName = "TerrainMacroMaterialManager"; + } + + namespace TerrainSrgInputs + { + static const char* const MacroMaterialData("m_macroMaterialData"); + static const char* const MacroMaterialGrid("m_macroMaterialGrid"); + } + + void TerrainMacroMaterialManager::Initialize( + const AZStd::shared_ptr& bindlessImageHandler, + AZ::Data::Instance& terrainSrg) + { + AZ_Error(TerrainMacroMaterialManagerName, bindlessImageHandler, "bindlessImageHandler must not be null."); + AZ_Error(TerrainMacroMaterialManagerName, terrainSrg, "terrainSrg must not be null."); + AZ_Error(TerrainMacroMaterialManagerName, !m_isInitialized, "Already initialized."); + + if (!bindlessImageHandler || !terrainSrg || m_isInitialized) + { + return; + } + + if (UpdateSrgIndices(terrainSrg)) + { + m_bindlessImageHandler = bindlessImageHandler; + + OnTerrainDataChanged(AZ::Aabb::CreateNull(), TerrainDataChangedMask::Settings); + AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusConnect(); + TerrainMacroMaterialNotificationBus::Handler::BusConnect(); + + m_terrainSizeChanged = true; + m_isInitialized = true; + } + } + + void TerrainMacroMaterialManager::Reset() + { + m_isInitialized = false; + + m_macroMaterialDataBuffer = {}; + + m_macroMaterialShaderData.clear(); + m_macroMaterialEntities.clear(); + + RemoveAllImages(); + m_macroMaterials.clear(); + + m_bindlessImageHandler = {}; + + AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusDisconnect(); + TerrainMacroMaterialNotificationBus::Handler::BusDisconnect(); + } + + bool TerrainMacroMaterialManager::IsInitialized() + { + return m_isInitialized; + } + + bool TerrainMacroMaterialManager::UpdateSrgIndices(AZ::Data::Instance& terrainSrg) + { + const AZ::RHI::ShaderResourceGroupLayout* terrainSrgLayout = terrainSrg->GetLayout(); + + m_macroMaterialGridIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::MacroMaterialGrid)); + AZ_Error(TerrainMacroMaterialManagerName, m_macroMaterialGridIndex.IsValid(), "Failed to find terrain srg input constant %s.", TerrainSrgInputs::MacroMaterialGrid); + + AZ::Render::GpuBufferHandler::Descriptor desc; + + // Set up the gpu buffer for macro material data + desc.m_bufferName = "Macro Material Data"; + desc.m_bufferSrgName = TerrainSrgInputs::MacroMaterialData; + desc.m_elementSize = sizeof(MacroMaterialShaderData); + desc.m_srgLayout = terrainSrgLayout; + m_macroMaterialDataBuffer = AZ::Render::GpuBufferHandler(desc); + + m_bufferNeedsUpdate = true; + + return m_macroMaterialDataBuffer.IsValid() && m_macroMaterialGridIndex.IsValid(); + } + + void TerrainMacroMaterialManager::OnTerrainDataChanged(const AZ::Aabb& dirtyRegion [[maybe_unused]], TerrainDataChangedMask dataChangedMask) + { + if ((dataChangedMask & TerrainDataChangedMask::Settings) != 0) + { + AZ::Aabb worldBounds = AZ::Aabb::CreateNull(); + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + worldBounds, &AzFramework::Terrain::TerrainDataRequests::GetTerrainAabb); + + m_terrainSizeChanged = m_terrainSizeChanged || m_terrainBounds != worldBounds; + m_terrainBounds = worldBounds; + } + } + + void TerrainMacroMaterialManager::OnTerrainMacroMaterialCreated(AZ::EntityId entityId, const MacroMaterialData& newMaterialData) + { + AZ_Assert(!m_macroMaterials.contains(entityId), + "OnTerrainMacroMaterialCreated called for a macro material that already exists. This indicates that either the bus is incorrectly sending out " + "OnCreated announcements for existing materials, or the terrain feature processor isn't properly cleaning up macro materials."); + + MacroMaterial& macroMaterial = m_macroMaterials[entityId]; + macroMaterial.m_data = newMaterialData; + if (newMaterialData.m_colorImage) + { + macroMaterial.m_colorIndex = m_bindlessImageHandler->AppendBindlessImage(newMaterialData.m_colorImage->GetImageView()); + } + if (newMaterialData.m_normalImage) + { + macroMaterial.m_normalIndex = m_bindlessImageHandler->AppendBindlessImage(newMaterialData.m_normalImage->GetImageView()); + } + + ForMacroMaterialsInBounds(newMaterialData.m_bounds, + [&](uint16_t idx, [[maybe_unused]] const AZ::Vector2& corner) + { + for (uint16_t offset = 0; offset < MacroMaterialsPerTile; ++offset) + { + MacroMaterialShaderData& macroMaterialShaderData = m_macroMaterialShaderData.at(idx + offset); + if ((macroMaterialShaderData.m_flags & MacroMaterialShaderFlags::IsUsed) == 0) + { + UpdateMacroMaterialShaderEntry(idx + offset, macroMaterial); + break; + } + AZ_Assert(m_macroMaterialEntities.at(idx + offset) != entityId, "Found existing macro material tile for what should be a completely new macro material."); + } + } + ); + + m_bufferNeedsUpdate = true; + } + + void TerrainMacroMaterialManager::OnTerrainMacroMaterialChanged(AZ::EntityId entityId, const MacroMaterialData& newMaterialData) + { + AZ_Assert(m_macroMaterials.contains(entityId), + "OnTerrainMacroMaterialChanged called for a macro material that TerrainFeatureProcessor isn't tracking. This indicates that either the bus is sending out " + "Changed announcements for materials that haven't had a OnCreated event sent, or the terrain feature processor isn't properly tracking macro materials."); + + MacroMaterial& macroMaterial = m_macroMaterials[entityId]; + macroMaterial.m_data = newMaterialData; + + auto UpdateImageIndex = [&](uint16_t& indexRef, const AZ::Data::Instance& imageView) + { + if (indexRef) + { + if (imageView) + { + m_bindlessImageHandler->UpdateBindlessImage(indexRef, imageView->GetImageView()); + } + else + { + m_bindlessImageHandler->RemoveBindlessImage(indexRef); + indexRef = 0xFFFF; + } + } + else if (imageView) + { + indexRef = m_bindlessImageHandler->AppendBindlessImage(imageView->GetImageView()); + } + }; + + UpdateImageIndex(macroMaterial.m_colorIndex, newMaterialData.m_colorImage); + UpdateImageIndex(macroMaterial.m_normalIndex, newMaterialData.m_normalImage); + + ForMacroMaterialsInBounds(newMaterialData.m_bounds, + [&](uint16_t idx, [[maybe_unused]] const AZ::Vector2& corner) + { + for (uint16_t offset = 0; offset < MacroMaterialsPerTile; ++offset) + { + if (m_macroMaterialEntities.at(idx + offset) == entityId) + { + UpdateMacroMaterialShaderEntry(idx + offset, macroMaterial); + break; + } + } + } + ); + + m_bufferNeedsUpdate = true; + } + + void TerrainMacroMaterialManager::OnTerrainMacroMaterialRegionChanged( + AZ::EntityId entityId, [[maybe_unused]] const AZ::Aabb& oldRegion, const AZ::Aabb& newRegion) + { + AZ_Assert(m_macroMaterials.contains(entityId), + "OnTerrainMacroMaterialChanged called for a macro material that TerrainFeatureProcessor isn't tracking. This indicates that either the bus is sending out " + "Changed announcements for materials that haven't had a OnCreated event sent, or the terrain feature processor isn't properly tracking macro materials."); + + MacroMaterial& macroMaterial = m_macroMaterials[entityId]; + macroMaterial.m_data.m_bounds = newRegion; + + AZ::Aabb changedRegion = oldRegion; + changedRegion.AddAabb(newRegion); + + ForMacroMaterialsInBounds(changedRegion, + [&](uint16_t idx, const AZ::Vector2& corner) + { + AZ::Aabb tileAabb = AZ::Aabb::CreateFromMinMaxValues( + corner.GetX(), corner.GetY(), m_terrainBounds.GetMin().GetZ(), + corner.GetX() + MacroMaterialGridSize, corner.GetY() + MacroMaterialGridSize, m_terrainBounds.GetMax().GetZ()); + + bool overlapsNew = tileAabb.Overlaps(newRegion); + uint16_t end = idx + MacroMaterialsPerTile; + + for (; idx < end; ++idx) + { + if (m_macroMaterialEntities.at(idx) == entityId) + { + if (overlapsNew) + { + // Update the macro material entry from this tile. + UpdateMacroMaterialShaderEntry(idx, macroMaterial); + } + else + { + // Remove the macro material entry from this tile. + RemoveMacroMaterialShaderEntry(idx); + } + break; + } + else if (overlapsNew && (m_macroMaterialShaderData.at(idx).m_flags & MacroMaterialShaderFlags::IsUsed) == 0) + { + // Add a macro material entry from this tile. (!overlapsOld && overlapsNew) + UpdateMacroMaterialShaderEntry(idx, macroMaterial); + break; + } + } + } + ); + + m_bufferNeedsUpdate = true; + } + + void TerrainMacroMaterialManager::OnTerrainMacroMaterialDestroyed(AZ::EntityId entityId) + { + AZ_Assert(m_macroMaterials.contains(entityId), + "OnTerrainMacroMaterialChanged called for a macro material that TerrainFeatureProcessor isn't tracking. This indicates that either the bus is sending out " + "Changed announcements for materials that haven't had a OnCreated event sent, or the terrain feature processor isn't properly tracking macro materials."); + + const MacroMaterial& macroMaterial = m_macroMaterials[entityId]; + + ForMacroMaterialsInBounds(macroMaterial.m_data.m_bounds, + [&](uint16_t idx, [[maybe_unused]] const AZ::Vector2& corner) + { + uint16_t end = idx + MacroMaterialsPerTile; + + for (; idx < end; ++idx) + { + if (m_macroMaterialEntities.at(idx) == entityId) + { + RemoveMacroMaterialShaderEntry(idx); + } + } + } + ); + + if (macroMaterial.m_colorIndex != 0xFFFF) + { + m_bindlessImageHandler->RemoveBindlessImage(macroMaterial.m_colorIndex); + } + if (macroMaterial.m_normalIndex != 0xFFFF) + { + m_bindlessImageHandler->RemoveBindlessImage(macroMaterial.m_normalIndex); + } + + m_macroMaterials.erase(entityId); + m_bufferNeedsUpdate = true; + } + + void TerrainMacroMaterialManager::UpdateMacroMaterialShaderEntry(uint16_t shaderDataIdx, const MacroMaterial& macroMaterial) + { + m_macroMaterialEntities.at(shaderDataIdx) = macroMaterial.m_data.m_entityId; + MacroMaterialShaderData& macroMaterialShaderData = m_macroMaterialShaderData.at(shaderDataIdx); + + macroMaterialShaderData.m_flags = (MacroMaterialShaderFlags)( + MacroMaterialShaderFlags::IsUsed | + (macroMaterial.m_data.m_normalFlipX ? MacroMaterialShaderFlags::FlipMacroNormalX : 0) | + (macroMaterial.m_data.m_normalFlipY ? MacroMaterialShaderFlags::FlipMacroNormalY : 0) + ); + + macroMaterialShaderData.m_normalFactor = macroMaterial.m_data.m_normalFactor; + macroMaterialShaderData.m_boundsMin = { macroMaterial.m_data.m_bounds.GetMin().GetX(), macroMaterial.m_data.m_bounds.GetMin().GetY() }; + macroMaterialShaderData.m_boundsMax = { macroMaterial.m_data.m_bounds.GetMax().GetX(), macroMaterial.m_data.m_bounds.GetMax().GetY() }; + macroMaterialShaderData.m_colorMapId = macroMaterial.m_colorIndex; + macroMaterialShaderData.m_normalMapId = macroMaterial.m_normalIndex; + } + + void TerrainMacroMaterialManager::RemoveMacroMaterialShaderEntry(uint16_t shaderDataIdx) + { + // Remove the macro material entry from this tile by copying the remaining entries on top. + for (++shaderDataIdx; shaderDataIdx % MacroMaterialsPerTile != 0; ++shaderDataIdx) + { + m_macroMaterialEntities.at(shaderDataIdx - 1) = m_macroMaterialEntities.at(shaderDataIdx); + m_macroMaterialShaderData.at(shaderDataIdx - 1) = m_macroMaterialShaderData.at(shaderDataIdx); + } + // Disable the last entry. + m_macroMaterialEntities.at(shaderDataIdx - 1) = AZ::EntityId(); + m_macroMaterialShaderData.at(shaderDataIdx - 1).m_flags = MacroMaterialShaderFlags(0); + } + + template + void TerrainMacroMaterialManager::ForMacroMaterialsInBounds(const AZ::Aabb& bounds, Callback callback) + { + // Get the macro material bounds relative to the terrain + float yStart = bounds.GetMin().GetY() - m_terrainBounds.GetMin().GetY(); + float yEnd = bounds.GetMax().GetY() - m_terrainBounds.GetMin().GetY(); + float xStart = bounds.GetMin().GetX() - m_terrainBounds.GetMin().GetX(); + float xEnd = bounds.GetMax().GetX() - m_terrainBounds.GetMin().GetX(); + + // Clamp the bounds to the terrain + uint16_t yStartIdx = yStart > 0.0f ? uint16_t(yStart / MacroMaterialGridSize) : 0; + uint16_t yEndIdx = yEnd > 0.0f ? AZStd::GetMin(uint16_t(yEnd / MacroMaterialGridSize) + 1, m_tilesY) : 0; + uint16_t xStartIdx = xStart > 0.0f ? uint16_t(xStart / MacroMaterialGridSize) : 0; + uint16_t xEndIdx = xEnd > 0.0f ? AZStd::GetMin(uint16_t(xEnd / MacroMaterialGridSize) + 1, m_tilesX) : 0; + + AZ::Vector2 gridCorner = AZ::Vector2( + floor(m_terrainBounds.GetMin().GetX() / MacroMaterialGridSize) * MacroMaterialGridSize, + floor(m_terrainBounds.GetMin().GetY() / MacroMaterialGridSize) * MacroMaterialGridSize); + + for (uint16_t y = yStartIdx; y < yEndIdx; ++y) + { + for (uint16_t x = xStartIdx; x < xEndIdx; ++x) + { + uint16_t idx = (y * m_tilesX + x) * MacroMaterialsPerTile; + const AZ::Vector2 corner = gridCorner + AZ::Vector2(x * MacroMaterialGridSize, y * MacroMaterialGridSize); + callback(idx, corner); + } + } + } + + void TerrainMacroMaterialManager::Update(AZ::Data::Instance& terrainSrg) + { + if (m_terrainSizeChanged) + { + m_terrainSizeChanged = false; + + // Rebuild the macro material tiles from scratch when the world size changes. This could be made more efficient + // but is fine for now since world resizes are rare. + + RemoveAllImages(); + m_macroMaterials.clear(); + + m_macroMaterialShaderData.clear(); + m_macroMaterialEntities.clear(); + + m_tilesX = aznumeric_cast(m_terrainBounds.GetXExtent() / MacroMaterialGridSize) + 1; + m_tilesY = aznumeric_cast(m_terrainBounds.GetYExtent() / MacroMaterialGridSize) + 1; + const uint32_t macroMaterialTileCount = m_tilesX * m_tilesY * MacroMaterialsPerTile; + + m_macroMaterialShaderData.resize(macroMaterialTileCount); + m_macroMaterialEntities.resize(macroMaterialTileCount); + + TerrainMacroMaterialRequestBus::EnumerateHandlers( + [&](TerrainMacroMaterialRequests* handler) + { + MacroMaterialData macroMaterial = handler->GetTerrainMacroMaterialData(); + AZ::EntityId entityId = *(Terrain::TerrainMacroMaterialRequestBus::GetCurrentBusId()); + OnTerrainMacroMaterialCreated(entityId, macroMaterial); + return true; + } + ); + } + + if (m_bufferNeedsUpdate) + { + m_bufferNeedsUpdate = false; + m_macroMaterialDataBuffer.UpdateBuffer(m_macroMaterialShaderData.data(), aznumeric_cast(m_macroMaterialShaderData.size())); + + MacroMaterialGridShaderData macroMaterialGridShaderData; + macroMaterialGridShaderData.m_offset = { m_terrainBounds.GetMin().GetX(), m_terrainBounds.GetMin().GetY() }; + macroMaterialGridShaderData.m_resolution = (m_tilesX << 16) | m_tilesY; + macroMaterialGridShaderData.m_tileSize = MacroMaterialGridSize; + + if (terrainSrg) + { + m_macroMaterialDataBuffer.UpdateSrg(terrainSrg.get()); + terrainSrg->SetConstant(m_macroMaterialGridIndex, macroMaterialGridShaderData); + } + } + } + + void TerrainMacroMaterialManager::RemoveAllImages() + { + for (const auto& [entity, macroMaterial] : m_macroMaterials) + { + RemoveImagesForMaterial(macroMaterial); + } + } + + void TerrainMacroMaterialManager::RemoveImagesForMaterial(const MacroMaterial& macroMaterial) + { + if (macroMaterial.m_colorIndex != 0xFFFF) + { + m_bindlessImageHandler->RemoveBindlessImage(macroMaterial.m_colorIndex); + } + if (macroMaterial.m_normalIndex != 0xFFFF) + { + m_bindlessImageHandler->RemoveBindlessImage(macroMaterial.m_normalIndex); + } + } + +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialManager.h b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialManager.h new file mode 100644 index 0000000000..6a603eeced --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialManager.h @@ -0,0 +1,116 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include +#include + +namespace Terrain +{ + class TerrainMacroMaterialManager + : private TerrainMacroMaterialNotificationBus::Handler + , private AzFramework::Terrain::TerrainDataNotificationBus::Handler + { + public: + + TerrainMacroMaterialManager() = default; + ~TerrainMacroMaterialManager() = default; + + void Initialize( + const AZStd::shared_ptr& bindlessImageHandler, + AZ::Data::Instance& terrainSrg); + void Reset(); + bool IsInitialized(); + bool UpdateSrgIndices(AZ::Data::Instance& terrainSrg); + + void Update(AZ::Data::Instance& terrainSrg); + + private: + + static constexpr auto InvalidImageIndex = AZ::Render::BindlessImageArrayHandler::InvalidImageIndex; + static constexpr float MacroMaterialGridSize = 64.0f; + static constexpr uint16_t MacroMaterialsPerTile = 4; + + enum MacroMaterialShaderFlags : uint32_t + { + IsUsed = 0b0000'0000'0000'0000'0000'0000'0000'0001, + FlipMacroNormalX = 0b0000'0000'0000'0000'0000'0000'0000'0010, + FlipMacroNormalY = 0b0000'0000'0000'0000'0000'0000'0000'0100, + }; + + struct MacroMaterialShaderData + { + MacroMaterialShaderFlags m_flags; + uint32_t m_colorMapId{InvalidImageIndex}; + uint32_t m_normalMapId{InvalidImageIndex}; + float m_normalFactor; + + // macro material bounds in world space + AZStd::array m_boundsMin{ 0.0f, 0.0f }; + AZStd::array m_boundsMax{ 0.0f, 0.0f }; + }; + static_assert(sizeof(MacroMaterialShaderData) % 16 == 0, "MacroMaterialShaderData must be 16 byte aligned."); + + struct MacroMaterial + { + MacroMaterialData m_data; + uint16_t m_colorIndex{ 0xFFFF }; + uint16_t m_normalIndex{ 0xFFFF }; + }; + + struct MacroMaterialGridShaderData + { + uint32_t m_resolution; // How many x/y tiles in grid. x & y stored in 16 bits each. Total number of entries in m_macroMaterialData will be x * y + float m_tileSize; // Size of a tile in meters. + AZStd::array m_offset; // x/y offset of min x/y corner of grid. + }; + static_assert(sizeof(MacroMaterialGridShaderData) % 16 == 0, "MacroMaterialGridShaderData must be 16 byte aligned."); + + // AzFramework::Terrain::TerrainDataNotificationBus overrides... + void OnTerrainDataChanged(const AZ::Aabb& dirtyRegion [[maybe_unused]], TerrainDataChangedMask dataChangedMask) override; + + // TerrainMacroMaterialNotificationBus overrides... + void OnTerrainMacroMaterialCreated(AZ::EntityId entityId, const MacroMaterialData& material) override; + void OnTerrainMacroMaterialChanged(AZ::EntityId entityId, const MacroMaterialData& material) override; + void OnTerrainMacroMaterialRegionChanged(AZ::EntityId entityId, const AZ::Aabb& oldRegion, const AZ::Aabb& newRegion) override; + void OnTerrainMacroMaterialDestroyed(AZ::EntityId entityId) override; + + void UpdateMacroMaterialShaderEntry(uint16_t shaderDataIdx, const MacroMaterial& macroMaterialData); + void RemoveMacroMaterialShaderEntry(uint16_t shaderDataIdx); + + template + void ForMacroMaterialsInBounds(const AZ::Aabb& bounds, Callback callback); + + void RemoveAllImages(); + void RemoveImagesForMaterial(const MacroMaterial& macroMaterial); + + AZ::Aabb m_terrainBounds{ AZ::Aabb::CreateNull() }; + + // Macro materials stored in a grid of (MacroMaterialGridCount * MacroMaterialGridCount) where each tile in the grid covers + // an area of (MacroMaterialGridSize * MacroMaterialGridSize) and each tile can hold MacroMaterialsPerTile macro materials + AZStd::vector m_macroMaterialShaderData; + AZStd::vector m_macroMaterialEntities; // Same as above, but used to track entity ids which aren't needed by the shader. + AZStd::map m_macroMaterials; // Used for looking up macro materials by entity id when the data isn't provided by a bus. + uint16_t m_tilesX{ 0 }; + uint16_t m_tilesY{ 0 }; + + AZStd::shared_ptr m_bindlessImageHandler; + AZ::Render::GpuBufferHandler m_macroMaterialDataBuffer; + + AZ::RHI::ShaderInputConstantIndex m_macroMaterialGridIndex; + + bool m_terrainSizeChanged{ false }; + bool m_bufferNeedsUpdate{ false }; + bool m_isInitialized{ false }; + + }; +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.cpp new file mode 100644 index 0000000000..d689d2635c --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.cpp @@ -0,0 +1,354 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +namespace Terrain +{ + namespace + { + [[maybe_unused]] static const char* TerrainMeshManagerName = "TerrainMeshManager"; + } + + namespace ShaderInputs + { + static const char* const PatchData("m_patchData"); + } + + void TerrainMeshManager::Initialize() + { + if (!InitializePatchModel()) + { + AZ_Error(TerrainMeshManagerName, false, "Failed to create Terrain render buffers!"); + return; + } + + OnTerrainDataChanged(AZ::Aabb::CreateNull(), TerrainDataChangedMask::HeightData); + AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusConnect(); + + m_isInitialized = true; + } + + bool TerrainMeshManager::IsInitialized() const + { + return m_isInitialized; + } + + void TerrainMeshManager::Reset() + { + AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusDisconnect(); + m_patchModel = {}; + m_sectorData.clear(); + m_rebuildSectors = true; + m_isInitialized = false; + } + + bool TerrainMeshManager::CheckRebuildSurfaces(MaterialInstance materialInstance, AZ::RPI::Scene& parentScene) + { + if (!m_rebuildSectors) + { + return false; + } + + m_rebuildSectors = false; + m_sectorData.clear(); + + const auto layout = materialInstance->GetAsset()->GetObjectSrgLayout(); + + AZ::RHI::ShaderInputConstantIndex patchDataIndex = layout->FindShaderInputConstantIndex(AZ::Name(ShaderInputs::PatchData)); + AZ_Error(TerrainMeshManagerName, patchDataIndex.IsValid(), "Failed to find shader input constant %s.", ShaderInputs::PatchData); + + const float xFirstPatchStart = AZStd::floorf(m_worldBounds.GetMin().GetX() / GridMeters) * GridMeters; + const float xLastPatchStart = AZStd::floorf(m_worldBounds.GetMax().GetX() / GridMeters) * GridMeters; + const float yFirstPatchStart = AZStd::floorf(m_worldBounds.GetMin().GetY() / GridMeters) * GridMeters; + const float yLastPatchStart = AZStd::floorf(m_worldBounds.GetMax().GetY() / GridMeters) * GridMeters; + + const auto& materialAsset = materialInstance->GetAsset(); + const auto& shaderAsset = materialAsset->GetMaterialTypeAsset()->GetShaderAssetForObjectSrg(); + + for (float yPatch = yFirstPatchStart; yPatch <= yLastPatchStart; yPatch += GridMeters) + { + for (float xPatch = xFirstPatchStart; xPatch <= xLastPatchStart; xPatch += GridMeters) + { + ShaderTerrainData objectSrgData; + objectSrgData.m_xyTranslation = { xPatch, yPatch }; + + m_sectorData.push_back(); + SectorData& sectorData = m_sectorData.back(); + + for (auto& lod : m_patchModel->GetLods()) + { + objectSrgData.m_xyScale = m_sampleSpacing * GridSize; + + auto objectSrg = AZ::RPI::ShaderResourceGroup::Create(shaderAsset, materialAsset->GetObjectSrgLayout()->GetName()); + if (!objectSrg) + { + AZ_WarningOnce(TerrainMeshManagerName, false, "Failed to create a new shader resource group, skipping."); + continue; + } + objectSrg->SetConstant(patchDataIndex, objectSrgData); + objectSrg->Compile(); + + AZ::RPI::ModelLod& modelLod = *lod.get(); + sectorData.m_drawPackets.emplace_back(modelLod, 0, materialInstance, objectSrg); + AZ::RPI::MeshDrawPacket& drawPacket = sectorData.m_drawPackets.back(); + + sectorData.m_srgs.emplace_back(objectSrg); + + // set the shader option to select forward pass IBL specular if necessary + if (!drawPacket.SetShaderOption(AZ::Name("o_meshUseForwardPassIBLSpecular"), AZ::RPI::ShaderOptionValue{ false })) + { + AZ_Warning(TerrainMeshManagerName, false, "Failed to set o_meshUseForwardPassIBLSpecular on mesh draw packet"); + } + const uint8_t stencilRef = AZ::Render::StencilRefs::UseDiffuseGIPass | AZ::Render::StencilRefs::UseIBLSpecularPass; + drawPacket.SetStencilRef(stencilRef); + drawPacket.Update(parentScene, true); + } + + sectorData.m_aabb = + AZ::Aabb::CreateFromMinMax( + AZ::Vector3(xPatch, yPatch, m_worldBounds.GetMin().GetZ()), + AZ::Vector3(xPatch + GridMeters, yPatch + GridMeters, m_worldBounds.GetMax().GetZ()) + ); + } + } + return true; + } + + void TerrainMeshManager::DrawMeshes(const AZ::RPI::FeatureProcessor::RenderPacket& process) + { + for (auto& sectorData : m_sectorData) + { + uint8_t lodChoice = AZ::RPI::ModelLodAsset::LodCountMax; + + // Go through all cameras and choose an LOD based on the closest camera. + for (auto& view : process.m_views) + { + if ((view->GetUsageFlags() & AZ::RPI::View::UsageFlags::UsageCamera) > 0) + { + const AZ::Vector3 cameraPosition = view->GetCameraTransform().GetTranslation(); + const AZ::Vector2 cameraPositionXY = AZ::Vector2(cameraPosition.GetX(), cameraPosition.GetY()); + const AZ::Vector2 sectorCenterXY = AZ::Vector2(sectorData.m_aabb.GetCenter().GetX(), sectorData.m_aabb.GetCenter().GetY()); + + const float sectorDistance = sectorCenterXY.GetDistance(cameraPositionXY); + + // This will be configurable later + const float minDistanceForLod0 = (GridMeters * 4.0f); + + // For every distance doubling beyond a minDistanceForLod0, we only need half the mesh density. Each LOD + // is exactly half the resolution of the last. + const float lodForCamera = AZStd::floorf(AZ::GetMax(0.0f, log2f(sectorDistance / minDistanceForLod0))); + + // All cameras should render the same LOD so effects like shadows are consistent. + lodChoice = AZ::GetMin(lodChoice, aznumeric_cast(lodForCamera)); + } + } + + // Add the correct LOD draw packet for visible sectors. + for (auto& view : process.m_views) + { + AZ::Frustum viewFrustum = AZ::Frustum::CreateFromMatrixColumnMajor(view->GetWorldToClipMatrix()); + if (viewFrustum.IntersectAabb(sectorData.m_aabb) != AZ::IntersectResult::Exterior) + { + const uint8_t lodToRender = AZ::GetMin(lodChoice, aznumeric_cast(sectorData.m_drawPackets.size() - 1)); + view->AddDrawPacket(sectorData.m_drawPackets.at(lodToRender).GetRHIDrawPacket()); + } + } + } + } + + void TerrainMeshManager::RebuildDrawPackets(AZ::RPI::Scene& scene) + { + for (auto& sectorData : m_sectorData) + { + for (auto& drawPacket : sectorData.m_drawPackets) + { + drawPacket.Update(scene, true); + } + } + } + + void TerrainMeshManager::OnTerrainDataDestroyBegin() + { + Reset(); + } + + void TerrainMeshManager::OnTerrainDataChanged([[maybe_unused]] const AZ::Aabb& dirtyRegion, TerrainDataChangedMask dataChangedMask) + { + if ((dataChangedMask & (TerrainDataChangedMask::HeightData | TerrainDataChangedMask::Settings)) != 0) + { + AZ::Aabb worldBounds = AZ::Aabb::CreateNull(); + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + worldBounds, &AzFramework::Terrain::TerrainDataRequests::GetTerrainAabb); + + AZ::Vector2 queryResolution2D = AZ::Vector2(1.0f); + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + queryResolution2D, &AzFramework::Terrain::TerrainDataRequests::GetTerrainHeightQueryResolution); + // Currently query resolution is multidimensional but the rendering system only supports this changing in one dimension. + float queryResolution = queryResolution2D.GetX(); + + // Sectors need to be rebuilt if the world bounds change in the x/y, or the sample spacing changes. + m_rebuildSectors = m_rebuildSectors || + m_worldBounds.GetMin().GetX() != worldBounds.GetMin().GetX() || + m_worldBounds.GetMin().GetY() != worldBounds.GetMin().GetY() || + m_worldBounds.GetMax().GetX() != worldBounds.GetMax().GetX() || + m_worldBounds.GetMax().GetY() != worldBounds.GetMax().GetY() || + m_sampleSpacing != queryResolution; + + m_worldBounds = worldBounds; + m_sampleSpacing = queryResolution; + } + } + + void TerrainMeshManager::InitializeTerrainPatch(uint16_t gridSize, PatchData& patchdata) + { + patchdata.m_positions.clear(); + patchdata.m_indices.clear(); + + const uint16_t gridVertices = gridSize + 1; // For m_gridSize quads, (m_gridSize + 1) vertices are needed. + const size_t size = gridVertices * gridVertices; + + patchdata.m_positions.reserve(size); + + for (uint16_t y = 0; y < gridVertices; ++y) + { + for (uint16_t x = 0; x < gridVertices; ++x) + { + patchdata.m_positions.push_back({ aznumeric_cast(x) / gridSize, aznumeric_cast(y) / gridSize }); + } + } + + patchdata.m_indices.reserve(gridSize * gridSize * 6); // total number of quads, 2 triangles with 6 indices per quad. + + for (uint16_t y = 0; y < gridSize; ++y) + { + for (uint16_t x = 0; x < gridSize; ++x) + { + const uint16_t topLeft = y * gridVertices + x; + const uint16_t topRight = topLeft + 1; + const uint16_t bottomLeft = (y + 1) * gridVertices + x; + const uint16_t bottomRight = bottomLeft + 1; + + patchdata.m_indices.emplace_back(topLeft); + patchdata.m_indices.emplace_back(topRight); + patchdata.m_indices.emplace_back(bottomLeft); + patchdata.m_indices.emplace_back(bottomLeft); + patchdata.m_indices.emplace_back(topRight); + patchdata.m_indices.emplace_back(bottomRight); + } + } + } + + AZ::Outcome> TerrainMeshManager::CreateBufferAsset( + const void* data, const AZ::RHI::BufferViewDescriptor& bufferViewDescriptor, const AZStd::string& bufferName) + { + AZ::RPI::BufferAssetCreator creator; + creator.Begin(AZ::Uuid::CreateRandom()); + + AZ::RHI::BufferDescriptor bufferDescriptor; + bufferDescriptor.m_bindFlags = AZ::RHI::BufferBindFlags::InputAssembly | AZ::RHI::BufferBindFlags::ShaderRead; + bufferDescriptor.m_byteCount = static_cast(bufferViewDescriptor.m_elementSize) * static_cast(bufferViewDescriptor.m_elementCount); + + creator.SetBuffer(data, bufferDescriptor.m_byteCount, bufferDescriptor); + creator.SetBufferViewDescriptor(bufferViewDescriptor); + creator.SetUseCommonPool(AZ::RPI::CommonBufferPoolType::StaticInputAssembly); + + AZ::Data::Asset bufferAsset; + if (creator.End(bufferAsset)) + { + bufferAsset.SetHint(bufferName); + return AZ::Success(bufferAsset); + } + + return AZ::Failure(); + } + + bool TerrainMeshManager::InitializePatchModel() + { + AZ::RPI::ModelAssetCreator modelAssetCreator; + modelAssetCreator.Begin(AZ::Uuid::CreateRandom()); + + uint16_t gridSize = GridSize; + float gridSpacing = GridSpacing; + + for (uint32_t i = 0; i < AZ::RPI::ModelLodAsset::LodCountMax && gridSize > 0; ++i) + { + PatchData patchData; + InitializeTerrainPatch(gridSize, patchData); + + const auto positionBufferViewDesc = AZ::RHI::BufferViewDescriptor::CreateTyped(0, aznumeric_cast(patchData.m_positions.size()), AZ::RHI::Format::R32G32_FLOAT); + const auto positionsOutcome = CreateBufferAsset(patchData.m_positions.data(), positionBufferViewDesc, "TerrainPatchPositions"); + + const auto indexBufferViewDesc = AZ::RHI::BufferViewDescriptor::CreateTyped(0, aznumeric_cast(patchData.m_indices.size()), AZ::RHI::Format::R16_UINT); + const auto indicesOutcome = CreateBufferAsset(patchData.m_indices.data(), indexBufferViewDesc, "TerrainPatchIndices"); + + if (!positionsOutcome.IsSuccess() || !indicesOutcome.IsSuccess()) + { + AZ_Error(TerrainMeshManagerName, false, "Failed to create GPU buffers for Terrain"); + return false; + } + + AZ::RPI::ModelLodAssetCreator modelLodAssetCreator; + modelLodAssetCreator.Begin(AZ::Uuid::CreateRandom()); + + modelLodAssetCreator.BeginMesh(); + modelLodAssetCreator.AddMeshStreamBuffer(AZ::RHI::ShaderSemantic{ "POSITION" }, AZ::Name(), {positionsOutcome.GetValue(), positionBufferViewDesc}); + modelLodAssetCreator.SetMeshIndexBuffer({indicesOutcome.GetValue(), indexBufferViewDesc}); + + AZ::Aabb aabb = AZ::Aabb::CreateFromMinMax(AZ::Vector3(0.0, 0.0, 0.0), AZ::Vector3(GridMeters, GridMeters, 0.0)); + modelLodAssetCreator.SetMeshAabb(AZStd::move(aabb)); + modelLodAssetCreator.SetMeshName(AZ::Name("Terrain Patch")); + modelLodAssetCreator.EndMesh(); + + AZ::Data::Asset modelLodAsset; + modelLodAssetCreator.End(modelLodAsset); + + modelAssetCreator.AddLodAsset(AZStd::move(modelLodAsset)); + + gridSize = gridSize / 2; + gridSpacing *= 2.0f; + } + + AZ::Data::Asset modelAsset; + bool success = modelAssetCreator.End(modelAsset); + + m_patchModel = AZ::RPI::Model::FindOrCreate(modelAsset); + + return success; + } + + template + void TerrainMeshManager::ForOverlappingSectors(const AZ::Aabb& bounds, Callback callback) + { + for (SectorData& sectorData : m_sectorData) + { + if (sectorData.m_aabb.Overlaps(bounds)) + { + callback(sectorData); + } + } + } + +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.h b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.h new file mode 100644 index 0000000000..7252a85686 --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.h @@ -0,0 +1,117 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + +#include + + +namespace AZ::RPI +{ + class BufferAsset; +} + +namespace AZ::RHI +{ + struct BufferViewDescriptor; +} + +namespace Terrain +{ + class TerrainMeshManager + : private AzFramework::Terrain::TerrainDataNotificationBus::Handler + { + private: + + using MaterialInstance = AZ::Data::Instance; + + public: + + AZ_RTTI(TerrainMeshManager, "{62C84AD8-05FE-4C78-8501-A2DB6731B9B7}"); + AZ_DISABLE_COPY_MOVE(TerrainMeshManager); + + TerrainMeshManager() = default; + ~TerrainMeshManager() = default; + + void Initialize(); + bool IsInitialized() const; + void Reset(); + + bool CheckRebuildSurfaces(MaterialInstance materialInstance, AZ::RPI::Scene& parentScene); + void DrawMeshes(const AZ::RPI::FeatureProcessor::RenderPacket& process); + void RebuildDrawPackets(AZ::RPI::Scene& scene); + + static constexpr float GridSpacing{ 1.0f }; + static constexpr int32_t GridSize{ 64 }; // number of terrain quads (vertices are m_gridSize + 1) + static constexpr float GridMeters{ GridSpacing * GridSize }; + static constexpr uint32_t MaxMaterialsPerSector = 4; + + private: + + struct VertexPosition + { + float m_posx; + float m_posy; + }; + + struct PatchData + { + AZStd::vector m_positions; + AZStd::vector m_indices; + }; + + struct SectorData + { + AZStd::fixed_vector m_drawPackets; + AZStd::fixed_vector, AZ::RPI::ModelLodAsset::LodCountMax> m_srgs; // Hold on to refs so it's not dropped + AZ::Aabb m_aabb; + }; + + struct ShaderTerrainData // Must align with struct in Object Srg + { + AZStd::array m_xyTranslation{ 0.0f, 0.0f }; + float m_xyScale{ 1.0f }; + }; + + // AzFramework::Terrain::TerrainDataNotificationBus overrides... + void OnTerrainDataDestroyBegin() override; + void OnTerrainDataChanged(const AZ::Aabb& dirtyRegion, TerrainDataChangedMask dataChangedMask) override; + + AZ::Outcome> CreateBufferAsset( + const void* data, const AZ::RHI::BufferViewDescriptor& bufferViewDescriptor, const AZStd::string& bufferName); + + void InitializeTerrainPatch(uint16_t gridSize, PatchData& patchdata); + bool InitializePatchModel(); + + template + void ForOverlappingSectors(const AZ::Aabb& bounds, Callback callback); + + AZStd::vector m_sectorData; + AZ::Data::Instance m_patchModel; + + AZ::Aabb m_worldBounds{ AZ::Aabb::CreateNull() }; + float m_sampleSpacing = 1.0f; + + bool m_isInitialized{ false }; + bool m_rebuildSectors{ true }; + + }; +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.cpp new file mode 100644 index 0000000000..1df945b88c --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.cpp @@ -0,0 +1,41 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +namespace Terrain +{ + auto Vector2i::operator+(const Vector2i& rhs) const -> Vector2i + { + Vector2i offsetPoint = *this; + offsetPoint += rhs; + return offsetPoint; + } + + auto Vector2i::operator+=(const Vector2i& rhs) -> Vector2i& + { + m_x += rhs.m_x; + m_y += rhs.m_y; + return *this; + } + + auto Vector2i::operator-(const Vector2i& rhs) const -> Vector2i + { + return *this + -rhs; + } + + auto Vector2i::operator-=(const Vector2i& rhs) -> Vector2i& + { + return *this += -rhs; + } + + auto Vector2i::operator-() const -> Vector2i + { + return {-m_x, -m_y}; + } +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.h b/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.h new file mode 100644 index 0000000000..1244972fe9 --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +namespace Terrain +{ + class Vector2i + { + public: + + Vector2i operator+(const Vector2i& rhs) const; + Vector2i& operator+=(const Vector2i& rhs); + Vector2i operator-(const Vector2i& rhs) const; + Vector2i& operator-=(const Vector2i& rhs); + Vector2i operator-() const; + + int32_t m_x{ 0 }; + int32_t m_y{ 0 }; + + }; +} diff --git a/Gems/Terrain/Code/terrain_files.cmake b/Gems/Terrain/Code/terrain_files.cmake index a4f39056e4..ab19d33618 100644 --- a/Gems/Terrain/Code/terrain_files.cmake +++ b/Gems/Terrain/Code/terrain_files.cmake @@ -31,11 +31,23 @@ set(FILES Source/TerrainRenderer/Components/TerrainSurfaceMaterialsListComponent.h Source/TerrainRenderer/Components/TerrainMacroMaterialComponent.cpp Source/TerrainRenderer/Components/TerrainMacroMaterialComponent.h + Source/TerrainRenderer/Aabb2i.cpp + Source/TerrainRenderer/Aabb2i.h Source/TerrainRenderer/TerrainFeatureProcessor.cpp Source/TerrainRenderer/TerrainFeatureProcessor.h + Source/TerrainRenderer/TerrainDetailMaterialManager.cpp + Source/TerrainRenderer/TerrainDetailMaterialManager.h + Source/TerrainRenderer/TerrainMacroMaterialManager.cpp + Source/TerrainRenderer/TerrainMacroMaterialManager.h + Source/TerrainRenderer/TerrainMeshManager.cpp + Source/TerrainRenderer/TerrainMeshManager.h + Source/TerrainRenderer/BindlessImageArrayHandler.cpp + Source/TerrainRenderer/BindlessImageArrayHandler.h Source/TerrainRenderer/TerrainAreaMaterialRequestBus.h Source/TerrainRenderer/TerrainMacroMaterialBus.cpp Source/TerrainRenderer/TerrainMacroMaterialBus.h + Source/TerrainRenderer/Vector2i.cpp + Source/TerrainRenderer/Vector2i.h Source/TerrainSystem/TerrainSystem.cpp Source/TerrainSystem/TerrainSystem.h Source/TerrainSystem/TerrainSystemBus.h From 49652352f483a92a142fe04a8d526dbf4c00ec97 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 29 Dec 2021 16:38:21 -0800 Subject: [PATCH 214/399] Allowing default ImGui clipboard behavior so copy+paste works in the imgui console menu Signed-off-by: Gene Walters --- Gems/ImGui/Code/Source/Platform/Windows/imgui_windows.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/Gems/ImGui/Code/Source/Platform/Windows/imgui_windows.cmake b/Gems/ImGui/Code/Source/Platform/Windows/imgui_windows.cmake index 419c652a38..bea2cfc38b 100644 --- a/Gems/ImGui/Code/Source/Platform/Windows/imgui_windows.cmake +++ b/Gems/ImGui/Code/Source/Platform/Windows/imgui_windows.cmake @@ -8,6 +8,5 @@ set(LY_COMPILE_DEFINITIONS PRIVATE - IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS ) From 48260486fb606020f4715f4299e46b26faa0c0cd Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Thu, 30 Dec 2021 12:43:00 -0600 Subject: [PATCH 215/399] Change gradients to use cached GradientTransform instance (#6591) * Change flow so that TerrainSystem stops responding during deactivation. Some systems might accidentally try to call back to the TerrainSystem inside a DestroyBegin notification, so make sure it stops listening before sending out the notification. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Change gradients to cache and use a GradientTransform instance. In my local test case, calling EBus on every call took 337 ms, using a lambda to wrap the calls took 197 ms, and using the fully cached version took 170 ms. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Remove the wrappingTransform function and go back to the switch statement. There was a bit of overhead to each function call due to using AZStd::function that just isn't necessary for this use case. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Add profile markers to the heightfield updates so that they're more visible. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Cleared state while component is deactivated. The state was getting refreshed even while the component was in a deactivated state, which meant that it wasn't properly notifying of state changes when it became active since it wasn't detecting an actual change. By clearing the state when deactivated, and ensuring the state isn't getting refreshed *while* deactivated, the notifications work properly. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed compile warning on unit test. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Addressed PR feedback - changed comments, reduced mutex scope Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Source/FastNoiseGradientComponent.cpp | 18 +++- .../Code/Source/FastNoiseGradientComponent.h | 16 ++-- Gems/FastNoise/Code/Tests/FastNoiseTest.cpp | 13 +-- .../Ebuses/GradientTransformRequestBus.h | 51 +++++++++-- .../GradientSignal/GradientTransform.h | 2 - .../Components/GradientTransformComponent.cpp | 85 +++++++++---------- .../Components/GradientTransformComponent.h | 9 +- .../Components/ImageGradientComponent.cpp | 23 +++-- .../Components/ImageGradientComponent.h | 17 ++-- .../Components/PerlinGradientComponent.cpp | 24 ++++-- .../Components/PerlinGradientComponent.h | 16 ++-- .../Components/RandomGradientComponent.cpp | 19 ++++- .../Components/RandomGradientComponent.h | 16 ++-- .../EditorGradientTransformComponent.cpp | 12 ++- .../Code/Source/GradientTransform.cpp | 58 +++++++------ .../TerrainPhysicsColliderComponent.cpp | 4 + .../Source/TerrainSystem/TerrainSystem.cpp | 6 +- 17 files changed, 245 insertions(+), 144 deletions(-) diff --git a/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp b/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp index bb4c337299..4cea2efcc8 100644 --- a/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp +++ b/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp @@ -249,6 +249,9 @@ namespace FastNoiseGem void FastNoiseGradientComponent::Activate() { + // This will immediately call OnGradientTransformChanged and initialize m_gradientTransform. + GradientSignal::GradientTransformNotificationBus::Handler::BusConnect(GetEntityId()); + // Some platforms require random seeds to be > 0. Clamp to a positive range to ensure we're always safe. m_generator.SetSeed(AZ::GetMax(m_configuration.m_seed, 1)); m_generator.SetFrequency(m_configuration.m_frequency); @@ -272,6 +275,7 @@ namespace FastNoiseGem { GradientSignal::GradientRequestBus::Handler::BusDisconnect(); FastNoiseGradientRequestBus::Handler::BusDisconnect(); + GradientSignal::GradientTransformNotificationBus::Handler::BusDisconnect(); } bool FastNoiseGradientComponent::ReadInConfig(const AZ::ComponentConfig* baseConfig) @@ -294,13 +298,21 @@ namespace FastNoiseGem return false; } + void FastNoiseGradientComponent::OnGradientTransformChanged(const GradientSignal::GradientTransform& newTransform) + { + AZStd::unique_lock lock(m_transformMutex); + m_gradientTransform = newTransform; + } + float FastNoiseGradientComponent::GetValue(const GradientSignal::GradientSampleParams& sampleParams) const { AZ::Vector3 uvw = sampleParams.m_position; - bool wasPointRejected = false; - GradientSignal::GradientTransformRequestBus::Event( - GetEntityId(), &GradientSignal::GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, wasPointRejected); + + { + AZStd::shared_lock lock(m_transformMutex); + m_gradientTransform.TransformPositionToUVW(sampleParams.m_position, uvw, wasPointRejected); + } if (!wasPointRejected) { diff --git a/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.h b/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.h index da972743ec..dd19049ee6 100644 --- a/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.h +++ b/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -67,6 +68,7 @@ namespace FastNoiseGem : public AZ::Component , private GradientSignal::GradientRequestBus::Handler , private FastNoiseGradientRequestBus::Handler + , private GradientSignal::GradientTransformNotificationBus::Handler { public: friend class EditorFastNoiseGradientComponent; @@ -80,23 +82,25 @@ namespace FastNoiseGem FastNoiseGradientComponent(const FastNoiseGradientConfig& configuration); FastNoiseGradientComponent() = default; - ////////////////////////////////////////////////////////////////////////// - // AZ::Component interface implementation + // AZ::Component overrides... void Activate() override; void Deactivate() override; bool ReadInConfig(const AZ::ComponentConfig* baseConfig) override; bool WriteOutConfig(AZ::ComponentConfig* outBaseConfig) const override; - ////////////////////////////////////////////////////////////////////////// - // GradientRequestBus + // GradientRequestBus overrides... float GetValue(const GradientSignal::GradientSampleParams& sampleParams) const override; protected: FastNoiseGradientConfig m_configuration; FastNoise m_generator; + GradientSignal::GradientTransform m_gradientTransform; + mutable AZStd::shared_mutex m_transformMutex; - ///////////////////////////////////////////////////////////////////////// - // FastNoiseGradientRequest overrides + // GradientTransformNotificationBus overrides... + void OnGradientTransformChanged(const GradientSignal::GradientTransform& newTransform) override; + + // FastNoiseGradientRequest overrides... int GetRandomSeed() const override; void SetRandomSeed(int seed) override; diff --git a/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp b/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp index 620f538c71..f0d5a9d1bd 100644 --- a/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp +++ b/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp @@ -46,17 +46,10 @@ public: //////////////////////////////////////////////////////////////////////////// //// GradientTransformRequestBus - void TransformPositionToUVW([[maybe_unused]] const AZ::Vector3& inPosition, [[maybe_unused]] AZ::Vector3& outUVW, [[maybe_unused]] bool& wasPointRejected) const override {} - void TransformPositionToUVWNormalized( - [[maybe_unused]] const AZ::Vector3& inPosition, - [[maybe_unused]] AZ::Vector3& outUVW, - [[maybe_unused]] bool& wasPointRejected) const override + const GradientSignal::GradientTransform& GetGradientTransform() const override { + return m_gradientTransform; } - void GetGradientLocalBounds([[maybe_unused]] AZ::Aabb& bounds) const override - { - } - void GetGradientEncompassingBounds([[maybe_unused]] AZ::Aabb& bounds) const override {} ////////////////////////////////////////////////////////////////////////// // GradientTransformModifierRequestBus @@ -104,6 +97,8 @@ public: bool GetAdvancedMode() const override { return false; } void SetAdvancedMode([[maybe_unused]] bool value) override {} + + GradientSignal::GradientTransform m_gradientTransform; }; TEST(FastNoiseTest, ComponentsWithComponentApplication) diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformRequestBus.h b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformRequestBus.h index ac2f1a9cb1..3b674d0bd5 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformRequestBus.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformRequestBus.h @@ -11,6 +11,7 @@ #include #include #include +#include namespace GradientSignal { @@ -22,16 +23,56 @@ namespace GradientSignal static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; using BusIdType = AZ::EntityId; - //! allows multiple threads to call shape requests + //! allows multiple threads to call gradient transform requests using MutexType = AZStd::recursive_mutex; virtual ~GradientTransformRequests() = default; - virtual void TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const = 0; - virtual void TransformPositionToUVWNormalized(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const = 0; - virtual void GetGradientLocalBounds(AZ::Aabb& bounds) const = 0; - virtual void GetGradientEncompassingBounds(AZ::Aabb& bounds) const = 0; + //! Get the GradientTransform that's been configured by the bus listener. + //! \return the GradientTransform instance that can be used to transform world points into gradient lookup space. + virtual const GradientTransform& GetGradientTransform() const = 0; }; using GradientTransformRequestBus = AZ::EBus; + + /** + * Notifies about changes to the GradientTransform configuration + */ + class GradientTransformNotifications + : public AZ::EBusTraits + { + public: + //////////////////////////////////////////////////////////////////////// + // EBusTraits + static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; + using BusIdType = AZ::EntityId; + using MutexType = AZStd::recursive_mutex; + //////////////////////////////////////////////////////////////////////// + + //! Notify listeners that the GradientTransform configuration has changed. + //! \return the GradientTransform instance that can be used to transform world points into gradient lookup space. + virtual void OnGradientTransformChanged(const GradientTransform& newTransform) = 0; + + //! Connection policy that auto-calls OnGradientTransformChanged on connection with the current GradientTransform data. + template + struct ConnectionPolicy : public AZ::EBusConnectionPolicy + { + static void Connect( + typename Bus::BusPtr& busPtr, + typename Bus::Context& context, + typename Bus::HandlerNode& handler, + typename Bus::Context::ConnectLockGuard& connectLock, + const typename Bus::BusIdType& id = 0) + { + AZ::EBusConnectionPolicy::Connect(busPtr, context, handler, connectLock, id); + + GradientTransform transform; + GradientTransformRequestBus::EventResult(transform, id, &GradientTransformRequests::GetGradientTransform); + handler->OnGradientTransformChanged(transform); + } + }; + }; + + using GradientTransformNotificationBus = AZ::EBus; + } //namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/GradientTransform.h b/Gems/GradientSignal/Code/Include/GradientSignal/GradientTransform.h index c8073c2f4f..b191ea245a 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/GradientTransform.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/GradientTransform.h @@ -111,7 +111,6 @@ namespace GradientSignal private: //! These are the various transformations that will be performed, based on wrapping type. - using WrappingTransformFunction = AZStd::function; static AZ::Vector3 NoTransform(const AZ::Vector3& point, const AZ::Aabb& bounds); static AZ::Vector3 GetUnboundedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); static AZ::Vector3 GetClampedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); @@ -144,7 +143,6 @@ namespace GradientSignal //! How the gradient should repeat itself outside of the shape bounds. WrappingType m_wrappingType = WrappingType::None; - WrappingTransformFunction m_wrappingTransform = NoTransform; /** * Cached reciprocal for performing an inverse lerp back to shape bounds. diff --git a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp index 8cd7dc56a1..5b2ce4d4cf 100644 --- a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp @@ -276,24 +276,29 @@ namespace GradientSignal void GradientTransformComponent::Activate() { + m_dirty = false; + m_gradientTransform = GradientTransform(); + + // Update our GradientTransform to be configured correctly. We don't need to notify dependents of the change though. + // If anyone is listening, they're already getting notified below. + const bool notifyDependentsOfChange = false; + UpdateFromShape(notifyDependentsOfChange); + GradientTransformRequestBus::Handler::BusConnect(GetEntityId()); LmbrCentral::DependencyNotificationBus::Handler::BusConnect(GetEntityId()); AZ::TickBus::Handler::BusConnect(); GradientTransformModifierRequestBus::Handler::BusConnect(GetEntityId()); - m_dirty = false; - m_dependencyMonitor.Reset(); m_dependencyMonitor.ConnectOwner(GetEntityId()); m_dependencyMonitor.ConnectDependency(GetEntityId()); m_dependencyMonitor.ConnectDependency(GetShapeEntityId()); - - UpdateFromShape(); } void GradientTransformComponent::Deactivate() { m_dirty = false; + m_gradientTransform = GradientTransform(); m_dependencyMonitor.Reset(); GradientTransformRequestBus::Handler::BusDisconnect(); @@ -322,28 +327,10 @@ namespace GradientSignal return false; } - void GradientTransformComponent::TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const + const GradientTransform& GradientTransformComponent::GetGradientTransform() const { AZStd::lock_guard lock(m_cacheMutex); - m_gradientTransform.TransformPositionToUVW(inPosition, outUVW, wasPointRejected); - } - - void GradientTransformComponent::TransformPositionToUVWNormalized( - const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const - { - AZStd::lock_guard lock(m_cacheMutex); - m_gradientTransform.TransformPositionToUVWNormalized(inPosition, outUVW, wasPointRejected); - } - - void GradientTransformComponent::GetGradientLocalBounds(AZ::Aabb& bounds) const - { - bounds = m_shapeBounds; - } - - void GradientTransformComponent::GetGradientEncompassingBounds(AZ::Aabb& bounds) const - { - bounds = m_shapeBounds; - bounds.ApplyMatrix3x4(m_shapeTransformInverse.GetInverseFull()); + return m_gradientTransform; } void GradientTransformComponent::OnCompositionChanged() @@ -355,25 +342,16 @@ namespace GradientSignal { if (m_dirty) { - const auto configurationOld = m_configuration; - const auto shapeBoundsOld = m_shapeBounds; - const auto shapeTransformInverseOld = m_shapeTransformInverse; - - //updating on tick to query transform bus on main thread - UpdateFromShape(); + // Updating on tick to query transform bus on main thread. + // Also, if the GradientTransform configuration changes, notify listeners so they can refresh themselves. + const bool notifyDependentsOfChange = true; + UpdateFromShape(notifyDependentsOfChange); - //notify observers if content has changed - if (configurationOld != m_configuration || - shapeBoundsOld != m_shapeBounds || - shapeTransformInverseOld != m_shapeTransformInverse) - { - LmbrCentral::DependencyNotificationBus::Event(GetEntityId(), &LmbrCentral::DependencyNotificationBus::Events::OnCompositionChanged); - } m_dirty = false; } } - void GradientTransformComponent::UpdateFromShape() + void GradientTransformComponent::UpdateFromShape(bool notifyDependentsOfChange) { AZ_PROFILE_FUNCTION(Entity); @@ -385,6 +363,10 @@ namespace GradientSignal return; } + const GradientTransform oldGradientTransform = m_gradientTransform; + AZ::Aabb shapeBounds = AZ::Aabb::CreateNull(); + AZ::Matrix3x4 shapeTransformInverse = AZ::Matrix3x4::CreateIdentity(); + AZ::Transform shapeTransform = AZ::Transform::CreateIdentity(); switch (m_configuration.m_transformType) { @@ -428,10 +410,10 @@ namespace GradientSignal if (!m_configuration.m_advancedMode || !m_configuration.m_overrideBounds) { // If we have a shape reference, grab its local space bounds and (inverse) transform into that local space - GetObbParamsFromShape(shapeReference, m_shapeBounds, m_shapeTransformInverse); - if (m_shapeBounds.IsValid()) + GetObbParamsFromShape(shapeReference, shapeBounds, shapeTransformInverse); + if (shapeBounds.IsValid()) { - m_configuration.m_bounds = m_shapeBounds.GetExtents(); + m_configuration.m_bounds = shapeBounds.GetExtents(); } } @@ -453,19 +435,34 @@ namespace GradientSignal //rebuild bounds from parameters m_configuration.m_bounds = m_configuration.m_bounds.GetAbs(); - m_shapeBounds = AZ::Aabb::CreateFromMinMax(-m_configuration.m_bounds * 0.5f, m_configuration.m_bounds * 0.5f); + shapeBounds = AZ::Aabb::CreateFromMinMax(-m_configuration.m_bounds * 0.5f, m_configuration.m_bounds * 0.5f); //rebuild transform from parameters AZ::Matrix3x4 shapeTransformFinal; shapeTransformFinal.SetFromEulerDegrees(m_configuration.m_rotate); shapeTransformFinal.SetTranslation(m_configuration.m_translate); shapeTransformFinal.MultiplyByScale(m_configuration.m_scale); - m_shapeTransformInverse = shapeTransformFinal.GetInverseFull(); + shapeTransformInverse = shapeTransformFinal.GetInverseFull(); // Set everything up on the Gradient Transform const bool use3dGradients = m_configuration.m_advancedMode && m_configuration.m_is3d; m_gradientTransform = GradientTransform( - m_shapeBounds, shapeTransformFinal, use3dGradients, m_configuration.m_frequencyZoom, m_configuration.m_wrappingType); + shapeBounds, shapeTransformFinal, use3dGradients, m_configuration.m_frequencyZoom, m_configuration.m_wrappingType); + + // If the transform has changed, send out notifications. + if (oldGradientTransform != m_gradientTransform) + { + // Always notify on the GradientTransformNotificationBus. + GradientTransformNotificationBus::Event( + GetEntityId(), &GradientTransformNotificationBus::Events::OnGradientTransformChanged, m_gradientTransform); + + // Only notify the DependencyNotificationBus when requested by the caller. + if (notifyDependentsOfChange) + { + LmbrCentral::DependencyNotificationBus::Event( + GetEntityId(), &LmbrCentral::DependencyNotificationBus::Events::OnCompositionChanged); + } + } } AZ::EntityId GradientTransformComponent::GetShapeEntityId() const diff --git a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h index 50ae6fe475..805fba9e74 100644 --- a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h +++ b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h @@ -101,10 +101,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientTransformRequestBus - void TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const override; - void TransformPositionToUVWNormalized(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const override; - void GetGradientLocalBounds(AZ::Aabb& bounds) const override; - void GetGradientEncompassingBounds(AZ::Aabb& bounds) const override; + const GradientTransform& GetGradientTransform() const override; ////////////////////////////////////////////////////////////////////////// // DependencyNotificationBus @@ -114,7 +111,7 @@ namespace GradientSignal // AZ::TickBus::Handler void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; - void UpdateFromShape(); + void UpdateFromShape(bool notifyDependentsOfChange); AZ::EntityId GetShapeEntityId() const; @@ -169,8 +166,6 @@ namespace GradientSignal private: mutable AZStd::recursive_mutex m_cacheMutex; GradientTransformConfig m_configuration; - AZ::Aabb m_shapeBounds = AZ::Aabb::CreateNull(); - AZ::Matrix3x4 m_shapeTransformInverse = AZ::Matrix3x4::CreateIdentity(); LmbrCentral::DependencyMonitor m_dependencyMonitor; AZStd::atomic_bool m_dirty{ false }; GradientTransform m_gradientTransform; diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp index 2d594a201c..4bf709755b 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp @@ -129,6 +129,9 @@ namespace GradientSignal void ImageGradientComponent::Activate() { + // This will immediately call OnGradientTransformChanged and initialize m_gradientTransform. + GradientTransformNotificationBus::Handler::BusConnect(GetEntityId()); + SetupDependencies(); ImageGradientRequestBus::Handler::BusConnect(GetEntityId()); @@ -144,6 +147,7 @@ namespace GradientSignal AZ::Data::AssetBus::Handler::BusDisconnect(); GradientRequestBus::Handler::BusDisconnect(); ImageGradientRequestBus::Handler::BusDisconnect(); + GradientTransformNotificationBus::Handler::BusDisconnect(); m_dependencyMonitor.Reset(); @@ -189,18 +193,27 @@ namespace GradientSignal m_configuration.m_imageAsset = asset; } + void ImageGradientComponent::OnGradientTransformChanged(const GradientTransform& newTransform) + { + AZStd::unique_lock lock(m_imageMutex); + m_gradientTransform = newTransform; + } + float ImageGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { AZ::Vector3 uvw = sampleParams.m_position; - bool wasPointRejected = false; - GradientTransformRequestBus::Event( - GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVWNormalized, sampleParams.m_position, uvw, wasPointRejected); - if (!wasPointRejected) { AZStd::shared_lock imageLock(m_imageMutex); - return GetValueFromImageAsset(m_configuration.m_imageAsset, uvw, m_configuration.m_tilingX, m_configuration.m_tilingY, 0.0f); + + m_gradientTransform.TransformPositionToUVWNormalized(sampleParams.m_position, uvw, wasPointRejected); + + if (!wasPointRejected) + { + return GetValueFromImageAsset( + m_configuration.m_imageAsset, uvw, m_configuration.m_tilingX, m_configuration.m_tilingY, 0.0f); + } } return 0.0f; diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h index e73c8d0c4a..8214436f83 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -46,6 +47,7 @@ namespace GradientSignal , private AZ::Data::AssetBus::Handler , private GradientRequestBus::Handler , private ImageGradientRequestBus::Handler + , private GradientTransformNotificationBus::Handler { public: template friend class LmbrCentral::EditorWrappedComponentBase; @@ -59,29 +61,27 @@ namespace GradientSignal ImageGradientComponent() = default; ~ImageGradientComponent() = default; - ////////////////////////////////////////////////////////////////////////// - // AZ::Component interface implementation + // AZ::Component overrides... void Activate() override; void Deactivate() override; bool ReadInConfig(const AZ::ComponentConfig* baseConfig) override; bool WriteOutConfig(AZ::ComponentConfig* outBaseConfig) const override; - ////////////////////////////////////////////////////////////////////////// - // GradientRequestBus + // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; - ////////////////////////////////////////////////////////////////////////// - // AZ::Data::AssetBus::Handler + // AZ::Data::AssetBus overrides... void OnAssetReady(AZ::Data::Asset asset) override; void OnAssetMoved(AZ::Data::Asset asset, void* oldDataPointer) override; void OnAssetReloaded(AZ::Data::Asset asset) override; protected: + // GradientTransformNotificationBus overrides... + void OnGradientTransformChanged(const GradientTransform& newTransform) override; void SetupDependencies(); - ////////////////////////////////////////////////////////////////////////// - // ImageGradientRequestBus + // ImageGradientRequestBus overrides... AZStd::string GetImageAssetPath() const override; void SetImageAssetPath(const AZStd::string& assetPath) override; @@ -95,5 +95,6 @@ namespace GradientSignal ImageGradientConfig m_configuration; LmbrCentral::DependencyMonitor m_dependencyMonitor; mutable AZStd::shared_mutex m_imageMutex; + GradientTransform m_gradientTransform; }; } diff --git a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp index d5e846b9ef..8f9d40387b 100644 --- a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp @@ -138,6 +138,9 @@ namespace GradientSignal void PerlinGradientComponent::Activate() { + // This will immediately call OnGradientTransformChanged and initialize m_gradientTransform. + GradientTransformNotificationBus::Handler::BusConnect(GetEntityId()); + m_perlinImprovedNoise.reset(aznew PerlinImprovedNoise(AZ::GetMax(m_configuration.m_randomSeed, 1))); GradientRequestBus::Handler::BusConnect(GetEntityId()); PerlinGradientRequestBus::Handler::BusConnect(GetEntityId()); @@ -148,6 +151,7 @@ namespace GradientSignal m_perlinImprovedNoise.reset(); GradientRequestBus::Handler::BusDisconnect(); PerlinGradientRequestBus::Handler::BusDisconnect(); + GradientTransformNotificationBus::Handler::BusDisconnect(); } bool PerlinGradientComponent::ReadInConfig(const AZ::ComponentConfig* baseConfig) @@ -170,21 +174,29 @@ namespace GradientSignal return false; } - float PerlinGradientComponent::GetValue(const GradientSampleParams& sampleParams) const + void PerlinGradientComponent::OnGradientTransformChanged(const GradientTransform& newTransform) { - AZ_PROFILE_FUNCTION(Entity); + AZStd::unique_lock lock(m_transformMutex); + m_gradientTransform = newTransform; + } + float PerlinGradientComponent::GetValue(const GradientSampleParams& sampleParams) const + { if (m_perlinImprovedNoise) { AZ::Vector3 uvw = sampleParams.m_position; - bool wasPointRejected = false; - GradientTransformRequestBus::Event( - GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, wasPointRejected); + + { + AZStd::shared_lock lock(m_transformMutex); + m_gradientTransform.TransformPositionToUVW(sampleParams.m_position, uvw, wasPointRejected); + } if (!wasPointRejected) { - return m_perlinImprovedNoise->GenerateOctaveNoise(uvw.GetX(), uvw.GetY(), uvw.GetZ(), m_configuration.m_octave, m_configuration.m_amplitude, m_configuration.m_frequency); + return m_perlinImprovedNoise->GenerateOctaveNoise( + uvw.GetX(), uvw.GetY(), uvw.GetZ(), m_configuration.m_octave, m_configuration.m_amplitude, + m_configuration.m_frequency); } } diff --git a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.h b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.h index 9fda45c716..ef171f5319 100644 --- a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -47,6 +48,7 @@ namespace GradientSignal : public AZ::Component , private GradientRequestBus::Handler , private PerlinGradientRequestBus::Handler + , private GradientTransformNotificationBus::Handler { public: template friend class LmbrCentral::EditorWrappedComponentBase; @@ -60,23 +62,25 @@ namespace GradientSignal PerlinGradientComponent() = default; ~PerlinGradientComponent() = default; - ////////////////////////////////////////////////////////////////////////// - // AZ::Component interface implementation + // AZ::Component overrides... void Activate() override; void Deactivate() override; bool ReadInConfig(const AZ::ComponentConfig* baseConfig) override; bool WriteOutConfig(AZ::ComponentConfig* outBaseConfig) const override; - ////////////////////////////////////////////////////////////////////////// - // GradientRequestBus + // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; private: PerlinGradientConfig m_configuration; AZStd::unique_ptr m_perlinImprovedNoise; + GradientTransform m_gradientTransform; + mutable AZStd::shared_mutex m_transformMutex; - ///////////////////////////////////////////////////////////////////////// - //PerlinGradientRequest overrides + // GradientTransformNotificationBus overrides... + void OnGradientTransformChanged(const GradientTransform& newTransform) override; + + // PerlinGradientRequestBus overrides... int GetRandomSeed() const override; void SetRandomSeed(int seed) override; diff --git a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp index d320dbeb3d..fc2ccbef70 100644 --- a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp @@ -105,6 +105,9 @@ namespace GradientSignal void RandomGradientComponent::Activate() { + // This will immediately call OnGradientTransformChanged and initialize m_gradientTransform. + GradientTransformNotificationBus::Handler::BusConnect(GetEntityId()); + GradientRequestBus::Handler::BusConnect(GetEntityId()); RandomGradientRequestBus::Handler::BusConnect(GetEntityId()); } @@ -113,6 +116,7 @@ namespace GradientSignal { GradientRequestBus::Handler::BusDisconnect(); RandomGradientRequestBus::Handler::BusDisconnect(); + GradientTransformNotificationBus::Handler::BusDisconnect(); } bool RandomGradientComponent::ReadInConfig(const AZ::ComponentConfig* baseConfig) @@ -135,15 +139,22 @@ namespace GradientSignal return false; } + void RandomGradientComponent::OnGradientTransformChanged(const GradientTransform& newTransform) + { + AZStd::unique_lock lock(m_transformMutex); + m_gradientTransform = newTransform; + } + float RandomGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(Entity); AZ::Vector3 uvw = sampleParams.m_position; - bool wasPointRejected = false; - GradientTransformRequestBus::Event( - GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, wasPointRejected); + + { + AZStd::shared_lock lock(m_transformMutex); + m_gradientTransform.TransformPositionToUVW(sampleParams.m_position, uvw, wasPointRejected); + } if (!wasPointRejected) { diff --git a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.h b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.h index 299b9dadfe..b0dbd964a0 100644 --- a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.h @@ -10,6 +10,7 @@ #include #include +#include #include namespace LmbrCentral @@ -38,6 +39,7 @@ namespace GradientSignal : public AZ::Component , private GradientRequestBus::Handler , private RandomGradientRequestBus::Handler + , private GradientTransformNotificationBus::Handler { public: template friend class LmbrCentral::EditorWrappedComponentBase; @@ -51,22 +53,24 @@ namespace GradientSignal RandomGradientComponent() = default; ~RandomGradientComponent() = default; - ////////////////////////////////////////////////////////////////////////// - // AZ::Component interface implementation + // AZ::Component overrides... void Activate() override; void Deactivate() override; bool ReadInConfig(const AZ::ComponentConfig* baseConfig) override; bool WriteOutConfig(AZ::ComponentConfig* outBaseConfig) const override; - ////////////////////////////////////////////////////////////////////////// - // GradientRequestBus + // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; private: RandomGradientConfig m_configuration; + GradientTransform m_gradientTransform; + mutable AZStd::shared_mutex m_transformMutex; - ///////////////////////////////////////////////////////////////////////// - // RandomGradientRequest overrides + // GradientTransformNotificationBus overrides... + void OnGradientTransformChanged(const GradientTransform& newTransform) override; + + // RandomGradientRequestBus overrides... int GetRandomSeed() const override; void SetRandomSeed(int seed) override; }; diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorGradientTransformComponent.cpp b/Gems/GradientSignal/Code/Source/Editor/EditorGradientTransformComponent.cpp index 4517c30711..850faf19df 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorGradientTransformComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Editor/EditorGradientTransformComponent.cpp @@ -55,9 +55,13 @@ namespace GradientSignal void EditorGradientTransformComponent::UpdateFromShape() { - // Update config from shape on game component, copy that back to our config - m_component.UpdateFromShape(); - m_component.WriteOutConfig(&m_configuration); - SetDirty(); + if (m_runtimeComponentActive) + { + // Update config from shape on game component, copy that back to our config. + bool notifyDependentsOfChange = true; + m_component.UpdateFromShape(notifyDependentsOfChange); + m_component.WriteOutConfig(&m_configuration); + SetDirty(); + } } } //namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/GradientTransform.cpp b/Gems/GradientSignal/Code/Source/GradientTransform.cpp index acf9e2f150..ffaa8f7e6a 100644 --- a/Gems/GradientSignal/Code/Source/GradientTransform.cpp +++ b/Gems/GradientSignal/Code/Source/GradientTransform.cpp @@ -20,7 +20,6 @@ namespace GradientSignal , m_inverseTransform(transform.GetInverseFull()) , m_frequencyZoom(frequencyZoom) , m_wrappingType(wrappingType) - , m_wrappingTransform(NoTransform) , m_alwaysAcceptPoint(true) { // If we want this to be a 2D gradient lookup, we always want to set the W result in the output to 0. @@ -30,31 +29,17 @@ namespace GradientSignal m_inverseTransform.SetRow(2, AZ::Vector4::CreateZero()); } - // Set up the appropriate wrapping transform function for the the given wrapping type. - // Also note that ClampToZero is the only wrapping type that allows us to return a "pointIsRejected" result - // for points that fall outside the shape bounds. - if (m_shapeBounds.IsValid()) + // If we have invalid shape bounds, reset the wrapping type back to None. Wrapping won't work without valid bounds. + if (!m_shapeBounds.IsValid()) { - switch (wrappingType) - { - default: - case WrappingType::None: - m_wrappingTransform = GetUnboundedPointInAabb; - break; - case WrappingType::ClampToEdge: - m_wrappingTransform = GetClampedPointInAabb; - break; - case WrappingType::ClampToZero: - m_alwaysAcceptPoint = false; - m_wrappingTransform = GetClampedPointInAabb; - break; - case WrappingType::Mirror: - m_wrappingTransform = GetMirroredPointInAabb; - break; - case WrappingType::Repeat: - m_wrappingTransform = GetWrappedPointInAabb; - break; - } + m_wrappingType = WrappingType::None; + } + + // ClampToZero is the only wrapping type that allows us to return a "pointIsRejected" result for points that fall + // outside the shape bounds. + if (m_wrappingType == WrappingType::ClampToZero) + { + m_alwaysAcceptPoint = false; } m_normalizeExtentsReciprocal = AZ::Vector3( @@ -76,7 +61,26 @@ namespace GradientSignal (outUVW.IsGreaterEqualThan(m_shapeBounds.GetMin()) && outUVW.IsLessThan(m_shapeBounds.GetMax())); wasPointRejected = !wasPointAccepted; - outUVW = m_wrappingTransform(outUVW, m_shapeBounds); + switch (m_wrappingType) + { + default: + case WrappingType::None: + outUVW = GetUnboundedPointInAabb(outUVW, m_shapeBounds); + break; + case WrappingType::ClampToEdge: + outUVW = GetClampedPointInAabb(outUVW, m_shapeBounds); + break; + case WrappingType::ClampToZero: + outUVW = GetClampedPointInAabb(outUVW, m_shapeBounds); + break; + case WrappingType::Mirror: + outUVW = GetMirroredPointInAabb(outUVW, m_shapeBounds); + break; + case WrappingType::Repeat: + outUVW = GetWrappedPointInAabb(outUVW, m_shapeBounds); + break; + } + outUVW *= m_frequencyZoom; } @@ -121,7 +125,7 @@ namespace GradientSignal * [min, max) : value * [max, min) : max - value - epsilon * ... - * The epsilon is because we always want to keep our output values in the [min, max) range. We apply the epsilon to all + * The epsilon is because we always want to keep our output values in the [min, max) range. We apply the epsilon to all * the mirrored values so that we get consistent spacing between the values. */ diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp index 1299403659..8c2c0e80b6 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp @@ -255,6 +255,8 @@ namespace Terrain void TerrainPhysicsColliderComponent::GenerateHeightsInBounds(AZStd::vector& heights) const { + AZ_PROFILE_FUNCTION(Entity); + const AZ::Vector2 gridResolution = GetHeightfieldGridSpacing(); AZ::Aabb worldSize = GetHeightfieldAabb(); @@ -315,6 +317,8 @@ namespace Terrain void TerrainPhysicsColliderComponent::GenerateHeightsAndMaterialsInBounds( AZStd::vector& heightMaterials) const { + AZ_PROFILE_FUNCTION(Entity); + const AZ::Vector2 gridResolution = GetHeightfieldGridSpacing(); AZ::Aabb worldSize = GetHeightfieldAabb(); diff --git a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp index 1b2dedd469..7c8b6021af 100644 --- a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp +++ b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp @@ -105,11 +105,13 @@ void TerrainSystem::Activate() void TerrainSystem::Deactivate() { + // Stop listening to the bus even before we signal DestroyBegin so that way any calls to the terrain system as a *result* of + // calling DestroyBegin will fail to reach the terrain system. + AzFramework::Terrain::TerrainDataRequestBus::Handler::BusDisconnect(); + AzFramework::Terrain::TerrainDataNotificationBus::Broadcast( &AzFramework::Terrain::TerrainDataNotificationBus::Events::OnTerrainDataDestroyBegin); - AzFramework::Terrain::TerrainDataRequestBus::Handler::BusDisconnect(); - { AZStd::unique_lock lock(m_areaMutex); m_registeredAreas.clear(); From 8cd4a3dceda4654bdb9741d9b7a0c75e84309de4 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Thu, 30 Dec 2021 12:50:06 -0800 Subject: [PATCH 216/399] Fix netbind component to use the new svg icons instead of png (which no longer exist) Signed-off-by: Gene Walters --- Gems/Multiplayer/Code/Source/Components/NetBindComponent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/Multiplayer/Code/Source/Components/NetBindComponent.cpp b/Gems/Multiplayer/Code/Source/Components/NetBindComponent.cpp index e7cf297f1e..beb17ed9f6 100644 --- a/Gems/Multiplayer/Code/Source/Components/NetBindComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Components/NetBindComponent.cpp @@ -39,8 +39,8 @@ namespace Multiplayer "Network Binding", "The Network Binding component marks an entity as able to be replicated across the network") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->Attribute(AZ::Edit::Attributes::Category, "Multiplayer") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/Components/NetBind.png") - ->Attribute(AZ::Edit::Attributes::ViewportIcon, "Icons/Components/Viewport/NetBind.png") + ->Attribute(AZ::Edit::Attributes::Icon, "Icons/Components/NetBinding.svg") + ->Attribute(AZ::Edit::Attributes::ViewportIcon, "Icons/Components/Viewport/NetBinding.svg") ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("Game")); } } From 955a6db374f851e31c920b1d2e017fc315565330 Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Thu, 30 Dec 2021 15:56:27 -0600 Subject: [PATCH 217/399] Converting Editor automated tests to utilize prefab system Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../hydra_editor_utils.py | 13 +++++-- .../AssetBrowser_SearchFiltering.py | 5 ++- .../AssetBrowser_TreeNavigation.py | 4 +-- .../editor/EditorScripts/AssetPicker_UI_UX.py | 3 +- ...flows_ExistingLevel_EntityComponentCRUD.py | 6 ++-- ...ditorWorkflows_LevelEntityComponentCRUD.py | 30 +++++++--------- .../ComponentCRUD_Add_Delete_Components.py | 6 ++-- .../EditorScripts/Docking_BasicDockedTools.py | 13 ++++--- .../EntityOutliner_EntityOrdering.py | 11 +++--- .../InputBindings_Add_Remove_Input_Events.py | 5 ++- .../EditorScripts/Menus_EditMenuOptions.py | 5 ++- .../EditorScripts/Menus_FileMenuOptions.py | 12 +++---- .../EditorScripts/Menus_ViewMenuOptions.py | 5 ++- .../Gem/PythonTests/editor/TestSuite_Main.py | 20 +++++------ .../editor/TestSuite_Main_Optimized.py | 33 +++++++++-------- .../PythonTests/editor/TestSuite_Periodic.py | 35 +++++++++++-------- .../PythonTests/editor/TestSuite_Sandbox.py | 4 +-- .../editor/TestSuite_Sandbox_Optimized.py | 2 -- 18 files changed, 105 insertions(+), 107 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py index 5e3828ad02..36fc6003f7 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py @@ -5,15 +5,22 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ +from typing import List +from math import isclose +import collections.abc + import azlmbr.bus as bus import azlmbr.editor as editor import azlmbr.entity as entity import azlmbr.legacy.general as general import azlmbr.object -from typing import List -from math import isclose -import collections.abc +from editor_python_test_tools.utils import TestHelper as helper + + +def open_base_level(): + helper.init_idle() + helper.open_level("Prefab", "Base") def find_entity_by_name(entity_name): diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py index 7366faafdc..254224a2f8 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py @@ -59,8 +59,8 @@ def AssetBrowser_SearchFiltering(): import azlmbr.legacy.general as general + import editor_python_test_tools.hydra_editor_utils as hydra from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper def verify_files_appeared(model, allowed_asset_extensions, parent_index=QtCore.QModelIndex()): indexes = [parent_index] @@ -80,8 +80,7 @@ def AssetBrowser_SearchFiltering(): return True # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Open Asset Browser (if not opened already) editor_window = pyside_utils.get_editor_main_window() diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py index ecc77778cc..52072205b5 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py @@ -53,6 +53,7 @@ def AssetBrowser_TreeNavigation(): import azlmbr.legacy.general as general import editor_python_test_tools.pyside_utils as pyside_utils + import editor_python_test_tools.hydra_editor_utils as hydra from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -69,8 +70,7 @@ def AssetBrowser_TreeNavigation(): file_path = ("AutomatedTesting", "Assets", "ImageGradients", "image_grad_test_gsi.png") # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Open Asset Browser (if not opened already) editor_window = pyside_utils.get_editor_main_window() diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetPicker_UI_UX.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetPicker_UI_UX.py index 59a78c9e5d..047d6edf41 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetPicker_UI_UX.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetPicker_UI_UX.py @@ -215,8 +215,7 @@ def AssetPicker_UI_UX(): QtTest.QTest.keyClick(tree, Qt.Key_Enter, Qt.NoModifier) # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Create entity and add Mesh component entity_position = math.Vector3(125.0, 136.0, 32.0) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD.py index 39cacf9af5..48b7d2b176 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD.py @@ -56,19 +56,17 @@ def BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(): 06. delete parent entity """ + import editor_python_test_tools.hydra_editor_utils as hydra from editor_python_test_tools.utils import Report from editor_python_test_tools.editor_entity_utils import EditorEntity import azlmbr.bus as bus import azlmbr.editor as editor import azlmbr.entity as entity - import azlmbr.legacy.general as general import azlmbr.object # 01. load an existing level - test_level = 'Simple' - general.open_level_no_prompt(test_level) - Report.result(Tests.load_level, general.get_current_level_name() == test_level) + hydra.open_base_level() # 02. create parent entity and set name # Delete any exiting entity and Create a new Entity at the root level diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_LevelEntityComponentCRUD.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_LevelEntityComponentCRUD.py index 9c5880ab1e..f13b924e30 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_LevelEntityComponentCRUD.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_LevelEntityComponentCRUD.py @@ -31,7 +31,7 @@ class Tests: "Component removed from entity successfully", "Failed to remove component from entity" ) - level_saved_and_exported = ( + saved_and_exported = ( "Level saved and exported successfully", "Failed to save/export level" ) @@ -52,8 +52,7 @@ def BasicEditorWorkflows_LevelEntityComponentCRUD(): - A new entity can be created - Entity hierarchy can be adjusted - Components can be added/removed/updated - - Level can be saved - - Level can be exported + - Level can be saved/exported Note: - This test file must be called from the O3DE Editor command terminal @@ -70,7 +69,7 @@ def BasicEditorWorkflows_LevelEntityComponentCRUD(): import azlmbr.editor as editor import azlmbr.entity as entity import azlmbr.math as math - import azlmbr.paths + import azlmbr.paths as paths import editor_python_test_tools.hydra_editor_utils as hydra from editor_python_test_tools.utils import Report @@ -84,7 +83,7 @@ def BasicEditorWorkflows_LevelEntityComponentCRUD(): return None # 1) Create a new level - level = "tmp_level" + lvl_name = "tmp_level" editor_window = pyside_utils.get_editor_main_window() new_level_action = pyside_utils.get_action_for_menu_path(editor_window, "File", "New Level") pyside_utils.trigger_action_async(new_level_action) @@ -95,23 +94,24 @@ def BasicEditorWorkflows_LevelEntityComponentCRUD(): Report.info("New Level dialog opened") grp_box = new_level_dlg.findChild(QtWidgets.QGroupBox, "STATIC_GROUP1") level_name = grp_box.findChild(QtWidgets.QLineEdit, "LEVEL") - level_name.setText(level) + level_name.setText(lvl_name) button_box = new_level_dlg.findChild(QtWidgets.QDialogButtonBox, "buttonBox") button_box.button(QtWidgets.QDialogButtonBox.Ok).click() # Verify new level was created successfully level_create_success = await pyside_utils.wait_for_condition(lambda: editor.EditorToolsApplicationRequestBus( - bus.Broadcast, "GetCurrentLevelName") == level, 5.0) + bus.Broadcast, "GetCurrentLevelName") == lvl_name, 5.0) Report.critical_result(Tests.level_created, level_create_success) # 2) Delete existing entities, and create and manipulate new entities via Entity Inspector search_filter = azlmbr.entity.SearchFilter() all_entities = entity.SearchBus(azlmbr.bus.Broadcast, "SearchEntities", search_filter) editor.ToolsApplicationRequestBus(bus.Broadcast, "DeleteEntities", all_entities) - entity_outliner_widget = editor_window.findChild(QtWidgets.QWidget, "OutlinerWidgetUI") + entity_outliner_widget = editor_window.findChild(QtWidgets.QWidget, "EntityOutlinerWidgetUI") outliner_object_list = entity_outliner_widget.findChild(QtWidgets.QWidget, "m_objectList_Contents") outliner_tree = outliner_object_list.findChild(QtWidgets.QWidget, "m_objectTree") - await pyside_utils.trigger_context_menu_entry(outliner_tree, "Create entity") + outliner_viewport = outliner_tree.findChild(QtWidgets.QWidget, "qt_scrollarea_viewport") + await pyside_utils.trigger_context_menu_entry(outliner_viewport, "Create entity") # Find the new entity parent_entity_id = find_entity_by_name("Entity1") @@ -153,14 +153,10 @@ def BasicEditorWorkflows_LevelEntityComponentCRUD(): save_level_action = pyside_utils.get_action_for_menu_path(editor_window, "File", "Save") pyside_utils.trigger_action_async(save_level_action) - # 5) Export the level - export_action = pyside_utils.get_action_for_menu_path(editor_window, "Game", "Export to Engine") - pyside_utils.trigger_action_async(export_action) - level_pak_file = os.path.join( - "AutomatedTesting", "Levels", level, "level.pak" - ) - export_success = await pyside_utils.wait_for_condition(lambda: os.path.exists(level_pak_file), 5.0) - Report.result(Tests.level_saved_and_exported, export_success) + # 5) Verify the save/export of the level + level_prefab_path = os.path.join(paths.products, "levels", lvl_name, f"{lvl_name}.spawnable") + success = await pyside_utils.wait_for_condition(lambda: os.path.exists(level_prefab_path), 5.0) + Report.result(Tests.saved_and_exported, success) run_test() diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/ComponentCRUD_Add_Delete_Components.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/ComponentCRUD_Add_Delete_Components.py index 779f1ef953..6772450405 100755 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/ComponentCRUD_Add_Delete_Components.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/ComponentCRUD_Add_Delete_Components.py @@ -63,7 +63,7 @@ def ComponentCRUD_Add_Delete_Components(): :return: None """ - from PySide2 import QtWidgets, QtTest, QtCore + from PySide2 import QtWidgets, QtTest from PySide2.QtCore import Qt import azlmbr.legacy.general as general @@ -74,7 +74,6 @@ def ComponentCRUD_Add_Delete_Components(): import editor_python_test_tools.hydra_editor_utils as hydra from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper async def add_component(component_name): pyside_utils.click_button_async(add_comp_btn) @@ -88,8 +87,7 @@ def ComponentCRUD_Add_Delete_Components(): QtTest.QTest.keyClick(tree, Qt.Key_Enter, Qt.NoModifier) # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Create entity entity_position = math.Vector3(125.0, 136.0, 32.0) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py index 6683fc952a..d83db7d90c 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py @@ -62,12 +62,11 @@ def Docking_BasicDockedTools(): import azlmbr.editor as editor import azlmbr.entity as entity + import editor_python_test_tools.hydra_editor_utils as hydra from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # Make sure the Entity Outliner, Entity Inspector and Console tools are open general.open_pane("Entity Outliner (PREVIEW)") @@ -80,7 +79,7 @@ def Docking_BasicDockedTools(): editor.EditorEntityAPIBus(bus.Event, 'SetName', entity_id, entity_original_name) editor_window = pyside_utils.get_editor_main_window() - entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner (PREVIEW)") + entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner") # 1) Open the tools and dock them together in a floating tabbed widget. # We drag/drop it over the viewport since it doesn't allow docking, so this will undock it @@ -89,7 +88,7 @@ def Docking_BasicDockedTools(): # We need to grab a new reference to the Entity Outliner QDockWidget because when it gets moved # to the floating window, its parent changes so the wrapped intance we had becomes invalid - entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner (PREVIEW)") + entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner") # Dock the Entity Inspector tabbed with the floating Entity Outliner entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector") @@ -106,7 +105,7 @@ def Docking_BasicDockedTools(): # Check to ensure all the tools are parented to the same QStackedWidget def check_all_panes_tabbed(): entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector") - entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner (PREVIEW)") + entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner") console = editor_window.findChild(QtWidgets.QDockWidget, "Console") entity_inspector_parent = entity_inspector.parentWidget() entity_outliner_parent = entity_outliner.parentWidget() @@ -122,7 +121,7 @@ def Docking_BasicDockedTools(): # 2.1,2) Select an Entity in the Entity Outliner. entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector") - entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner (PREVIEW)") + entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner") console = editor_window.findChild(QtWidgets.QDockWidget, "Console") object_tree = entity_outliner.findChild(QtWidgets.QTreeView, "m_objectTree") test_entity_index = pyside_utils.find_child_by_pattern(object_tree, entity_original_name) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/EntityOutliner_EntityOrdering.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/EntityOutliner_EntityOrdering.py index 5fa8130302..fab7984df9 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/EntityOutliner_EntityOrdering.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/EntityOutliner_EntityOrdering.py @@ -30,11 +30,13 @@ def EntityOutliner_EntityOrdering(): 5) Add another new entity, ensure the rest of the order is unchanged """ - import editor_python_test_tools.pyside_utils as pyside_utils + from PySide2 import QtCore + import azlmbr.legacy.general as general + + import editor_python_test_tools.hydra_editor_utils as hydra + import editor_python_test_tools.pyside_utils as pyside_utils from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper - from PySide2 import QtCore, QtWidgets, QtGui, QtTest # Grab the Editor, Entity Outliner, and Outliner Model editor_window = pyside_utils.get_editor_main_window() @@ -110,8 +112,7 @@ def EntityOutliner_EntityOrdering(): expected_order = [] # 1) Open the empty Prefab Base level - helper.init_idle() - helper.open_level("Prefab", "Base") + hydra.open_base_level() # 2) Add 5 entities to the outliner ENTITIES_TO_ADD = 5 diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/InputBindings_Add_Remove_Input_Events.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/InputBindings_Add_Remove_Input_Events.py index f4769dab4d..07c89ff110 100755 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/InputBindings_Add_Remove_Input_Events.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/InputBindings_Add_Remove_Input_Events.py @@ -69,8 +69,8 @@ def InputBindings_Add_Remove_Input_Events(): import azlmbr.legacy.general as general + import editor_python_test_tools.hydra_editor_utils as hydra from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper def open_asset_editor(): general.open_pane("Asset Editor") @@ -81,8 +81,7 @@ def InputBindings_Add_Remove_Input_Events(): return not general.is_pane_visible("Asset Editor") # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Open Asset Editor Report.result(Tests.asset_editor_opened, open_asset_editor()) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py index bd213be293..7d72d76776 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py @@ -26,9 +26,9 @@ def Menus_EditMenuOptions_Work(): :return: None """ + import editor_python_test_tools.hydra_editor_utils as hydra import editor_python_test_tools.pyside_utils as pyside_utils from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper edit_menu_options = [ ("Undo",), @@ -57,8 +57,7 @@ def Menus_EditMenuOptions_Work(): ] # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Interact with Edit Menu options editor_window = pyside_utils.get_editor_main_window() diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py index a3e7611b5e..cade2125e2 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py @@ -26,29 +26,27 @@ def Menus_FileMenuOptions_Work(): :return: None """ + import editor_python_test_tools.hydra_editor_utils as hydra import editor_python_test_tools.pyside_utils as pyside_utils from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper file_menu_options = [ ("New Level",), - ("Open Level",), + #("Open Level",), Temporarily disabled due to https://github.com/o3de/o3de/issues/6605 ("Import",), ("Save",), - ("Save As",), + #("Save As",), Temporarily disabled due to https://github.com/o3de/o3de/issues/6605 ("Save Level Statistics",), ("Edit Project Settings",), - ("Edit Platform Settings",), + #("Edit Platform Settings",), Temporarily disabled due to https://github.com/o3de/o3de/issues/6604 ("New Project",), ("Open Project",), ("Show Log File",), - ("Resave All Slices",), ("Exit",), ] # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Interact with File Menu options editor_window = pyside_utils.get_editor_main_window() diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py index deff2855a0..2d92fdb97c 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py @@ -26,9 +26,9 @@ def Menus_ViewMenuOptions_Work(): :return: None """ + import editor_python_test_tools.hydra_editor_utils as hydra import editor_python_test_tools.pyside_utils as pyside_utils from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper view_menu_options = [ ("Center on Selection",), @@ -45,8 +45,7 @@ def Menus_ViewMenuOptions_Work(): ] # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Interact with View Menu options editor_window = pyside_utils.get_editor_main_window() diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py index c9e91687e0..949aab140d 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py @@ -33,22 +33,20 @@ class TestAutomation(TestAutomationBase): def test_BasicEditorWorkflows_LevelEntityComponentCRUD(self, request, workspace, editor, launcher_platform, remove_test_level): from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False, enable_prefab_system=False) + self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False) @pytest.mark.REQUIRES_gpu def test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(self, request, workspace, editor, launcher_platform, remove_test_level): from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False, - use_null_renderer=False, enable_prefab_system=False) + use_null_renderer=False) - def test_EntityOutlienr_EntityOrdering(self, request, workspace, editor, launcher_platform): + def test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(self, request, workspace, editor, + launcher_platform): + from .EditorScripts import BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD as test_module + self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False) + + def test_EntityOutliner_EntityOrdering(self, request, workspace, editor, launcher_platform): from .EditorScripts import EntityOutliner_EntityOrdering as test_module - self._run_test( - request, - workspace, - editor, - test_module, - batch_mode=False, - autotest_mode=True, - ) + self._run_test(request, workspace, editor, test_module, batch_mode=False) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py index d87fd8625b..7364cd8bc9 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py @@ -12,7 +12,6 @@ import ly_test_tools.environment.file_system as file_system from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite -@pytest.mark.xfail(reason="Optimized tests are experimental, we will enable xfail and monitor them temporarily.") @pytest.mark.SUITE_main @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @pytest.mark.parametrize("project", ["AutomatedTesting"]) @@ -21,8 +20,12 @@ class TestAutomationNoAutoTestMode(EditorTestSuite): # Disable -autotest_mode and -BatchMode. Tests cannot run in -BatchMode due to UI interactions, and these tests # interact with modal dialogs global_extra_cmdline_args = [] - - enable_prefab_system = False + + class test_AssetPicker_UI_UX(EditorSharedTest): + from .EditorScripts import AssetPicker_UI_UX as test_module + + class test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(EditorSingleTest): + from .EditorScripts import BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD as test_module class test_BasicEditorWorkflows_LevelEntityComponentCRUD(EditorSingleTest): # Custom teardown to remove slice asset created during test @@ -45,9 +48,6 @@ class TestAutomationNoAutoTestMode(EditorTestSuite): class test_InputBindings_Add_Remove_Input_Events(EditorSharedTest): from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module - class test_AssetPicker_UI_UX(EditorSharedTest): - from .EditorScripts import AssetPicker_UI_UX as test_module - @pytest.mark.SUITE_main @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @@ -57,23 +57,26 @@ class TestAutomationAutoTestMode(EditorTestSuite): # Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions global_extra_cmdline_args = ["-autotest_mode"] - enable_prefab_system = False + class test_AssetBrowser_SearchFiltering(EditorSharedTest): + from .EditorScripts import AssetBrowser_SearchFiltering as test_module class test_AssetBrowser_TreeNavigation(EditorSharedTest): from .EditorScripts import AssetBrowser_TreeNavigation as test_module - class test_AssetBrowser_SearchFiltering(EditorSharedTest): - from .EditorScripts import AssetBrowser_SearchFiltering as test_module - class test_ComponentCRUD_Add_Delete_Components(EditorSharedTest): from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module - class test_Menus_ViewMenuOptions_Work(EditorSharedTest): - from .EditorScripts import Menus_ViewMenuOptions as test_module + class test_Docking_BasicDockedTools(EditorSharedTest): + from .EditorScripts import Docking_BasicDockedTools as test_module + + class test_EntityOutliner_EntityOrdering(EditorSharedTest): + from .EditorScripts import EntityOutliner_EntityOrdering as test_module + + class test_Menus_EditMenuOptions_Work(EditorSharedTest): + from .EditorScripts import Menus_EditMenuOptions as test_module - @pytest.mark.skip(reason="Times out due to dialogs failing to dismiss: LYN-4208") class test_Menus_FileMenuOptions_Work(EditorSharedTest): from .EditorScripts import Menus_FileMenuOptions as test_module - class test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(EditorSharedTest): - from .EditorScripts import BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD as test_module + class test_Menus_ViewMenuOptions_Work(EditorSharedTest): + from .EditorScripts import Menus_ViewMenuOptions as test_module \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py index 1bd1d7f987..f8a054d517 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py @@ -10,6 +10,7 @@ import pytest import sys import ly_test_tools.environment.file_system as file_system +import ly_test_tools.environment.process_utils as process_utils sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared') from base import TestAutomationBase @@ -25,36 +26,42 @@ def remove_test_level(request, workspace, project): request.addfinalizer(teardown) +@pytest.fixture +def kill_external_tools(request): + def teardown(): + process_utils.kill_processes_named("o3de.exe") + request.addfinalizer(teardown) + + @pytest.mark.SUITE_periodic @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @pytest.mark.parametrize("project", ["AutomatedTesting"]) class TestAutomation(TestAutomationBase): - def test_AssetBrowser_TreeNavigation(self, request, workspace, editor, launcher_platform): - from .EditorScripts import AssetBrowser_TreeNavigation as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False) - def test_AssetBrowser_SearchFiltering(self, request, workspace, editor, launcher_platform): from .EditorScripts import AssetBrowser_SearchFiltering as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False) + self._run_test(request, workspace, editor, test_module, batch_mode=False) + + def test_AssetBrowser_TreeNavigation(self, request, workspace, editor, launcher_platform): + from .EditorScripts import AssetBrowser_TreeNavigation as test_module + self._run_test(request, workspace, editor, test_module, batch_mode=False) def test_AssetPicker_UI_UX(self, request, workspace, editor, launcher_platform): from .EditorScripts import AssetPicker_UI_UX as test_module - self._run_test(request, workspace, editor, test_module, autotest_mode=False, batch_mode=False, enable_prefab_system=False) + self._run_test(request, workspace, editor, test_module, autotest_mode=False, batch_mode=False) def test_ComponentCRUD_Add_Delete_Components(self, request, workspace, editor, launcher_platform): from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False) + self._run_test(request, workspace, editor, test_module, batch_mode=False) def test_InputBindings_Add_Remove_Input_Events(self, request, workspace, editor, launcher_platform): from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False, enable_prefab_system=False) + self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False) + + def test_Menus_FileMenuOptions_Work(self, request, workspace, editor, launcher_platform, kill_external_tools): + from .EditorScripts import Menus_FileMenuOptions as test_module + self._run_test(request, workspace, editor, test_module, batch_mode=False) def test_Menus_ViewMenuOptions_Work(self, request, workspace, editor, launcher_platform): from .EditorScripts import Menus_ViewMenuOptions as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False) - - @pytest.mark.skip(reason="Times out due to dialogs failing to dismiss: LYN-4208") - def test_Menus_FileMenuOptions_Work(self, request, workspace, editor, launcher_platform): - from .EditorScripts import Menus_FileMenuOptions as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False) + self._run_test(request, workspace, editor, test_module, batch_mode=False) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py index 8a56a2dbfd..98a6620d9c 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py @@ -20,8 +20,8 @@ class TestAutomation(TestAutomationBase): def test_Menus_EditMenuOptions_Work(self, request, workspace, editor, launcher_platform): from .EditorScripts import Menus_EditMenuOptions as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False) + self._run_test(request, workspace, editor, test_module, batch_mode=False) def test_Docking_BasicDockedTools(self, request, workspace, editor, launcher_platform): from .EditorScripts import Docking_BasicDockedTools as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False) + self._run_test(request, workspace, editor, test_module, batch_mode=False) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py index ce0d5e43e9..4a472095ae 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py @@ -19,8 +19,6 @@ class TestAutomationAutoTestMode(EditorTestSuite): # Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions global_extra_cmdline_args = ["-autotest_mode"] - enable_prefab_system = False - class test_Docking_BasicDockedTools(EditorSharedTest): from .EditorScripts import Docking_BasicDockedTools as test_module From 79dd65e1ccfdef85747cbc26c8f868b42df060d6 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Mon, 3 Jan 2022 10:20:27 +0100 Subject: [PATCH 218/399] Quaternion shortest equivalent (#6472) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added new helper functions to get the shortest equivalent of the rotation. In case the w component of the quaternion is negative the rotation is > 180° and taking the longer path. The quaternion will be inverted in that case to take the shortest path of rotation. * Added unit test. * Renamed the angle parameter of the CreateRotationX/Y/Z() functions into angleInRadians. Signed-off-by: Benjamin Jillich --- .../Framework/AzCore/AzCore/Math/Quaternion.h | 16 +++++++--- .../AzCore/AzCore/Math/Quaternion.inl | 29 +++++++++++++++---- .../AzCore/Tests/Math/QuaternionTests.cpp | 19 ++++++++++-- 3 files changed, 51 insertions(+), 13 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Math/Quaternion.h b/Code/Framework/AzCore/AzCore/Math/Quaternion.h index 83e8012a62..ad454aab4f 100644 --- a/Code/Framework/AzCore/AzCore/Math/Quaternion.h +++ b/Code/Framework/AzCore/AzCore/Math/Quaternion.h @@ -54,11 +54,11 @@ namespace AZ //! Sets components using a Vector3 for the imaginary part and a float for the real part. static Quaternion CreateFromVector3AndValue(const Vector3& v, float w); - //! Sets the quaternion to be a rotation around a specified axis. + //! Sets the quaternion to be a rotation around a specified axis in radians. //! @{ - static Quaternion CreateRotationX(float angle); - static Quaternion CreateRotationY(float angle); - static Quaternion CreateRotationZ(float angle); + static Quaternion CreateRotationX(float angleInRadians); + static Quaternion CreateRotationY(float angleInRadians); + static Quaternion CreateRotationZ(float angleInRadians); //! @} //! Creates a quaternion from a Matrix3x3 @@ -168,6 +168,14 @@ namespace AZ float NormalizeWithLengthEstimate(); //! @} + //! Get the shortest equivalent of the rotation. + //! In case the w component of the quaternion is negative the rotation is > 180° and taking the longer path. + //! The quaternion will be inverted in that case to take the shortest path of rotation. + //! @{ + Quaternion GetShortestEquivalent() const; + void ShortestEquivalent(); + //! @} + //! Linearly interpolate towards a destination quaternion. //! @param[in] dest The quaternion to interpolate towards. //! @param[in] t Normalized interpolation value where 0.0 represents the current and 1.0 the destination value. diff --git a/Code/Framework/AzCore/AzCore/Math/Quaternion.inl b/Code/Framework/AzCore/AzCore/Math/Quaternion.inl index 37319ae146..bd51a90fca 100644 --- a/Code/Framework/AzCore/AzCore/Math/Quaternion.inl +++ b/Code/Framework/AzCore/AzCore/Math/Quaternion.inl @@ -73,27 +73,27 @@ namespace AZ } - AZ_MATH_INLINE Quaternion Quaternion::CreateRotationX(float angle) + AZ_MATH_INLINE Quaternion Quaternion::CreateRotationX(float angleInRadians) { - const float halfAngle = 0.5f * angle; + const float halfAngle = 0.5f * angleInRadians; float sin, cos; SinCos(halfAngle, sin, cos); return Quaternion(sin, 0.0f, 0.0f, cos); } - AZ_MATH_INLINE Quaternion Quaternion::CreateRotationY(float angle) + AZ_MATH_INLINE Quaternion Quaternion::CreateRotationY(float angleInRadians) { - const float halfAngle = 0.5f * angle; + const float halfAngle = 0.5f * angleInRadians; float sin, cos; SinCos(halfAngle, sin, cos); return Quaternion(0.0f, sin, 0.0f, cos); } - AZ_MATH_INLINE Quaternion Quaternion::CreateRotationZ(float angle) + AZ_MATH_INLINE Quaternion Quaternion::CreateRotationZ(float angleInRadians) { - const float halfAngle = 0.5f * angle; + const float halfAngle = 0.5f * angleInRadians; float sin, cos; SinCos(halfAngle, sin, cos); return Quaternion(0.0f, 0.0f, sin, cos); @@ -345,6 +345,23 @@ namespace AZ } + AZ_MATH_INLINE Quaternion Quaternion::GetShortestEquivalent() const + { + if (GetW() < 0.0f) + { + return -(*this); + } + + return *this; + } + + + AZ_MATH_INLINE void Quaternion::ShortestEquivalent() + { + *this = GetShortestEquivalent(); + } + + AZ_MATH_INLINE Quaternion Quaternion::Lerp(const Quaternion& dest, float t) const { if (Dot(dest) >= 0.0f) diff --git a/Code/Framework/AzCore/Tests/Math/QuaternionTests.cpp b/Code/Framework/AzCore/Tests/Math/QuaternionTests.cpp index 9ef38d7115..3de60a1fd4 100644 --- a/Code/Framework/AzCore/Tests/Math/QuaternionTests.cpp +++ b/Code/Framework/AzCore/Tests/Math/QuaternionTests.cpp @@ -11,6 +11,7 @@ #include #include #include +#include using namespace AZ; @@ -453,7 +454,7 @@ namespace UnitTest AZ::Quaternion backFromScaledAxisAngle = AZ::Quaternion::CreateFromScaledAxisAngle(scaledAxisAngle); // Compare the original quaternion with the one after the conversion. - EXPECT_TRUE(testQuat.IsClose(backFromScaledAxisAngle, 1e-6f)); + EXPECT_THAT(testQuat, IsCloseTolerance(backFromScaledAxisAngle, 1e-6f)); } TEST_P(QuaternionScaledAxisAngleConversionFixture, AxisAngleQuatRoundtripTests) @@ -467,7 +468,7 @@ namespace UnitTest // Convert the axis-angle back into a quaternion and compare the original quaternion with the one after the conversion. const AZ::Quaternion backFromAxisAngle = AZ::Quaternion::CreateFromAxisAngle(axis, angle); - EXPECT_TRUE(testQuat.IsClose(backFromAxisAngle, 1e-6f)); + EXPECT_THAT(testQuat, IsCloseTolerance(backFromAxisAngle, 1e-6f)); } TEST_P(QuaternionScaledAxisAngleConversionFixture, CompareAxisAngleConversionTests) @@ -506,8 +507,20 @@ namespace UnitTest } const AZ::Quaternion backFromAxisAngle = AZ::Quaternion::CreateFromAxisAngle(axisFromScaledResult, angleFromScaledResult); - EXPECT_TRUE(testQuat.IsClose(backFromAxisAngle, 1e-6f)); + EXPECT_THAT(testQuat, IsCloseTolerance(backFromAxisAngle, 1e-6f)); } INSTANTIATE_TEST_CASE_P(MATH_Quaternion, QuaternionScaledAxisAngleConversionFixture, ::testing::ValuesIn(RotationRepresentationConversionTestQuats)); + + TEST(MATH_Quaternion, ShortestEquivalent) + { + const AZ::Quaternion testQuat = AZ::Quaternion::CreateRotationX(AZ::Constants::HalfPi * 3.0f); + + AZ::Quaternion absQuat = testQuat; + absQuat.ShortestEquivalent(); + EXPECT_THAT(testQuat.GetShortestEquivalent(), IsCloseTolerance(absQuat, 1e-6f)); + + const float angle = absQuat.GetEulerRadians().GetX(); + EXPECT_THAT(angle, testing::FloatEq(-AZ::Constants::HalfPi)); + } } From 346a414aff6a79b4651337b473c82f8c924aa749 Mon Sep 17 00:00:00 2001 From: amzn-mike <80125227+amzn-mike@users.noreply.github.com> Date: Mon, 3 Jan 2022 09:44:34 -0600 Subject: [PATCH 219/399] Change AP unit test project to a DLL like all others, add benchmarks project (#6588) Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> --- Code/Tools/AssetProcessor/CMakeLists.txt | 15 ++-- .../native/tests/AssetProcessorTest.cpp | 8 +-- .../AssetProcessor/native/tests/test_main.cpp | 70 +------------------ 3 files changed, 13 insertions(+), 80 deletions(-) diff --git a/Code/Tools/AssetProcessor/CMakeLists.txt b/Code/Tools/AssetProcessor/CMakeLists.txt index 431a167163..98c5f8e5e8 100644 --- a/Code/Tools/AssetProcessor/CMakeLists.txt +++ b/Code/Tools/AssetProcessor/CMakeLists.txt @@ -52,7 +52,7 @@ get_property(asset_builders GLOBAL PROPERTY LY_ASSET_BUILDERS) string (REPLACE ";" "," asset_builders "${asset_builders}") ly_add_source_properties( SOURCES native/utilities/ApplicationManager.cpp - PROPERTY COMPILE_DEFINITIONS + PROPERTY COMPILE_DEFINITIONS VALUES LY_ASSET_BUILDERS="${asset_builders}" ) @@ -147,9 +147,9 @@ endif() # Tests ################################################################################ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) - + ly_add_target( - NAME AssetProcessor.Tests EXECUTABLE + NAME AssetProcessor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE AZ AUTOMOC AUTORCC @@ -167,12 +167,12 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) ) ly_add_source_properties( SOURCES native/tests/assetBuilderSDK/assetBuilderSDKTest.cpp - PROPERTY COMPILE_DEFINITIONS + PROPERTY COMPILE_DEFINITIONS VALUES ${LY_PAL_TOOLS_DEFINES} ) ly_add_source_properties( SOURCES native/unittests/AssetProcessorManagerUnitTests.cpp - PROPERTY COMPILE_DEFINITIONS + PROPERTY COMPILE_DEFINITIONS VALUES LY_CMAKE_BINARY_DIR="${CMAKE_BINARY_DIR}" ) @@ -266,7 +266,10 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) ly_add_googletest( NAME AZ::AssetProcessor.Tests - TEST_COMMAND $ --unittest --gtest_filter=-*.SUITE_sandbox* + ) + ly_add_googlebenchmark( + NAME AZ::AssetProcessor.Benchmarks + TARGET AZ::AssetProcessor.Tests ) endif() diff --git a/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp b/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp index 5be9436145..e2b28c1260 100644 --- a/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp +++ b/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp @@ -18,8 +18,6 @@ #include -AZ_UNIT_TEST_HOOK(new BaseAssetProcessorTestEnvironment) - namespace AssetProcessor { class UnitTestAppManager : public BatchApplicationManager @@ -35,7 +33,7 @@ namespace AssetProcessor { return false; } - + // tests which use the builder bus plug in their own mock version, so disconnect ours. AssetProcessor::AssetBuilderInfoBus::Handler::BusDisconnect(); @@ -59,7 +57,7 @@ namespace AssetProcessor void SetUp() override { AssetProcessorTest::SetUp(); - + static int numParams = 1; static char processName[] = {"AssetProcessorBatch"}; static char* namePtr = &processName[0]; @@ -147,7 +145,7 @@ namespace AssetProcessor time.start(); actualTest->StartTest(); - + while (!testIsComplete) { QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); diff --git a/Code/Tools/AssetProcessor/native/tests/test_main.cpp b/Code/Tools/AssetProcessor/native/tests/test_main.cpp index e0cdc8cb3c..69f6e9a6c8 100644 --- a/Code/Tools/AssetProcessor/native/tests/test_main.cpp +++ b/Code/Tools/AssetProcessor/native/tests/test_main.cpp @@ -5,76 +5,8 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#include "utilities/BatchApplicationManager.h" - #include -#include #include -DECLARE_AZ_UNIT_TEST_MAIN() - -int RunUnitTests(int argc, char* argv[], bool& ranUnitTests) -{ - ranUnitTests = true; - - INVOKE_AZ_UNIT_TEST_MAIN(nullptr); // nullptr turns off default test environment used to catch stray asserts - - // This looks a bit weird, but the macro returns conditionally, so *if* we get here, it means the unit tests didn't run - ranUnitTests = false; - return 0; -} - -int main(int argc, char* argv[]) -{ - qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "1"); - - AZ::Debug::Trace::HandleExceptions(true); - AZ::Test::ApplyGlobalParameters(&argc, argv); - - // If "--unittest" is present on the command line, run unit testing - // and return immediately. Otherwise, continue as normal. - AZ::Test::addTestEnvironment(new BaseAssetProcessorTestEnvironment()); - - bool pauseOnComplete = false; - - if (AZ::Test::ContainsParameter(argc, argv, "--pause-on-completion")) - { - pauseOnComplete = true; - } - - bool ranUnitTests; - int result = RunUnitTests(argc, argv, ranUnitTests); - - if (ranUnitTests) - { - if (pauseOnComplete) - { - system("pause"); - } - - return result; - } - - BatchApplicationManager applicationManager(&argc, &argv); - setvbuf(stdout, NULL, _IONBF, 0); // Disabling output buffering to fix test failures due to incomplete logs - - ApplicationManager::BeforeRunStatus status = applicationManager.BeforeRun(); - - if (status != ApplicationManager::BeforeRunStatus::Status_Success) - { - if (status == ApplicationManager::BeforeRunStatus::Status_Restarting) - { - //AssetProcessor will restart - return 0; - } - else - { - //Initialization failed - return 1; - } - } - - return applicationManager.Run() ? 0 : 1; -} - +AZ_UNIT_TEST_HOOK(new BaseAssetProcessorTestEnvironment) From a95b303f197d242c01db1100e235870047ae0c4d Mon Sep 17 00:00:00 2001 From: amzn-mike <80125227+amzn-mike@users.noreply.github.com> Date: Mon, 3 Jan 2022 09:44:51 -0600 Subject: [PATCH 220/399] Remove Shader compiler tab from Asset Processor (#6486) * Remove Shader compiler tab from Asset Processor Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Remove more references to shader compiler Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> --- .../assetprocessor_static_files.cmake | 7 - .../assetprocessor_test_files.cmake | 2 - .../shadercompiler/shadercompilerManager.cpp | 162 --------------- .../shadercompiler/shadercompilerManager.h | 67 ------ .../shadercompiler/shadercompilerMessages.h | 24 --- .../shadercompiler/shadercompilerModel.cpp | 150 -------------- .../shadercompiler/shadercompilerModel.h | 93 --------- .../shadercompiler/shadercompilerjob.cpp | 194 ------------------ .../native/shadercompiler/shadercompilerjob.h | 44 ---- .../AssetProcessor/native/ui/MainWindow.cpp | 10 - .../AssetProcessor/native/ui/MainWindow.h | 1 - .../AssetProcessor/native/ui/MainWindow.ui | 53 ----- .../unittests/ShaderCompilerUnitTests.cpp | 188 ----------------- .../unittests/ShaderCompilerUnitTests.h | 81 -------- .../utilities/GUIApplicationManager.cpp | 63 +----- .../native/utilities/GUIApplicationManager.h | 11 +- 16 files changed, 8 insertions(+), 1142 deletions(-) delete mode 100644 Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerManager.cpp delete mode 100644 Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerManager.h delete mode 100644 Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerMessages.h delete mode 100644 Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerModel.cpp delete mode 100644 Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerModel.h delete mode 100644 Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerjob.cpp delete mode 100644 Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerjob.h delete mode 100644 Code/Tools/AssetProcessor/native/unittests/ShaderCompilerUnitTests.cpp delete mode 100644 Code/Tools/AssetProcessor/native/unittests/ShaderCompilerUnitTests.h diff --git a/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake b/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake index 400a3f7ba5..7daca9bbc1 100644 --- a/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake +++ b/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake @@ -63,13 +63,6 @@ set(FILES native/resourcecompiler/RCJobSortFilterProxyModel.h native/resourcecompiler/RCQueueSortModel.cpp native/resourcecompiler/RCQueueSortModel.h - native/shadercompiler/shadercompilerjob.cpp - native/shadercompiler/shadercompilerjob.h - native/shadercompiler/shadercompilerManager.cpp - native/shadercompiler/shadercompilerManager.h - native/shadercompiler/shadercompilerMessages.h - native/shadercompiler/shadercompilerModel.cpp - native/shadercompiler/shadercompilerModel.h native/utilities/ApplicationManagerAPI.h native/utilities/ApplicationManager.cpp native/utilities/ApplicationManager.h diff --git a/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake b/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake index 3a336ce97b..2c4c53642c 100644 --- a/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake +++ b/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake @@ -67,8 +67,6 @@ set(FILES native/unittests/PlatformConfigurationUnitTests.h native/unittests/RCcontrollerUnitTests.cpp native/unittests/RCcontrollerUnitTests.h - native/unittests/ShaderCompilerUnitTests.cpp - native/unittests/ShaderCompilerUnitTests.h native/unittests/UnitTestRunner.cpp native/unittests/UnitTestRunner.h native/unittests/UtilitiesUnitTests.cpp diff --git a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerManager.cpp b/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerManager.cpp deleted file mode 100644 index 47b2ca9047..0000000000 --- a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerManager.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#include "shadercompilerManager.h" -#include "shadercompilerjob.h" - -#include - -#include "native/utilities/assetUtils.h" - -ShaderCompilerManager::ShaderCompilerManager(QObject* parent) - : QObject(parent) - , m_isUnitTesting(false) - , m_numberOfJobsStarted(0) - , m_numberOfJobsEnded(0) - , m_numberOfErrors(0) -{ -} - -ShaderCompilerManager::~ShaderCompilerManager() -{ -} - -void ShaderCompilerManager::process(unsigned int connID, unsigned int type, unsigned int serial, QByteArray payload) -{ - (void)type; - (void)serial; - Q_ASSERT(AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyRequest") == type); - decodeShaderCompilerRequest(connID, payload); -} - -void ShaderCompilerManager::decodeShaderCompilerRequest(unsigned int connID, QByteArray payload) -{ - if (payload.length() < sizeof(unsigned int) + sizeof(unsigned int) + 2 + sizeof(unsigned short)) - { - QString error = "Payload size is too small"; - AZ_Warning(AssetProcessor::ConsoleChannel, false, error.toUtf8().data()); - emit sendErrorMessage(error); - return; - } - - unsigned char* data_end = reinterpret_cast(payload.data() + payload.size()); - unsigned int* requestId = reinterpret_cast(data_end - sizeof(unsigned int)); - unsigned int* serverListSizePtr = reinterpret_cast(data_end - sizeof(unsigned int) - sizeof(unsigned int)); - unsigned short* serverPortPtr = reinterpret_cast(data_end - sizeof(unsigned int) - sizeof(unsigned int) - sizeof(unsigned short)); - - ShaderCompilerRequestMessage msg; - QString error; - - msg.requestId = *requestId; - msg.serverListSize = *serverListSizePtr; - msg.serverPort = *serverPortPtr; - if ((msg.serverListSize <= 0) || (msg.serverListSize > 100000)) - { - error = "Shader Compiler Server List is wrong"; - AZ_Warning(AssetProcessor::ConsoleChannel, false, error.toUtf8().data()); - emit sendErrorMessage(error); - return; - } - if (msg.serverPort == 0) - { - error = "Shader Compiler port is wrong"; - AZ_Warning(AssetProcessor::ConsoleChannel, false, error.toUtf8().data()); - emit sendErrorMessage(error); - return; - } - - char* position_of_first_null = reinterpret_cast(serverPortPtr) - 1;// -1 for null - if ((*position_of_first_null) != '\0') - { - error = "Shader Compiler payload is corrupt,position is not null"; - AZ_Warning(AssetProcessor::ConsoleChannel, false, error.toUtf8().data()); - emit sendErrorMessage(error); - return; - } - char* beginning_of_serverList = position_of_first_null - msg.serverListSize; - char* position_of_second_null = beginning_of_serverList - 1;//-1 for null - - if ((*position_of_second_null) != '\0') - { - error = "Shader Compiler payload is corrupt,position is not null"; - AZ_Warning(AssetProcessor::ConsoleChannel, false, error.toUtf8().data()); - emit sendErrorMessage(error); - return; - } - - unsigned int originalPayloadSize = static_cast(payload.size()) - sizeof(unsigned int) - sizeof(unsigned int) - sizeof(unsigned short) - static_cast(msg.serverListSize) - 2; - msg.serverList = beginning_of_serverList; - msg.originalPayload.insert(0, payload.data(), static_cast(originalPayloadSize)); - ShaderCompilerJob* shaderCompilerJob = new ShaderCompilerJob(); - shaderCompilerJob->initialize(this, msg); - shaderCompilerJob->setIsUnitTesting(m_isUnitTesting); - m_shaderCompilerJobMap[msg.requestId] = connID; - shaderCompilerJob->setAutoDelete(true); - QThreadPool* threadPool = QThreadPool::globalInstance(); - threadPool->start(shaderCompilerJob); -} - -void ShaderCompilerManager::OnShaderCompilerJobComplete(QByteArray payload, unsigned int requestId) -{ - auto iterator = m_shaderCompilerJobMap.find(requestId); - if (iterator != m_shaderCompilerJobMap.end()) - { - sendResponse(iterator.value(), AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyResponse"), 0, payload); - } - else - { - QString error = "Shader Compiler cannot find the connection id"; - AZ_Warning(AssetProcessor::ConsoleChannel, false, error.toUtf8().data()); - emit sendErrorMessage(error); - } -} - -void ShaderCompilerManager::sendResponse(unsigned int connId, unsigned int /*type*/, unsigned int /*serial*/, QByteArray payload) -{ - EBUS_EVENT_ID(connId, AssetProcessor::ConnectionBus, SendRaw, AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyResponse"), 0, payload); -} - -void ShaderCompilerManager::shaderCompilerError(QString errorMessage, QString server, QString timestamp, QString payload) -{ - m_numberOfErrors++; - emit numberOfErrorsChanged(); - emit sendErrorMessageFromShaderJob(errorMessage, server, timestamp, payload); -} - -void ShaderCompilerManager::jobStarted() -{ - m_numberOfJobsStarted++; - emit numberOfJobsStartedChanged(); -} - -void ShaderCompilerManager::jobEnded() -{ - m_numberOfJobsEnded++; - numberOfJobsEndedChanged(); -} - - -void ShaderCompilerManager::setIsUnitTesting(bool isUnitTesting) -{ - m_isUnitTesting = isUnitTesting; -} - -int ShaderCompilerManager::numberOfJobsStarted() -{ - return m_numberOfJobsStarted; -} - -int ShaderCompilerManager::numberOfJobsEnded() -{ - return m_numberOfJobsEnded; -} - -int ShaderCompilerManager::numberOfErrors() -{ - return m_numberOfErrors; -} - diff --git a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerManager.h b/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerManager.h deleted file mode 100644 index cb51ee98f6..0000000000 --- a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerManager.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef SHADERCOMPILERMANAGER_H -#define SHADERCOMPILERMANAGER_H - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#include -#endif - -typedef QHash ShaderCompilerJobMap; - -/** - * The Shader Compiler Manager class receive a shader compile request - * and starts a shader compiler job for it - */ -class ShaderCompilerManager - : public QObject -{ - Q_OBJECT - Q_PROPERTY(int numberOfJobsStarted READ numberOfJobsStarted NOTIFY numberOfJobsStartedChanged) - Q_PROPERTY(int numberOfJobsEnded READ numberOfJobsEnded NOTIFY numberOfJobsEndedChanged) - Q_PROPERTY(int numberOfErrors READ numberOfErrors NOTIFY numberOfErrorsChanged) -public: - - explicit ShaderCompilerManager(QObject* parent = 0); - virtual ~ShaderCompilerManager(); - - void process(unsigned int connID, unsigned int type, unsigned int serial, QByteArray payload); - void decodeShaderCompilerRequest(unsigned int connID, QByteArray payload); - void setIsUnitTesting(bool isUnitTesting); - int numberOfJobsStarted(); - int numberOfJobsEnded(); - int numberOfErrors(); - virtual void sendResponse(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload); - -signals: - void sendErrorMessage(QString errorMessage); - void sendErrorMessageFromShaderJob(QString errorMessage, QString server, QString timestamp, QString payload); - void numberOfJobsStartedChanged(); - void numberOfJobsEndedChanged(); - void numberOfErrorsChanged(); - - -public slots: - void OnShaderCompilerJobComplete(QByteArray payload, unsigned int requestId); - void shaderCompilerError(QString errorMessage, QString server, QString timestamp, QString payload); - void jobStarted(); - void jobEnded(); - - -private: - ShaderCompilerJobMap m_shaderCompilerJobMap; - bool m_isUnitTesting; - int m_numberOfJobsStarted; - int m_numberOfJobsEnded; - int m_numberOfErrors; -}; - -#endif // SHADERCOMPILERMANAGER_H diff --git a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerMessages.h b/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerMessages.h deleted file mode 100644 index be90a7b3e5..0000000000 --- a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerMessages.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef SHADERCOMPILERMESSAGES_H -#define SHADERCOMPILERMESSAGES_H - -#include -#include - -struct ShaderCompilerRequestMessage -{ - QByteArray originalPayload; - QString serverList; - unsigned short serverPort; - unsigned int serverListSize; - unsigned int requestId; -}; - -#endif //SHADERCOMPILERMESSAGES_H - diff --git a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerModel.cpp b/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerModel.cpp deleted file mode 100644 index 50b5254e79..0000000000 --- a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerModel.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#include "shadercompilerModel.h" - -namespace -{ - ShaderCompilerModel* s_singleton = nullptr; -} - -ShaderCompilerModel::ShaderCompilerModel(QObject* parent) - : QAbstractItemModel(parent) -{ - Q_ASSERT(s_singleton == nullptr); - s_singleton = this; -} - -ShaderCompilerModel::~ShaderCompilerModel() -{ - s_singleton = nullptr; -} - -ShaderCompilerModel* ShaderCompilerModel::Get() -{ - return s_singleton; -} - -QVariant ShaderCompilerModel::data(const QModelIndex& index, int role) const -{ - if (!index.isValid()) - { - return QVariant(); - } - - int row = index.row(); - - if (row < 0) - { - return QVariant(); - } - if (row >= m_shaderErrorInfoList.count()) - { - return QVariant(); - } - - switch (role) - { - case TimeStampRole: - return m_shaderErrorInfoList[row].m_shaderTimestamp; - case ServerRole: - return m_shaderErrorInfoList[row].m_shaderServerName; - case ErrorRole: - return m_shaderErrorInfoList[row].m_shaderError; - case OriginalRequestRole: - return m_shaderErrorInfoList[row].m_shaderOriginalPayload; - - case Qt::DisplayRole: - switch (index.column()) - { - case ColumnTimeStamp: - return m_shaderErrorInfoList[row].m_shaderTimestamp; - case ColumnServer: - return m_shaderErrorInfoList[row].m_shaderServerName; - case ColumnError: - return m_shaderErrorInfoList[row].m_shaderServerName; - } - } - - return QVariant(); -} - - -Qt::ItemFlags ShaderCompilerModel::flags(const QModelIndex& index) const -{ - (void)index; - return Qt::ItemIsSelectable | Qt::ItemIsEnabled; -} - - -int ShaderCompilerModel::rowCount(const QModelIndex& parent) const -{ - (void)parent; - return m_shaderErrorInfoList.count(); -} - - -QModelIndex ShaderCompilerModel::parent(const QModelIndex&) const -{ - return QModelIndex(); -} - - -QModelIndex ShaderCompilerModel::index(int row, int column, const QModelIndex& parent) const -{ - if (row >= rowCount(parent) || column >= columnCount(parent)) - { - return QModelIndex(); - } - return createIndex(row, column); -} - - -int ShaderCompilerModel::columnCount(const QModelIndex& parent) const -{ - return parent.isValid() ? 0 : Column::Max; -} - - -QVariant ShaderCompilerModel::headerData(int section, Qt::Orientation orientation, int role) const -{ - if (orientation == Qt::Horizontal && role == Qt::DisplayRole) - { - switch (section) - { - case ColumnTimeStamp: - return tr("Time Stamp"); - case ColumnServer: - return tr("Server"); - case ColumnError: - return tr("Error"); - default: - break; - } - } - - return QAbstractItemModel::headerData(section, orientation, role); -} - - -QHash ShaderCompilerModel::roleNames() const -{ - QHash result; - result[TimeStampRole] = "timestamp"; - result[ServerRole] = "server"; - result[ErrorRole] = "error"; - result[OriginalRequestRole] = "originalRequest"; - return result; -} -void ShaderCompilerModel::addShaderErrorInfoEntry(QString errorMessage, QString timestamp, QString payload, QString server) -{ - ShaderCompilerErrorInfo shaderCompileErrorInfo(errorMessage, timestamp, payload, server); - beginInsertRows(QModelIndex(), m_shaderErrorInfoList.size(), m_shaderErrorInfoList.size()); - m_shaderErrorInfoList.append(shaderCompileErrorInfo); - endInsertRows(); -} - diff --git a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerModel.h b/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerModel.h deleted file mode 100644 index 464ca9b5b0..0000000000 --- a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerModel.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef SHADERCOMPILERMODEL_H -#define SHADERCOMPILERMODEL_H - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#include -#include -#include -#endif - -class QModelIndex; -class QObject; - -struct ShaderCompilerErrorInfo -{ - QString m_shaderError; - QString m_shaderTimestamp; - QString m_shaderOriginalPayload; - QString m_shaderServerName; - - ShaderCompilerErrorInfo(QString shaderError, QString shaderTimestamp, QString shaderOriginalPayload, QString shaderServerName) - : m_shaderError(shaderError) - , m_shaderTimestamp(shaderTimestamp) - , m_shaderOriginalPayload(shaderOriginalPayload) - , m_shaderServerName(shaderServerName) - { - } -}; - -/** The Shader Compiler model is responsible for capturing error requests - */ -class ShaderCompilerModel - : public QAbstractItemModel -{ - Q_OBJECT -public: - - enum DataRoles - { - TimeStampRole = Qt::UserRole + 1, - ServerRole, - ErrorRole, - OriginalRequestRole, - }; - - enum Column - { - ColumnTimeStamp, - ColumnServer, - ColumnError, - Max - }; - - /// standard Qt constructor - explicit ShaderCompilerModel(QObject* parent = 0); - virtual ~ShaderCompilerModel(); - - // singleton pattern - static ShaderCompilerModel* Get(); - - - /// QAbstractListModel interface - QModelIndex parent(const QModelIndex&) const override; - QModelIndex index(int row, int column, const QModelIndex& parent) const override; - int columnCount(const QModelIndex&) const override; - virtual int rowCount(const QModelIndex& parent) const override; - QVariant headerData(int section, Qt::Orientation orientation, int role) const override; - virtual QVariant data(const QModelIndex& index, int role) const override; - virtual QHash roleNames() const override; - virtual Qt::ItemFlags flags(const QModelIndex& index) const override; - -public slots: - void addShaderErrorInfoEntry(QString errorMessage, QString timestamp, QString payload, QString server); - -private: - - QList m_shaderErrorInfoList; -}; - - -#endif // SHADERCOMPILERMODEL_H - - - diff --git a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerjob.cpp b/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerjob.cpp deleted file mode 100644 index 58f9244616..0000000000 --- a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerjob.cpp +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#include "shadercompilerjob.h" -#include "native/assetprocessor.h" - -#include - -ShaderCompilerJob::ShaderCompilerJob() - : m_isUnitTesting(false) - , m_manager(nullptr) -{ -} - -ShaderCompilerJob::~ShaderCompilerJob() -{ - m_manager = nullptr; -} - -ShaderCompilerRequestMessage ShaderCompilerJob::ShaderCompilerMessage() const -{ - return m_ShaderCompilerMessage; -} - -void ShaderCompilerJob::initialize(QObject* pManager, const ShaderCompilerRequestMessage& ShaderCompilerMessage) -{ - m_manager = pManager; - m_ShaderCompilerMessage = ShaderCompilerMessage; -} - -QString ShaderCompilerJob::getServerAddress() -{ - if (isServerListEmpty()) - { - return QString(); - } - - QString serverAddress; - if (!m_ShaderCompilerMessage.serverList.contains(",")) - { - serverAddress = m_ShaderCompilerMessage.serverList; - m_ShaderCompilerMessage.serverList.clear(); - return serverAddress; - } - - QStringList serverList = m_ShaderCompilerMessage.serverList.split(","); - serverAddress = serverList.takeAt(0); - m_ShaderCompilerMessage.serverList = serverList.join(","); - return serverAddress; -} - -bool ShaderCompilerJob::isServerListEmpty() -{ - return m_ShaderCompilerMessage.serverList.isEmpty(); -} - -bool ShaderCompilerJob::attemptDelivery(QString serverAddress, QByteArray& payload) -{ - QTcpSocket socket; - QString error; - int waitingTime = 8000; // 8 sec timeout for sending. - int jobCompileMaxTime = 1000 * 60; // 60 sec timeout for compilation - if (m_isUnitTesting) - { - waitingTime = 500; - jobCompileMaxTime = 500; - } - - socket.connectToHost(serverAddress, m_ShaderCompilerMessage.serverPort, QIODevice::ReadWrite); - - if (socket.waitForConnected(waitingTime)) - { - qint64 bytesWritten = 0; - qint64 payloadSize = static_cast(m_ShaderCompilerMessage.originalPayload.size()); - // send payload size to server - while (bytesWritten != sizeof(qint64)) - { - qint64 currentWrite = socket.write(reinterpret_cast(&payloadSize) + bytesWritten, - sizeof(qint64) - bytesWritten); - if (currentWrite == -1) - { - //It is important to note that we are only outputting the error to debugchannel only here because - //we are forwarding these error messages upstream to the manager,who will take the appropriate action - error = "Connection Lost:Unable to send data"; - AZ_TracePrintf(AssetProcessor::DebugChannel, error.toUtf8().data()); - QMetaObject::invokeMethod(m_manager, "shaderCompilerError", Qt::QueuedConnection, Q_ARG(QString, error), Q_ARG(QString, QDateTime::currentDateTime().toString()), Q_ARG(QString, QString(m_ShaderCompilerMessage.originalPayload)), Q_ARG(QString, serverAddress)); - return false; - } - socket.flush(); - bytesWritten += currentWrite; - } - bytesWritten = 0; - //send actual payload to server - while (bytesWritten != m_ShaderCompilerMessage.originalPayload.size()) - { - qint64 currentWrite = socket.write(m_ShaderCompilerMessage.originalPayload.data() + bytesWritten, - m_ShaderCompilerMessage.originalPayload.size() - bytesWritten); - if (currentWrite == -1) - { - error = "Connection Lost:Unable to send data"; - AZ_TracePrintf(AssetProcessor::DebugChannel, error.toUtf8().data()); - QMetaObject::invokeMethod(m_manager, "shaderCompilerError", Qt::QueuedConnection, Q_ARG(QString, error), Q_ARG(QString, QDateTime::currentDateTime().toString()), Q_ARG(QString, QString(m_ShaderCompilerMessage.originalPayload)), Q_ARG(QString, serverAddress)); - } - socket.flush(); - bytesWritten += currentWrite; - } - } - else - { - error = "Unable to connect to IP Address " + serverAddress; - AZ_TracePrintf(AssetProcessor::DebugChannel, error.toUtf8().data()); - QMetaObject::invokeMethod(m_manager, "shaderCompilerError", Qt::QueuedConnection, Q_ARG(QString, error), Q_ARG(QString, QDateTime::currentDateTime().toString()), Q_ARG(QString, QString(m_ShaderCompilerMessage.originalPayload)), Q_ARG(QString, serverAddress)); - return false; - } - - unsigned int expectedBytes = sizeof(unsigned int) + sizeof(qint8); - unsigned int bytesReadTotal = 0; - unsigned int messageSize = 0; - bool isMessageSizeKnown = false; - //read the entire payload - while ((bytesReadTotal < expectedBytes + messageSize)) - { - if (socket.bytesAvailable() == 0) - { - if (!socket.waitForReadyRead(jobCompileMaxTime)) - { - error = "Remote IP is taking too long to respond: " + serverAddress; - AZ_TracePrintf(AssetProcessor::DebugChannel, error.toUtf8().data()); - QMetaObject::invokeMethod(m_manager, "shaderCompilerError", Qt::QueuedConnection, Q_ARG(QString, error), Q_ARG(QString, QDateTime::currentDateTime().toString()), Q_ARG(QString, QString(m_ShaderCompilerMessage.originalPayload)), Q_ARG(QString, serverAddress)); - payload.clear(); - return false; - } - } - - qint64 bytesAvailable = socket.bytesAvailable(); - - if (bytesAvailable >= expectedBytes && !isMessageSizeKnown) - { - socket.peek(reinterpret_cast(&messageSize), sizeof(unsigned int)); - payload.resize(expectedBytes + messageSize); - isMessageSizeKnown = true; - } - - if (bytesAvailable > 0) - { - qint64 bytesRead = socket.read(payload.data() + bytesReadTotal, bytesAvailable); - - if (bytesRead <= 0) - { - error = "Connection closed by remote IP Address " + serverAddress; - AZ_TracePrintf(AssetProcessor::DebugChannel, error.toUtf8().data()); - QMetaObject::invokeMethod(m_manager, "shaderCompilerError", Qt::QueuedConnection, Q_ARG(QString, error), Q_ARG(QString, QDateTime::currentDateTime().toString()), Q_ARG(QString, QString(m_ShaderCompilerMessage.originalPayload)), Q_ARG(QString, serverAddress)); - payload.clear(); - return false; - } - - bytesReadTotal = aznumeric_cast(bytesReadTotal + bytesRead); - } - } - - return true; // payload successfully send -} - -void ShaderCompilerJob::run() -{ - QMetaObject::invokeMethod(m_manager, "jobStarted", Qt::QueuedConnection); - QByteArray payload; - //until server list is empty, keep trying - while (!isServerListEmpty()) - { - QString serverAddress = getServerAddress(); - //attempt to send payload - if (attemptDelivery(serverAddress, payload)) - { - break; - } - } - //we are appending request id at the end of every payload, - //therefore in the case of any errors also - //we will be sending atleast four bytes to the game - payload.append(reinterpret_cast(&m_ShaderCompilerMessage.requestId), sizeof(unsigned int)); - QMetaObject::invokeMethod(m_manager, "OnShaderCompilerJobComplete", Qt::QueuedConnection, Q_ARG(QByteArray, payload), Q_ARG(unsigned int, m_ShaderCompilerMessage.requestId)); - QMetaObject::invokeMethod(m_manager, "jobEnded", Qt::QueuedConnection); -} - - -void ShaderCompilerJob::setIsUnitTesting(bool isUnitTesting) -{ - m_isUnitTesting = isUnitTesting; -} diff --git a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerjob.h b/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerjob.h deleted file mode 100644 index 1d72365331..0000000000 --- a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerjob.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef SHADERCOMPILERJOB_H -#define SHADERCOMPILERJOB_H - -#include -#include "shadercompilerMessages.h" - -class QByteArray; -class QObject; - -/** - * This class is responsible for connecting to the shader compiler server - * and getting back the response to the shader compiler manager - */ -class ShaderCompilerJob - : public QRunnable -{ -public: - - explicit ShaderCompilerJob(); - virtual ~ShaderCompilerJob(); - ShaderCompilerRequestMessage ShaderCompilerMessage() const; - void initialize(QObject* pManager, const ShaderCompilerRequestMessage& ShaderCompilerMessage); - QString getServerAddress(); - bool isServerListEmpty(); - virtual void run() override; - - void setIsUnitTesting(bool isUnitTesting); - - bool attemptDelivery(QString serverAddress, QByteArray& payload); - -private: - ShaderCompilerRequestMessage m_ShaderCompilerMessage; - QObject* m_manager; - bool m_isUnitTesting; -}; - -#endif // SHADERCOMPILERJOB_H diff --git a/Code/Tools/AssetProcessor/native/ui/MainWindow.cpp b/Code/Tools/AssetProcessor/native/ui/MainWindow.cpp index 70b7ceb009..c3674e6431 100644 --- a/Code/Tools/AssetProcessor/native/ui/MainWindow.cpp +++ b/Code/Tools/AssetProcessor/native/ui/MainWindow.cpp @@ -37,7 +37,6 @@ #include "../connection/connection.h" #include "../resourcecompiler/rccontroller.h" #include "../resourcecompiler/RCJobSortFilterProxyModel.h" -#include "../shadercompiler/shadercompilerModel.h" #include @@ -148,7 +147,6 @@ void MainWindow::Activate() ui->buttonList->addTab(QStringLiteral("Jobs")); ui->buttonList->addTab(QStringLiteral("Assets")); ui->buttonList->addTab(QStringLiteral("Logs")); - ui->buttonList->addTab(QStringLiteral("Shaders")); ui->buttonList->addTab(QStringLiteral("Connections")); ui->buttonList->addTab(QStringLiteral("Tools")); @@ -317,14 +315,6 @@ void MainWindow::Activate() connect(ui->jobFilteredSearchWidget, &AzQtComponents::FilteredSearchWidget::TextFilterChanged, this, writeJobFilterSettings); - //Shader view - ui->shaderTreeView->setModel(m_guiApplicationManager->GetShaderCompilerModel()); - ui->shaderTreeView->header()->resizeSection(ShaderCompilerModel::ColumnTimeStamp, 80); - ui->shaderTreeView->header()->resizeSection(ShaderCompilerModel::ColumnServer, 40); - ui->shaderTreeView->header()->resizeSection(ShaderCompilerModel::ColumnError, 220); - ui->shaderTreeView->header()->setSectionResizeMode(ShaderCompilerModel::ColumnError, QHeaderView::Stretch); - ui->shaderTreeView->header()->setStretchLastSection(false); - // Asset view m_sourceAssetTreeFilterModel = new AssetProcessor::AssetTreeFilterModel(this); m_sourceModel = new AssetProcessor::SourceAssetTreeModel(m_sharedDbConnection, this); diff --git a/Code/Tools/AssetProcessor/native/ui/MainWindow.h b/Code/Tools/AssetProcessor/native/ui/MainWindow.h index 8dc1f3e356..1bec6f982d 100644 --- a/Code/Tools/AssetProcessor/native/ui/MainWindow.h +++ b/Code/Tools/AssetProcessor/native/ui/MainWindow.h @@ -65,7 +65,6 @@ public: Jobs, Assets, Logs, - Shaders, Connections, Tools }; diff --git a/Code/Tools/AssetProcessor/native/ui/MainWindow.ui b/Code/Tools/AssetProcessor/native/ui/MainWindow.ui index d4f341d2b5..9d90beec13 100644 --- a/Code/Tools/AssetProcessor/native/ui/MainWindow.ui +++ b/Code/Tools/AssetProcessor/native/ui/MainWindow.ui @@ -763,59 +763,6 @@ - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Shaders - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - diff --git a/Code/Tools/AssetProcessor/native/unittests/ShaderCompilerUnitTests.cpp b/Code/Tools/AssetProcessor/native/unittests/ShaderCompilerUnitTests.cpp deleted file mode 100644 index f8bab90118..0000000000 --- a/Code/Tools/AssetProcessor/native/unittests/ShaderCompilerUnitTests.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#include "ShaderCompilerUnitTests.h" -#include "native/connection/connectionManager.h" -#include "native/connection/connection.h" -#include "native/utilities/assetUtils.h" - -#define UNIT_TEST_CONNECT_PORT 12125 - -ShaderCompilerUnitTest::ShaderCompilerUnitTest() -{ - m_connectionManager = ConnectionManager::Get(); - connect(this, SIGNAL(StartUnitTestForGoodShaderCompiler()), this, SLOT(UnitTestForGoodShaderCompiler())); - connect(this, SIGNAL(StartUnitTestForFirstBadShaderCompiler()), this, SLOT(UnitTestForFirstBadShaderCompiler())); - connect(this, SIGNAL(StartUnitTestForSecondBadShaderCompiler()), this, SLOT(UnitTestForSecondBadShaderCompiler())); - connect(this, SIGNAL(StartUnitTestForThirdBadShaderCompiler()), this, SLOT(UnitTestForThirdBadShaderCompiler())); - connect(&m_shaderCompilerManager, SIGNAL(sendErrorMessageFromShaderJob(QString, QString, QString, QString)), this, SLOT(ReceiveShaderCompilerErrorMessage(QString, QString, QString, QString))); - - m_shaderCompilerManager.setIsUnitTesting(true); - m_connectionManager->RegisterService(AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyRequest"), AZStd::bind(&ShaderCompilerManager::process, &m_shaderCompilerManager, AZStd::placeholders::_1, AZStd::placeholders::_2, AZStd::placeholders::_3, AZStd::placeholders::_4)); - ContructPayloadForShaderCompilerServer(m_testPayload); -} - -ShaderCompilerUnitTest::~ShaderCompilerUnitTest() -{ - m_connectionManager->removeConnection(m_connectionId); -} - -void ShaderCompilerUnitTest::ContructPayloadForShaderCompilerServer(QByteArray& payload) -{ - QString testString = "This is a test string"; - QString testServerList = "127.0.0.3,198.51.100.0,127.0.0.1"; // note - 198.51.100.0 is in the 'test' range that will never be assigned to anyone. - unsigned int testServerListLength = static_cast(testServerList.size()); - unsigned short testServerPort = 12348; - unsigned int testRequestId = 1; - qint64 testStringLength = static_cast(testString.size()); - payload.resize(static_cast(testStringLength)); - memcpy(payload.data(), (testString.toStdString().c_str()), testStringLength); - unsigned int payloadSize = payload.size(); - payload.resize(payloadSize + 1 + static_cast(testServerListLength) + 1 + sizeof(unsigned short) + sizeof(unsigned int) + sizeof(unsigned int)); - char* dataStart = payload.data() + payloadSize; - *dataStart = 0;// null - memcpy(payload.data() + payloadSize + 1, (testServerList.toStdString().c_str()), testServerListLength); - dataStart += 1 + testServerListLength; - *dataStart = 0; //null - memcpy(payload.data() + payloadSize + 1 + testServerListLength + 1, reinterpret_cast(&testServerPort), sizeof(unsigned short)); - memcpy(payload.data() + payloadSize + 1 + testServerListLength + 1 + sizeof(unsigned short), reinterpret_cast(&testServerListLength), sizeof(unsigned int)); - memcpy(payload.data() + payloadSize + 1 + testServerListLength + 1 + sizeof(unsigned short) + sizeof(unsigned int), reinterpret_cast(&testRequestId), sizeof(unsigned int)); -} - -void ShaderCompilerUnitTest::StartTest() -{ - m_connectionId = m_connectionManager->addConnection(); - Connection* connection = m_connectionManager->getConnection(m_connectionId); - connection->SetPort(UNIT_TEST_CONNECT_PORT); - connection->SetIpAddress("127.0.0.1"); - connection->SetAutoConnect(true); - UnitTestForGoodShaderCompiler(); -} - -int ShaderCompilerUnitTest::UnitTestPriority() const -{ - return -4; -} - -void ShaderCompilerUnitTest::UnitTestForGoodShaderCompiler() -{ - AZ_TracePrintf("ShaderCompilerUnitTest", " ... Starting test of 'good' shader compiler...\n"); - m_shaderCompilerManager.m_sendResponseCallbackFn = AZStd::bind(&ShaderCompilerUnitTest::VerifyPayloadForGoodShaderCompiler, this , AZStd::placeholders::_1, AZStd::placeholders::_2, AZStd::placeholders::_3, AZStd::placeholders::_4); - m_server.Init("127.0.0.1", 12348); - m_server.setServerStatus(UnitTestShaderCompilerServer::GoodServer); - m_connectionManager->SendMessageToService(m_connectionId, AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyRequest"), 0, m_testPayload); -} - -void ShaderCompilerUnitTest::UnitTestForFirstBadShaderCompiler() -{ - AZ_TracePrintf("ShaderCompilerUnitTest", " ... Starting test of 'bad' shader compiler... (Incomplete Payload)\n"); - m_shaderCompilerManager.m_sendResponseCallbackFn = AZStd::bind(&ShaderCompilerUnitTest::VerifyPayloadForFirstBadShaderCompiler, this, AZStd::placeholders::_1, AZStd::placeholders::_2, AZStd::placeholders::_3, AZStd::placeholders::_4); - m_server.setServerStatus(UnitTestShaderCompilerServer::BadServer_SendsIncompletePayload); - m_connectionManager->SendMessageToService(m_connectionId, AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyRequest"), 0, m_testPayload); -} - -void ShaderCompilerUnitTest::UnitTestForSecondBadShaderCompiler() -{ - AZ_TracePrintf("ShaderCompilerUnitTest", " ... Starting test of 'bad' shader compiler... (Payload followed by disconnection)\n"); - m_shaderCompilerManager.m_sendResponseCallbackFn = AZStd::bind(&ShaderCompilerUnitTest::VerifyPayloadForSecondBadShaderCompiler, this, AZStd::placeholders::_1, AZStd::placeholders::_2, AZStd::placeholders::_3, AZStd::placeholders::_4); - m_server.setServerStatus(UnitTestShaderCompilerServer::BadServer_ReadsPayloadAndDisconnect); - m_connectionManager->SendMessageToService(m_connectionId, AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyRequest"), 0, m_testPayload); -} - -void ShaderCompilerUnitTest::UnitTestForThirdBadShaderCompiler() -{ - AZ_TracePrintf("ShaderCompilerUnitTest", " ... Starting test of 'bad' shader compiler... (Connect but disconnect without data)\n"); - m_shaderCompilerManager.m_sendResponseCallbackFn = AZStd::bind(&ShaderCompilerUnitTest::VerifyPayloadForThirdBadShaderCompiler, this, AZStd::placeholders::_1, AZStd::placeholders::_2, AZStd::placeholders::_3, AZStd::placeholders::_4); - m_server.setServerStatus(UnitTestShaderCompilerServer::BadServer_DisconnectAfterConnect); - m_server.startServer(); - m_connectionManager->SendMessageToService(m_connectionId, AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyRequest"), 0, m_testPayload); -} - -void ShaderCompilerUnitTest::VerifyPayloadForGoodShaderCompiler(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload) -{ - (void) connId; - (void) type; - (void) serial; - m_shaderCompilerManager.m_sendResponseCallbackFn = nullptr; - - unsigned int messageSize; - quint8 status; - QByteArray payloadToCheck; - unsigned int requestId; - memcpy((&messageSize), payload.data(), sizeof(unsigned int)); - memcpy((&status), payload.data() + sizeof(unsigned int), sizeof(unsigned char)); - payloadToCheck.resize(messageSize); - memcpy((payloadToCheck.data()), payload.data() + sizeof(unsigned int) + sizeof(unsigned char), messageSize); - memcpy((&requestId), payload.data() + sizeof(unsigned int) + sizeof(unsigned char) + messageSize, sizeof(unsigned int)); - QString outgoingTestString = "Test string validated"; - if (QString::compare(QString(payloadToCheck), outgoingTestString, Qt::CaseSensitive) != 0) - { - Q_EMIT UnitTestFailed("Unit Test for Good Shader Compiler Failed"); - return; - } - Q_EMIT StartUnitTestForFirstBadShaderCompiler(); -} - -void ShaderCompilerUnitTest::VerifyPayloadForFirstBadShaderCompiler(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload) -{ - (void) connId; - (void) type; - (void) serial; - m_shaderCompilerManager.m_sendResponseCallbackFn = nullptr; - QString error = "Remote IP is taking too long to respond: 127.0.0.1"; - if ((payload.size() != 4) || (QString::compare(m_lastShaderCompilerErrorMessage, error, Qt::CaseSensitive) != 0)) - { - Q_EMIT UnitTestFailed("Unit Test for First Bad Shader Compiler Failed"); - return; - } - m_lastShaderCompilerErrorMessage.clear(); - Q_EMIT StartUnitTestForSecondBadShaderCompiler(); -} - -void ShaderCompilerUnitTest::VerifyPayloadForSecondBadShaderCompiler(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload) -{ - (void) connId; - (void) type; - (void) serial; - m_shaderCompilerManager.m_sendResponseCallbackFn = nullptr; - QString error = "Remote IP is taking too long to respond: 127.0.0.1"; - if ((payload.size() != 4) || (QString::compare(m_lastShaderCompilerErrorMessage, error, Qt::CaseSensitive) != 0)) - { - Q_EMIT UnitTestFailed("Unit Test for Second Bad Shader Compiler Failed"); - return; - } - m_lastShaderCompilerErrorMessage.clear(); - Q_EMIT StartUnitTestForThirdBadShaderCompiler(); -} - -void ShaderCompilerUnitTest::VerifyPayloadForThirdBadShaderCompiler(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload) -{ - (void) connId; - (void) type; - (void) serial; - m_shaderCompilerManager.m_sendResponseCallbackFn = nullptr; - QString error = "Remote IP is taking too long to respond: 127.0.0.1"; - if ((payload.size() != 4) || (QString::compare(m_lastShaderCompilerErrorMessage, error, Qt::CaseSensitive) != 0)) - { - Q_EMIT UnitTestFailed("Unit Test for Third Bad Shader Compiler Failed"); - return; - } - m_lastShaderCompilerErrorMessage.clear(); - Q_EMIT UnitTestPassed(); -} - -void ShaderCompilerUnitTest::ReceiveShaderCompilerErrorMessage(QString error, QString server, QString timestamp, QString payload) -{ - (void) server; - (void) timestamp; - (void) payload; - m_lastShaderCompilerErrorMessage = error; -} - - -REGISTER_UNIT_TEST(ShaderCompilerUnitTest) - diff --git a/Code/Tools/AssetProcessor/native/unittests/ShaderCompilerUnitTests.h b/Code/Tools/AssetProcessor/native/unittests/ShaderCompilerUnitTests.h deleted file mode 100644 index edcff7e949..0000000000 --- a/Code/Tools/AssetProcessor/native/unittests/ShaderCompilerUnitTests.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef SHADERCOMPILERUNITTEST_H -#define SHADERCOMPILERUNITTEST_H - -#if !defined(Q_MOC_RUN) -#include "UnitTestRunner.h" - -#include - -#include "native/shadercompiler/shadercompilerManager.h" -//#include "native/shadercompiler/shadercompilerMessages.h" -#include "native/utilities/UnitTestShaderCompilerServer.h" -#include -#include -#endif - -class ConnectionManager; - -class ShaderCompilerManagerForUnitTest : public ShaderCompilerManager -{ -public: - explicit ShaderCompilerManagerForUnitTest(QObject* parent = 0) : ShaderCompilerManager(parent) {}; - - // for this test, we override sendResponse and make it so that it just calls a callback instead of actually sending it to the connection manager. - void sendResponse(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload) override - { - if (m_sendResponseCallbackFn) - { - m_sendResponseCallbackFn(connId, type, serial, payload); - } - } - AZStd::function m_sendResponseCallbackFn; -}; - -class ShaderCompilerUnitTest - : public UnitTestRun -{ - Q_OBJECT -public: - ShaderCompilerUnitTest(); - ~ShaderCompilerUnitTest(); - virtual void StartTest() override; - virtual int UnitTestPriority() const override; - void ContructPayloadForShaderCompilerServer(QByteArray& payload); - -Q_SIGNALS: - void StartUnitTestForGoodShaderCompiler(); - void StartUnitTestForFirstBadShaderCompiler(); - void StartUnitTestForSecondBadShaderCompiler(); - void StartUnitTestForThirdBadShaderCompiler(); - -public Q_SLOTS: - void UnitTestForGoodShaderCompiler(); - void UnitTestForFirstBadShaderCompiler(); - void UnitTestForSecondBadShaderCompiler(); - void UnitTestForThirdBadShaderCompiler(); - void VerifyPayloadForGoodShaderCompiler(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload); - void VerifyPayloadForFirstBadShaderCompiler(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload); - void VerifyPayloadForSecondBadShaderCompiler(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload); - void VerifyPayloadForThirdBadShaderCompiler(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload); - void ReceiveShaderCompilerErrorMessage(QString error, QString server, QString timestamp, QString payload); - - -private: - UnitTestShaderCompilerServer m_server; - ShaderCompilerManagerForUnitTest m_shaderCompilerManager; - ConnectionManager* m_connectionManager; - QByteArray m_testPayload; - QString m_lastShaderCompilerErrorMessage; - unsigned int m_connectionId = 0; -}; - -#endif // SHADERCOMPILERUNITTEST_H - - diff --git a/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp b/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp index c3ff22a39e..7652b67db0 100644 --- a/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp @@ -12,8 +12,6 @@ #include "native/resourcecompiler/rccontroller.h" #include "native/FileServer/fileServer.h" #include "native/AssetManager/assetScanner.h" -#include "native/shadercompiler/shadercompilerManager.h" -#include "native/shadercompiler/shadercompilerModel.h" #include #include @@ -55,7 +53,7 @@ namespace { moduleFileInfo.setFile(executableDirectory); } - + QDir binaryDir = moduleFileInfo.absoluteDir(); // strip extension QString applicationBase = moduleFileInfo.completeBaseName(); @@ -70,7 +68,7 @@ namespace binaryDir.remove(tempFile); } } - + } @@ -145,8 +143,6 @@ void GUIApplicationManager::Destroy() DestroyIniConfiguration(); DestroyFileServer(); - DestroyShaderCompilerManager(); - DestroyShaderCompilerModel(); } @@ -192,7 +188,7 @@ bool GUIApplicationManager::Run() wrapper->enableSaveRestoreGeometry(GetOrganizationName(), GetApplicationName(), "MainWindow", restoreOnFirstShow); AzQtComponents::StyleManager::setStyleSheet(m_mainWindow, QStringLiteral("style:AssetProcessor.qss")); - + auto refreshStyleSheets = [styleManager]() { styleManager->Refresh(); @@ -334,7 +330,7 @@ bool GUIApplicationManager::Run() m_duringStartup = false; int resultCode = qApp->exec(); // this blocks until the last window is closed. - + if(!InitiatedShutdown()) { // if we are here it implies that AP did not stop the Qt event loop and is shutting down prematurely @@ -427,7 +423,7 @@ bool GUIApplicationManager::OnError(const char* /*window*/, const char* message) return true; } - // If we're the main thread, then consider showing the message box directly. + // If we're the main thread, then consider showing the message box directly. // note that all other threads will PAUSE if they emit a message while the main thread is showing this box // due to the way the trace system EBUS is mutex-protected. Qt::ConnectionType connection = Qt::DirectConnection; @@ -470,7 +466,7 @@ bool GUIApplicationManager::Activate() AssetUtilities::ComputeProjectCacheRoot(projectCacheRoot); m_localUserSettings.Load(projectCacheRoot.filePath("AssetProcessorUserSettings.xml").toUtf8().data(), context); m_localUserSettings.Activate(AZ::UserSettings::CT_LOCAL); - + InitIniConfiguration(); InitFileServer(); @@ -479,9 +475,6 @@ bool GUIApplicationManager::Activate() { return false; } - - InitShaderCompilerModel(); - InitShaderCompilerManager(); return true; } @@ -606,7 +599,7 @@ void GUIApplicationManager::InitConnectionManager() QObject::connect(m_fileServer, SIGNAL(AddRenameRequest(unsigned int, bool)), m_connectionManager, SLOT(AddRenameRequest(unsigned int, bool))); QObject::connect(m_fileServer, SIGNAL(AddFindFileNamesRequest(unsigned int, bool)), m_connectionManager, SLOT(AddFindFileNamesRequest(unsigned int, bool))); QObject::connect(m_fileServer, SIGNAL(UpdateConnectionMetrics()), m_connectionManager, SLOT(UpdateConnectionMetrics())); - + m_connectionManager->RegisterService(ShowAssetProcessorRequest::MessageType, std::bind([this](unsigned int /*connId*/, unsigned int /*type*/, unsigned int /*serial*/, QByteArray /*payload*/) { @@ -661,40 +654,6 @@ void GUIApplicationManager::DestroyFileServer() } } -void GUIApplicationManager::InitShaderCompilerManager() -{ - m_shaderCompilerManager = new ShaderCompilerManager(); - - //Shader compiler stuff - m_connectionManager->RegisterService(AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyRequest"), std::bind(&ShaderCompilerManager::process, m_shaderCompilerManager, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); - QObject::connect(m_shaderCompilerManager, SIGNAL(sendErrorMessageFromShaderJob(QString, QString, QString, QString)), m_shaderCompilerModel, SLOT(addShaderErrorInfoEntry(QString, QString, QString, QString))); - - -} - -void GUIApplicationManager::DestroyShaderCompilerManager() -{ - if (m_shaderCompilerManager) - { - delete m_shaderCompilerManager; - m_shaderCompilerManager = nullptr; - } -} - -void GUIApplicationManager::InitShaderCompilerModel() -{ - m_shaderCompilerModel = new ShaderCompilerModel(); -} - -void GUIApplicationManager::DestroyShaderCompilerModel() -{ - if (m_shaderCompilerModel) - { - delete m_shaderCompilerModel; - m_shaderCompilerModel = nullptr; - } -} - IniConfiguration* GUIApplicationManager::GetIniConfiguration() const { return m_iniConfiguration; @@ -704,14 +663,6 @@ FileServer* GUIApplicationManager::GetFileServer() const { return m_fileServer; } -ShaderCompilerManager* GUIApplicationManager::GetShaderCompilerManager() const -{ - return m_shaderCompilerManager; -} -ShaderCompilerModel* GUIApplicationManager::GetShaderCompilerModel() const -{ - return m_shaderCompilerModel; -} void GUIApplicationManager::ShowTrayIconErrorMessage(QString msg) { diff --git a/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.h b/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.h index 3cf58231f2..c10d841daf 100644 --- a/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.h +++ b/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.h @@ -24,8 +24,6 @@ class ConnectionManager; class IniConfiguration; class ApplicationServer; class FileServer; -class ShaderCompilerManager; -class ShaderCompilerModel; namespace AssetProcessor { @@ -47,8 +45,6 @@ public: ApplicationManager::BeforeRunStatus BeforeRun() override; IniConfiguration* GetIniConfiguration() const; FileServer* GetFileServer() const; - ShaderCompilerManager* GetShaderCompilerManager() const; - ShaderCompilerModel* GetShaderCompilerModel() const; bool Run() override; //////////////////////////////////////////////////// @@ -72,10 +68,6 @@ private: void DestroyIniConfiguration(); void InitFileServer(); void DestroyFileServer(); - void InitShaderCompilerManager(); - void DestroyShaderCompilerManager(); - void InitShaderCompilerModel(); - void DestroyShaderCompilerModel(); void Destroy() override; Q_SIGNALS: @@ -99,8 +91,7 @@ private: IniConfiguration* m_iniConfiguration = nullptr; FileServer* m_fileServer = nullptr; - ShaderCompilerManager* m_shaderCompilerManager = nullptr; - ShaderCompilerModel* m_shaderCompilerModel = nullptr; + QFileSystemWatcher m_qtFileWatcher; AZ::UserSettingsProvider m_localUserSettings; bool m_messageBoxIsVisible = false; From 81453defa02e691f17860ab7327a169c7b7cc0b4 Mon Sep 17 00:00:00 2001 From: amzn-mike <80125227+amzn-mike@users.noreply.github.com> Date: Mon, 3 Jan 2022 09:56:19 -0600 Subject: [PATCH 221/399] Load QIcons once for asset tree and share with each Asset Tree Item to avoid file loads for every asset and improve start up time (#6485) Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> --- .../Tools/AssetProcessor/native/ui/AssetTreeItem.cpp | 12 +++++++----- Code/Tools/AssetProcessor/native/ui/AssetTreeItem.h | 2 ++ .../AssetProcessor/native/ui/AssetTreeModel.cpp | 9 ++++++--- Code/Tools/AssetProcessor/native/ui/AssetTreeModel.h | 2 ++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Code/Tools/AssetProcessor/native/ui/AssetTreeItem.cpp b/Code/Tools/AssetProcessor/native/ui/AssetTreeItem.cpp index d8b69a80f5..75823374a0 100644 --- a/Code/Tools/AssetProcessor/native/ui/AssetTreeItem.cpp +++ b/Code/Tools/AssetProcessor/native/ui/AssetTreeItem.cpp @@ -29,14 +29,16 @@ namespace AssetProcessor AssetTreeItem::AssetTreeItem( AZStd::shared_ptr data, QIcon errorIcon, + QIcon folderIcon, + QIcon fileIcon, AssetTreeItem* parentItem) : m_data(data), m_parent(parentItem), - m_errorIcon(errorIcon), // QIcon is implicitily shared. - m_folderIcon(QIcon(QStringLiteral(":/Gallery/Asset_Folder.svg"))), - m_fileIcon(QIcon(QStringLiteral(":/Gallery/Asset_File.svg"))) + m_errorIcon(errorIcon), // QIcon is implicitly shared. + m_folderIcon(folderIcon), + m_fileIcon(fileIcon) { - m_folderIcon.addFile(QStringLiteral(":/Gallery/Asset_Folder.svg"), QSize(), QIcon::Selected); + } AssetTreeItem::~AssetTreeItem() @@ -45,7 +47,7 @@ namespace AssetProcessor AssetTreeItem* AssetTreeItem::CreateChild(AZStd::shared_ptr data) { - m_childItems.emplace_back(new AssetTreeItem(data, m_errorIcon, this)); + m_childItems.emplace_back(new AssetTreeItem(data, m_errorIcon, m_folderIcon, m_fileIcon, this)); return m_childItems.back().get(); } diff --git a/Code/Tools/AssetProcessor/native/ui/AssetTreeItem.h b/Code/Tools/AssetProcessor/native/ui/AssetTreeItem.h index c9bc926c34..f36855adfe 100644 --- a/Code/Tools/AssetProcessor/native/ui/AssetTreeItem.h +++ b/Code/Tools/AssetProcessor/native/ui/AssetTreeItem.h @@ -50,6 +50,8 @@ namespace AssetProcessor explicit AssetTreeItem( AZStd::shared_ptr data, QIcon errorIcon, + QIcon folderIcon, + QIcon fileIcon, AssetTreeItem* parentItem = nullptr); virtual ~AssetTreeItem(); diff --git a/Code/Tools/AssetProcessor/native/ui/AssetTreeModel.cpp b/Code/Tools/AssetProcessor/native/ui/AssetTreeModel.cpp index 8d889343f9..e8540c3d8d 100644 --- a/Code/Tools/AssetProcessor/native/ui/AssetTreeModel.cpp +++ b/Code/Tools/AssetProcessor/native/ui/AssetTreeModel.cpp @@ -16,9 +16,12 @@ namespace AssetProcessor AssetTreeModel::AssetTreeModel(AZStd::shared_ptr sharedDbConnection, QObject *parent) : QAbstractItemModel(parent), - m_sharedDbConnection(sharedDbConnection), - m_errorIcon(QStringLiteral(":/stylesheet/img/logging/error.svg")) + m_sharedDbConnection(sharedDbConnection) + , m_errorIcon(QStringLiteral(":/stylesheet/img/logging/error.svg")) + , m_folderIcon(QIcon(QStringLiteral(":/Gallery/Asset_Folder.svg"))) + , m_fileIcon(QIcon(QStringLiteral(":/Gallery/Asset_File.svg"))) { + m_folderIcon.addFile(QStringLiteral(":/Gallery/Asset_Folder.svg"), QSize(), QIcon::Selected); ApplicationManagerNotifications::Bus::Handler::BusConnect(); AzToolsFramework::AssetDatabase::AssetDatabaseNotificationBus::Handler::BusConnect(); } @@ -40,7 +43,7 @@ namespace AssetProcessor void AssetTreeModel::Reset() { beginResetModel(); - m_root.reset(new AssetTreeItem(AZStd::make_shared("", "", true, AZ::Uuid::CreateNull()), m_errorIcon)); + m_root.reset(new AssetTreeItem(AZStd::make_shared("", "", true, AZ::Uuid::CreateNull()), m_errorIcon, m_folderIcon, m_fileIcon)); ResetModel(); diff --git a/Code/Tools/AssetProcessor/native/ui/AssetTreeModel.h b/Code/Tools/AssetProcessor/native/ui/AssetTreeModel.h index d33bc0bc48..27201c55a3 100644 --- a/Code/Tools/AssetProcessor/native/ui/AssetTreeModel.h +++ b/Code/Tools/AssetProcessor/native/ui/AssetTreeModel.h @@ -54,5 +54,7 @@ namespace AssetProcessor AZStd::shared_ptr m_sharedDbConnection; QIcon m_errorIcon; + QIcon m_folderIcon; + QIcon m_fileIcon; }; } From ee554f6464715c342acb6d26f64bd27b71200560 Mon Sep 17 00:00:00 2001 From: Roman <69218254+amzn-rhhong@users.noreply.github.com> Date: Mon, 3 Jan 2022 09:25:41 -0800 Subject: [PATCH 222/399] ActorInstanceId default to -1 when no %lastresult matches (#6442) * small bugfix Signed-off-by: rhhong * ActorInstanceId default to -1 when no %lastresult matches Signed-off-by: rhhong * CR feedback - wrap function to get the first available editor actor instance. Signed-off-by: rhhong * Remove mcore inline Signed-off-by: rhhong * Fixed the bug that delete an instance from actor manager crashes the editor. Signed-off-by: rhhong --- .../Source/ActorInstanceCommands.cpp | 20 ++++++++++++++++++- .../Source/AnimGraphCommands.cpp | 13 ++++++++++-- .../Code/EMotionFX/Source/ActorManager.cpp | 14 +++++++++++++ .../Code/EMotionFX/Source/ActorManager.h | 6 ++++++ .../EMStudioSDK/Source/MainWindow.cpp | 10 +++++++++- .../Source/RenderPlugin/RenderPlugin.cpp | 10 +++++++++- .../EMStudioSDK/Source/Workspace.cpp | 13 ++++++++++++ .../Code/MCore/Source/MCoreCommandManager.cpp | 7 ++++++- 8 files changed, 87 insertions(+), 6 deletions(-) diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorInstanceCommands.cpp b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorInstanceCommands.cpp index ba25318944..328c905ded 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorInstanceCommands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorInstanceCommands.cpp @@ -439,6 +439,12 @@ namespace CommandSystem return false; } + if (actorInstance->GetEntity()) + { + outResult = AZStd::string::format("Cannot remove actor instance. Actor instance %i belongs to an entity.", actorInstanceID); + return false; + } + // store the old values before removing the instance m_oldPosition = actorInstance->GetLocalSpaceTransform().m_position; m_oldRotation = actorInstance->GetLocalSpaceTransform().m_rotation; @@ -618,7 +624,7 @@ namespace CommandSystem MCore::CommandGroup commandGroup("Remove actor instances", numActorInstances); AZStd::string tempString; - // iterate over the selected instances and clone them + // iterate over the selected instances and remove them for (size_t i = 0; i < numActorInstances; ++i) { // get the current actor instance @@ -628,6 +634,18 @@ namespace CommandSystem continue; } + // Do not remove any runtime instance from the manager using the commands. + if (actorInstance->GetIsOwnedByRuntime()) + { + continue; + } + + // Do not remove the any instances owned by an entity from the manager using the commands. + if (actorInstance->GetEntity()) + { + continue; + } + tempString = AZStd::string::format("RemoveActorInstance -actorInstanceID %i", actorInstance->GetID()); commandGroup.AddCommandString(tempString.c_str()); } diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp index bd5a14f772..b1a830c838 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp @@ -455,8 +455,17 @@ namespace CommandSystem EMotionFX::ActorInstance* actorInstance = nullptr; if (parameters.CheckIfHasParameter("actorInstanceID")) { - const uint32 actorInstanceID = parameters.GetValueAsInt("actorInstanceID", this); - actorInstance = EMotionFX::GetActorManager().FindActorInstanceByID(actorInstanceID); + const int actorInstanceID = parameters.GetValueAsInt("actorInstanceID", this); + if (actorInstanceID == -1) + { + // If there isn't an actorInstanceId, grab the first actor instance. + actorInstance = EMotionFX::GetActorManager().GetFirstEditorActorInstance(); + } + else + { + actorInstance = EMotionFX::GetActorManager().FindActorInstanceByID(actorInstanceID); + } + if (!actorInstance) { outResult = AZStd::string::format("Cannot activate anim graph. Actor instance id '%i' is not valid.", actorInstanceID); diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/ActorManager.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/ActorManager.cpp index 184aac6e2c..252fccdb94 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/ActorManager.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/ActorManager.cpp @@ -434,6 +434,20 @@ namespace EMotionFX } + ActorInstance* ActorManager::GetFirstEditorActorInstance() const + { + const size_t numActorInstances = m_actorInstances.size(); + for (size_t i = 0; i < numActorInstances; ++i) + { + if (!m_actorInstances[i]->GetIsOwnedByRuntime()) + { + return m_actorInstances[i]; + } + } + return nullptr; + } + + const AZStd::vector& ActorManager::GetActorInstanceArray() const { return m_actorInstances; diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/ActorManager.h b/Gems/EMotionFX/Code/EMotionFX/Source/ActorManager.h index 003153b36c..016edb302e 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/ActorManager.h +++ b/Gems/EMotionFX/Code/EMotionFX/Source/ActorManager.h @@ -136,6 +136,12 @@ namespace EMotionFX */ MCORE_INLINE ActorInstance* GetActorInstance(size_t nr) const { return m_actorInstances[nr]; } + /** + * Get a given registered actor instance owned by editor (not owned by runtime). + * @result A pointer to the actor instance. + */ + ActorInstance* GetFirstEditorActorInstance() const; + /** * Get the array of actor instances. * @result The const reference to the actor instance array. diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp index b75fb71060..083d6a9be1 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -1340,8 +1341,15 @@ namespace EMStudio // add the load and the create instance commands commandGroup.AddCommandString(loadActorCommand.c_str()); - commandGroup.AddCommandString("CreateActorInstance -actorID %LASTRESULT%"); + // Temp solution after we refactor / remove the actor manager. + // We only need to create the actor instance by ourselves when openGLRenderPlugin is present. + // Atom render viewport will create actor instance along with the actor component. + PluginManager* pluginManager = GetPluginManager(); + if (pluginManager->FindActivePlugin(static_cast(OpenGLRenderPlugin::CLASS_ID))) + { + commandGroup.AddCommandString("CreateActorInstance -actorID %LASTRESULT%"); + } // execute the group command if (GetCommandManager()->ExecuteCommandGroup(commandGroup, outResult) == false) diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderPlugin.cpp index 2c9e84c9b9..3451855c86 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderPlugin.cpp @@ -429,6 +429,7 @@ namespace EMStudio // 3. Relink the actor instances with the emstudio actors const size_t numActorInstances = EMotionFX::GetActorManager().GetNumActorInstances(); + size_t numActorInstancesInRenderPlugin = 0; for (size_t i = 0; i < numActorInstances; ++i) { EMotionFX::ActorInstance* actorInstance = EMotionFX::GetActorManager().GetActorInstance(i); @@ -440,6 +441,12 @@ namespace EMStudio continue; } + if (actorInstance->GetEntity()) + { + continue; + } + + numActorInstancesInRenderPlugin++; if (!emstudioActor) { for (EMStudioRenderActor* currentEMStudioActor : m_actors) @@ -485,6 +492,7 @@ namespace EMStudio if (found == false) { emstudioActor->m_actorInstances.erase(AZStd::next(begin(emstudioActor->m_actorInstances), j)); + numActorInstancesInRenderPlugin--; } else { @@ -497,7 +505,7 @@ namespace EMStudio m_reinitRequested = false; // zoom the camera to the available character only in case we're dealing with a single instance - if (resetViewCloseup && numActorInstances == 1) + if (resetViewCloseup && numActorInstancesInRenderPlugin == 1) { ViewCloseup(false); } diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Workspace.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Workspace.cpp index cada8c7f59..c8ee9be995 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Workspace.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Workspace.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -430,6 +431,18 @@ namespace EMStudio continue; } + // Temp solution after we refactor / remove the actor manager. + // We only need to create the actor instance by ourselves when openGLRenderPlugin is present. + // Atom render viewport will create actor instance along with the actor component. + PluginManager* pluginManager = GetPluginManager(); + if (!pluginManager->FindActivePlugin(static_cast(OpenGLRenderPlugin::CLASS_ID))) + { + if (commands[i].find("CreateActorInstance") == 0) + { + continue; + } + } + AzFramework::StringFunc::Replace(commands[i], "@products@", assetCacheFolder.c_str()); AzFramework::StringFunc::Replace(commands[i], "@assets@", assetCacheFolder.c_str()); AzFramework::StringFunc::Replace(commands[i], "@root@", assetCacheFolder.c_str()); diff --git a/Gems/EMotionFX/Code/MCore/Source/MCoreCommandManager.cpp b/Gems/EMotionFX/Code/MCore/Source/MCoreCommandManager.cpp index b59f2b69a0..4b21cde9f6 100644 --- a/Gems/EMotionFX/Code/MCore/Source/MCoreCommandManager.cpp +++ b/Gems/EMotionFX/Code/MCore/Source/MCoreCommandManager.cpp @@ -547,7 +547,12 @@ namespace MCore } tmpStr = commandString.substr(lastResultIndex, rightPercentagePos - lastResultIndex + 1); - AzFramework::StringFunc::Replace(commandString, tmpStr.c_str(), intermediateCommandResults[i - relativeIndex].c_str()); + AZStd::string replaceStr = intermediateCommandResults[i - relativeIndex]; + if (replaceStr.empty()) + { + replaceStr = "-1"; + } + AzFramework::StringFunc::Replace(commandString, tmpStr.c_str(), replaceStr.c_str()); replaceHappen = true; // Search again in case the command group is referring to other results From 1d819e25917a41a5f619195c6c1070b07bd83f90 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Mon, 3 Jan 2022 11:50:49 -0800 Subject: [PATCH 223/399] Fix crash caused by trying to dereference a nullptr Early return if input attachment is null (#6590) Signed-off-by: amzn-sj --- .../Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp index b92d538fb5..553133aef7 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp @@ -101,6 +101,13 @@ namespace AZ void EsmShadowmapsPass::UpdateChildren() { const RPI::PassAttachmentBinding& inputBinding = GetInputBinding(0); + + if (!inputBinding.m_attachment) + { + AZ_Assert(false, "[EsmShadowmapsPass %s] requires an input attachment", GetPathName().GetCStr()); + return; + } + AZ_Assert(inputBinding.m_attachment->m_descriptor.m_type == RHI::AttachmentType::Image, "[EsmShadowmapsPass %s] input attachment requires an image attachment", GetPathName().GetCStr()); m_shadowmapImageSize = inputBinding.m_attachment->m_descriptor.m_image.m_size; m_shadowmapArraySize = inputBinding.m_attachment->m_descriptor.m_image.m_arraySize; From 75476032ab97809e37507e7a1801562bc450efeb Mon Sep 17 00:00:00 2001 From: Junbo Liang <68558268+junbo75@users.noreply.github.com> Date: Mon, 3 Jan 2022 11:59:03 -0800 Subject: [PATCH 224/399] Define AWSI automation tests pipe for Jenkins (#6518) * Define AWSI automation tests pipe for Jenkins Signed-off-by: Junbo Liang <68558268+junbo75@users.noreply.github.com> --- .../build/Platform/Linux/build_config.json | 49 +++++++++++++++ .../Platform/Linux/deploy_cdk_applications.sh | 8 +++ .../Linux/destroy_cdk_applications.sh | 8 +++ scripts/build/Platform/Linux/pipeline.json | 62 +++++++++++++++++++ 4 files changed, 127 insertions(+) diff --git a/scripts/build/Platform/Linux/build_config.json b/scripts/build/Platform/Linux/build_config.json index 5290a32f6d..988cf23703 100644 --- a/scripts/build/Platform/Linux/build_config.json +++ b/scripts/build/Platform/Linux/build_config.json @@ -132,6 +132,35 @@ "ASSET_PROCESSOR_PLATFORMS": "linux,server" } }, + "awsi_test_profile_pipe": { + "TAGS": [ + "nightly-incremental", + "nightly-clean" + ], + "steps": [ + "awsi_deployment", + "awsi_test_profile", + "awsi_destruction" + ] + }, + "awsi_test_profile": { + "TAGS": [ + "weekly-build-metrics" + ], + "PIPELINE_ENV": { + "NONBLOCKING_STEP": "True" + }, + "COMMAND": "build_test_linux.sh", + "PARAMETERS": { + "CONFIGURATION": "profile", + "OUTPUT_DIRECTORY": "build\\linux", + "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DLY_PARALLEL_LINK_JOBS=4", + "CMAKE_LY_PROJECTS": "AutomatedTesting", + "CMAKE_TARGET": "TEST_SUITE_awsi", + "CTEST_OPTIONS": "-L \"(SUITE_awsi)\" --no-tests=error", + "TEST_RESULTS": "True" + } + }, "periodic_test_profile": { "TAGS": [ "nightly-incremental", @@ -275,5 +304,25 @@ "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DLY_PARALLEL_LINK_JOBS=4 -DCMAKE_MODULE_PATH=${WORKSPACE}/o3de/install/cmake", "CMAKE_TARGET": "all" } + }, + "awsi_deployment": { + "TAGS": [], + "PIPELINE_ENV": { + "NONBLOCKING_STEP": "True" + }, + "COMMAND": "deploy_cdk_applications.sh", + "PARAMETERS": { + "NVM_VERSION": "v0.39.1" + } + }, + "awsi_destruction": { + "TAGS": [], + "PIPELINE_ENV": { + "NONBLOCKING_STEP": "True" + }, + "COMMAND": "destroy_cdk_applications.sh", + "PARAMETERS": { + "NVM_VERSION": "v0.39.1" + } } } diff --git a/scripts/build/Platform/Linux/deploy_cdk_applications.sh b/scripts/build/Platform/Linux/deploy_cdk_applications.sh index 93a3dccd9f..97668ee70c 100755 --- a/scripts/build/Platform/Linux/deploy_cdk_applications.sh +++ b/scripts/build/Platform/Linux/deploy_cdk_applications.sh @@ -61,6 +61,14 @@ then exit 1 fi +echo [cdk_installation] Install nvm $NVM_VERSION +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh | bash +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion +echo [cdk_installation] Install the current version of nodejs +nvm install node + echo [cdk_installation] Install the latest version of CDK if ! sudo npm uninstall -g aws-cdk; then diff --git a/scripts/build/Platform/Linux/destroy_cdk_applications.sh b/scripts/build/Platform/Linux/destroy_cdk_applications.sh index 795ab78484..54f84911a6 100755 --- a/scripts/build/Platform/Linux/destroy_cdk_applications.sh +++ b/scripts/build/Platform/Linux/destroy_cdk_applications.sh @@ -61,6 +61,14 @@ then exit 1 fi +echo [cdk_installation] Install nvm $NVM_VERSION +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh | bash +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion +echo [cdk_installation] Install the current version of nodejs +nvm install node + echo [cdk_installation] Install the latest version of CDK if ! sudo npm uninstall -g aws-cdk; then diff --git a/scripts/build/Platform/Linux/pipeline.json b/scripts/build/Platform/Linux/pipeline.json index f44ed5f9de..d10e2886f2 100644 --- a/scripts/build/Platform/Linux/pipeline.json +++ b/scripts/build/Platform/Linux/pipeline.json @@ -16,5 +16,67 @@ "nightly-clean": { "CLEAN_WORKSPACE": true } + }, + "PIPELINE_JENKINS_PARAMETERS": { + "nightly-incremental": [ + { + "parameter_name": "O3DE_AWS_PROJECT_NAME", + "parameter_type": "string", + "default_value": "", + "use_last_run_value": true, + "description": "The name of the O3DE project that stacks should be deployed for." + }, + { + "parameter_name": "O3DE_AWS_DEPLOY_REGION", + "parameter_type": "string", + "default_value": "", + "use_last_run_value": true, + "description": "The region to deploy the stacks into." + }, + { + "parameter_name": "ASSUME_ROLE_ARN", + "parameter_type": "string", + "default_value": "", + "use_last_run_value": true, + "description": "The ARN of the IAM role to assume to retrieve temporary AWS credentials." + }, + { + "parameter_name": "COMMIT_ID", + "parameter_type": "string", + "default_value": "", + "use_last_run_value": true, + "description": "The commit ID for locking the version of CDK applications to deploy." + } + ], + "nightly-clean": [ + { + "parameter_name": "O3DE_AWS_PROJECT_NAME", + "parameter_type": "string", + "default_value": "", + "use_last_run_value": true, + "description": "The name of the O3DE project that stacks should be deployed for." + }, + { + "parameter_name": "O3DE_AWS_DEPLOY_REGION", + "parameter_type": "string", + "default_value": "", + "use_last_run_value": true, + "description": "The region to deploy the stacks into." + }, + { + "parameter_name": "ASSUME_ROLE_ARN", + "parameter_type": "string", + "default_value": "", + "use_last_run_value": true, + "description": "The ARN of the IAM role to assume to retrieve temporary AWS credentials." + }, + { + "parameter_name": "COMMIT_ID", + "parameter_type": "string", + "default_value": "", + "use_last_run_value": true, + "description": "The commit ID for locking the version of CDK applications to deploy." + } + ] } } From fd9574c6489bcbcb644db6e49ff876b79c72a17b Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Mon, 3 Jan 2022 14:21:44 -0600 Subject: [PATCH 225/399] Removed legacy QtUi/ClickableLabel and re-worked about dialog to use QLabel for terms of use label Signed-off-by: Chris Galvan --- Code/Editor/AboutDialog.cpp | 7 -- Code/Editor/AboutDialog.h | 2 - Code/Editor/AboutDialog.ui | 14 ++- Code/Editor/Lib/Tests/test_ClickableLabel.cpp | 58 ---------- Code/Editor/QtUI/ClickableLabel.cpp | 101 ------------------ Code/Editor/QtUI/ClickableLabel.h | 39 ------- Code/Editor/editor_lib_files.cmake | 2 - Code/Editor/editor_lib_test_files.cmake | 1 - 8 files changed, 6 insertions(+), 218 deletions(-) delete mode 100644 Code/Editor/Lib/Tests/test_ClickableLabel.cpp delete mode 100644 Code/Editor/QtUI/ClickableLabel.cpp delete mode 100644 Code/Editor/QtUI/ClickableLabel.h diff --git a/Code/Editor/AboutDialog.cpp b/Code/Editor/AboutDialog.cpp index c0fd39e1ae..ba086cad5d 100644 --- a/Code/Editor/AboutDialog.cpp +++ b/Code/Editor/AboutDialog.cpp @@ -30,8 +30,6 @@ CAboutDialog::CAboutDialog(QString versionText, QString richTextCopyrightNotice, m_ui->setupUi(this); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - connect(m_ui->m_transparentAgreement, &QLabel::linkActivated, this, &CAboutDialog::OnCustomerAgreement); - m_ui->m_transparentTrademarks->setText(versionText); m_ui->m_transparentAllRightReserved->setObjectName("copyrightNotice"); @@ -84,9 +82,4 @@ void CAboutDialog::mouseReleaseEvent(QMouseEvent* event) QDialog::mouseReleaseEvent(event); } -void CAboutDialog::OnCustomerAgreement() -{ - QDesktopServices::openUrl(QUrl(QStringLiteral("https://www.o3debinaries.org/license"))); -} - #include diff --git a/Code/Editor/AboutDialog.h b/Code/Editor/AboutDialog.h index db079a6ec7..279d7cd399 100644 --- a/Code/Editor/AboutDialog.h +++ b/Code/Editor/AboutDialog.h @@ -30,8 +30,6 @@ public: private: - void OnCustomerAgreement(); - void mouseReleaseEvent(QMouseEvent* event) override; void paintEvent(QPaintEvent* event) override; diff --git a/Code/Editor/AboutDialog.ui b/Code/Editor/AboutDialog.ui index 09a7c18841..a7433c620f 100644 --- a/Code/Editor/AboutDialog.ui +++ b/Code/Editor/AboutDialog.ui @@ -181,14 +181,17 @@ - + - Terms of Use + <a href="https://www.o3debinaries.org/license">Terms of Use</a> + + + Qt::RichText Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - + true @@ -274,11 +277,6 @@ QWidget
qsvgwidget.h
- - ClickableLabel - QLabel -
QtUI/ClickableLabel.h
-
diff --git a/Code/Editor/Lib/Tests/test_ClickableLabel.cpp b/Code/Editor/Lib/Tests/test_ClickableLabel.cpp deleted file mode 100644 index a676714992..0000000000 --- a/Code/Editor/Lib/Tests/test_ClickableLabel.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include "EditorDefs.h" -#include -#include -#include - -#include - -using namespace AZ; -using namespace ::testing; - -namespace UnitTest -{ - class TestingClickableLabel - : public ScopedAllocatorSetupFixture - { - public: - ClickableLabel m_clickableLabel; - }; - - TEST_F(TestingClickableLabel, CursorDoesNotUpdateWhileDisabled) - { - m_clickableLabel.setEnabled(false); - - QApplication::setOverrideCursor(QCursor(Qt::BlankCursor)); - QEnterEvent enterEvent{ QPointF(), QPointF(), QPointF() }; - QApplication::sendEvent(&m_clickableLabel, &enterEvent); - - const Qt::CursorShape cursorShape = QApplication::overrideCursor()->shape(); - EXPECT_THAT(cursorShape, Ne(Qt::PointingHandCursor)); - EXPECT_THAT(cursorShape, Eq(Qt::BlankCursor)); - } - - TEST_F(TestingClickableLabel, DoesNotRespondToDblClickWhileDisabled) - { - m_clickableLabel.setEnabled(false); - - bool linkActivated = false; - QObject::connect(&m_clickableLabel, &QLabel::linkActivated, [&linkActivated]() - { - linkActivated = true; - }); - - QMouseEvent mouseEvent { - QEvent::MouseButtonDblClick, QPointF(), - Qt::LeftButton, Qt::LeftButton, Qt::NoModifier }; - QApplication::sendEvent(&m_clickableLabel, &mouseEvent); - - EXPECT_THAT(linkActivated, Eq(false)); - } -} // namespace UnitTest diff --git a/Code/Editor/QtUI/ClickableLabel.cpp b/Code/Editor/QtUI/ClickableLabel.cpp deleted file mode 100644 index b0694e5f18..0000000000 --- a/Code/Editor/QtUI/ClickableLabel.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#include "EditorDefs.h" - -#include "ClickableLabel.h" - - -ClickableLabel::ClickableLabel(const QString& text, QWidget* parent) - : QLabel(parent) - , m_text(text) - , m_showDecoration(false) -{ - setTextFormat(Qt::RichText); - setTextInteractionFlags(Qt::TextBrowserInteraction); -} - -ClickableLabel::ClickableLabel(QWidget* parent) - : QLabel(parent) - , m_showDecoration(false) -{ - setTextFormat(Qt::RichText); - setTextInteractionFlags(Qt::TextBrowserInteraction); -} - -void ClickableLabel::showEvent([[maybe_unused]] QShowEvent* event) -{ - updateFormatting(false); -} - -void ClickableLabel::enterEvent(QEvent* ev) -{ - if (!isEnabled()) - { - return; - } - - updateFormatting(true); - QApplication::setOverrideCursor(QCursor(Qt::PointingHandCursor)); - QLabel::enterEvent(ev); -} - -void ClickableLabel::leaveEvent(QEvent* ev) -{ - if (!isEnabled()) - { - return; - } - - updateFormatting(false); - QApplication::restoreOverrideCursor(); - QLabel::leaveEvent(ev); -} - -void ClickableLabel::setText(const QString& text) -{ - m_text = text; - QLabel::setText(text); - updateFormatting(false); -} - -void ClickableLabel::setShowDecoration(bool b) -{ - m_showDecoration = b; - updateFormatting(false); -} - -void ClickableLabel::updateFormatting(bool mouseOver) -{ - //FIXME: this should be done differently. Using a style sheet would be easiest. - - QColor c = palette().color(QPalette::WindowText); - if (mouseOver || m_showDecoration) - { - QLabel::setText(QString(R"(%2)").arg(c.name(), m_text)); - } - else - { - QLabel::setText(m_text); - } -} - -bool ClickableLabel::event(QEvent* e) -{ - if (isEnabled()) - { - if (e->type() == QEvent::MouseButtonDblClick) - { - emit linkActivated(QString()); - return true; //ignore - } - } - - return QLabel::event(e); -} - -#include diff --git a/Code/Editor/QtUI/ClickableLabel.h b/Code/Editor/QtUI/ClickableLabel.h deleted file mode 100644 index 2b14676eae..0000000000 --- a/Code/Editor/QtUI/ClickableLabel.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once -#ifndef CRYINCLUDE_EDITORCOMMON_CLICKABLELABEL_H -#define CRYINCLUDE_EDITORCOMMON_CLICKABLELABEL_H - -#if !defined(Q_MOC_RUN) -#include -#endif - -class SANDBOX_API ClickableLabel - : public QLabel -{ - Q_OBJECT -public: - explicit ClickableLabel(const QString& text, QWidget* parent = nullptr); - explicit ClickableLabel(QWidget* parent = nullptr); - bool event(QEvent* e) override; - - void setText(const QString& text); - void setShowDecoration(bool b); - -protected: - void showEvent(QShowEvent* event) override; - void enterEvent(QEvent* ev) override; - void leaveEvent(QEvent* ev) override; - -private: - void updateFormatting(bool mouseOver); - QString m_text; - bool m_showDecoration; -}; - -#endif diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index fa627176d8..78a15123d6 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -526,8 +526,6 @@ set(FILES PythonEditorFuncs.h QtUI/QCollapsibleGroupBox.h QtUI/QCollapsibleGroupBox.cpp - QtUI/ClickableLabel.h - QtUI/ClickableLabel.cpp QtUI/PixmapLabelPreview.h QtUI/PixmapLabelPreview.cpp QtUI/WaitCursor.h diff --git a/Code/Editor/editor_lib_test_files.cmake b/Code/Editor/editor_lib_test_files.cmake index 17f36228db..5b66357c41 100644 --- a/Code/Editor/editor_lib_test_files.cmake +++ b/Code/Editor/editor_lib_test_files.cmake @@ -8,7 +8,6 @@ set(FILES Lib/Tests/IEditorMock.h - Lib/Tests/test_ClickableLabel.cpp Lib/Tests/test_CryEditPythonBindings.cpp Lib/Tests/test_CryEditDocPythonBindings.cpp Lib/Tests/test_EditorPythonBindings.cpp From 6c986657b416b151a4f5a0ea2ff73416b6ab9eb6 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Mon, 3 Jan 2022 13:18:18 -0800 Subject: [PATCH 226/399] Fix for file-save-as-new and open asset (#6490) Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../EditorScriptCanvasComponent.cpp | 2 +- .../Code/Editor/View/Widgets/GraphTabBar.cpp | 2 +- .../Code/Editor/View/Windows/MainWindow.cpp | 37 ++++++++++++------- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 0a0dbfc160..750097b428 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -242,7 +242,7 @@ namespace ScriptCanvasEditor SetName(m_sourceHandle.Path().Filename().Native()); } - void EditorScriptCanvasComponent::OpenEditor(const AZ::Data::AssetId&, const AZ::Data::AssetType&) + void EditorScriptCanvasComponent::OpenEditor([[maybe_unused]] const AZ::Data::AssetId& assetId, const AZ::Data::AssetType&) { AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index c5f808d5f4..0213765737 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -430,7 +430,7 @@ namespace ScriptCanvasEditor void GraphTabBar::UpdateFileState(const ScriptCanvasEditor::SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState) { auto tabData = GetTabData(assetId); - if (tabData && tabData->m_fileState != fileState) + if (tabData && tabData->m_fileState != Tracker::ScriptCanvasFileState::NEW && tabData->m_fileState != fileState) { int index = FindTab(assetId); tabData->m_fileState = fileState; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index f0bee2171a..6222d902da 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1136,23 +1136,20 @@ namespace ScriptCanvasEditor return AZ::Success(outTabIndex); } - auto loadedGraph = LoadFromFile(fileAssetId.Path().c_str()); - if (!loadedGraph.IsSuccess()) + auto loadedGraphOutcome = LoadFromFile(fileAssetId.Path().c_str()); + if (!loadedGraphOutcome.IsSuccess()) { return AZ::Failure(AZStd::string("Failed to load graph at %s", fileAssetId.Path().c_str())); } - outTabIndex = CreateAssetTab(loadedGraph.GetValue(), fileState); - - if (!m_isRestoringWorkspace) - { - SetActiveAsset(loadedGraph.GetValue()); - } + auto loadedGraph = loadedGraphOutcome.TakeValue(); + CompleteDescriptionInPlace(loadedGraph); + outTabIndex = CreateAssetTab(loadedGraph, fileState); if (outTabIndex >= 0) { - AddRecentFile(loadedGraph.GetValue().Path().c_str()); - OpenScriptCanvasAssetImplementation(loadedGraph.GetValue(), fileState); + AddRecentFile(loadedGraph.Path().c_str()); + OpenScriptCanvasAssetImplementation(loadedGraph, fileState); return AZ::Success(outTabIndex); } else @@ -1169,6 +1166,11 @@ namespace ScriptCanvasEditor return AZ::Failure(AZStd::string("Unable to open asset with invalid asset id")); } + if (!m_isRestoringWorkspace) + { + SetActiveAsset(scriptCanvasAsset); + } + if (!scriptCanvasAsset.IsDescriptionValid()) { if (!m_isRestoringWorkspace) @@ -1345,9 +1347,11 @@ namespace ScriptCanvasEditor AZ::Outcome outcome = LoadFromFile(fullPath); if (!outcome.IsSuccess()) { - QMessageBox::warning(this, "Invalid Source File", QString("'%1' failed to load properly.").arg(fullPath), QMessageBox::Ok); + QMessageBox::warning(this, "Invalid Source File" + , QString("'%1' failed to load properly.\nFailure: %2").arg(fullPath).arg(outcome.GetError().c_str()), QMessageBox::Ok); m_errorFilePath = fullPath; - AZ_Warning("ScriptCanvas", false, "Unable to open file as a ScriptCanvas graph: %s", fullPath); + AZ_Warning("ScriptCanvas", false, "Unable to open file as a ScriptCanvas graph: %s. Failure: %s" + , fullPath, outcome.GetError().c_str()); return; } @@ -1596,7 +1600,14 @@ namespace ScriptCanvasEditor bool MainWindow::OnFileSave() { - return SaveAssetImpl(m_activeGraph, Save::InPlace); + if (auto metaData = m_tabBar->GetTabData(m_activeGraph); metaData && metaData->m_fileState == Tracker::ScriptCanvasFileState::NEW) + { + return SaveAssetImpl(m_activeGraph, Save::As); + } + else + { + return SaveAssetImpl(m_activeGraph, Save::InPlace); + } } bool MainWindow::OnFileSaveAs() From a000198b1bd5e38feb18355b6cdafbea3e85c814 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:07:31 -0600 Subject: [PATCH 227/399] Add benchmarks to GradientSignal. (#6616) * Add benchmarks to GradientSignal. Cleaned up and rearranged a bit of the unit testing code to make it reusable from a benchmark suite as well. Added set of benchmarks for measuring GetValue(), so that we can compare against GetValues() when it gets added. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed Editor unit tests. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- Gems/GradientSignal/Code/CMakeLists.txt | 6 + .../Code/Include/GradientSignal/ImageAsset.h | 7 + .../EditorGradientSignalPreviewTests.cpp | 4 +- .../Code/Tests/GradientSignalBenchmarks.cpp | 106 +++++++++++++++ .../Code/Tests/GradientSignalImageTests.cpp | 125 +----------------- .../Tests/GradientSignalReferencesTests.cpp | 2 +- .../Tests/GradientSignalServicesTests.cpp | 2 +- .../Code/Tests/GradientSignalSurfaceTests.cpp | 2 +- .../Code/Tests/GradientSignalTest.cpp | 2 +- .../Code/Tests/GradientSignalTestFixtures.cpp | 121 +++++++++++++++++ .../Code/Tests/GradientSignalTestFixtures.h | 124 +++++++++++++++++ .../Code/Tests/GradientSignalTestMocks.cpp | 72 ++++++++++ .../Code/Tests/GradientSignalTestMocks.h | 91 +++++-------- .../Tests/GradientSignalTransformTests.cpp | 2 +- .../gradientsignal_editor_tests_files.cmake | 1 + .../Code/gradientsignal_tests_files.cmake | 4 + 16 files changed, 486 insertions(+), 185 deletions(-) create mode 100644 Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp create mode 100644 Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp create mode 100644 Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h create mode 100644 Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.cpp diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index f5c0457c23..d1ac8cdacf 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -145,6 +145,12 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) NAME Gem::GradientSignal.Tests ) + ly_add_googlebenchmark( + NAME Gem::GradientSignal.Benchmarks + TARGET Gem::GradientSignal.Tests + ) + + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME GradientSignal.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h b/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h index f65702c36c..4ffab0b4b4 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h @@ -35,6 +35,13 @@ namespace GradientSignal static bool VersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement); + ImageAsset() = default; + + ImageAsset(const AZ::Data::AssetId& assetId, AZ::Data::AssetData::AssetStatus status) + : AssetData(assetId, status) + { + } + AZ::u32 m_imageWidth = 0; AZ::u32 m_imageHeight = 0; AZ::u8 m_bytesPerPixel = 0; diff --git a/Gems/GradientSignal/Code/Tests/EditorGradientSignalPreviewTests.cpp b/Gems/GradientSignal/Code/Tests/EditorGradientSignalPreviewTests.cpp index 7e98aa1361..e8bd9f2dff 100644 --- a/Gems/GradientSignal/Code/Tests/EditorGradientSignalPreviewTests.cpp +++ b/Gems/GradientSignal/Code/Tests/EditorGradientSignalPreviewTests.cpp @@ -6,7 +6,7 @@ * */ -#include "Tests/GradientSignalTestMocks.h" +#include #include #include @@ -28,7 +28,6 @@ namespace UnitTest void SetUp() override { GradientSignalTest::SetUp(); - AZ::AllocatorInstance::Create(); // Set up job manager with two threads so that we can run and test the preview job logic. AZ::JobManagerDesc desc; @@ -46,7 +45,6 @@ namespace UnitTest delete m_jobContext; delete m_jobManager; - AZ::AllocatorInstance::Destroy(); GradientSignalTest::TearDown(); } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp new file mode 100644 index 0000000000..e780a5d893 --- /dev/null +++ b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp @@ -0,0 +1,106 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#ifdef HAVE_BENCHMARK + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace UnitTest +{ + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientGetValue)(benchmark::State& state) + { + // Create the Image Gradient Component with some default sizes and parameters. + GradientSignal::ImageGradientConfig config; + const uint32_t imageSize = 4096; + const int32_t imageSeed = 12345; + config.m_imageAsset = ImageAssetMockAssetHandler::CreateImageAsset(imageSize, imageSize, imageSeed); + config.m_tilingX = 1.0f; + config.m_tilingY = 1.0f; + CreateComponent(m_testEntity.get(), config); + + // Create the Gradient Transform Component with some default parameters. + GradientSignal::GradientTransformConfig gradientTransformConfig; + gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; + CreateComponent(m_testEntity.get(), gradientTransformConfig); + + // Run the benchmark + RunGetValueBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientGetValue) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientGetValue)(benchmark::State& state) + { + // Create the Perlin Gradient Component with some default sizes and parameters. + GradientSignal::PerlinGradientConfig config; + config.m_amplitude = 1.0f; + config.m_frequency = 1.1f; + config.m_octave = 4; + config.m_randomSeed = 12345; + CreateComponent(m_testEntity.get(), config); + + // Create the Gradient Transform Component with some default parameters. + GradientSignal::GradientTransformConfig gradientTransformConfig; + gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; + CreateComponent(m_testEntity.get(), gradientTransformConfig); + + // Run the benchmark + RunGetValueBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientGetValue) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientGetValue)(benchmark::State& state) + { + // Create the Random Gradient Component with some default parameters. + GradientSignal::RandomGradientConfig config; + config.m_randomSeed = 12345; + CreateComponent(m_testEntity.get(), config); + + // Create the Gradient Transform Component with some default parameters. + GradientSignal::GradientTransformConfig gradientTransformConfig; + gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; + CreateComponent(m_testEntity.get(), gradientTransformConfig); + + // Run the benchmark + RunGetValueBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientGetValue) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + +#endif + + + + +} + + diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp index 4c22afac76..fa30132836 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp @@ -7,7 +7,7 @@ */ -#include "Tests/GradientSignalTestMocks.h" +#include #include #include @@ -23,69 +23,6 @@ namespace UnitTest struct GradientSignalImageTestsFixture : public GradientSignalTest { - struct MockAssetHandler - : public AZ::Data::AssetHandler - { - AZ::Data::AssetPtr CreateAsset([[maybe_unused]] const AZ::Data::AssetId& id, [[maybe_unused]] const AZ::Data::AssetType& type) override - { - return AZ::Data::AssetPtr(); - } - - void DestroyAsset(AZ::Data::AssetPtr ptr) override - { - if (ptr) - { - delete ptr; - } - } - - void GetHandledAssetTypes([[maybe_unused]] AZStd::vector& assetTypes) override - { - } - - AZ::Data::AssetHandler::LoadResult LoadAssetData( - [[maybe_unused]] const AZ::Data::Asset& asset, - [[maybe_unused]] AZStd::shared_ptr stream, - [[maybe_unused]] const AZ::Data::AssetFilterCB& assetLoadFilterCB) override - { - return AZ::Data::AssetHandler::LoadResult::LoadComplete; - } - - }; - - MockAssetHandler* m_mockHandler = nullptr; - GradientSignal::ImageAsset* m_imageData = nullptr; - - void SetUp() override - { - GradientSignalTest::SetUp(); - AZ::AllocatorInstance::Create(); - AZ::Data::AssetManager::Descriptor desc; - AZ::Data::AssetManager::Create(desc); - m_mockHandler = new MockAssetHandler(); - AZ::Data::AssetManager::Instance().RegisterHandler(m_mockHandler, azrtti_typeid()); - } - - void TearDown() override - { - AZ::Data::AssetManager::Instance().UnregisterHandler(m_mockHandler); - delete m_mockHandler; // delete after removing from the asset manager - AzFramework::LegacyAssetEventBus::ClearQueuedEvents(); - AZ::Data::AssetManager::Destroy(); - AZ::AllocatorInstance::Destroy(); - GradientSignalTest::TearDown(); - } - - struct AssignIdToAsset - : public AZ::Data::AssetData - { - void MakeReady() - { - m_assetId = AZ::Data::AssetId(AZ::Uuid::CreateRandom()); - m_status.store(AZ::Data::AssetData::AssetStatus::Ready); - } - }; - struct PixelTestSetup { // How to create the source image @@ -105,61 +42,6 @@ namespace UnitTest static const AZ::Vector2 EndOfList; }; - AZ::Data::Asset CreateImageAsset(AZ::u32 width, AZ::u32 height, AZ::s32 seed) - { - m_imageData = aznew GradientSignal::ImageAsset(); - m_imageData->m_imageWidth = width; - m_imageData->m_imageHeight = height; - m_imageData->m_bytesPerPixel = 1; - m_imageData->m_imageFormat = ImageProcessingAtom::EPixelFormat::ePixelFormat_R8; - - size_t value = 0; - AZStd::hash_combine(value, seed); - - for (AZ::u32 x = 0; x < width; ++x) - { - for (AZ::u32 y = 0; y < height; ++y) - { - AZStd::hash_combine(value, x); - AZStd::hash_combine(value, y); - m_imageData->m_imageData.push_back(static_cast(value)); - } - } - - reinterpret_cast(m_imageData)->MakeReady(); - return AZ::Data::Asset(m_imageData, AZ::Data::AssetLoadBehavior::Default); - } - - AZ::Data::Asset CreateSpecificPixelImageAsset(AZ::u32 width, AZ::u32 height, AZ::u32 pixelX, AZ::u32 pixelY) - { - m_imageData = aznew GradientSignal::ImageAsset(); - m_imageData->m_imageWidth = width; - m_imageData->m_imageHeight = height; - m_imageData->m_bytesPerPixel = 1; - m_imageData->m_imageFormat = ImageProcessingAtom::EPixelFormat::ePixelFormat_R8; - - const AZ::u8 pixelValue = 255; - - // Image data should be stored inverted on the y axis relative to our engine, so loop backwards through y. - for (int y = static_cast(height) - 1; y >= 0; --y) - { - for (AZ::u32 x = 0; x < width; ++x) - { - if ((x == static_cast(pixelX)) && (y == static_cast(pixelY))) - { - m_imageData->m_imageData.push_back(pixelValue); - } - else - { - m_imageData->m_imageData.push_back(0); - } - } - } - - reinterpret_cast(m_imageData)->MakeReady(); - return AZ::Data::Asset(m_imageData, AZ::Data::AssetLoadBehavior::Default); - } - void TestPixels(GradientSignal::GradientSampler& sampler, AZ::u32 width, AZ::u32 height, float stepSize, const AZStd::vector& expectedPoints) { AZStd::vector foundPoints; @@ -203,7 +85,8 @@ namespace UnitTest // Create the Image Gradient Component. GradientSignal::ImageGradientConfig config; - config.m_imageAsset = CreateSpecificPixelImageAsset(test.m_imageSize, test.m_imageSize, static_cast(test.m_pixel.GetX()), static_cast(test.m_pixel.GetY())); + config.m_imageAsset = ImageAssetMockAssetHandler::CreateSpecificPixelImageAsset( + test.m_imageSize, test.m_imageSize, static_cast(test.m_pixel.GetX()), static_cast(test.m_pixel.GetY())); config.m_tilingX = test.m_tiling; config.m_tilingY = test.m_tiling; CreateComponent(entity.get(), config); @@ -495,7 +378,7 @@ namespace UnitTest // Create an ImageGradient with a 3x3 asset with the center pixel set. GradientSignal::ImageGradientConfig gradientConfig; - gradientConfig.m_imageAsset = CreateSpecificPixelImageAsset(3, 3, 1, 1); + gradientConfig.m_imageAsset = ImageAssetMockAssetHandler::CreateSpecificPixelImageAsset(3, 3, 1, 1); CreateComponent(entity.get(), gradientConfig); // Create the test GradientTransform diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp index 25a1aa28bb..ec22fbc1ec 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp @@ -10,7 +10,7 @@ #include #include #include -#include "Tests/GradientSignalTestMocks.h" +#include #include #include diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp index b8c0f85cf3..dc11d21b11 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp @@ -6,7 +6,7 @@ * */ -#include "Tests/GradientSignalTestMocks.h" +#include #include diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp index 809bbf2fe6..a0c8f5cf50 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "Tests/GradientSignalTestMocks.h" +#include #include #include diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp index 78aa4f1ac5..84b2daab84 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp @@ -7,7 +7,7 @@ */ -#include "Tests/GradientSignalTestMocks.h" +#include #include #include diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp new file mode 100644 index 0000000000..bc9b39aae8 --- /dev/null +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp @@ -0,0 +1,121 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + + +#include + +namespace UnitTest +{ + void GradientSignalBaseFixture::SetupCoreSystems() + { + m_app = AZStd::make_unique(); + ASSERT_TRUE(m_app != nullptr); + + AZ::ComponentApplication::Descriptor componentAppDesc; + + m_systemEntity = m_app->Create(componentAppDesc); + ASSERT_TRUE(m_systemEntity != nullptr); + m_app->AddEntity(m_systemEntity); + + AZ::AllocatorInstance::Create(); + AZ::Data::AssetManager::Descriptor desc; + AZ::Data::AssetManager::Create(desc); + m_mockHandler = new ImageAssetMockAssetHandler(); + AZ::Data::AssetManager::Instance().RegisterHandler(m_mockHandler, azrtti_typeid()); + } + + void GradientSignalBaseFixture::TearDownCoreSystems() + { + AZ::Data::AssetManager::Instance().UnregisterHandler(m_mockHandler); + delete m_mockHandler; // delete after removing from the asset manager + AzFramework::LegacyAssetEventBus::ClearQueuedEvents(); + AZ::Data::AssetManager::Destroy(); + AZ::AllocatorInstance::Destroy(); + + m_app->Destroy(); + m_app.reset(); + m_systemEntity = nullptr; + } + + void GradientSignalTest::TestFixedDataSampler(const AZStd::vector& expectedOutput, int size, AZ::EntityId gradientEntityId) + { + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = gradientEntityId; + + for (int y = 0; y < size; ++y) + { + for (int x = 0; x < size; ++x) + { + GradientSignal::GradientSampleParams params; + params.m_position = AZ::Vector3(static_cast(x), static_cast(y), 0.0f); + + const int index = y * size + x; + float actualValue = gradientSampler.GetValue(params); + float expectedValue = expectedOutput[index]; + + EXPECT_NEAR(actualValue, expectedValue, 0.01f); + } + } + } + +#ifdef HAVE_BENCHMARK + void GradientSignalBenchmarkFixture::CreateTestEntity(float shapeHalfBounds) + { + // Create the base entity + m_testEntity = CreateEntity(); + + // Create a mock Shape component that describes the bounds that we're using to map our gradient into world space. + CreateComponent(m_testEntity.get()); + MockShapeComponentHandler mockShapeHandler(m_testEntity->GetId()); + mockShapeHandler.m_GetLocalBounds = AZ::Aabb::CreateCenterRadius(AZ::Vector3(shapeHalfBounds), shapeHalfBounds); + + // Create a mock Transform component that locates our gradient in the center of our desired mock Shape. + MockTransformHandler mockTransformHandler; + mockTransformHandler.m_GetLocalTMOutput = AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds)); + mockTransformHandler.m_GetWorldTMOutput = AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds)); + mockTransformHandler.BusConnect(m_testEntity->GetId()); + } + + void GradientSignalBenchmarkFixture::DestroyTestEntity() + { + m_testEntity.reset(); + } + + void GradientSignalBenchmarkFixture::RunGetValueBenchmark(benchmark::State& state) + { + // All components are created, so activate the entity + ActivateEntity(m_testEntity.get()); + + // Create a gradient sampler and run through a series of points to see if they match expectations. + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = m_testEntity->GetId(); + + // Get the height and width ranges for querying from our benchmark parameters + float height = aznumeric_cast(state.range(0)); + float width = aznumeric_cast(state.range(1)); + + // Call GetValue() for every height and width in our ranges. + for (auto _ : state) + { + for (float y = 0.0f; y < height; y += 1.0f) + { + for (float x = 0.0f; x < width; x += 1.0f) + { + GradientSignal::GradientSampleParams params; + params.m_position = AZ::Vector3(x, y, 0.0f); + float value = gradientSampler.GetValue(params); + benchmark::DoNotOptimize(value); + } + } + } + } + +#endif + +} + diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h new file mode 100644 index 0000000000..5e05cba374 --- /dev/null +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h @@ -0,0 +1,124 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include + +namespace UnitTest +{ + // Base test fixture used for GradientSignal unit tests and benchmark tests + class GradientSignalBaseFixture + { + public: + void SetupCoreSystems(); + void TearDownCoreSystems(); + + AZStd::unique_ptr CreateEntity() + { + return AZStd::make_unique(); + } + + void ActivateEntity(AZ::Entity* entity) + { + entity->Init(); + entity->Activate(); + } + + template + AZ::Component* CreateComponent(AZ::Entity* entity, const Configuration& config) + { + m_app->RegisterComponentDescriptor(Component::CreateDescriptor()); + return entity->CreateComponent(config); + } + + template + AZ::Component* CreateComponent(AZ::Entity* entity) + { + m_app->RegisterComponentDescriptor(Component::CreateDescriptor()); + return entity->CreateComponent(); + } + + AZStd::unique_ptr m_app; + AZ::Entity* m_systemEntity = nullptr; + ImageAssetMockAssetHandler* m_mockHandler = nullptr; + }; + + struct GradientSignalTest + : public GradientSignalBaseFixture + , public UnitTest::AllocatorsTestFixture + { + protected: + void SetUp() override + { + UnitTest::AllocatorsTestFixture::SetUp(); + SetupCoreSystems(); + } + + void TearDown() override + { + TearDownCoreSystems(); + UnitTest::AllocatorsTestFixture::TearDown(); + } + + void TestFixedDataSampler(const AZStd::vector& expectedOutput, int size, AZ::EntityId gradientEntityId); + }; + +#ifdef HAVE_BENCHMARK + class GradientSignalBenchmarkFixture + : public GradientSignalBaseFixture + , public UnitTest::AllocatorsBenchmarkFixture + , public UnitTest::TraceBusRedirector + { + public: + void internalSetUp(const benchmark::State& state) + { + AZ::Debug::TraceMessageBus::Handler::BusConnect(); + UnitTest::AllocatorsBenchmarkFixture::SetUp(state); + SetupCoreSystems(); + + // Create a default test entity with bounds of 256 m x 256 m x 256 m. + const float shapeHalfBounds = 128.0f; + CreateTestEntity(shapeHalfBounds); + } + + void internalTearDown(const benchmark::State& state) + { + DestroyTestEntity(); + TearDownCoreSystems(); + UnitTest::AllocatorsBenchmarkFixture::TearDown(state); + AZ::Debug::TraceMessageBus::Handler::BusDisconnect(); + } + + void CreateTestEntity(float shapeHalfBounds); + void DestroyTestEntity(); + + void RunGetValueBenchmark(benchmark::State& state); + + protected: + void SetUp(const benchmark::State& state) override + { + internalSetUp(state); + } + void SetUp(benchmark::State& state) override + { + internalSetUp(state); + } + + void TearDown(const benchmark::State& state) override + { + internalTearDown(state); + } + void TearDown(benchmark::State& state) override + { + internalTearDown(state); + } + + AZStd::unique_ptr m_testEntity; + }; +#endif +} diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.cpp new file mode 100644 index 0000000000..ccbe17dee8 --- /dev/null +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.cpp @@ -0,0 +1,72 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + + +#include + +namespace UnitTest +{ + AZ::Data::Asset ImageAssetMockAssetHandler::CreateImageAsset(AZ::u32 width, AZ::u32 height, AZ::s32 seed) + { + GradientSignal::ImageAsset* imageData = + aznew GradientSignal::ImageAsset(AZ::Data::AssetId(AZ::Uuid::CreateRandom()), AZ::Data::AssetData::AssetStatus::Ready); + imageData->m_imageWidth = width; + imageData->m_imageHeight = height; + imageData->m_bytesPerPixel = 1; + imageData->m_imageFormat = ImageProcessingAtom::EPixelFormat::ePixelFormat_R8; + imageData->m_imageData.reserve(width * height); + + size_t value = 0; + AZStd::hash_combine(value, seed); + + for (AZ::u32 x = 0; x < width; ++x) + { + for (AZ::u32 y = 0; y < height; ++y) + { + AZStd::hash_combine(value, x); + AZStd::hash_combine(value, y); + imageData->m_imageData.push_back(static_cast(value)); + } + } + + return AZ::Data::Asset(imageData, AZ::Data::AssetLoadBehavior::Default); + } + + AZ::Data::Asset ImageAssetMockAssetHandler::CreateSpecificPixelImageAsset( + AZ::u32 width, AZ::u32 height, AZ::u32 pixelX, AZ::u32 pixelY) + { + GradientSignal::ImageAsset* imageData = + aznew GradientSignal::ImageAsset(AZ::Data::AssetId(AZ::Uuid::CreateRandom()), AZ::Data::AssetData::AssetStatus::Ready); + imageData->m_imageWidth = width; + imageData->m_imageHeight = height; + imageData->m_bytesPerPixel = 1; + imageData->m_imageFormat = ImageProcessingAtom::EPixelFormat::ePixelFormat_R8; + imageData->m_imageData.reserve(width * height); + + const AZ::u8 pixelValue = 255; + + // Image data should be stored inverted on the y axis relative to our engine, so loop backwards through y. + for (int y = static_cast(height) - 1; y >= 0; --y) + { + for (AZ::u32 x = 0; x < width; ++x) + { + if ((x == static_cast(pixelX)) && (y == static_cast(pixelY))) + { + imageData->m_imageData.push_back(pixelValue); + } + else + { + imageData->m_imageData.push_back(0); + } + } + } + + return AZ::Data::Asset(imageData, AZ::Data::AssetLoadBehavior::Default); + } +} + diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.h b/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.h index 9c0d8be588..1d83a5eb55 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.h +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.h @@ -8,90 +8,69 @@ #pragma once #include -#include +#include +#include #include #include #include +#include +#include +#include #include #include #include +#include #include #include -#include - #include namespace UnitTest { - struct GradientSignalTest - : public ::testing::Test + // Mock asset handler for GradientSignal::ImageAsset that we can use in unit tests to pretend to load an image asset with. + // Also includes utility functions for creating image assets with specific testable patterns. + struct ImageAssetMockAssetHandler : public AZ::Data::AssetHandler { - protected: - AZ::ComponentApplication m_app; - AZ::Entity* m_systemEntity = nullptr; + //! Creates a deterministically random set of pixel data as an ImageAsset. + //! \param width The width of the ImageAsset + //! \param height The height of the ImageAsset + //! \param seed The random seed to use for generating the random data + //! \return The ImageAsset in a loaded ready state + static AZ::Data::Asset CreateImageAsset(AZ::u32 width, AZ::u32 height, AZ::s32 seed); - void SetUp() override - { - AZ::ComponentApplication::Descriptor appDesc; - appDesc.m_memoryBlocksByteSize = 128 * 1024 * 1024; - m_systemEntity = m_app.Create(appDesc); - m_app.AddEntity(m_systemEntity); - } + //! Creates an ImageAsset where all the pixels are 0 except for the one pixel at the given coordinates, which is set to 1. + //! \param width The width of the ImageAsset + //! \param height The height of the ImageAsset + //! \param pixelX The X coordinate of the pixel to set to 1 + //! \param pixelY The Y coordinate of the pixel to set to 1 + //! \return The ImageAsset in a loaded ready state + static AZ::Data::Asset CreateSpecificPixelImageAsset( + AZ::u32 width, AZ::u32 height, AZ::u32 pixelX, AZ::u32 pixelY); - void TearDown() override + AZ::Data::AssetPtr CreateAsset( + [[maybe_unused]] const AZ::Data::AssetId& id, [[maybe_unused]] const AZ::Data::AssetType& type) override { - m_app.Destroy(); - m_systemEntity = nullptr; + return AZ::Data::AssetPtr(); } - void TestFixedDataSampler(const AZStd::vector& expectedOutput, int size, AZ::EntityId gradientEntityId) + void DestroyAsset(AZ::Data::AssetPtr ptr) override { - GradientSignal::GradientSampler gradientSampler; - gradientSampler.m_gradientId = gradientEntityId; - - for(int y = 0; y < size; ++y) + if (ptr) { - for (int x = 0; x < size; ++x) - { - GradientSignal::GradientSampleParams params; - params.m_position = AZ::Vector3(static_cast(x), static_cast(y), 0.0f); - - const int index = y * size + x; - float actualValue = gradientSampler.GetValue(params); - float expectedValue = expectedOutput[index]; - - EXPECT_NEAR(actualValue, expectedValue, 0.01f); - } + delete ptr; } } - AZStd::unique_ptr CreateEntity() - { - return AZStd::make_unique(); - } - - void ActivateEntity(AZ::Entity* entity) - { - entity->Init(); - EXPECT_EQ(AZ::Entity::State::Init, entity->GetState()); - - entity->Activate(); - EXPECT_EQ(AZ::Entity::State::Active, entity->GetState()); - } - - template - AZ::Component* CreateComponent(AZ::Entity* entity, const Configuration& config) + void GetHandledAssetTypes([[maybe_unused]] AZStd::vector& assetTypes) override { - m_app.RegisterComponentDescriptor(Component::CreateDescriptor()); - return entity->CreateComponent(config); } - template - AZ::Component* CreateComponent(AZ::Entity* entity) + AZ::Data::AssetHandler::LoadResult LoadAssetData( + [[maybe_unused]] const AZ::Data::Asset& asset, + [[maybe_unused]] AZStd::shared_ptr stream, + [[maybe_unused]] const AZ::Data::AssetFilterCB& assetLoadFilterCB) override { - m_app.RegisterComponentDescriptor(Component::CreateDescriptor()); - return entity->CreateComponent(); + return AZ::Data::AssetHandler::LoadResult::LoadComplete; } }; diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp index 73dabf1d6a..ddebc0ce1f 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp @@ -7,7 +7,7 @@ */ -#include "Tests/GradientSignalTestMocks.h" +#include #include #include diff --git a/Gems/GradientSignal/Code/gradientsignal_editor_tests_files.cmake b/Gems/GradientSignal/Code/gradientsignal_editor_tests_files.cmake index 5a3a75602b..8172591afa 100644 --- a/Gems/GradientSignal/Code/gradientsignal_editor_tests_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_editor_tests_files.cmake @@ -7,5 +7,6 @@ # set(FILES + Tests/GradientSignalTestFixtures.cpp Tests/EditorGradientSignalPreviewTests.cpp ) diff --git a/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake b/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake index 5f8ffe2ebb..8e081e5711 100644 --- a/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake @@ -7,11 +7,15 @@ # set(FILES + Tests/GradientSignalBenchmarks.cpp Tests/GradientSignalImageTests.cpp Tests/GradientSignalReferencesTests.cpp Tests/GradientSignalServicesTests.cpp Tests/GradientSignalSurfaceTests.cpp Tests/GradientSignalTransformTests.cpp + Tests/GradientSignalTestFixtures.cpp + Tests/GradientSignalTestFixtures.h + Tests/GradientSignalTestMocks.cpp Tests/GradientSignalTestMocks.h Tests/GradientSignalTest.cpp Tests/ImageAssetTests.cpp From b0af08e61fd213865314abb4c4b450f0ddb8c742 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:12:15 -0600 Subject: [PATCH 228/399] Moved GradientSignal component headers to Include directory. All of the component headers in the gem have been moved to the Include directory to make them public to other gems. This allows "upstream" unit tests and benchmarks to easily create real non-mocked-out versions of these components to do more integration-level and system-level testing and benchmarking. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Components/ConstantGradientComponent.h | 0 .../Components/DitherGradientComponent.h | 0 .../Components/GradientSurfaceDataComponent.h | 0 .../Components/GradientTransformComponent.h | 0 .../Components/ImageGradientComponent.h | 0 .../Components/InvertGradientComponent.h | 0 .../Components/LevelsGradientComponent.h | 0 .../Components/MixedGradientComponent.h | 0 .../Components/PerlinGradientComponent.h | 0 .../Components/PosterizeGradientComponent.h | 0 .../Components/RandomGradientComponent.h | 0 .../Components/ReferenceGradientComponent.h | 0 .../ShapeAreaFalloffGradientComponent.h | 0 .../Components/SmoothStepGradientComponent.h | 0 .../SurfaceAltitudeGradientComponent.h | 0 .../Components/SurfaceMaskGradientComponent.h | 0 .../SurfaceSlopeGradientComponent.h | 0 .../Components/ThresholdGradientComponent.h | 0 .../Components/ConstantGradientComponent.cpp | 2 +- .../Components/DitherGradientComponent.cpp | 2 +- .../GradientSurfaceDataComponent.cpp | 2 +- .../Components/GradientTransformComponent.cpp | 2 +- .../Components/ImageGradientComponent.cpp | 2 +- .../Components/InvertGradientComponent.cpp | 2 +- .../Components/LevelsGradientComponent.cpp | 2 +- .../Components/MixedGradientComponent.cpp | 2 +- .../Components/PerlinGradientComponent.cpp | 2 +- .../Components/PosterizeGradientComponent.cpp | 2 +- .../Components/RandomGradientComponent.cpp | 2 +- .../Components/ReferenceGradientComponent.cpp | 2 +- .../ShapeAreaFalloffGradientComponent.cpp | 2 +- .../SmoothStepGradientComponent.cpp | 2 +- .../SurfaceAltitudeGradientComponent.cpp | 2 +- .../SurfaceMaskGradientComponent.cpp | 2 +- .../SurfaceSlopeGradientComponent.cpp | 2 +- .../Components/ThresholdGradientComponent.cpp | 2 +- .../Editor/EditorConstantGradientComponent.h | 2 +- .../Editor/EditorDitherGradientComponent.h | 2 +- .../EditorGradientSurfaceDataComponent.h | 2 +- .../Editor/EditorGradientTransformComponent.h | 2 +- .../Editor/EditorImageGradientComponent.h | 2 +- .../Editor/EditorInvertGradientComponent.h | 2 +- .../Editor/EditorLevelsGradientComponent.h | 2 +- .../Editor/EditorMixedGradientComponent.h | 2 +- .../Editor/EditorPerlinGradientComponent.h | 2 +- .../Editor/EditorPosterizeGradientComponent.h | 2 +- .../Editor/EditorRandomGradientComponent.h | 2 +- .../Editor/EditorReferenceGradientComponent.h | 2 +- .../EditorShapeAreaFalloffGradientComponent.h | 2 +- .../EditorSmoothStepGradientComponent.h | 2 +- .../EditorSurfaceAltitudeGradientComponent.h | 2 +- .../EditorSurfaceMaskGradientComponent.h | 2 +- .../EditorSurfaceSlopeGradientComponent.h | 2 +- .../Editor/EditorThresholdGradientComponent.h | 2 +- .../Code/Source/GradientSignalModule.cpp | 36 +++++++++---------- .../Code/Tests/GradientSignalBenchmarks.cpp | 8 ++--- .../Code/Tests/GradientSignalImageTests.cpp | 4 +-- .../Tests/GradientSignalReferencesTests.cpp | 20 +++++------ .../Tests/GradientSignalServicesTests.cpp | 6 ++-- .../Code/Tests/GradientSignalSurfaceTests.cpp | 4 +-- .../Code/Tests/GradientSignalTest.cpp | 14 ++++---- .../Tests/GradientSignalTransformTests.cpp | 2 +- .../Code/gradientsignal_files.cmake | 36 +++++++++---------- 63 files changed, 101 insertions(+), 101 deletions(-) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/ConstantGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/DitherGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/GradientSurfaceDataComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/GradientTransformComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/ImageGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/InvertGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/LevelsGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/MixedGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/PerlinGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/PosterizeGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/RandomGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/ReferenceGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/ShapeAreaFalloffGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/SmoothStepGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/SurfaceAltitudeGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/SurfaceMaskGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/SurfaceSlopeGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/ThresholdGradientComponent.h (100%) diff --git a/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/DitherGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/DitherGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/GradientSurfaceDataComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/GradientSurfaceDataComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/GradientSurfaceDataComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/GradientSurfaceDataComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/GradientTransformComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/GradientTransformComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/InvertGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/InvertGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/LevelsGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/LevelsGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/MixedGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/MixedGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PosterizeGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/PosterizeGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ReferenceGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/ReferenceGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SmoothStepGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/SmoothStepGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceMaskGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceMaskGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ThresholdGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/ThresholdGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp index 3bb27b00f3..86e8a5abc6 100644 --- a/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "ConstantGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp index dbc2cd2827..c7845a41a6 100644 --- a/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "DitherGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/GradientSurfaceDataComponent.cpp b/Gems/GradientSignal/Code/Source/Components/GradientSurfaceDataComponent.cpp index bdda0e48d2..5a0555fe33 100644 --- a/Gems/GradientSignal/Code/Source/Components/GradientSurfaceDataComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/GradientSurfaceDataComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "GradientSurfaceDataComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp index 5b2ce4d4cf..67f073a178 100644 --- a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "GradientTransformComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp index 4bf709755b..269bfbc2df 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "ImageGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp index 11ae5a67da..678f3b363c 100644 --- a/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "InvertGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp index af26ba494d..b2958c590c 100644 --- a/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "LevelsGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp index 5f6a18c7fb..e042188f8a 100644 --- a/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "MixedGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp index 8f9d40387b..3096afa3dc 100644 --- a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "PerlinGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp index 89beb15f32..21d321df13 100644 --- a/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "PosterizeGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp index fc2ccbef70..1b6753560c 100644 --- a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "RandomGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp index 28ffaad7d3..ea304a7eed 100644 --- a/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "ReferenceGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp index cdf542bf51..9e1a250900 100644 --- a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "ShapeAreaFalloffGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp index 13b641426b..510ed41510 100644 --- a/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "SmoothStepGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp index 476e0971f4..8b36182750 100644 --- a/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "SurfaceAltitudeGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp index 7f46ad6e98..df7a3f5787 100644 --- a/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "SurfaceMaskGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp index 15b462f292..84e0b61a62 100644 --- a/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "SurfaceSlopeGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp index 97acbb4441..a47ebdebe6 100644 --- a/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "ThresholdGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorConstantGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorConstantGradientComponent.h index 02a5d8ec33..87228671b3 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorConstantGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorConstantGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorDitherGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorDitherGradientComponent.h index 39ce4973c5..b01968eed6 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorDitherGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorDitherGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorGradientSurfaceDataComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorGradientSurfaceDataComponent.h index 4c31283768..e79571e662 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorGradientSurfaceDataComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorGradientSurfaceDataComponent.h @@ -8,7 +8,7 @@ #pragma once -#include +#include #include #include diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorGradientTransformComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorGradientTransformComponent.h index 8478d3e434..d2e2dc38eb 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorGradientTransformComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorGradientTransformComponent.h @@ -8,7 +8,7 @@ #pragma once -#include +#include #include namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorImageGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorImageGradientComponent.h index d1682be46f..f84766e73b 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorImageGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorInvertGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorInvertGradientComponent.h index ab9c13679c..652ddc3279 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorInvertGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorInvertGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorLevelsGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorLevelsGradientComponent.h index a2626d9a0a..b43f9bbb73 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorLevelsGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorLevelsGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorMixedGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorMixedGradientComponent.h index 837c64e6d8..c2ca707014 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorMixedGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorMixedGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorPerlinGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorPerlinGradientComponent.h index 4ef09ee3e4..1c39cf8faa 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorPerlinGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorPerlinGradientComponent.h @@ -10,7 +10,7 @@ #include #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorPosterizeGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorPosterizeGradientComponent.h index af85429b32..0078e2865f 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorPosterizeGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorPosterizeGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorRandomGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorRandomGradientComponent.h index 750e5bae4f..f5f9daee0a 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorRandomGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorRandomGradientComponent.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorReferenceGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorReferenceGradientComponent.h index 41eccf27e4..bf29b270bd 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorReferenceGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorReferenceGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorShapeAreaFalloffGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorShapeAreaFalloffGradientComponent.h index d8d7c052ce..7772dfe7c5 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorShapeAreaFalloffGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorShapeAreaFalloffGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorSmoothStepGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorSmoothStepGradientComponent.h index 864a419985..4a43920a6c 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorSmoothStepGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorSmoothStepGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceAltitudeGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceAltitudeGradientComponent.h index b334bb149d..f40176a9f5 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceAltitudeGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceAltitudeGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceMaskGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceMaskGradientComponent.h index 5df17a2699..9e71526541 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceMaskGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceMaskGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceSlopeGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceSlopeGradientComponent.h index ad1adb98f9..20daa662a9 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceSlopeGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceSlopeGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorThresholdGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorThresholdGradientComponent.h index 0291e65fd8..cbeb626c5e 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorThresholdGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorThresholdGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/GradientSignalModule.cpp b/Gems/GradientSignal/Code/Source/GradientSignalModule.cpp index 9986e62b34..eeaeae00dd 100644 --- a/Gems/GradientSignal/Code/Source/GradientSignalModule.cpp +++ b/Gems/GradientSignal/Code/Source/GradientSignalModule.cpp @@ -9,24 +9,24 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp index e780a5d893..dd179bd253 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp @@ -16,10 +16,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace UnitTest { diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp index fa30132836..e99bf1de5b 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp @@ -15,8 +15,8 @@ #include #include -#include -#include +#include +#include namespace UnitTest { diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp index ec22fbc1ec..32cd483c81 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp @@ -12,16 +12,16 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace UnitTest { diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp index dc11d21b11..dd81c14a09 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp @@ -10,9 +10,9 @@ #include -#include -#include -#include +#include +#include +#include namespace UnitTest { diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp index a0c8f5cf50..702965c0de 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp @@ -11,8 +11,8 @@ #include #include -#include -#include +#include +#include namespace UnitTest { diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp index 84b2daab84..adc35e6738 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp @@ -11,13 +11,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include namespace UnitTest { diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp index ddebc0ce1f..04e4611e71 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include namespace UnitTest { diff --git a/Gems/GradientSignal/Code/gradientsignal_files.cmake b/Gems/GradientSignal/Code/gradientsignal_files.cmake index 7318f18739..8555c2c0b4 100644 --- a/Gems/GradientSignal/Code/gradientsignal_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_files.cmake @@ -15,6 +15,24 @@ set(FILES Include/GradientSignal/PerlinImprovedNoise.h Include/GradientSignal/Util.h Include/GradientSignal/GradientImageConversion.h + Include/GradientSignal/Components/ConstantGradientComponent.h + Include/GradientSignal/Components/DitherGradientComponent.h + Include/GradientSignal/Components/GradientSurfaceDataComponent.h + Include/GradientSignal/Components/GradientTransformComponent.h + Include/GradientSignal/Components/ImageGradientComponent.h + Include/GradientSignal/Components/InvertGradientComponent.h + Include/GradientSignal/Components/LevelsGradientComponent.h + Include/GradientSignal/Components/MixedGradientComponent.h + Include/GradientSignal/Components/PerlinGradientComponent.h + Include/GradientSignal/Components/PosterizeGradientComponent.h + Include/GradientSignal/Components/RandomGradientComponent.h + Include/GradientSignal/Components/ReferenceGradientComponent.h + Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h + Include/GradientSignal/Components/SmoothStepGradientComponent.h + Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h + Include/GradientSignal/Components/SurfaceMaskGradientComponent.h + Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h + Include/GradientSignal/Components/ThresholdGradientComponent.h Include/GradientSignal/Ebuses/GradientTransformRequestBus.h Include/GradientSignal/Ebuses/GradientRequestBus.h Include/GradientSignal/Ebuses/GradientPreviewRequestBus.h @@ -40,41 +58,23 @@ set(FILES Include/GradientSignal/Ebuses/GradientSurfaceDataRequestBus.h Include/GradientSignal/Ebuses/SmoothStepRequestBus.h Source/Components/ConstantGradientComponent.cpp - Source/Components/ConstantGradientComponent.h Source/Components/DitherGradientComponent.cpp - Source/Components/DitherGradientComponent.h Source/Components/GradientSurfaceDataComponent.cpp - Source/Components/GradientSurfaceDataComponent.h Source/Components/GradientTransformComponent.cpp - Source/Components/GradientTransformComponent.h Source/Components/ImageGradientComponent.cpp - Source/Components/ImageGradientComponent.h Source/Components/InvertGradientComponent.cpp - Source/Components/InvertGradientComponent.h Source/Components/LevelsGradientComponent.cpp - Source/Components/LevelsGradientComponent.h Source/Components/MixedGradientComponent.cpp - Source/Components/MixedGradientComponent.h Source/Components/PerlinGradientComponent.cpp - Source/Components/PerlinGradientComponent.h Source/Components/PosterizeGradientComponent.cpp - Source/Components/PosterizeGradientComponent.h Source/Components/RandomGradientComponent.cpp - Source/Components/RandomGradientComponent.h Source/Components/ReferenceGradientComponent.cpp - Source/Components/ReferenceGradientComponent.h Source/Components/ShapeAreaFalloffGradientComponent.cpp - Source/Components/ShapeAreaFalloffGradientComponent.h Source/Components/SmoothStepGradientComponent.cpp - Source/Components/SmoothStepGradientComponent.h Source/Components/SurfaceAltitudeGradientComponent.cpp - Source/Components/SurfaceAltitudeGradientComponent.h Source/Components/SurfaceMaskGradientComponent.cpp - Source/Components/SurfaceMaskGradientComponent.h Source/Components/SurfaceSlopeGradientComponent.cpp - Source/Components/SurfaceSlopeGradientComponent.h Source/Components/ThresholdGradientComponent.cpp - Source/Components/ThresholdGradientComponent.h Source/GradientSampler.cpp Source/GradientSignalSystemComponent.cpp Source/GradientSignalSystemComponent.h From 9556c5bf628f5be54c9f6b159751346c39a37028 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:37:38 -0600 Subject: [PATCH 229/399] Add benchmarks for terrain APIs. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- Gems/Terrain/Code/CMakeLists.txt | 5 + .../TerrainSurfaceGradientListComponent.h | 7 + .../Code/Tests/TerrainSystemBenchmarks.cpp | 421 ++++++++++++++++++ Gems/Terrain/Code/terrain_tests_files.cmake | 1 + 4 files changed, 434 insertions(+) create mode 100644 Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp diff --git a/Gems/Terrain/Code/CMakeLists.txt b/Gems/Terrain/Code/CMakeLists.txt index d532284350..69a1bef3c0 100644 --- a/Gems/Terrain/Code/CMakeLists.txt +++ b/Gems/Terrain/Code/CMakeLists.txt @@ -119,6 +119,11 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) NAME Gem::Terrain.Tests ) + ly_add_googlebenchmark( + NAME Gem::Terrain.Benchmarks + TARGET Gem::Terrain.Tests + ) + # If we are a host platform we want to add tools test like editor tests here if(PAL_TRAIT_BUILD_HOST_TOOLS) # We support Terrain.Editor.Tests on this platform, add Terrain.Editor.Tests target which depends on Terrain.Editor diff --git a/Gems/Terrain/Code/Source/Components/TerrainSurfaceGradientListComponent.h b/Gems/Terrain/Code/Source/Components/TerrainSurfaceGradientListComponent.h index 20851c127f..8a3c097b6c 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainSurfaceGradientListComponent.h +++ b/Gems/Terrain/Code/Source/Components/TerrainSurfaceGradientListComponent.h @@ -32,6 +32,13 @@ namespace Terrain AZ_RTTI(TerrainSurfaceGradientMapping, "{473AD2CE-F22A-45A9-803F-2192F3D9F2BF}"); static void Reflect(AZ::ReflectContext* context); + TerrainSurfaceGradientMapping() = default; + TerrainSurfaceGradientMapping(const AZ::EntityId& entityId, const SurfaceData::SurfaceTag& surfaceTag) + : m_gradientEntityId(entityId) + , m_surfaceTag(surfaceTag) + { + } + AZ::EntityId m_gradientEntityId; SurfaceData::SurfaceTag m_surfaceTag; }; diff --git a/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp b/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp new file mode 100644 index 0000000000..b921681ab5 --- /dev/null +++ b/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp @@ -0,0 +1,421 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#ifdef HAVE_BENCHMARK + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + +#include + +namespace UnitTest +{ + using ::testing::NiceMock; + using ::testing::Return; + + class TerrainSystemBenchmarkFixture + : public UnitTest::AllocatorsBenchmarkFixture + , public UnitTest::TraceBusRedirector + { + public: + void SetUp(const benchmark::State& state) override + { + InternalSetUp(state); + } + void SetUp(benchmark::State& state) override + { + InternalSetUp(state); + } + + void TearDown(const benchmark::State& state) override + { + InternalTearDown(state); + } + void TearDown(benchmark::State& state) override + { + InternalTearDown(state); + } + + void InternalSetUp(const benchmark::State& state) + { + AZ::Debug::TraceMessageBus::Handler::BusConnect(); + UnitTest::AllocatorsBenchmarkFixture::SetUp(state); + + m_app = AZStd::make_unique(); + ASSERT_TRUE(m_app != nullptr); + + AZ::ComponentApplication::Descriptor componentAppDesc; + + AZ::Entity* systemEntity = m_app->Create(componentAppDesc); + ASSERT_TRUE(systemEntity != nullptr); + m_app->AddEntity(systemEntity); + + AZ::AllocatorInstance::Create(); + } + + void InternalTearDown(const benchmark::State& state) + { + AZ::AllocatorInstance::Destroy(); + + m_app->Destroy(); + m_app.reset(); + + UnitTest::AllocatorsBenchmarkFixture::TearDown(state); + AZ::Debug::TraceMessageBus::Handler::BusDisconnect(); + } + + AZStd::unique_ptr CreateEntity() + { + return AZStd::make_unique(); + } + + void ActivateEntity(AZ::Entity* entity) + { + entity->Init(); + entity->Activate(); + } + + template + Component* CreateComponent(AZ::Entity* entity, const Configuration& config) + { + m_app->RegisterComponentDescriptor(Component::CreateDescriptor()); + return entity->CreateComponent(config); + } + + template + Component* CreateComponent(AZ::Entity* entity) + { + m_app->RegisterComponentDescriptor(Component::CreateDescriptor()); + return entity->CreateComponent(); + } + + // Create a terrain system with reasonable defaults for testing, but with the ability to override the defaults + // on a test-by-test basis. + AZStd::unique_ptr CreateAndActivateTerrainSystem( + AZ::Vector2 queryResolution = AZ::Vector2(1.0f), + AZ::Aabb worldBounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-128.0f), AZ::Vector3(128.0f))) + { + // Create the terrain system and give it one tick to fully initialize itself. + auto terrainSystem = AZStd::make_unique(); + terrainSystem->SetTerrainAabb(worldBounds); + terrainSystem->SetTerrainHeightQueryResolution(queryResolution); + terrainSystem->Activate(); + AZ::TickBus::Broadcast(&AZ::TickBus::Events::OnTick, 0.f, AZ::ScriptTimePoint{}); + return terrainSystem; + } + + // Create a mock shape bus listener that will listen to the given EntityId for shape requests and returns the following: + // - GetEncompassingAabb - returns the given Aabb + // - GetTransformAndLocalBounds - returns the center of the Aabb as the transform, and the size of the Aabb as the local bounds + // - IsPointInside - true if the point is in the Aabb, false if not + AZStd::unique_ptr> CreateMockShape( + const AZ::Aabb& spawnerBox, const AZ::EntityId& shapeEntityId) + { + AZStd::unique_ptr> mockShape = + AZStd::make_unique>(shapeEntityId); + + ON_CALL(*mockShape, GetEncompassingAabb).WillByDefault(Return(spawnerBox)); + ON_CALL(*mockShape, GetTransformAndLocalBounds) + .WillByDefault( + [spawnerBox](AZ::Transform& transform, AZ::Aabb& bounds) + { + transform = AZ::Transform::CreateTranslation(spawnerBox.GetCenter()); + bounds = spawnerBox.GetTranslated(-spawnerBox.GetCenter()); + }); + ON_CALL(*mockShape, IsPointInside) + .WillByDefault( + [spawnerBox](const AZ::Vector3& point) -> bool + { + return spawnerBox.Contains(point); + }); + + return mockShape; + } + + // Create an entity with a Random Gradient on it that can be used for gradient queries. + AZStd::unique_ptr CreateTestRandomGradientEntity(const AZ::Aabb& spawnerBox, uint32_t randomSeed) + { + // Create the base entity + AZStd::unique_ptr testGradientEntity = CreateEntity(); + + // Add a mock AABB Shape so that the shape requirement is fulfilled. + CreateComponent(testGradientEntity.get()); + + // Create the Random Gradient Component with some default parameters. + GradientSignal::RandomGradientConfig config; + config.m_randomSeed = randomSeed; + CreateComponent(testGradientEntity.get(), config); + + // Create the Gradient Transform Component with some default parameters. + GradientSignal::GradientTransformConfig gradientTransformConfig; + gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; + CreateComponent(testGradientEntity.get(), gradientTransformConfig); + + // Set the transform to match the given spawnerBox + auto transform = CreateComponent(testGradientEntity.get()); + transform->SetLocalTM(AZ::Transform::CreateTranslation(spawnerBox.GetCenter())); + transform->SetWorldTM(AZ::Transform::CreateTranslation(spawnerBox.GetCenter())); + + return testGradientEntity; + } + + AZStd::unique_ptr CreateTestLayerSpawnerEntity( + const AZ::Aabb& spawnerBox, const AZ::EntityId& heightGradientEntityId, + const Terrain::TerrainSurfaceGradientListConfig& surfaceConfig) + { + // Create the base entity + AZStd::unique_ptr testLayerSpawnerEntity = CreateEntity(); + + // Add a mock AABB Shape so that the shape requirement is fulfilled. + CreateComponent(testLayerSpawnerEntity.get()); + + // Add a Terrain Layer Spawner + CreateComponent(testLayerSpawnerEntity.get()); + + // Add a Terrain Height Gradient List with one entry pointing to the given gradient entity + Terrain::TerrainHeightGradientListConfig heightConfig; + heightConfig.m_gradientEntities.emplace_back(heightGradientEntityId); + CreateComponent(testLayerSpawnerEntity.get(), heightConfig); + + // Add a Terrain Surface Gradient List with however many entries we were given + CreateComponent(testLayerSpawnerEntity.get(), surfaceConfig); + + // Set the transform to match the given spawnerBox + auto transform = CreateComponent(testLayerSpawnerEntity.get()); + transform->SetLocalTM(AZ::Transform::CreateTranslation(spawnerBox.GetCenter())); + transform->SetWorldTM(AZ::Transform::CreateTranslation(spawnerBox.GetCenter())); + + return testLayerSpawnerEntity; + } + + void RunTerrainApiBenchmark( + benchmark::State& state, + AZStd::function ApiCaller) + { + // Get the ranges for querying from our benchmark parameters + float boundsRange = aznumeric_cast(state.range(0)); + uint32_t numSurfaces = aznumeric_cast(state.range(1)); + AzFramework::Terrain::TerrainDataRequests::Sampler sampler = + static_cast(state.range(2)); + + // Set up our world bounds and query resolution + AZ::Aabb worldBounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-boundsRange / 2.0f), AZ::Vector3(boundsRange / 2.0f)); + AZ::Vector2 queryResolution = AZ::Vector2(1.0f); + + // Create a Random Gradient to use as our height provider + const uint32_t heightRandomSeed = 12345; + auto heightGradientEntity = CreateTestRandomGradientEntity(worldBounds, heightRandomSeed); + auto heightGradientShapeRequests = CreateMockShape(worldBounds, heightGradientEntity->GetId()); + ActivateEntity(heightGradientEntity.get()); + + + // Create a set of Random Gradients to use as our surface providers + Terrain::TerrainSurfaceGradientListConfig surfaceConfig; + AZStd::vector> surfaceGradientEntities; + AZStd::vector>> surfaceGradientShapeRequests; + for (uint32_t surfaces = 0; surfaces < numSurfaces; surfaces++) + { + const uint32_t surfaceRandomSeed = 23456 + surfaces; + auto surfaceGradientEntity = CreateTestRandomGradientEntity(worldBounds, surfaceRandomSeed); + auto shapeRequests = CreateMockShape(worldBounds, surfaceGradientEntity->GetId()); + ActivateEntity(surfaceGradientEntity.get()); + + // Give each gradient a new surface tag + surfaceConfig.m_gradientSurfaceMappings.emplace_back( + surfaceGradientEntity->GetId(), SurfaceData::SurfaceTag(AZStd::string::format("test%zu", surfaces))); + + surfaceGradientEntities.emplace_back(AZStd::move(surfaceGradientEntity)); + surfaceGradientShapeRequests.emplace_back(AZStd::move(shapeRequests)); + } + + // Create a single Terrain Layer Spawner that covers the entire terrain world bounds + // (Do this *after* creating and activating the height and surface gradients) + auto testLayerSpawnerEntity = CreateTestLayerSpawnerEntity(worldBounds, heightGradientEntity->GetId(), surfaceConfig); + auto spawnerShapeRequests = CreateMockShape(worldBounds, testLayerSpawnerEntity->GetId()); + ActivateEntity(testLayerSpawnerEntity.get()); + + // Create the terrain system (do this after creating the terrain layer entity to ensure that we don't need any data refreshes) + auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution, worldBounds); + + // Call the terrain API we're testing for every height and width in our ranges. + for (auto stateIterator : state) + { + ApiCaller(queryResolution, worldBounds, sampler); + } + + testLayerSpawnerEntity.reset(); + spawnerShapeRequests.reset(); + + heightGradientEntity.reset(); + heightGradientShapeRequests.reset(); + + surfaceGradientEntities.clear(); + surfaceGradientShapeRequests.clear(); + } + + protected: + AZStd::unique_ptr m_app; + }; + + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_GetHeight)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + float worldMinZ = worldBounds.GetMin().GetZ(); + + for (float y = worldBounds.GetMin().GetY(); y < worldBounds.GetMax().GetY(); y += 1.0f) + { + for (float x = worldBounds.GetMin().GetX(); x < worldBounds.GetMax().GetX(); x += 1.0f) + { + float terrainHeight = worldMinZ; + bool terrainExists = false; + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + terrainHeight, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, x, y, sampler, &terrainExists); + benchmark::DoNotOptimize(terrainHeight); + } + } + }); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_GetHeight) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_GetNormal)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + for (float y = worldBounds.GetMin().GetY(); y < worldBounds.GetMax().GetY(); y += 1.0f) + { + for (float x = worldBounds.GetMin().GetX(); x < worldBounds.GetMax().GetX(); x += 1.0f) + { + AZ::Vector3 terrainNormal; + bool terrainExists = false; + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + terrainNormal, &AzFramework::Terrain::TerrainDataRequests::GetNormalFromFloats, x, y, sampler, &terrainExists); + benchmark::DoNotOptimize(terrainNormal); + } + } + }); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_GetNormal) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_GetSurfaceWeights)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + AzFramework::SurfaceData::SurfaceTagWeightList surfaceWeights; + for (float y = worldBounds.GetMin().GetY(); y < worldBounds.GetMax().GetY(); y += 1.0f) + { + for (float x = worldBounds.GetMin().GetX(); x < worldBounds.GetMax().GetX(); x += 1.0f) + { + bool terrainExists = false; + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::GetSurfaceWeightsFromFloats, x, y, surfaceWeights, sampler, + &terrainExists); + benchmark::DoNotOptimize(surfaceWeights); + } + } + }); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_GetSurfaceWeights) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 2, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 2, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 4, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 4, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_GetSurfacePoints)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (float y = worldBounds.GetMin().GetY(); y < worldBounds.GetMax().GetY(); y += 1.0f) + { + for (float x = worldBounds.GetMin().GetX(); x < worldBounds.GetMax().GetX(); x += 1.0f) + { + bool terrainExists = false; + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::GetSurfacePointFromFloats, x, y, surfacePoint, sampler, + &terrainExists); + benchmark::DoNotOptimize(surfacePoint); + } + } + }); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_GetSurfacePoints) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); +#endif + +} diff --git a/Gems/Terrain/Code/terrain_tests_files.cmake b/Gems/Terrain/Code/terrain_tests_files.cmake index 88de53f8cf..1a46fdd203 100644 --- a/Gems/Terrain/Code/terrain_tests_files.cmake +++ b/Gems/Terrain/Code/terrain_tests_files.cmake @@ -16,4 +16,5 @@ set(FILES Tests/TerrainHeightGradientListTests.cpp Tests/TerrainMacroMaterialTests.cpp Tests/TerrainSurfaceGradientListTests.cpp + Tests/TerrainSystemBenchmarks.cpp ) From a7d173db3d530dbf0d5f0067e05e4bd8ea422406 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 3 Jan 2022 16:15:35 -0800 Subject: [PATCH 230/399] changes from review and switching to assert model instead of return bool Signed-off-by: Scott Murray --- .../editor_entity_utils.py | 164 ++++++++++-------- 1 file changed, 93 insertions(+), 71 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index 58d9e30f81..0878431054 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -8,7 +8,8 @@ SPDX-License-Identifier: Apache-2.0 OR MIT # Built-in Imports from __future__ import annotations from typing import List, Tuple, Union - +from enum import Enum +import warnings # Open 3D Engine Imports import azlmbr @@ -21,15 +22,21 @@ import azlmbr.legacy.general as general from editor_python_test_tools.utils import Report +class Entity_Type(Enum): + GAME = azlmbr.entity.EntityType().Game + LEVEL = azlmbr.entity.EntityType().Level + + class EditorComponent: """ EditorComponent class used to set and get the component property value using path EditorComponent object is returned from either of EditorEntity.add_component() or Entity.add_components() or EditorEntity.get_components_of_type() which also assigns self.id and self.type_id to the EditorComponent object. + self.type_id is the UUID for the component type as provided by an ebus call. """ - def __init__(self, type_id): + def __init__(self, type_id: uuid): self.type_id = type_id self.id = None self.property_tree = None @@ -88,51 +95,59 @@ class EditorComponent: :param component_property_path: String of component property. (e.g. 'Settings|Visible') :return: Count of items in the container as unsigned integer """ - if self.is_property_container(component_property_path): - container_count_outcome = self.property_tree.get_container_count(component_property_path) - assert ( - container_count_outcome.IsSuccess() - ), f"Failure: get_container_count did not return success for '{component_property_path}'" - return container_count_outcome.GetValue() + assert ( + self.is_property_container(component_property_path) + ), f"Failure: '{component_property_path}' is not a property container" + container_count_outcome = self.property_tree.get_container_count(component_property_path) + assert ( + container_count_outcome.IsSuccess() + ), f"Failure: get_container_count did not return success for '{component_property_path}'" + return container_count_outcome.GetValue() - def reset_container(self, component_property_path: str) -> bool: + def reset_container(self, component_property_path: str): """ Used to rest a container to empty :param component_property_path: String of component property. (e.g. 'Settings|Visible') - :return: Boolean success + :return: None """ - if self.is_property_container(component_property_path): - reset_outcome = self.property_tree.reset_container(component_property_path) - return reset_outcome.IsSuccess() - else: - return False + assert ( + self.is_property_container(component_property_path) + ), f"Failure: '{component_property_path}' is not a property container" + reset_outcome = self.property_tree.reset_container(component_property_path) + assert ( + reset_outcome.IsSuccess() + ), f"Failure: could not reset_container on '{component_property_path}'" - def append_container_item(self, component_property_path: str, value: any) -> bool: + def append_container_item(self, component_property_path: str, value: any): """ Used to append a container item without providing an index key. :param component_property_path: String of component property. (e.g. 'Settings|Visible') :param value: Value to be set - :return: Boolean success + :return: None """ - if self.is_property_container(component_property_path): - append_outcome = self.property_tree.append_container_item(component_property_path, value) - return append_outcome.IsSuccess() - else: - return False + assert ( + self.is_property_container(component_property_path) + ), f"Failure: '{component_property_path}' is not a property container" + append_outcome = self.property_tree.append_container_item(component_property_path, value) + assert ( + append_outcome.IsSuccess() + ), f"Failure: could not append_container_item to '{component_property_path}'" - def add_container_item(self, component_property_path: str, key: any, value: any) -> bool: + def add_container_item(self, component_property_path: str, key: any, value: any): """ Used to add a container item at a specified key. In practice key should be an integer index. :param component_property_path: String of component property. (e.g. 'Settings|Visible') :param key: Zero index integer key, although this could be any unique unused key value :param value: Value to be set - :return: Boolean success + :return: None """ - if self.is_property_container(component_property_path): - add_outcome = self.property_tree.add_container_item(component_property_path, key, value) - return add_outcome.IsSuccess() - else: - return False + assert ( + self.is_property_container(component_property_path) + ), f"Failure: '{component_property_path}' is not a property container" + add_outcome = self.property_tree.add_container_item(component_property_path, key, value) + assert ( + add_outcome.IsSuccess() + ), f"Failure: could not add_container_item '{key}' to '{component_property_path}'" def get_container_item(self, component_property_path: str, key: any) -> any: """ @@ -141,27 +156,29 @@ class EditorComponent: :param key: Zero index integer key :return: Value stored at the key specified """ - if self.is_property_container(component_property_path): - get_outcome = self.property_tree.get_container_item(component_property_path, key) - assert ( - get_outcome.IsSuccess() - ), f"Failure: could not get a value for {self.get_component_name()}: '{component_property_path}' [{key}]" - return get_outcome.GetValue() - else: - return None + assert ( + self.is_property_container(component_property_path) + ), f"Failure: '{component_property_path}' is not a property container" + get_outcome = self.property_tree.get_container_item(component_property_path, key) + assert ( + get_outcome.IsSuccess() + ), f"Failure: could not get a value for {self.get_component_name()}: '{component_property_path}' [{key}]" + return get_outcome.GetValue() - def remove_container_item(self, component_property_path: str, key: any) -> bool: + def remove_container_item(self, component_property_path: str, key: any): """ Used to remove a container item value at the specified key. In practice key should be an integer index. :param component_property_path: String of component property. (e.g. 'Settings|Visible') :param key: Zero index integer key - :return: Boolean success + :return: None """ - if self.is_property_container(component_property_path): - remove_outcome = self.property_tree.remove_container_item(component_property_path, key) - return remove_outcome.IsSuccess() - else: - return False + assert ( + self.is_property_container(component_property_path) + ), f"Failure: '{component_property_path}' is not a property container" + remove_outcome = self.property_tree.remove_container_item(component_property_path, key) + assert ( + remove_outcome.IsSuccess() + ), f"Failure: could not remove_container_item '{key}' from '{component_property_path}'" def update_container_item(self, component_property_path: str, key: any, value: any): """ @@ -169,13 +186,15 @@ class EditorComponent: :param component_property_path: String of component property. (e.g. 'Settings|Visible') :param key: Zero index integer key :param value: Value to be set - :return: Boolean success + :return: None """ - if self.is_property_container(component_property_path): - update_outcome = self.property_tree.update_container_item(component_property_path, key, value) - return update_outcome.IsSuccess() - else: - return False + assert ( + self.is_property_container(component_property_path) + ), f"Failure: '{component_property_path}' is not a property container" + update_outcome = self.property_tree.update_container_item(component_property_path, key, value) + assert ( + update_outcome.IsSuccess() + ), f"Failure: could not update '{key}' in '{component_property_path}'" def get_component_property_value(self, component_property_path: str): """ @@ -211,30 +230,33 @@ class EditorComponent: """ return editor.EditorComponentAPIBus(bus.Broadcast, "IsComponentEnabled", self.id) - def disable_component(self): + def set_enabled(self, new_state: bool): """ - Used to disable the component using its id value. + Used to set the component enabled state + :param new_state: Boolean enabled True, disabled False :return: None """ - editor.EditorComponentAPIBus(bus.Broadcast, "DisableComponents", [self.id]) + if new_state: + editor.EditorComponentAPIBus(bus.Broadcast, "EnableComponents", [self.id]) + else: + editor.EditorComponentAPIBus(bus.Broadcast, "DisableComponents", [self.id]) - def enable_component(self): + def disable_component(self): """ - used to enable the componet using its id value + Used to disable the component using its id value. + :return: None """ - editor.EditorComponentAPIBus(bus.Broadcast, "EnabledComponents", [self.id]) + warnings.warn("disable_component is deprecated, use set_enabled(False) instead.", DeprecationWarning) + editor.EditorComponentAPIBus(bus.Broadcast, "DisableComponents", [self.id]) @staticmethod - def get_type_ids(component_names: list, entity_type: str ='Game') -> list: + def get_type_ids(component_names: list, entity_type: Entity_Type = Entity_Type.GAME) -> list: """ Used to get type ids of given components list - :param: component_names: List of components to get type ids - :return: List of type ids of given components. + :param component_names: List of components to get type ids + :param entity_type: Entity_Type enum value Entity_Type.GAME is the default + :return: List of type ids of given components. Type id is a UUID as provided by the ebus call """ - if entity_type.lower() == 'level': - entity_type = azlmbr.entity.EntityType().Level - else: - entity_type = azlmbr.entity.EntityType().Game type_ids = editor.EditorComponentAPIBus( bus.Broadcast, "FindComponentTypeIdsByEntityType", component_names, entity_type) return type_ids @@ -402,7 +424,7 @@ class EditorEntity: :return: List of newly added components to the entity """ components = [] - type_ids = EditorComponent.get_type_ids(component_names) + type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.GAME) for type_id in type_ids: new_comp = EditorComponent(type_id) add_component_outcome = editor.EditorComponentAPIBus( @@ -430,7 +452,7 @@ class EditorEntity: :param component_names: List of component names to remove :return: None """ - type_ids = EditorComponent.get_type_ids(component_names) + type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.GAME) for type_id in type_ids: remove_outcome = editor.EditorComponentAPIBus(bus.Broadcast, "RemoveComponents", self.id, [type_id]) assert ( @@ -444,7 +466,7 @@ class EditorEntity: :return: List of Entity Component objects of given component name """ component_list = [] - type_ids = EditorComponent.get_type_ids(component_names) + type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.GAME) for type_id in type_ids: component = EditorComponent(type_id) get_component_of_type_outcome = editor.EditorComponentAPIBus( @@ -464,7 +486,7 @@ class EditorEntity: :param component_name: Name of component to check for :return: True, if entity has specified component. Else, False """ - type_ids = EditorComponent.get_type_ids([component_name]) + type_ids = EditorComponent.get_type_ids([component_name], Entity_Type.GAME) return editor.EditorComponentAPIBus(bus.Broadcast, "HasComponentOfType", self.id, type_ids[0]) def get_start_status(self) -> int: @@ -666,7 +688,7 @@ class EditorLevelEntity: :return: List of newly added components to the level """ components = [] - type_ids = EditorComponent.get_type_ids(component_names, 'level') + type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.LEVEL) for type_id in type_ids: new_comp = EditorComponent(type_id) add_component_outcome = editor.EditorLevelComponentAPIBus( @@ -687,7 +709,7 @@ class EditorLevelEntity: :return: List of Level Component objects of given component name """ component_list = [] - type_ids = EditorComponent.get_type_ids(component_names, 'level') + type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.LEVEL) for type_id in type_ids: component = EditorComponent(type_id) get_component_of_type_outcome = editor.EditorLevelComponentAPIBus( @@ -708,7 +730,7 @@ class EditorLevelEntity: :param component_name: Name of component to check for :return: True, if level has specified component. Else, False """ - type_ids = EditorComponent.get_type_ids([component_name], 'level') + type_ids = EditorComponent.get_type_ids([component_name], Entity_Type.LEVEL) return editor.EditorLevelComponentAPIBus(bus.Broadcast, "HasComponentOfType", type_ids[0]) @staticmethod @@ -718,5 +740,5 @@ class EditorLevelEntity: :param component_name: Name of component to check for :return: integer count of occurences of level component attached to level or zero if none are present """ - type_ids = EditorComponent.get_type_ids([component_name], 'level') + type_ids = EditorComponent.get_type_ids([component_name], Entity_Type.LEVEL) return editor.EditorLevelComponentAPIBus(bus.Broadcast, "CountComponentsOfType", type_ids[0]) From 0f2e33af680e608eb622821deee0bd063534d292 Mon Sep 17 00:00:00 2001 From: evanchia Date: Mon, 3 Jan 2022 16:48:20 -0800 Subject: [PATCH 231/399] Changed test artifact upload check Signed-off-by: evanchia --- scripts/build/Jenkins/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/Jenkins/Jenkinsfile b/scripts/build/Jenkins/Jenkinsfile index 9e013fd816..ec40840fa6 100644 --- a/scripts/build/Jenkins/Jenkinsfile +++ b/scripts/build/Jenkins/Jenkinsfile @@ -610,7 +610,7 @@ def CreateSingleNode(Map pipelineConfig, def platform, def build_job, Map envVar CreateUploadAPLogsStage(platform.key, build_job_name, envVars['WORKSPACE'], platform.value.build_types[build_job_name].PARAMETERS).call() } // Upload test artifacts only on builds that failed and ran test suites - if (env.IS_UPLOAD_TEST_ARTIFACTS?.toBoolean() && params.containsKey('CMAKE_TARGET') && params.CMAKE_TARGET.contains("TEST_SUITE")) { + if (env.IS_UPLOAD_TEST_ARTIFACTS?.toBoolean() && params.containsKey('CTEST_OPTIONS')) { CreateUploadTestArtifactStage(build_job_name, envVars['WORKSPACE'], params.OUTPUT_DIRECTORY).call() } // All other errors will be raised outside the retry block From f9404baabcafc1670a8653e2667dffb2c2cc929d Mon Sep 17 00:00:00 2001 From: abrmich Date: Wed, 22 Dec 2021 17:32:20 -0800 Subject: [PATCH 232/399] Move LyShine shader to the gem Signed-off-by: abrmich --- .../Assets => LyShine/Assets/LyShine}/Shaders/LyShineUI.azsl | 0 .../Assets => LyShine/Assets/LyShine}/Shaders/LyShineUI.shader | 0 .../Assets/LyShine}/Shaders/LyShineUI.shadervariantlist | 0 Gems/LyShine/Code/Source/UiRenderer.cpp | 2 +- 4 files changed, 1 insertion(+), 1 deletion(-) rename Gems/{AtomLyIntegration/AtomBridge/Assets => LyShine/Assets/LyShine}/Shaders/LyShineUI.azsl (100%) rename Gems/{AtomLyIntegration/AtomBridge/Assets => LyShine/Assets/LyShine}/Shaders/LyShineUI.shader (100%) rename Gems/{AtomLyIntegration/AtomBridge/Assets => LyShine/Assets/LyShine}/Shaders/LyShineUI.shadervariantlist (100%) diff --git a/Gems/AtomLyIntegration/AtomBridge/Assets/Shaders/LyShineUI.azsl b/Gems/LyShine/Assets/LyShine/Shaders/LyShineUI.azsl similarity index 100% rename from Gems/AtomLyIntegration/AtomBridge/Assets/Shaders/LyShineUI.azsl rename to Gems/LyShine/Assets/LyShine/Shaders/LyShineUI.azsl diff --git a/Gems/AtomLyIntegration/AtomBridge/Assets/Shaders/LyShineUI.shader b/Gems/LyShine/Assets/LyShine/Shaders/LyShineUI.shader similarity index 100% rename from Gems/AtomLyIntegration/AtomBridge/Assets/Shaders/LyShineUI.shader rename to Gems/LyShine/Assets/LyShine/Shaders/LyShineUI.shader diff --git a/Gems/AtomLyIntegration/AtomBridge/Assets/Shaders/LyShineUI.shadervariantlist b/Gems/LyShine/Assets/LyShine/Shaders/LyShineUI.shadervariantlist similarity index 100% rename from Gems/AtomLyIntegration/AtomBridge/Assets/Shaders/LyShineUI.shadervariantlist rename to Gems/LyShine/Assets/LyShine/Shaders/LyShineUI.shadervariantlist diff --git a/Gems/LyShine/Code/Source/UiRenderer.cpp b/Gems/LyShine/Code/Source/UiRenderer.cpp index ea5dfdd134..b43be90a36 100644 --- a/Gems/LyShine/Code/Source/UiRenderer.cpp +++ b/Gems/LyShine/Code/Source/UiRenderer.cpp @@ -57,7 +57,7 @@ void UiRenderer::OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene) // At this point the RPI is ready for use // Load the UI shader - const char* uiShaderFilepath = "Shaders/LyShineUI.azshader"; + const char* uiShaderFilepath = "LyShine/Shaders/LyShineUI.azshader"; AZ::Data::Instance uiShader = AZ::RPI::LoadCriticalShader(uiShaderFilepath); // Create scene to be used by the dynamic draw context From 95245e2424681d2b86c35cb1c7f9847540ff2451 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Tue, 4 Jan 2022 09:13:14 +0100 Subject: [PATCH 233/399] EMotion FX: Linear and angular velocity calculation and debug visualization helpers (#6613) * Added helper functions for calculating linear and angular velocities. * Added debug visualization helper for linear and angular velocities. Signed-off-by: Benjamin Jillich --- .../Code/EMotionFX/Source/Velocity.cpp | 83 +++++++++++++++++++ .../Code/EMotionFX/Source/Velocity.h | 23 +++++ .../Code/EMotionFX/emotionfx_files.cmake | 2 + 3 files changed, 108 insertions(+) create mode 100644 Gems/EMotionFX/Code/EMotionFX/Source/Velocity.cpp create mode 100644 Gems/EMotionFX/Code/EMotionFX/Source/Velocity.h diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Velocity.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Velocity.cpp new file mode 100644 index 0000000000..e02262fa8e --- /dev/null +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Velocity.cpp @@ -0,0 +1,83 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace EMotionFX +{ + AZ::Vector3 CalculateLinearVelocity(const AZ::Vector3& lastPosition, + const AZ::Vector3& currentPosition, + float timeDelta) + { + if (timeDelta <= AZ::Constants::FloatEpsilon) + { + return AZ::Vector3::CreateZero(); + } + + const AZ::Vector3 deltaPosition = currentPosition - lastPosition; + const AZ::Vector3 velocity = deltaPosition / timeDelta; + + if (velocity.GetLength() > AZ::Constants::FloatEpsilon) + { + return velocity; + } + + return AZ::Vector3::CreateZero(); + } + + AZ::Vector3 CalculateAngularVelocity(const AZ::Quaternion& lastRotation, + const AZ::Quaternion& currentRotation, + float timeDelta) + { + if (timeDelta <= AZ::Constants::FloatEpsilon) + { + return AZ::Vector3::CreateZero(); + } + + const AZ::Quaternion deltaRotation = currentRotation * lastRotation.GetInverseFull(); + const AZ::Quaternion shortestEquivalent = deltaRotation.GetShortestEquivalent().GetNormalized(); + const AZ::Vector3 scaledAxisAngle = shortestEquivalent.ConvertToScaledAxisAngle(); + const AZ::Vector3 angularVelocity = scaledAxisAngle / timeDelta; + + if (angularVelocity.GetLength() > AZ::Constants::FloatEpsilon) + { + return angularVelocity; + } + + return AZ::Vector3::CreateZero(); + } + + void DebugDrawVelocity(AzFramework::DebugDisplayRequests& debugDisplay, + const AZ::Vector3& position, const AZ::Vector3& velocity, const AZ::Color& color) + { + // Don't visualize joints that remain motionless (zero velocity). + if (velocity.GetLength() < AZ::Constants::FloatEpsilon) + { + return; + } + + const float scale = 0.15f; + const AZ::Vector3 arrowPosition = position + velocity; + + debugDisplay.DepthTestOff(); + debugDisplay.SetColor(color); + + debugDisplay.DrawSolidCylinder(/*center=*/(arrowPosition + position) * 0.5f, + /*direction=*/(arrowPosition - position).GetNormalizedSafe(), + /*radius=*/0.003f, + /*height=*/(arrowPosition - position).GetLength(), + /*drawShaded=*/false); + + debugDisplay.DrawSolidCone(position + velocity, + velocity, + 0.1f * scale, + scale * 0.5f, + /*drawShaded=*/false); + } +} // namespace EMotionFX diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Velocity.h b/Gems/EMotionFX/Code/EMotionFX/Source/Velocity.h new file mode 100644 index 0000000000..a37a888024 --- /dev/null +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Velocity.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include + +namespace EMotionFX +{ + AZ::Vector3 EMFX_API CalculateLinearVelocity(const AZ::Vector3& lastPosition, const AZ::Vector3& currentPosition, float timeDelta); + AZ::Vector3 EMFX_API CalculateAngularVelocity(const AZ::Quaternion& lastRotation, const AZ::Quaternion& currentRotation, float timeDelta); + + void EMFX_API DebugDrawVelocity(AzFramework::DebugDisplayRequests& debugDisplay, + const AZ::Vector3& position, const AZ::Vector3& velocity, const AZ::Color& color); +} // namespace EMotionFX diff --git a/Gems/EMotionFX/Code/EMotionFX/emotionfx_files.cmake b/Gems/EMotionFX/Code/EMotionFX/emotionfx_files.cmake index 8135f14f12..52c9d6aa15 100644 --- a/Gems/EMotionFX/Code/EMotionFX/emotionfx_files.cmake +++ b/Gems/EMotionFX/Code/EMotionFX/emotionfx_files.cmake @@ -144,6 +144,8 @@ set(FILES Source/TransformData.h Source/TriggerActionSetup.cpp Source/TriggerActionSetup.h + Source/Velocity.cpp + Source/Velocity.h Source/VertexAttributeLayer.cpp Source/VertexAttributeLayer.h Source/VertexAttributeLayerAbstractData.cpp From c7d72bc6b68a93e194466eac80fdb17d78acf22f Mon Sep 17 00:00:00 2001 From: Tobias Alexander Franke Date: Wed, 17 Nov 2021 15:30:46 +0800 Subject: [PATCH 234/399] Ragdoll saving issue Signed-off-by: T.J. McGrath-Daly --- .../Code/Source/Editor/Plugins/Ragdoll/RagdollNodeWidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Gems/EMotionFX/Code/Source/Editor/Plugins/Ragdoll/RagdollNodeWidget.cpp b/Gems/EMotionFX/Code/Source/Editor/Plugins/Ragdoll/RagdollNodeWidget.cpp index 29745beb68..538ad3ba52 100644 --- a/Gems/EMotionFX/Code/Source/Editor/Plugins/Ragdoll/RagdollNodeWidget.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/Plugins/Ragdoll/RagdollNodeWidget.cpp @@ -125,6 +125,10 @@ namespace EMotionFX Physics::RagdollNodeConfiguration* ragdollNodeConfig = GetRagdollNodeConfig(); if (ragdollNodeConfig) { + AzPhysics::JointConfiguration* jointLimitConfig = ragdollNodeConfig->m_jointConfig.get(); + jointLimitConfig->SetPropertyVisibility(AzPhysics::JointConfiguration::PropertyVisibility::ParentLocalRotation, jointLimitConfig != nullptr); + jointLimitConfig->SetPropertyVisibility(AzPhysics::JointConfiguration::PropertyVisibility::ChildLocalRotation, jointLimitConfig != nullptr); + m_addColliderButton->show(); m_addRemoveButton->setText("Remove from ragdoll"); From e4880cf9a18617b2504cf64ac73bc6b16996777c Mon Sep 17 00:00:00 2001 From: Tobias Alexander Franke Date: Tue, 21 Dec 2021 19:35:34 +0800 Subject: [PATCH 235/399] Fix: Right hand bones misplaced Signed-off-by: T.J. McGrath-Daly --- .../Code/EMotionFX/Rendering/Common/RenderUtil.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp index 6fd28ee72f..b1dd26061a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp @@ -952,7 +952,15 @@ namespace MCommon } else { - worldTM = AZ::Transform::CreateFromQuaternion(MCore::AzEulerAnglesToAzQuat(0.0f, 0.0f, MCore::Math::DegreesToRadians(180.0f))); + if (direction.GetX() > 0) + { + worldTM = AZ::Transform::CreateFromQuaternion(MCore::AzEulerAnglesToAzQuat(MCore::Math::DegreesToRadians(180.0f), 0.0f, MCore::Math::DegreesToRadians(180.0f))); + } + else + { + worldTM = AZ::Transform::CreateFromQuaternion(MCore::AzEulerAnglesToAzQuat(0.0f, 0.0f, 0.0f)); + } + } // set the cylinder to the given position From 07c862bd5295093ffd975bfa9fee07a154ffefbc Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Tue, 4 Jan 2022 08:37:58 -0600 Subject: [PATCH 236/399] Fix string format specifier. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp b/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp index b921681ab5..3d0cb5222e 100644 --- a/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp +++ b/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp @@ -250,7 +250,7 @@ namespace UnitTest // Give each gradient a new surface tag surfaceConfig.m_gradientSurfaceMappings.emplace_back( - surfaceGradientEntity->GetId(), SurfaceData::SurfaceTag(AZStd::string::format("test%zu", surfaces))); + surfaceGradientEntity->GetId(), SurfaceData::SurfaceTag(AZStd::string::format("test%u", surfaces))); surfaceGradientEntities.emplace_back(AZStd::move(surfaceGradientEntity)); surfaceGradientShapeRequests.emplace_back(AZStd::move(shapeRequests)); From cab09dc4aec745a2be94172645c9624c7b0126ff Mon Sep 17 00:00:00 2001 From: mrieggeramzn <61609885+mrieggeramzn@users.noreply.github.com> Date: Tue, 4 Jan 2022 08:27:43 -0800 Subject: [PATCH 237/399] Adding better decal culling (#6519) * Adding better decal culling Signed-off-by: mrieggeramzn * removing accidental commit Signed-off-by: mrieggeramzn * Breja's suggestion for decal sphere size estimation Signed-off-by: mrieggeramzn * Removing unused variable Signed-off-by: mrieggeramzn --- .../Assets/Shaders/LightCulling/LightCulling.azsl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCulling.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCulling.azsl index 707ede9868..e806bc7cb7 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCulling.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCulling.azsl @@ -368,16 +368,19 @@ void CullDecals(uint groupIndex, TileLightData tileLightData, float3 aabb_center float3 decalPosition = WorldToView_Point(decal.m_position); // just wrapping a bounding sphere around a cube for now to get a minor perf boost. i.e. the sphere radius is sqrt(x*x + y*y + z*z) - // ATOM-4224 - try AABB-AABB and implement depth binning for the decals - float maxHalfSize = max(max(decal.m_halfSize.x, decal.m_halfSize.y), decal.m_halfSize.z); - float boundingSphereRadiusSqr = maxHalfSize * maxHalfSize * 3; + // ATOM-4224 - try AABB-AABB + float boundingSphereRadiusSqr = dot(decal.m_halfSize, decal.m_halfSize); bool potentiallyIntersects = TestSphereVsAabb(decalPosition, boundingSphereRadiusSqr, aabb_center, aabb_extents); + if (potentiallyIntersects) { - // Implement and profile fine-grained light culling testing - // ATOM-3732 - MarkLightAsVisibleInSharedMemory(decalIndex, 0xFFFF); + uint inside = 0; + float2 minmax = ComputePointLightMinMaxZ(sqrt(boundingSphereRadiusSqr), decalPosition); + if (IsObjectInsideTile(tileLightData, minmax, inside)) + { + MarkLightAsVisibleInSharedMemory(decalIndex, inside); + } } } } From 03f6ba55fd1d1ae58aa2d67a19ddc26266d0fe36 Mon Sep 17 00:00:00 2001 From: mrieggeramzn <61609885+mrieggeramzn@users.noreply.github.com> Date: Tue, 4 Jan 2022 08:29:34 -0800 Subject: [PATCH 238/399] Adding cascade blending for pcf (#6181) * Adding cascade blending for pcf Signed-off-by: mrieggeramzn * tabs to spaces Signed-off-by: mrieggeramzn * tabs to spaces Signed-off-by: mrieggeramzn * tabs 2 spaces Signed-off-by: mrieggeramzn * Feedback using min3 Signed-off-by: mrieggeramzn * Only enable flag if > 1 cascade Signed-off-by: mrieggeramzn * no blending if last cascade Signed-off-by: mrieggeramzn * Remove unused Signed-off-by: mrieggeramzn --- .../Shadow/DirectionalLightShadow.azsli | 52 +++++++++++++++++-- ...irectionalLightFeatureProcessorInterface.h | 3 ++ .../DirectionalLightFeatureProcessor.cpp | 13 +++-- .../DirectionalLightFeatureProcessor.h | 4 ++ .../CoreLights/DirectionalLightBus.h | 8 +++ .../DirectionalLightComponentConfig.h | 3 ++ .../DirectionalLightComponentConfig.cpp | 6 +-- .../DirectionalLightComponentController.cpp | 17 +++++- .../DirectionalLightComponentController.h | 4 +- .../EditorDirectionalLightComponent.cpp | 6 ++- 10 files changed, 104 insertions(+), 12 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli index 59817af701..870bebdf4b 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli @@ -10,6 +10,7 @@ #include #include +#include #include "Shadow.azsli" #include "ShadowmapAtlasLib.azsli" #include "BicubicPcfFilters.azsli" @@ -25,6 +26,10 @@ enum class ShadowFilterMethod {None, Pcf, Esm, EsmPcf}; option ShadowFilterMethod o_directional_shadow_filtering_method = ShadowFilterMethod::None; option bool o_directional_shadow_receiver_plane_bias_enable = true; +option bool o_blend_between_cascades_enable = false; + +static const float CascadeBlendArea = 0.015f; // might be worth exposing this as a slider. + // DirectionalLightShadow calculates lit ratio for a directional light. class DirectionalLightShadow @@ -98,6 +103,8 @@ class DirectionalLightShadow float SamplePcfBicubic(float3 shadowCoord, uint indexOfCascade); + float CalculateCascadeBlendAmount(const float3 texCoord); + uint m_lightIndex; float3 m_shadowCoords[ViewSrg::MaxCascadeCount]; float m_slopeBias[ViewSrg::MaxCascadeCount]; @@ -174,6 +181,7 @@ bool2 DirectionalLightShadow::IsShadowed(float3 shadowCoord, uint indexOfCascade const uint cascadeCount = ViewSrg::m_directionalLightShadows[m_lightIndex].m_cascadeCount; Texture2DArray shadowmap = PassSrg::m_directionalLightShadowmap; + [branch] if (shadowCoord.x >= 0. && shadowCoord.x * size < size - PixelMargin && shadowCoord.y >= 0. && shadowCoord.y * size < size - PixelMargin) { @@ -213,20 +221,46 @@ float DirectionalLightShadow::GetVisibilityFromLightPcf() static const float PixelMargin = 1.5; // avoiding artifact between cascade levels. static const float DepthMargin = 1e-8; // avoiding artifact when near depth bounds. + bool cascadeFound = false; + int currentCascadeIndex = 0; + const uint size = ViewSrg::m_directionalLightShadows[m_lightIndex].m_shadowmapSize; const uint cascadeCount = ViewSrg::m_directionalLightShadows[m_lightIndex].m_cascadeCount; for (uint indexOfCascade = 0; indexOfCascade < cascadeCount; ++indexOfCascade) { const float3 shadowCoord = m_shadowCoords[indexOfCascade]; - + if (shadowCoord.x >= 0. && shadowCoord.x * size < size - PixelMargin && shadowCoord.y >= 0. && shadowCoord.y * size < size - PixelMargin && shadowCoord.z < 1. - DepthMargin) { - m_debugInfo.m_cascadeIndex = indexOfCascade; - return SamplePcfBicubic(shadowCoord, indexOfCascade); + currentCascadeIndex = m_debugInfo.m_cascadeIndex = indexOfCascade; + cascadeFound = true; + break; } } + + [branch] + if (cascadeFound) + { + float lit = SamplePcfBicubic(m_shadowCoords[currentCascadeIndex], currentCascadeIndex); + + if(o_blend_between_cascades_enable) + { + const float blendBetweenCascadesAmount = CalculateCascadeBlendAmount(m_shadowCoords[currentCascadeIndex].xyz); + + const int nextCascadeIndex = currentCascadeIndex + 1; + [branch] + if (blendBetweenCascadesAmount < 1.0f && nextCascadeIndex < cascadeCount) + { + const float nextLit = SamplePcfBicubic(m_shadowCoords[nextCascadeIndex], nextCascadeIndex); + lit = lerp(nextLit, lit, blendBetweenCascadesAmount); + } + } + + return lit; + } + m_debugInfo.m_cascadeIndex = cascadeCount; return 1.; } @@ -244,6 +278,8 @@ float DirectionalLightShadow::GetVisibilityFromLightEsm() const float distanceMin = ViewSrg::m_esmsDirectional[indexOfCascade].m_lightDistanceOfCameraViewFrustum; bool2 checkedShadowed = IsShadowed(shadowCoord, indexOfCascade); const float depthDiff = shadowCoord.z - distanceMin; + + [branch] if (checkedShadowed.x && depthDiff >= 0) { const float distanceWithinCameraView = depthDiff / (1. - distanceMin); @@ -274,6 +310,8 @@ float DirectionalLightShadow::GetVisibilityFromLightEsmPcf() const float distanceMin = ViewSrg::m_esmsDirectional[indexOfCascade].m_lightDistanceOfCameraViewFrustum; bool2 checkedShadowed = IsShadowed(shadowCoord, indexOfCascade); const float depthDiff = shadowCoord.z - distanceMin; + + [branch] if (checkedShadowed.x && depthDiff >= 0) { const float distanceWithinCameraView = depthDiff / (1. - distanceMin); @@ -319,6 +357,7 @@ float DirectionalLightShadow::SamplePcfBicubic(float3 shadowCoord, uint indexOfC param.samplerState = SceneSrg::m_hwPcfSampler; param.receiverPlaneDepthBias = o_directional_shadow_receiver_plane_bias_enable ? ComputeReceiverPlaneDepthBias(m_shadowPosDX[indexOfCascade], m_shadowPosDY[indexOfCascade]) : 0; + [branch] if (filteringSampleCount <= 4) { return SampleShadowMapBicubic_4Tap(param); @@ -420,3 +459,10 @@ float3 DirectionalLightShadow::AddDebugColoring( } return color; } + +float DirectionalLightShadow::CalculateCascadeBlendAmount(const float3 texCoord) +{ + const float distanceToOneMin = min3(1.0f - texCoord); + const float currentPixelsBlendBandLocation = min(min(texCoord.x, texCoord.y), distanceToOneMin); + return currentPixelsBlendBandLocation / CascadeBlendArea; +} diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h index fa987a7156..6119585d9d 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h @@ -163,6 +163,9 @@ namespace AZ //! Reduces acne by biasing the shadowmap lookup along the geometric normal. virtual void SetNormalShadowBias(LightHandle handle, float normalShadowBias) = 0; + + //! Sets whether or not blending between shadow map cascades is enabled. + virtual void SetCascadeBlendingEnabled(LightHandle handle, bool enable) = 0; }; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp index ee60ff412a..5cf65adcee 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp @@ -198,13 +198,15 @@ namespace AZ if (m_shadowingLightHandle.IsValid()) { - uint32_t shadowFilterMethod = m_shadowData.at(nullptr).GetData(m_shadowingLightHandle.GetIndex()).m_shadowFilterMethod; + const uint32_t shadowFilterMethod = m_shadowData.at(nullptr).GetData(m_shadowingLightHandle.GetIndex()).m_shadowFilterMethod; RPI::ShaderSystemInterface::Get()->SetGlobalShaderOption(m_directionalShadowFilteringMethodName, AZ::RPI::ShaderOptionValue{shadowFilterMethod}); - RPI::ShaderSystemInterface::Get()->SetGlobalShaderOption(m_directionalShadowReceiverPlaneBiasEnableName, AZ::RPI::ShaderOptionValue{ m_shadowProperties.GetData(m_shadowingLightHandle.GetIndex()).m_isReceiverPlaneBiasEnabled }); + RPI::ShaderSystemInterface::Get()->SetGlobalShaderOption(m_directionalShadowReceiverPlaneBiasEnableName, AZ::RPI::ShaderOptionValue{ m_shadowProperties.GetData(m_shadowingLightHandle.GetIndex()).m_isReceiverPlaneBiasEnabled }); const uint32_t cascadeCount = m_shadowData.at(nullptr).GetData(m_shadowingLightHandle.GetIndex()).m_cascadeCount; - ShadowProperty& property = m_shadowProperties.GetData(m_shadowingLightHandle.GetIndex()); + RPI::ShaderSystemInterface::Get()->SetGlobalShaderOption(m_BlendBetweenCascadesEnableName, AZ::RPI::ShaderOptionValue{cascadeCount > 1 && m_shadowProperties.GetData(m_shadowingLightHandle.GetIndex()).m_blendBetwenCascades }); + + ShadowProperty& property = m_shadowProperties.GetData(m_shadowingLightHandle.GetIndex()); bool segmentsNeedUpdate = property.m_segments.empty(); for (const auto& passIt : m_cascadedShadowmapsPasses) { @@ -577,6 +579,11 @@ namespace AZ m_shadowProperties.GetData(handle.GetIndex()).m_isReceiverPlaneBiasEnabled = enable; } + void DirectionalLightFeatureProcessor::SetCascadeBlendingEnabled(LightHandle handle, bool enable) + { + m_shadowProperties.GetData(handle.GetIndex()).m_blendBetwenCascades = enable; + } + void DirectionalLightFeatureProcessor::SetShadowBias(LightHandle handle, float bias) { for (auto& it : m_shadowData) diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.h index c206a5097f..83ab7cb15b 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.h @@ -176,6 +176,8 @@ namespace AZ // If true, this will reduce the shadow acne introduced by large pcf kernels by estimating the angle of the triangle being shaded // with the ddx/ddy functions. bool m_isReceiverPlaneBiasEnabled = true; + + bool m_blendBetwenCascades = false; }; static void Reflect(ReflectContext* context); @@ -215,6 +217,7 @@ namespace AZ void SetShadowFilterMethod(LightHandle handle, ShadowFilterMethod method) override; void SetFilteringSampleCount(LightHandle handle, uint16_t count) override; void SetShadowReceiverPlaneBiasEnabled(LightHandle handle, bool enable) override; + void SetCascadeBlendingEnabled(LightHandle handle, bool enable) override; void SetShadowBias(LightHandle handle, float bias) override; void SetNormalShadowBias(LightHandle handle, float normalShadowBias) override; @@ -367,6 +370,7 @@ namespace AZ Name m_lightTypeName = Name("directional"); Name m_directionalShadowFilteringMethodName = Name("o_directional_shadow_filtering_method"); Name m_directionalShadowReceiverPlaneBiasEnableName = Name("o_directional_shadow_receiver_plane_bias_enable"); + Name m_BlendBetweenCascadesEnableName = Name("o_blend_between_cascades_enable"); static constexpr const char* FeatureProcessorName = "DirectionalLightFeatureProcessor"; }; } // namespace Render diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightBus.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightBus.h index 3cafc183a5..ebccccadcd 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightBus.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightBus.h @@ -184,6 +184,14 @@ namespace AZ //! Reduces acne by biasing the shadowmap lookup along the geometric normal. //! @param normalShadowBias Sets the amount of normal shadow bias to apply. virtual void SetNormalShadowBias(float normalShadowBias) = 0; + + //! Gets whether the directional shadow map has cascade blending enabled. + //! This smooths out the border between cascades at the cost of some performance in the blend area. + virtual bool GetCascadeBlendingEnabled() const = 0; + + //! Sets whether the directional shadow map has cascade blending enabled. + //! @param enable flag specifying whether to enable cascade blending. + virtual void SetCascadeBlendingEnabled(bool enable) = 0; }; using DirectionalLightRequestBus = EBus; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightComponentConfig.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightComponentConfig.h index 92d5cc9ac0..ca872d78d6 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightComponentConfig.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightComponentConfig.h @@ -115,6 +115,9 @@ namespace AZ //! Reduces shadow acne by applying a small amount of offset along shadow-space z. float m_shadowBias = 0.0f; + // If true, sample between two adjacent shadow map cascades in a small boundary area to smooth out the transition. + bool m_cascadeBlendingEnabled = false; + bool IsSplitManual() const; bool IsSplitAutomatic() const; bool IsCascadeCorrectionDisabled() const; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentConfig.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentConfig.cpp index 78a9cc21d1..d9f93cc825 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentConfig.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentConfig.cpp @@ -40,7 +40,8 @@ namespace AZ ->Field("PcfFilteringSampleCount", &DirectionalLightComponentConfig::m_filteringSampleCount) ->Field("ShadowReceiverPlaneBiasEnabled", &DirectionalLightComponentConfig::m_receiverPlaneBiasEnabled) ->Field("Shadow Bias", &DirectionalLightComponentConfig::m_shadowBias) - ->Field("Normal Shadow Bias", &DirectionalLightComponentConfig::m_normalShadowBias); + ->Field("Normal Shadow Bias", &DirectionalLightComponentConfig::m_normalShadowBias) + ->Field("CascadeBlendingEnabled", &DirectionalLightComponentConfig::m_cascadeBlendingEnabled); } } @@ -113,8 +114,7 @@ namespace AZ bool DirectionalLightComponentConfig::IsShadowPcfDisabled() const { - return !(m_shadowFilterMethod == ShadowFilterMethod::Pcf || - m_shadowFilterMethod == ShadowFilterMethod::EsmPcf); + return !(m_shadowFilterMethod == ShadowFilterMethod::Pcf); } bool DirectionalLightComponentConfig::IsEsmDisabled() const diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.cpp index e36868c4bb..ce39a32b19 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.cpp @@ -88,6 +88,8 @@ namespace AZ ->Event("SetShadowBias", &DirectionalLightRequestBus::Events::SetShadowBias) ->Event("GetNormalShadowBias", &DirectionalLightRequestBus::Events::GetNormalShadowBias) ->Event("SetNormalShadowBias", &DirectionalLightRequestBus::Events::SetNormalShadowBias) + ->Event("GetCascadeBlendingEnabled", &DirectionalLightRequestBus::Events::GetCascadeBlendingEnabled) + ->Event("SetCascadeBlendingEnabled", &DirectionalLightRequestBus::Events::SetCascadeBlendingEnabled) ->VirtualProperty("Color", "GetColor", "SetColor") ->VirtualProperty("Intensity", "GetIntensity", "SetIntensity") ->VirtualProperty("AngularDiameter", "GetAngularDiameter", "SetAngularDiameter") @@ -104,7 +106,8 @@ namespace AZ ->VirtualProperty("FilteringSampleCount", "GetFilteringSampleCount", "SetFilteringSampleCount") ->VirtualProperty("ShadowReceiverPlaneBiasEnabled", "GetShadowReceiverPlaneBiasEnabled", "SetShadowReceiverPlaneBiasEnabled") ->VirtualProperty("ShadowBias", "GetShadowBias", "SetShadowBias") - ->VirtualProperty("NormalShadowBias", "GetNormalShadowBias", "SetNormalShadowBias"); + ->VirtualProperty("NormalShadowBias", "GetNormalShadowBias", "SetNormalShadowBias") + ->VirtualProperty("BlendBetweenCascadesEnabled", "GetCascadeBlendingEnabled", "SetCascadeBlendingEnabled"); ; } } @@ -537,6 +540,7 @@ namespace AZ SetNormalShadowBias(m_configuration.m_normalShadowBias); SetFilteringSampleCount(m_configuration.m_filteringSampleCount); SetShadowReceiverPlaneBiasEnabled(m_configuration.m_receiverPlaneBiasEnabled); + SetCascadeBlendingEnabled(m_configuration.m_cascadeBlendingEnabled); // [GFX TODO][ATOM-1726] share config for multiple light (e.g., light ID). // [GFX TODO][ATOM-2416] adapt to multiple viewports. @@ -636,5 +640,16 @@ namespace AZ m_featureProcessor->SetShadowReceiverPlaneBiasEnabled(m_lightHandle, enable); } + bool DirectionalLightComponentController::GetCascadeBlendingEnabled() const + { + return m_configuration.m_cascadeBlendingEnabled; + } + + void DirectionalLightComponentController::SetCascadeBlendingEnabled(bool enable) + { + m_configuration.m_cascadeBlendingEnabled = enable; + m_featureProcessor->SetCascadeBlendingEnabled(m_lightHandle, enable); + } + } // namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.h index 9a6edda666..4aa8aed2fd 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.h @@ -83,7 +83,9 @@ namespace AZ float GetShadowBias() const override; void SetShadowBias(float bias) override; float GetNormalShadowBias() const override; - void SetNormalShadowBias(float bias) override; + void SetNormalShadowBias(float bias) override; + bool GetCascadeBlendingEnabled() const override; + void SetCascadeBlendingEnabled(bool enable) override; private: friend class EditorDirectionalLightComponent; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp index 545064b86f..2b1510b861 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp @@ -161,7 +161,11 @@ namespace AZ ->Attribute(Edit::Attributes::Min, 0.f) ->Attribute(Edit::Attributes::Max, 10.0f) ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ; + ->DataElement( + Edit::UIHandlers::CheckBox, &DirectionalLightComponentConfig::m_cascadeBlendingEnabled, + "Blend between cascades\n", "Enables smooth blending between shadow map cascades.") + ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsShadowPcfDisabled) + ; } } From c15ead9c30048ad5a2cf49eae9fbad0518e78779 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 4 Jan 2022 10:32:52 -0600 Subject: [PATCH 239/399] Removed unused bone name class. Signed-off-by: Chris Galvan --- .../Animation/AnimationBipedBoneNames.cpp | 30 ---------------- .../Animation/AnimationBipedBoneNames.h | 34 ------------------- Code/Editor/editor_lib_files.cmake | 2 -- 3 files changed, 66 deletions(-) delete mode 100644 Code/Editor/Animation/AnimationBipedBoneNames.cpp delete mode 100644 Code/Editor/Animation/AnimationBipedBoneNames.h diff --git a/Code/Editor/Animation/AnimationBipedBoneNames.cpp b/Code/Editor/Animation/AnimationBipedBoneNames.cpp deleted file mode 100644 index 72502fe61d..0000000000 --- a/Code/Editor/Animation/AnimationBipedBoneNames.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include "EditorDefs.h" - -#include "AnimationBipedBoneNames.h" - -namespace EditorAnimationBones::Biped -{ - const char* Pelvis = "Bip01 Pelvis"; - const char* Head = "Bip01 Head"; - const char* Weapon = "weapon_bone"; - - const char* LeftEye = "eye_bone_left"; - const char* RightEye = "eye_bone_right"; - - const char* Spine[5] = { "Bip01 Spine", "Bip01 Spine1", "Bip01 Spine2", "Bip01 Spine3", "Bip01 Spine4" }; - const char* Neck[2] = { "Bip01 Neck", "Bip01 Neck1" }; - - const char* LeftHeel = "Bip01 L Heel"; - const char* LeftToe[2] = { "Bip01 L Toe0", "Bip01 L Toe1" }; - - const char* RightHeel = "Bip01 R Heel"; - const char* RightToe[2] = { "Bip01 R Toe0", "Bip01 R Toe1" }; -} // namespace EditorAnimationBones::Biped diff --git a/Code/Editor/Animation/AnimationBipedBoneNames.h b/Code/Editor/Animation/AnimationBipedBoneNames.h deleted file mode 100644 index fdcfff7c82..0000000000 --- a/Code/Editor/Animation/AnimationBipedBoneNames.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef CRYINCLUDE_EDITOR_ANIMATION_ANIMATIONBIPEDBONENAMES_H -#define CRYINCLUDE_EDITOR_ANIMATION_ANIMATIONBIPEDBONENAMES_H -#pragma once - -namespace EditorAnimationBones -{ - namespace Biped - { - extern const char* Pelvis; - extern const char* Head; - extern const char* Weapon; - - extern const char* Spine[5]; - extern const char* Neck[2]; - - extern const char* LeftEye; - extern const char* RightEye; - - extern const char* LeftHeel; - extern const char* RightHeel; - extern const char* LeftToe[2]; - extern const char* RightToe[2]; - } -} - - -#endif // CRYINCLUDE_EDITOR_ANIMATION_ANIMATIONBIPEDBONENAMES_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 78a15123d6..a63a74f01d 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -297,8 +297,6 @@ set(FILES Util/AffineParts.cpp Objects/BaseObject.cpp Objects/BaseObject.h - Animation/AnimationBipedBoneNames.cpp - Animation/AnimationBipedBoneNames.h AnimationContext.cpp AnimationContext.h AzAssetBrowser/AzAssetBrowserRequestHandler.cpp From 2dfdabdfc9631556f732f21883cd00fc60d8d622 Mon Sep 17 00:00:00 2001 From: bosnichd Date: Tue, 4 Jan 2022 09:54:20 -0700 Subject: [PATCH 240/399] ProcessWatcher fixes. (#6570) * ProcessWatcher fixes. Signed-off-by: bosnichd * Update based on review feedback. Signed-off-by: bosnichd --- .../AzFramework/AzFramework/azframework_files.cmake | 2 -- .../Default/AzFramework/Process/ProcessWatcher_Default.cpp | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index aac7bd8f14..73608d6a85 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -270,8 +270,6 @@ set(FILES Physics/WindBus.h Process/ProcessCommunicator.cpp Process/ProcessCommunicator.h - Process/ProcessWatcher.cpp - Process/ProcessWatcher.h Process/ProcessCommon_fwd.h Process/ProcessCommunicator.h Process/ProcessWatcher.cpp diff --git a/Code/Framework/AzFramework/Platform/Common/Default/AzFramework/Process/ProcessWatcher_Default.cpp b/Code/Framework/AzFramework/Platform/Common/Default/AzFramework/Process/ProcessWatcher_Default.cpp index f87c51bdc5..a30ab72420 100644 --- a/Code/Framework/AzFramework/Platform/Common/Default/AzFramework/Process/ProcessWatcher_Default.cpp +++ b/Code/Framework/AzFramework/Platform/Common/Default/AzFramework/Process/ProcessWatcher_Default.cpp @@ -83,4 +83,9 @@ namespace AzFramework { } + + AZStd::string ProcessLauncher::ProcessLaunchInfo::GetCommandLineParametersAsString() const + { + return AZStd::string{}; + } } //namespace AzFramework From 685706f8174c31068b4474b1b19545aff117ea4b Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 4 Jan 2022 10:58:50 -0600 Subject: [PATCH 241/399] Removed unused images under Editor/Common Signed-off-by: Chris Galvan --- Code/Editor/Common/spline_edit-00.png | 3 --- Code/Editor/Common/spline_edit-01.png | 3 --- Code/Editor/Common/spline_edit-02.png | 3 --- Code/Editor/Common/spline_edit-03.png | 3 --- Code/Editor/Common/spline_edit-04.png | 3 --- Code/Editor/Common/spline_edit-05.png | 3 --- Code/Editor/Common/spline_edit-06.png | 3 --- Code/Editor/Common/spline_edit-07.png | 3 --- Code/Editor/Common/spline_edit-08.png | 3 --- Code/Editor/Common/spline_edit-09.png | 3 --- Code/Editor/Common/spline_edit-10.png | 3 --- Code/Editor/Common/spline_edit-11.png | 3 --- Code/Editor/Common/spline_edit-12.png | 3 --- Code/Editor/Common/spline_edit-13.png | 3 --- Code/Editor/Common/spline_edit-14.png | 3 --- Code/Editor/Common/spline_edit-15.png | 3 --- Code/Editor/Common/spline_edit-16.png | 3 --- 17 files changed, 51 deletions(-) delete mode 100644 Code/Editor/Common/spline_edit-00.png delete mode 100644 Code/Editor/Common/spline_edit-01.png delete mode 100644 Code/Editor/Common/spline_edit-02.png delete mode 100644 Code/Editor/Common/spline_edit-03.png delete mode 100644 Code/Editor/Common/spline_edit-04.png delete mode 100644 Code/Editor/Common/spline_edit-05.png delete mode 100644 Code/Editor/Common/spline_edit-06.png delete mode 100644 Code/Editor/Common/spline_edit-07.png delete mode 100644 Code/Editor/Common/spline_edit-08.png delete mode 100644 Code/Editor/Common/spline_edit-09.png delete mode 100644 Code/Editor/Common/spline_edit-10.png delete mode 100644 Code/Editor/Common/spline_edit-11.png delete mode 100644 Code/Editor/Common/spline_edit-12.png delete mode 100644 Code/Editor/Common/spline_edit-13.png delete mode 100644 Code/Editor/Common/spline_edit-14.png delete mode 100644 Code/Editor/Common/spline_edit-15.png delete mode 100644 Code/Editor/Common/spline_edit-16.png diff --git a/Code/Editor/Common/spline_edit-00.png b/Code/Editor/Common/spline_edit-00.png deleted file mode 100644 index 0243becc2b..0000000000 --- a/Code/Editor/Common/spline_edit-00.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:58ef978b31b31df9aaf715a0e9b006fde414a17a3ff15a3bf680eaad7418867a -size 364 diff --git a/Code/Editor/Common/spline_edit-01.png b/Code/Editor/Common/spline_edit-01.png deleted file mode 100644 index 4789ee0820..0000000000 --- a/Code/Editor/Common/spline_edit-01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:98a681ec3d89ee57c5d1057fe984dcf8ad45721f47ae4df57fa358fbee85e616 -size 385 diff --git a/Code/Editor/Common/spline_edit-02.png b/Code/Editor/Common/spline_edit-02.png deleted file mode 100644 index 476883a514..0000000000 --- a/Code/Editor/Common/spline_edit-02.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:24a2b2c9242a841c20e7815dab0d80a575844055328aea413d28b7283b65a92e -size 386 diff --git a/Code/Editor/Common/spline_edit-03.png b/Code/Editor/Common/spline_edit-03.png deleted file mode 100644 index c1e79719a5..0000000000 --- a/Code/Editor/Common/spline_edit-03.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ce23a276fec849b8f832fab96d3b738793335c27d37ae3813158387f3415b508 -size 377 diff --git a/Code/Editor/Common/spline_edit-04.png b/Code/Editor/Common/spline_edit-04.png deleted file mode 100644 index e9cfb9d79e..0000000000 --- a/Code/Editor/Common/spline_edit-04.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c03befab41765200f4f28dbf1e0b2a702d2244bfa79b0d463f5d58d0a26095fc -size 386 diff --git a/Code/Editor/Common/spline_edit-05.png b/Code/Editor/Common/spline_edit-05.png deleted file mode 100644 index 3046c6008d..0000000000 --- a/Code/Editor/Common/spline_edit-05.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:418c3f0f27854b3795841359014d87686a7bf94daf2568d9cfd3ffac22675f69 -size 386 diff --git a/Code/Editor/Common/spline_edit-06.png b/Code/Editor/Common/spline_edit-06.png deleted file mode 100644 index 3c170baa3e..0000000000 --- a/Code/Editor/Common/spline_edit-06.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d3a831f34ac53c9b1f20037290e8a2b62a3cfb8a4f86467591f44fd2a0e3c15b -size 379 diff --git a/Code/Editor/Common/spline_edit-07.png b/Code/Editor/Common/spline_edit-07.png deleted file mode 100644 index 1c87d462ed..0000000000 --- a/Code/Editor/Common/spline_edit-07.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4267102ca7a889c34eff905480a68878d4d56e15bc723a5b0575cd472e259f5d -size 389 diff --git a/Code/Editor/Common/spline_edit-08.png b/Code/Editor/Common/spline_edit-08.png deleted file mode 100644 index 52c436f877..0000000000 --- a/Code/Editor/Common/spline_edit-08.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a0df013dd102b87348fba18b4da5443591309e9c40166d27ae928636924154ea -size 388 diff --git a/Code/Editor/Common/spline_edit-09.png b/Code/Editor/Common/spline_edit-09.png deleted file mode 100644 index 1223730915..0000000000 --- a/Code/Editor/Common/spline_edit-09.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e713076ab5abbbb2cf28da431a339e9905acc790e35295f025aa2e79e1c04141 -size 376 diff --git a/Code/Editor/Common/spline_edit-10.png b/Code/Editor/Common/spline_edit-10.png deleted file mode 100644 index 3b2a27bdbf..0000000000 --- a/Code/Editor/Common/spline_edit-10.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9e5af9d62ceafc3b8a1dfc36772350cd623fcc86c68711b299e143ff133f79b6 -size 387 diff --git a/Code/Editor/Common/spline_edit-11.png b/Code/Editor/Common/spline_edit-11.png deleted file mode 100644 index 7b68ead52b..0000000000 --- a/Code/Editor/Common/spline_edit-11.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:17c5fb3d7b87ea87a98934954c721573c641bc44005a34f1e16589d7f39b71e8 -size 409 diff --git a/Code/Editor/Common/spline_edit-12.png b/Code/Editor/Common/spline_edit-12.png deleted file mode 100644 index 3c7abb2182..0000000000 --- a/Code/Editor/Common/spline_edit-12.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6f5c78d9f764b62fb7dcf400c91c1edea9d7f88a426ba513fbf70825c6bcd2ac -size 383 diff --git a/Code/Editor/Common/spline_edit-13.png b/Code/Editor/Common/spline_edit-13.png deleted file mode 100644 index f71a5ec300..0000000000 --- a/Code/Editor/Common/spline_edit-13.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:376b549602afffca407525b77c1a9821bf6a0e279792ae2e52fe0a4f7c3c5bd4 -size 364 diff --git a/Code/Editor/Common/spline_edit-14.png b/Code/Editor/Common/spline_edit-14.png deleted file mode 100644 index 4a5f89b089..0000000000 --- a/Code/Editor/Common/spline_edit-14.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e7dc48f8d324b7563b168f27ebde1e00ee2bd11ba462f114a05b297913e285c5 -size 374 diff --git a/Code/Editor/Common/spline_edit-15.png b/Code/Editor/Common/spline_edit-15.png deleted file mode 100644 index 8542318682..0000000000 --- a/Code/Editor/Common/spline_edit-15.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:66b73afbd6dba1caaedfaae161b277b460b5198f7fc00bec414530116c567276 -size 375 diff --git a/Code/Editor/Common/spline_edit-16.png b/Code/Editor/Common/spline_edit-16.png deleted file mode 100644 index 6926024cbd..0000000000 --- a/Code/Editor/Common/spline_edit-16.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ae6e6714acf495246f4e59f6e5640f3a4417ea50100d37a116950d2b859aed0c -size 417 From 4426d15d32c76d924e6870c4006cada0704295ef Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Tue, 4 Jan 2022 11:25:13 -0600 Subject: [PATCH 242/399] Adding explicit wait to avoid teardown issues with external tools Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../editor/EditorScripts/Menus_FileMenuOptions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py index cade2125e2..c319535c05 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py @@ -26,6 +26,8 @@ def Menus_FileMenuOptions_Work(): :return: None """ + import azlmbr.legacy.general as general + import editor_python_test_tools.hydra_editor_utils as hydra import editor_python_test_tools.pyside_utils as pyside_utils from editor_python_test_tools.utils import Report @@ -64,6 +66,9 @@ def Menus_FileMenuOptions_Work(): ) Report.result(menu_action_triggered, action_triggered) + # Wait a few seconds for Project Settings dialogs to load so teardown can properly close them + general.idle_wait(2.0) + if __name__ == "__main__": From a891993c35091f4eb3f18ff1ac91c944b08d22ef Mon Sep 17 00:00:00 2001 From: mrieggeramzn Date: Tue, 4 Jan 2022 09:58:30 -0800 Subject: [PATCH 243/399] Remove 'INF' from integer widget and replace it with better formatted integers. Also fix warning message with invalid param Signed-off-by: mrieggeramzn --- .../UI/PropertyEditor/PropertyIntCtrlCommon.h | 39 +++++++------------ 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h index bb7d03367b..7d3e7191e3 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h @@ -93,23 +93,13 @@ namespace AzToolsFramework toolTipString += "\n"; } toolTipString += "["; - if (propertyControl->minimum() <= aznumeric_cast(QtWidgetLimits::Min())) - { - toolTipString += "-" + QObject::tr(PropertyQTConstant_InfinityString); - } - else - { - toolTipString += QString::number(propertyControl->minimum()); - } + + const QString minString = QLocale().toString(propertyControl->minimum()); + const QString maxString = QLocale().toString(propertyControl->maximum()); + + toolTipString += minString; toolTipString += ", "; - if (propertyControl->maximum() >= aznumeric_cast(QtWidgetLimits::Max())) - { - toolTipString += QObject::tr(PropertyQTConstant_InfinityString); - } - else - { - toolTipString += QString::number(propertyControl->maximum()); - } + toolTipString += maxString; toolTipString += "]"; return true; } @@ -128,15 +118,12 @@ namespace AzToolsFramework { toolTipString += "\n"; } - toolTipString += "[" + QString::number(propertyControl->minimum()) + ", "; - if (propertyControl->maximum() >= aznumeric_cast(QtWidgetLimits::Max())) - { - toolTipString += QObject::tr(PropertyQTConstant_InfinityString); - } - else - { - toolTipString += QString::number(propertyControl->maximum()); - } + + const QString minString = QLocale().toString(propertyControl->minimum()); + const QString maxString = QLocale().toString(propertyControl->maximum()); + + toolTipString += "[" + minString + ", "; + toolTipString += maxString; toolTipString += "]"; return true; } @@ -196,7 +183,7 @@ namespace AzToolsFramework } else { - AZ_WarningOnce("AzToolsFramework", false, "Property %s: 'Min' attribute from property '%s' into widget", debugName); + AZ_WarningOnce("AzToolsFramework", false, "Failed to read 'Min' attribute from property '%s' into widget", debugName); } } else if (attrib == AZ::Edit::Attributes::Max) From d343caa3f2d846610b4b1a29adac682d9e567867 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Tue, 4 Jan 2022 11:58:17 -0800 Subject: [PATCH 244/399] add optional force_get to get_property_tree Signed-off-by: Scott Murray --- .../editor_python_test_tools/editor_entity_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index 0878431054..4dd7ec1446 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -50,7 +50,7 @@ class EditorComponent: assert len(type_names) != 0, "Component object does not have type id" return type_names[0] - def get_property_tree(self): + def get_property_tree(self, force_get: bool = False): """ Used to get the property tree object of component that has following functions associated with it: 1. prop_tree.is_container(path) @@ -60,9 +60,10 @@ class EditorComponent: 5. prop_tree.remove_container_item(path, key) 6. prop_tree.update_container_item(path, key, value) 7. prop_tree.get_container_item(path, key) + :param force_get: Force a fresh property tree to be returned rather than using an existing self.property_tree :return: Property tree object of a component """ - if self.property_tree is not None: + if (not force_get) and (self.property_tree is not None): return self.property_tree build_prop_tree_outcome = editor.EditorComponentAPIBus( @@ -244,6 +245,7 @@ class EditorComponent: def disable_component(self): """ Used to disable the component using its id value. + Deprecation warning! Use set_enable(False) instead as this method is in deprecation :return: None """ warnings.warn("disable_component is deprecated, use set_enabled(False) instead.", DeprecationWarning) From 8ee384f436a1092cafd3a7bdd7128bbbea0208f9 Mon Sep 17 00:00:00 2001 From: amzn-mike <80125227+amzn-mike@users.noreply.github.com> Date: Tue, 4 Jan 2022 14:34:56 -0600 Subject: [PATCH 245/399] Asset Processor: Remove gem loading from AP (#6488) * AssetBuilder sends builder registration network message to AP Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Add AP activating status message Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * First builder handles registration. Fixed deadlock caused by AP and AssetBuilder waiting on each other when registering by moving AP builder start code to a thread Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Clean up external builder registration Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Add thread description for builder manager idle thread Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Remove gem loading Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Clean up builder registration and remove unused functions Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Remove PostActivate call from batch application since it will be called after builders are registered Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Removal external builder dependency scanning since we no longer support builder dlls Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Fix missing bus disconnect Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Remove unused variable Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Moved AP-AssetBuilder specific types into AssetBuilder.Static library. Also removed some unused/old code Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> --- .../AssetBuilder/AssetBuilderApplication.cpp | 2 + .../AssetBuilder/AssetBuilderComponent.cpp | 127 ++++--- .../AssetBuilder/AssetBuilderComponent.h | 13 +- .../AssetBuilder/AssetBuilderStatic.cpp | 182 +++++++++ .../AssetBuilder/AssetBuilderStatic.h | 140 +++++++ .../AssetBuilder/CMakeLists.txt | 17 + .../asset_builder_static_files.cmake | 12 + .../AssetBuilderSDK/AssetBuilderSDK.cpp | 168 --------- .../AssetBuilderSDK/AssetBuilderSDK.h | 164 +------- Code/Tools/AssetProcessor/CMakeLists.txt | 1 + .../AssetProcessor/native/assetprocessor.h | 16 +- .../AssetProcessor/native/ui/MainWindow.cpp | 30 +- .../native/utilities/ApplicationManager.cpp | 47 --- .../native/utilities/ApplicationManager.h | 5 +- .../utilities/ApplicationManagerBase.cpp | 355 +++++++----------- .../native/utilities/ApplicationManagerBase.h | 7 +- .../native/utilities/BuilderManager.cpp | 67 ++-- .../native/utilities/BuilderManager.h | 8 +- .../native/utilities/BuilderManager.inl | 4 +- .../utilities/GUIApplicationManager.cpp | 11 +- 20 files changed, 654 insertions(+), 722 deletions(-) create mode 100644 Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderStatic.cpp create mode 100644 Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderStatic.h create mode 100644 Code/Tools/AssetProcessor/AssetBuilder/asset_builder_static_files.cmake diff --git a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderApplication.cpp b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderApplication.cpp index da2edcc51f..074138b324 100644 --- a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderApplication.cpp +++ b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderApplication.cpp @@ -37,6 +37,7 @@ #include #include #include +#include namespace AssetBuilder { @@ -165,6 +166,7 @@ void AssetBuilderApplication::StartCommon(AZ::Entity* systemEntity) AssetBuilderSDK::InitializeSerializationContext(); AssetBuilderSDK::InitializeBehaviorContext(); + AssetBuilder::InitializeSerializationContext(); // the asset builder app never writes source files, only assets, so there is no need to do any kind of asset upgrading AZ::Data::AssetManager::Instance().SetAssetInfoUpgradingEnabled(false); diff --git a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.cpp b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.cpp index 78244ab02c..21b8c31cf4 100644 --- a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.cpp +++ b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.cpp @@ -34,6 +34,7 @@ #include #include #include +#include // Command-line parameter options: static const char* const s_paramHelp = "help"; // Print help information. @@ -51,10 +52,10 @@ static const char* const s_paramDebugCreate = "debug_create"; // Debug mode for static const char* const s_paramDebugProcess = "debug_process"; // Debug mode for the process job of the specified file. static const char* const s_paramPlatformTags = "tags"; // Additional list of tags to add platform tag list. static const char* const s_paramPlatform = "platform"; // Platform to use +static const char* const s_paramRegisterBuilders = "register"; // Indicates the AP is starting up and requesting a list of registered builders // Task modes: static const char* const s_taskResident = "resident"; // stays up and running indefinitely, accepting jobs via network connection -static const char* const s_taskRegisterBuilder = "register"; // outputs all the builder descriptors static const char* const s_taskCreateJob = "create"; // runs a builders createJobs function static const char* const s_taskProcessJob = "process"; // runs processJob function static const char* const s_taskDebug = "debug"; // runs a one shot job in a fake environment for a specified file. @@ -204,6 +205,40 @@ void AssetBuilderComponent::Reflect(AZ::ReflectContext* context) } } +bool AssetBuilderComponent::DoHelloPing() +{ + using namespace AssetBuilder; + + BuilderHelloRequest request; + BuilderHelloResponse response; + + AZStd::string id; + + if (!GetParameter(s_paramId, id)) + { + return false; + } + + request.m_uuid = AZ::Uuid::CreateString(id.c_str()); + + AZ_TracePrintf( + "AssetBuilderComponent", "RunInResidentMode: Pinging asset processor with the builder UUID %s\n", + request.m_uuid.ToString().c_str()); + + bool result = AzFramework::AssetSystem::SendRequest(request, response); + + AZ_Error("AssetBuilder", result, "Failed to send hello request to Asset Processor"); + // This error is only shown if we successfully got a response AND the response explicitly indicates the AP rejected the builder + AZ_Error("AssetBuilder", !result || response.m_accepted, "Asset Processor rejected connection request"); + + if (result) + { + AZ_TracePrintf("AssetBuilder", "Builder ID: %s\n", response.m_uuid.ToString().c_str()); + } + + return result; +} + bool AssetBuilderComponent::Run() { AZ_TracePrintf("AssetBuilderComponent", "Run: Parsing command line.\n"); @@ -217,8 +252,8 @@ bool AssetBuilderComponent::Run() } AZStd::string task; - AZStd::string debugFile; + if (GetParameter(s_paramDebug, debugFile, false)) { task = s_taskDebug; @@ -256,11 +291,13 @@ bool AssetBuilderComponent::Run() AZ_TracePrintf("AssetBuilderComponent", "Run: Connecting back to Asset Processor...\n"); bool connectedToAssetProcessor = ConnectToAssetProcessor(); //AP connection is required to access the asset catalog - AZ_Error("AssetBuilder", connectedToAssetProcessor, "Failed to establish a network connection to the AssetProcessor. Use -help for options.");; + AZ_Error("AssetBuilder", connectedToAssetProcessor, "Failed to establish a network connection to the AssetProcessor. Use -help for options."); + + bool registerBuilders = commandLine->GetNumSwitchValues(s_paramRegisterBuilders) > 0; IBuilderApplication* builderApplication = AZ::Interface::Get(); - if(!builderApplication) + if (!builderApplication) { AZ_Error("AssetBuilder", false, "Failed to retreive IBuilderApplication interface"); return false; @@ -274,7 +311,7 @@ bool AssetBuilderComponent::Run() { if (task == s_taskResident) { - result = RunInResidentMode(); + result = RunInResidentMode(registerBuilders); } else if (task == s_taskDebug) { @@ -370,43 +407,46 @@ bool AssetBuilderComponent::ConnectToAssetProcessor() ////////////////////////////////////////////////////////////////////////// -bool AssetBuilderComponent::RunInResidentMode() +bool AssetBuilderComponent::SendRegisteredBuildersToAp() { - using namespace AssetBuilderSDK; - using namespace AZStd::placeholders; - - AZ_TracePrintf("AssetBuilderComponent", "RunInResidentMode: Starting resident mode (waiting for commands to arrive)\n"); + AssetBuilder::BuilderRegistrationRequest registrationRequest; - AZStd::string port, id, builderFolder; - - if (!GetParameter(s_paramId, id) - || !GetParameter(s_paramModule, builderFolder)) + for (const auto& [uuid, desc] : m_assetBuilderDescMap) { - return false; + AssetBuilder::BuilderRegistration registration; + + registration.m_name = desc->m_name; + registration.m_analysisFingerprint = desc->m_analysisFingerprint; + registration.m_flags = desc->m_flags; + registration.m_flagsByJobKey = desc->m_flagsByJobKey; + registration.m_version = desc->m_version; + registration.m_busId = desc->m_busId; + registration.m_patterns = desc->m_patterns; + registration.m_productsToKeepOnFailure = desc->m_productsToKeepOnFailure; + + registrationRequest.m_builders.push_back(AZStd::move(registration)); } - if (!LoadBuilders(builderFolder)) - { - return false; - } + bool result = SendRequest(registrationRequest); - AzFramework::SocketConnection::GetInstance()->AddMessageHandler(CreateJobsNetRequest::MessageType(), AZStd::bind(&AssetBuilderComponent::CreateJobsResidentHandler, this, _1, _2, _3, _4)); - AzFramework::SocketConnection::GetInstance()->AddMessageHandler(ProcessJobNetRequest::MessageType(), AZStd::bind(&AssetBuilderComponent::ProcessJobResidentHandler, this, _1, _2, _3, _4)); + AZ_Error("AssetBuilder", result, "Failed to send builder registration request to Asset Processor"); - BuilderHelloRequest request; - BuilderHelloResponse response; + return result; +} - request.m_uuid = AZ::Uuid::CreateString(id.c_str()); +bool AssetBuilderComponent::RunInResidentMode(bool sendRegistration) +{ + using namespace AssetBuilder; + using namespace AZStd::placeholders; - AZ_TracePrintf("AssetBuilderComponent", "RunInResidentMode: Pinging asset processor with the builder UUID %s\n", request.m_uuid.ToString().c_str()); + AZ_TracePrintf("AssetBuilderComponent", "RunInResidentMode: Starting resident mode (waiting for commands to arrive)\n"); - bool result = AzFramework::AssetSystem::SendRequest(request, response); + AzFramework::SocketConnection::GetInstance()->AddMessageHandler(CreateJobsNetRequest::MessageType(), AZStd::bind(&AssetBuilderComponent::CreateJobsResidentHandler, this, _1, _2, _3, _4)); + AzFramework::SocketConnection::GetInstance()->AddMessageHandler(ProcessJobNetRequest::MessageType(), AZStd::bind(&AssetBuilderComponent::ProcessJobResidentHandler, this, _1, _2, _3, _4)); - AZ_Error("AssetBuilder", result, "Failed to send hello request to Asset Processor"); - // This error is only shown if we successfully got a response AND the response explicitly indicates the AP rejected the builder - AZ_Error("AssetBuilder", !result || response.m_accepted, "Asset Processor rejected connection request"); + bool result = DoHelloPing() && ((sendRegistration && SendRegisteredBuildersToAp()) || !sendRegistration); - if (result && response.m_accepted) + if (result) { m_running = true; @@ -415,7 +455,6 @@ bool AssetBuilderComponent::RunInResidentMode() AzFramework::EngineConnectionEvents::Bus::Handler::BusConnect(); // Listen for disconnects - AZ_TracePrintf("AssetBuilder", "Builder ID: %s\n", response.m_uuid.ToString().c_str()); AZ_TracePrintf("AssetBuilder", "Resident mode ready\n"); m_mainEvent.acquire(); AZ_TracePrintf("AssetBuilder", "Shutting down\n"); @@ -736,11 +775,7 @@ bool AssetBuilderComponent::RunOneShotTask(const AZStd::string& task) AZ::StringFunc::Path::Normalize(inputFilePath); AZ::StringFunc::Path::Normalize(outputFilePath); - if (task == s_taskRegisterBuilder) - { - return HandleRegisterBuilder(inputFilePath, outputFilePath); - } - else if (task == s_taskCreateJob) + if (task == s_taskCreateJob) { auto func = [this](const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response) { @@ -896,7 +931,7 @@ void AssetBuilderComponent::JobThread() { case JobType::Create: { - using namespace AssetBuilderSDK; + using namespace AssetBuilder; auto* netRequest = azrtti_cast(job->m_netRequest.get()); auto* netResponse = azrtti_cast(job->m_netResponse.get()); @@ -922,7 +957,7 @@ void AssetBuilderComponent::JobThread() } case JobType::Process: { - using namespace AssetBuilderSDK; + using namespace AssetBuilder; AZ_TracePrintf("AssetBuilder", "Running processJob task\n"); @@ -981,14 +1016,14 @@ void AssetBuilderComponent::JobThread() void AssetBuilderComponent::CreateJobsResidentHandler(AZ::u32 /*typeId*/, AZ::u32 serial, const void* data, AZ::u32 dataLength) { - using namespace AssetBuilderSDK; + using namespace AssetBuilder; ResidentJobHandler(serial, data, dataLength, JobType::Create); } void AssetBuilderComponent::ProcessJobResidentHandler(AZ::u32 /*typeId*/, AZ::u32 serial, const void* data, AZ::u32 dataLength) { - using namespace AssetBuilderSDK; + using namespace AssetBuilder; ResidentJobHandler(serial, data, dataLength, JobType::Process); } @@ -1018,18 +1053,6 @@ bool AssetBuilderComponent::HandleTask(const AZStd::string& inputFilePath, const return true; } -bool AssetBuilderComponent::HandleRegisterBuilder(const AZStd::string& /*inputFilePath*/, const AZStd::string& outputFilePath) const -{ - AssetBuilderSDK::RegisterBuilderResponse response; - - for (const auto& pair : m_assetBuilderDescMap) - { - response.m_assetBuilderDescList.push_back(*pair.second); - } - - return AZ::Utils::SaveObjectToFile(outputFilePath, AZ::DataStream::ST_XML, &response); -} - void AssetBuilderComponent::UpdateResultCode(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const { if (request.m_jobDescription.m_failOnError) diff --git a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.h b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.h index 2014be41aa..2172e9093e 100644 --- a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.h +++ b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.h @@ -46,6 +46,7 @@ class AssetBuilderComponent public: AZ_COMPONENT(AssetBuilderComponent, "{04332899-5d73-4d41-86b7-b1017d349673}") static void Reflect(AZ::ReflectContext* context); + bool DoHelloPing(); AssetBuilderComponent() = default; ~AssetBuilderComponent() override = default; @@ -64,7 +65,7 @@ public: void RegisterBuilderInformation(const AssetBuilderSDK::AssetBuilderDesc& builderDesc) override; void RegisterComponentDescriptor(AZ::ComponentDescriptor* descriptor) override; - + //EngineConnectionEvents Handler void Disconnected(AzFramework::SocketConnection* connection) override; @@ -98,12 +99,13 @@ protected: static const char* GetLibraryExtension(); bool ConnectToAssetProcessor(); + bool SendRegisteredBuildersToAp(); bool LoadBuilders(const AZStd::string& builderFolder); bool LoadBuilder(const AZStd::string& filePath); void UnloadBuilders(); //! Hooks up net job request handling and keeps the AssetBuilder running indefinitely - bool RunInResidentMode(); + bool RunInResidentMode(bool sendRegistration); bool RunDebugTask(AZStd::string&& debugFile, bool runCreateJobs, bool runProcessJob); bool RunOneShotTask(const AZStd::string& task); @@ -120,9 +122,6 @@ protected: void ProcessJob(const AssetBuilderSDK::ProcessJobFunction& job, const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& outResponse); - //! Handles a builder registration request - bool HandleRegisterBuilder(const AZStd::string& inputFilePath, const AZStd::string& outputFilePath) const; - //! If needed looks at collected data and updates the result code from the job accordingly. void UpdateResultCode(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const; @@ -141,7 +140,7 @@ protected: //! Currently loading builder AssetBuilder::ExternalModuleAssetBuilderInfo* m_currentAssetBuilder = nullptr; - + //! Thread for running a job, so we don't block the network thread while doing work AZStd::thread_desc m_jobThreadDesc; AZStd::thread m_jobThread; @@ -153,7 +152,7 @@ protected: AZStd::binary_semaphore m_mainEvent; //! Use to signal a new job is ready to be processed AZStd::binary_semaphore m_jobEvent; - + //! Lock for m_queuedJob AZStd::mutex m_jobMutex; diff --git a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderStatic.cpp b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderStatic.cpp new file mode 100644 index 0000000000..6a67fbe425 --- /dev/null +++ b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderStatic.cpp @@ -0,0 +1,182 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace AssetBuilder +{ + void Reflect(AZ::ReflectContext* context) + { + BuilderRegistrationRequest::Reflect(context); + + BuilderHelloRequest::Reflect(context); + BuilderHelloResponse::Reflect(context); + CreateJobsNetRequest::Reflect(context); + CreateJobsNetResponse::Reflect(context); + ProcessJobNetRequest::Reflect(context); + ProcessJobNetResponse::Reflect(context); + } + + void InitializeSerializationContext() + { + AZ::SerializeContext* serializeContext = nullptr; + + AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationBus::Events::GetSerializeContext); + AZ_Assert(serializeContext, "Unable to retrieve serialize context."); + + Reflect(serializeContext); + } + + void BuilderHelloRequest::Reflect(AZ::ReflectContext* context) + { + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class()->Version(1)->Field("UUID", &BuilderHelloRequest::m_uuid); + } + } + + unsigned int BuilderHelloRequest::MessageType() + { + static unsigned int messageType = AZ_CRC("AssetBuilderSDK::BuilderHelloRequest", 0x213a7248); + + return messageType; + } + + unsigned int BuilderHelloRequest::GetMessageType() const + { + return MessageType(); + } + + void BuilderHelloResponse::Reflect(AZ::ReflectContext* context) + { + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class() + ->Version(1) + ->Field("Accepted", &BuilderHelloResponse::m_accepted) + ->Field("UUID", &BuilderHelloResponse::m_uuid); + } + } + + unsigned int BuilderHelloResponse::GetMessageType() const + { + return BuilderHelloRequest::MessageType(); + } + + ////////////////////////////////////////////////////////////////////////// + + void CreateJobsNetRequest::Reflect(AZ::ReflectContext* context) + { + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class()->Version(1)->Field("Request", &CreateJobsNetRequest::m_request); + } + } + + unsigned int CreateJobsNetRequest::MessageType() + { + static unsigned int messageType = AZ_CRC("AssetBuilderSDK::CreateJobsNetRequest", 0xc48209c0); + + return messageType; + } + + unsigned int CreateJobsNetRequest::GetMessageType() const + { + return MessageType(); + } + + void CreateJobsNetResponse::Reflect(AZ::ReflectContext* context) + { + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class()->Version(1)->Field("Response", &CreateJobsNetResponse::m_response); + } + } + + unsigned int CreateJobsNetResponse::GetMessageType() const + { + return CreateJobsNetRequest::MessageType(); + } + + void ProcessJobNetRequest::Reflect(AZ::ReflectContext* context) + { + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class()->Version(1)->Field("Request", &ProcessJobNetRequest::m_request); + } + } + + unsigned int ProcessJobNetRequest::MessageType() + { + static unsigned int messageType = AZ_CRC("AssetBuilderSDK::ProcessJobNetRequest", 0x479f340f); + + return messageType; + } + + unsigned int ProcessJobNetRequest::GetMessageType() const + { + return MessageType(); + } + + void ProcessJobNetResponse::Reflect(AZ::ReflectContext* context) + { + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class()->Version(1)->Field("Response", &ProcessJobNetResponse::m_response); + } + } + + unsigned int ProcessJobNetResponse::GetMessageType() const + { + return ProcessJobNetRequest::MessageType(); + } + + //--------------------------------------------------------------------- + void BuilderRegistration::Reflect(AZ::ReflectContext* context) + { + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class() + ->Version(1) + ->Field("Name", &BuilderRegistration::m_name) + ->Field("Patterns", &BuilderRegistration::m_patterns) + ->Field("BusId", &BuilderRegistration::m_busId) + ->Field("Version", &BuilderRegistration::m_version) + ->Field("AnalysisFingerprint", &BuilderRegistration::m_analysisFingerprint) + ->Field("Flags", &BuilderRegistration::m_flags) + ->Field("FlagsByJobKey", &BuilderRegistration::m_flagsByJobKey) + ->Field("ProductsToKeepOnFailure", &BuilderRegistration::m_productsToKeepOnFailure); + } + } + + void BuilderRegistrationRequest::Reflect(AZ::ReflectContext* context) + { + BuilderRegistration::Reflect(context); + + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class()->Version(1)->Field( + "Builders", &BuilderRegistrationRequest::m_builders); + } + } + + unsigned int BuilderRegistrationRequest::GetMessageType() const + { + return BuilderRegistrationRequest::MessageType; + } + +} // namespace AssetBuilder diff --git a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderStatic.h b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderStatic.h new file mode 100644 index 0000000000..41b6531116 --- /dev/null +++ b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderStatic.h @@ -0,0 +1,140 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include + +namespace AssetBuilder +{ + void Reflect(AZ::ReflectContext* context); + + void InitializeSerializationContext(); + + //! BuilderHelloRequest is sent by an AssetBuilder that is attempting to connect to the AssetProcessor to register itself as a worker + class BuilderHelloRequest : public AzFramework::AssetSystem::BaseAssetProcessorMessage + { + public: + AZ_CLASS_ALLOCATOR(BuilderHelloRequest, AZ::OSAllocator, 0); + AZ_RTTI(BuilderHelloRequest, "{5fab5962-a1d8-42a5-bf7a-fb1a8c5a9588}", BaseAssetProcessorMessage); + + static void Reflect(AZ::ReflectContext* context); + static unsigned int MessageType(); + + unsigned int GetMessageType() const override; + + //! Unique ID assigned to this builder to identify it + AZ::Uuid m_uuid = AZ::Uuid::CreateNull(); + }; + + //! BuilderHelloResponse contains the AssetProcessor's response to a builder connection attempt, indicating if it is accepted and the ID + //! that it was assigned + class BuilderHelloResponse : public AzFramework::AssetSystem::BaseAssetProcessorMessage + { + public: + AZ_CLASS_ALLOCATOR(BuilderHelloResponse, AZ::OSAllocator, 0); + AZ_RTTI(BuilderHelloResponse, "{5f3d7c11-6639-4c6f-980a-32be546903c2}", BaseAssetProcessorMessage); + + static void Reflect(AZ::ReflectContext* context); + + unsigned int GetMessageType() const override; + + //! Indicates if the builder was accepted by the AP + bool m_accepted = false; + + //! Unique ID assigned to the builder. If the builder isn't a local process, this is the ID assigned by the AP + AZ::Uuid m_uuid = AZ::Uuid::CreateNull(); + }; + + class CreateJobsNetRequest : public AzFramework::AssetSystem::BaseAssetProcessorMessage + { + public: + AZ_CLASS_ALLOCATOR(CreateJobsNetRequest, AZ::OSAllocator, 0); + AZ_RTTI(CreateJobsNetRequest, "{97fa717d-3a09-4d21-95c6-b2eafd773f1c}", BaseAssetProcessorMessage); + + static void Reflect(AZ::ReflectContext* context); + static unsigned int MessageType(); + + unsigned int GetMessageType() const override; + + AssetBuilderSDK::CreateJobsRequest m_request; + }; + + class CreateJobsNetResponse : public AzFramework::AssetSystem::BaseAssetProcessorMessage + { + public: + AZ_CLASS_ALLOCATOR(CreateJobsNetResponse, AZ::OSAllocator, 0); + AZ_RTTI(CreateJobsNetResponse, "{b2c7c2d3-b60e-4b27-b699-43e0ba991c33}", BaseAssetProcessorMessage); + + static void Reflect(AZ::ReflectContext* context); + + unsigned int GetMessageType() const override; + + AssetBuilderSDK::CreateJobsResponse m_response; + }; + + class ProcessJobNetRequest : public AzFramework::AssetSystem::BaseAssetProcessorMessage + { + public: + AZ_CLASS_ALLOCATOR(ProcessJobNetRequest, AZ::OSAllocator, 0); + AZ_RTTI(ProcessJobNetRequest, "{05288de1-020b-48db-b9de-715f17284efa}", BaseAssetProcessorMessage); + + static void Reflect(AZ::ReflectContext* context); + static unsigned int MessageType(); + + unsigned int GetMessageType() const override; + + AssetBuilderSDK::ProcessJobRequest m_request; + }; + + class ProcessJobNetResponse : public AzFramework::AssetSystem::BaseAssetProcessorMessage + { + public: + AZ_CLASS_ALLOCATOR(ProcessJobNetResponse, AZ::OSAllocator, 0); + AZ_RTTI(ProcessJobNetResponse, "{26ddf882-246c-4cfb-912f-9b8e389df4f6}", BaseAssetProcessorMessage); + + static void Reflect(AZ::ReflectContext* context); + + unsigned int GetMessageType() const override; + + AssetBuilderSDK::ProcessJobResponse m_response; + }; + + ////////////////////////////////////////////////////////////////////////// + struct BuilderRegistration + { + AZ_CLASS_ALLOCATOR(BuilderRegistration, AZ::OSAllocator, 0); + AZ_TYPE_INFO(BuilderRegistration, "{36E785C3-5046-4568-870A-336C8249E453}"); + + static void Reflect(AZ::ReflectContext* context); + + AZStd::string m_name; + AZStd::vector m_patterns; + AZ::Uuid m_busId; + int m_version = 0; + AZStd::string m_analysisFingerprint; + AZ::u8 m_flags = 0; + AZStd::unordered_map m_flagsByJobKey; + AZStd::unordered_map> m_productsToKeepOnFailure; + }; + + class BuilderRegistrationRequest : public AzFramework::AssetSystem::BaseAssetProcessorMessage + { + public: + AZ_CLASS_ALLOCATOR(BuilderRegistrationRequest, AZ::OSAllocator, 0); + AZ_RTTI(BuilderRegistrationRequest, "{FA9CF2D5-C847-47F3-979D-6C3AE061715C}", BaseAssetProcessorMessage); + static void Reflect(AZ::ReflectContext* context); + static constexpr unsigned int MessageType = AZ_CRC_CE("AssetSystem::BuilderRegistrationRequest"); + + BuilderRegistrationRequest() = default; + unsigned int GetMessageType() const override; + + AZStd::vector m_builders; + }; +} // namespace AssetBuilder diff --git a/Code/Tools/AssetProcessor/AssetBuilder/CMakeLists.txt b/Code/Tools/AssetProcessor/AssetBuilder/CMakeLists.txt index 6baa99d43b..f23e749169 100644 --- a/Code/Tools/AssetProcessor/AssetBuilder/CMakeLists.txt +++ b/Code/Tools/AssetProcessor/AssetBuilder/CMakeLists.txt @@ -6,6 +6,22 @@ # # +ly_add_target( + NAME AssetBuilder.Static STATIC + NAMESPACE AZ + FILES_CMAKE + asset_builder_static_files.cmake + INCLUDE_DIRECTORIES + PUBLIC + . + BUILD_DEPENDENCIES + PUBLIC + AZ::AzCore + AZ::AzFramework + AZ::AzToolsFramework + AZ::AssetBuilderSDK +) + ly_add_target( NAME AssetBuilder EXECUTABLE NAMESPACE AZ @@ -17,6 +33,7 @@ ly_add_target( . BUILD_DEPENDENCIES PRIVATE + AssetBuilder.Static 3rdParty::Qt::Core 3rdParty::Qt::Gui 3rdParty::Qt::Network diff --git a/Code/Tools/AssetProcessor/AssetBuilder/asset_builder_static_files.cmake b/Code/Tools/AssetProcessor/AssetBuilder/asset_builder_static_files.cmake new file mode 100644 index 0000000000..48de742704 --- /dev/null +++ b/Code/Tools/AssetProcessor/AssetBuilder/asset_builder_static_files.cmake @@ -0,0 +1,12 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +set(FILES + AssetBuilderStatic.h + AssetBuilderStatic.cpp +) diff --git a/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.cpp b/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.cpp index b5323dd419..43126dd673 100644 --- a/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.cpp +++ b/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.cpp @@ -1172,19 +1172,10 @@ namespace AssetBuilderSDK JobProduct::Reflect(context); AssetBuilderDesc::Reflect(context); - RegisterBuilderRequest::Reflect(context); - RegisterBuilderResponse::Reflect(context); CreateJobsRequest::Reflect(context); CreateJobsResponse::Reflect(context); ProcessJobRequest::Reflect(context); ProcessJobResponse::Reflect(context); - - BuilderHelloRequest::Reflect(context); - BuilderHelloResponse::Reflect(context); - CreateJobsNetRequest::Reflect(context); - CreateJobsNetResponse::Reflect(context); - ProcessJobNetRequest::Reflect(context); - ProcessJobNetResponse::Reflect(context); } void InitializeSerializationContext() @@ -1263,24 +1254,6 @@ namespace AssetBuilderSDK } } - void RegisterBuilderRequest::Reflect(AZ::ReflectContext* context) - { - if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) - { - serializeContext->Class()-> - Version(1)-> - Field("FilePath", &RegisterBuilderRequest::m_filePath); - } - - if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) - { - behaviorContext->Class("RegisterBuilderRequest") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation) - ->Attribute(AZ::Script::Attributes::Module, "asset.builder") - ->Property("filePath", BehaviorValueProperty(&RegisterBuilderRequest::m_filePath)); - } - } - void AssetBuilderDesc::Reflect(AZ::ReflectContext* context) { if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) @@ -1313,25 +1286,6 @@ namespace AssetBuilderSDK } } - void RegisterBuilderResponse::Reflect(AZ::ReflectContext* context) - { - if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(1) - ->Field("Asset Builder Desc List", &RegisterBuilderResponse::m_assetBuilderDescList); - } - - if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) - { - behaviorContext->Class("RegisterBuilderResponse") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation) - ->Attribute(AZ::Script::Attributes::Module, "asset.builder") - ->Constructor() - ->Property("assetBuilderDescList", BehaviorValueProperty(&RegisterBuilderResponse::m_assetBuilderDescList)); - } - } - bool CreateJobsResponse::Succeeded() const { return m_result == CreateJobsResultCode::Success; @@ -1362,128 +1316,6 @@ namespace AssetBuilderSDK } } - void BuilderHelloRequest::Reflect(AZ::ReflectContext* context) - { - auto serialize = azrtti_cast(context); - if (serialize) - { - serialize->Class() - ->Version(1) - ->Field("UUID", &BuilderHelloRequest::m_uuid); - } - } - - unsigned int BuilderHelloRequest::MessageType() - { - static unsigned int messageType = AZ_CRC("AssetBuilderSDK::BuilderHelloRequest", 0x213a7248); - - return messageType; - } - - unsigned int BuilderHelloRequest::GetMessageType() const - { - return MessageType(); - } - - void BuilderHelloResponse::Reflect(AZ::ReflectContext* context) - { - auto serialize = azrtti_cast(context); - if (serialize) - { - serialize->Class() - ->Version(1) - ->Field("Accepted", &BuilderHelloResponse::m_accepted) - ->Field("UUID", &BuilderHelloResponse::m_uuid); - } - } - - unsigned int BuilderHelloResponse::GetMessageType() const - { - return BuilderHelloRequest::MessageType(); - } - - ////////////////////////////////////////////////////////////////////////// - - void CreateJobsNetRequest::Reflect(AZ::ReflectContext* context) - { - auto serialize = azrtti_cast(context); - if (serialize) - { - serialize->Class() - ->Version(1) - ->Field("Request", &CreateJobsNetRequest::m_request); - } - } - - unsigned int CreateJobsNetRequest::MessageType() - { - static unsigned int messageType = AZ_CRC("AssetBuilderSDK::CreateJobsNetRequest", 0xc48209c0); - - return messageType; - } - - unsigned int CreateJobsNetRequest::GetMessageType() const - { - return MessageType(); - } - - void CreateJobsNetResponse::Reflect(AZ::ReflectContext* context) - { - auto serialize = azrtti_cast(context); - if (serialize) - { - serialize->Class() - ->Version(1) - ->Field("Response", &CreateJobsNetResponse::m_response); - } - } - - unsigned int CreateJobsNetResponse::GetMessageType() const - { - return CreateJobsNetRequest::MessageType(); - } - - - - void ProcessJobNetRequest::Reflect(AZ::ReflectContext* context) - { - auto serialize = azrtti_cast(context); - if (serialize) - { - serialize->Class() - ->Version(1) - ->Field("Request", &ProcessJobNetRequest::m_request); - } - } - - unsigned int ProcessJobNetRequest::MessageType() - { - static unsigned int messageType = AZ_CRC("AssetBuilderSDK::ProcessJobNetRequest", 0x479f340f); - - return messageType; - } - - unsigned int ProcessJobNetRequest::GetMessageType() const - { - return MessageType(); - } - - void ProcessJobNetResponse::Reflect(AZ::ReflectContext* context) - { - auto serialize = azrtti_cast(context); - if (serialize) - { - serialize->Class() - ->Version(1) - ->Field("Response", &ProcessJobNetResponse::m_response); - } - } - - unsigned int ProcessJobNetResponse::GetMessageType() const - { - return ProcessJobNetRequest::MessageType(); - } - JobDependency::JobDependency(const AZStd::string& jobKey, const AZStd::string& platformIdentifier, const JobDependencyType& type, const SourceFileDependency& sourceFile) : m_jobKey(jobKey) , m_platformIdentifier(platformIdentifier) diff --git a/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.h b/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.h index f977e15be9..65bf9cc7d4 100644 --- a/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.h +++ b/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.h @@ -464,35 +464,6 @@ namespace AssetBuilderSDK AZStd::string m_platformIdentifier; }; - //! RegisterBuilderRequest contains input data that will be sent by the AssetProcessor to the builder during the startup registration phase - struct RegisterBuilderRequest - { - AZ_CLASS_ALLOCATOR(RegisterBuilderRequest, AZ::SystemAllocator, 0); - AZ_TYPE_INFO(RegisterBuilderRequest, "{7C6C5198-4766-42B8-9A1E-48479CE2F5EA}"); - - AZStd::string m_filePath; - - RegisterBuilderRequest() {} - - explicit RegisterBuilderRequest(const AZStd::string& filePath) - : m_filePath(filePath) - { - } - - static void Reflect(AZ::ReflectContext* context); - }; - - //! INTERNAL USE ONLY - RegisterBuilderResponse contains registration data that will be sent by the builder to the AssetProcessor in response to RegisterBuilderRequest - struct RegisterBuilderResponse - { - AZ_CLASS_ALLOCATOR(RegisterBuilderResponse, AZ::SystemAllocator, 0); - AZ_TYPE_INFO(RegisterBuilderResponse, "{0AE5583F-C763-410E-BA7F-78BD90546C01}"); - - AZStd::vector m_assetBuilderDescList; - - static void Reflect(AZ::ReflectContext* context); - }; - /** * This tells you about a platform in your CreateJobsRequest or your ProcessJobRequest */ @@ -756,99 +727,9 @@ namespace AssetBuilderSDK static void Reflect(AZ::ReflectContext* context); }; - //! BuilderHelloRequest is sent by an AssetBuilder that is attempting to connect to the AssetProcessor to register itself as a worker - class BuilderHelloRequest : public AzFramework::AssetSystem::BaseAssetProcessorMessage - { - public: - - AZ_CLASS_ALLOCATOR(BuilderHelloRequest, AZ::OSAllocator, 0); - AZ_RTTI(BuilderHelloRequest, "{5fab5962-a1d8-42a5-bf7a-fb1a8c5a9588}", BaseAssetProcessorMessage); - - static void Reflect(AZ::ReflectContext* context); - static unsigned int MessageType(); - - unsigned int GetMessageType() const override; - - //! Unique ID assigned to this builder to identify it - AZ::Uuid m_uuid = AZ::Uuid::CreateNull(); - }; - - //! BuilderHelloResponse contains the AssetProcessor's response to a builder connection attempt, indicating if it is accepted and the ID that it was assigned - class BuilderHelloResponse : public AzFramework::AssetSystem::BaseAssetProcessorMessage - { - public: - - AZ_CLASS_ALLOCATOR(BuilderHelloResponse, AZ::OSAllocator, 0); - AZ_RTTI(BuilderHelloResponse, "{5f3d7c11-6639-4c6f-980a-32be546903c2}", BaseAssetProcessorMessage); - - static void Reflect(AZ::ReflectContext* context); - - unsigned int GetMessageType() const override; - - //! Indicates if the builder was accepted by the AP - bool m_accepted = false; - - //! Unique ID assigned to the builder. If the builder isn't a local process, this is the ID assigned by the AP - AZ::Uuid m_uuid = AZ::Uuid::CreateNull(); - }; - - class CreateJobsNetRequest : public AzFramework::AssetSystem::BaseAssetProcessorMessage - { - public: + - AZ_CLASS_ALLOCATOR(CreateJobsNetRequest, AZ::OSAllocator, 0); - AZ_RTTI(CreateJobsNetRequest, "{97fa717d-3a09-4d21-95c6-b2eafd773f1c}", BaseAssetProcessorMessage); - - static void Reflect(AZ::ReflectContext* context); - static unsigned int MessageType(); - - unsigned int GetMessageType() const override; - - CreateJobsRequest m_request; - }; - - class CreateJobsNetResponse : public AzFramework::AssetSystem::BaseAssetProcessorMessage - { - public: - - AZ_CLASS_ALLOCATOR(CreateJobsNetResponse, AZ::OSAllocator, 0); - AZ_RTTI(CreateJobsNetResponse, "{b2c7c2d3-b60e-4b27-b699-43e0ba991c33}", BaseAssetProcessorMessage); - - static void Reflect(AZ::ReflectContext* context); - - unsigned int GetMessageType() const override; - - CreateJobsResponse m_response; - }; - - class ProcessJobNetRequest : public AzFramework::AssetSystem::BaseAssetProcessorMessage - { - public: - - AZ_CLASS_ALLOCATOR(ProcessJobNetRequest, AZ::OSAllocator, 0); - AZ_RTTI(ProcessJobNetRequest, "{05288de1-020b-48db-b9de-715f17284efa}", BaseAssetProcessorMessage); - - static void Reflect(AZ::ReflectContext* context); - static unsigned int MessageType(); - - unsigned int GetMessageType() const override; - - ProcessJobRequest m_request; - }; - - class ProcessJobNetResponse : public AzFramework::AssetSystem::BaseAssetProcessorMessage - { - public: - - AZ_CLASS_ALLOCATOR(ProcessJobNetResponse, AZ::OSAllocator, 0); - AZ_RTTI(ProcessJobNetResponse, "{26ddf882-246c-4cfb-912f-9b8e389df4f6}", BaseAssetProcessorMessage); - - static void Reflect(AZ::ReflectContext* context); - - unsigned int GetMessageType() const override; - - ProcessJobResponse m_response; - }; + //! JobCancelListener can be used by builders in their processJob method to listen for job cancellation request. //! The address of this listener is the jobid which can be found in the process job request. @@ -935,44 +816,3 @@ namespace AZ AZ_TYPE_INFO_SPECIALIZE(AssetBuilderSDK::ProductPathDependencyType, "{EF77742B-9627-4072-B431-396AA7183C80}"); AZ_TYPE_INFO_SPECIALIZE(AssetBuilderSDK::SourceFileDependency::SourceFileDependencyType, "{BE9C8805-DB17-4500-944A-EB33FD0BE347}"); } - -//! This macro should be used by every AssetBuilder to register itself, -//! AssetProcessor uses these exported function to identify whether a dll is an Asset Builder or not -//! If you want something highly custom you can do these entry points yourself instead of using the macro. -#define REGISTER_ASSETBUILDER \ - extern void BuilderOnInit(); \ - extern void BuilderDestroy(); \ - extern void BuilderRegisterDescriptors(); \ - extern void BuilderAddComponents(AZ::Entity * entity); \ - extern "C" \ - { \ - AZ_DLL_EXPORT int IsAssetBuilder() \ - { \ - return 0; \ - } \ - \ - AZ_DLL_EXPORT void InitializeModule(AZ::EnvironmentInstance sharedEnvironment) \ - { \ - AZ::Environment::Attach(sharedEnvironment); \ - BuilderOnInit(); \ - } \ - \ - AZ_DLL_EXPORT void UninitializeModule() \ - { \ - BuilderDestroy(); \ - AZ::Environment::Detach(); \ - } \ - \ - AZ_DLL_EXPORT void ModuleRegisterDescriptors() \ - { \ - BuilderRegisterDescriptors(); \ - } \ - \ - AZ_DLL_EXPORT void ModuleAddComponents(AZ::Entity * entity) \ - { \ - BuilderAddComponents(entity); \ - } \ - } -// confusion-reducing note: above end-brace is part of the macro, not a namespace - - diff --git a/Code/Tools/AssetProcessor/CMakeLists.txt b/Code/Tools/AssetProcessor/CMakeLists.txt index 98c5f8e5e8..a47ced43be 100644 --- a/Code/Tools/AssetProcessor/CMakeLists.txt +++ b/Code/Tools/AssetProcessor/CMakeLists.txt @@ -42,6 +42,7 @@ ly_add_target( AZ::AzQtComponents AZ::AzToolsFramework AZ::AssetBuilderSDK + AZ::AssetBuilder.Static ${additional_dependencies} RUNTIME_DEPENDENCIES AZ::AssetBuilder diff --git a/Code/Tools/AssetProcessor/native/assetprocessor.h b/Code/Tools/AssetProcessor/native/assetprocessor.h index 1c13eca200..83eb0464a5 100644 --- a/Code/Tools/AssetProcessor/native/assetprocessor.h +++ b/Code/Tools/AssetProcessor/native/assetprocessor.h @@ -85,7 +85,7 @@ namespace AssetProcessor enum AssetCatalogStatus { - RequiresSaving, + RequiresSaving, UpToDate }; @@ -213,11 +213,11 @@ namespace AssetProcessor bool m_critical = false; int m_priority = -1; - // indicates whether we need to check the server first for the outputs of this job + // indicates whether we need to check the server first for the outputs of this job // before we start processing locally bool m_checkServer = false; - - // Indicates whether this job needs to be processed irrespective of whether its fingerprint got modified or not. + + // Indicates whether this job needs to be processed irrespective of whether its fingerprint got modified or not. bool m_autoProcessJob = false; AssetBuilderSDK::AssetBuilderDesc m_assetBuilderDesc; @@ -251,9 +251,9 @@ namespace AssetProcessor JobDetails() = default; }; - - //! JobDesc struct is used for identifying jobs that need to be processed again - //! because of job dependency declared on them by other jobs + + //! JobDesc struct is used for identifying jobs that need to be processed again + //! because of job dependency declared on them by other jobs struct JobDesc { AZStd::string m_databaseSourceName; @@ -283,7 +283,7 @@ namespace AssetProcessor } }; - //! JobIndentifier is an internal structure that store all the data that can uniquely identify a job + //! JobIndentifier is an internal structure that store all the data that can uniquely identify a job struct JobIndentifier { JobDesc m_jobDesc; diff --git a/Code/Tools/AssetProcessor/native/ui/MainWindow.cpp b/Code/Tools/AssetProcessor/native/ui/MainWindow.cpp index c3674e6431..0837384d95 100644 --- a/Code/Tools/AssetProcessor/native/ui/MainWindow.cpp +++ b/Code/Tools/AssetProcessor/native/ui/MainWindow.cpp @@ -165,7 +165,7 @@ void MainWindow::Activate() ui->connectionTreeView->header()->resizeSection(ConnectionManager::PortColumn, 60); ui->connectionTreeView->header()->resizeSection(ConnectionManager::PlatformColumn, 60); ui->connectionTreeView->header()->resizeSection(ConnectionManager::AutoConnectColumn, 60); - + ui->connectionTreeView->header()->setStretchLastSection(false); connect(ui->connectionTreeView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &MainWindow::OnConnectionSelectionChanged); @@ -189,12 +189,12 @@ void MainWindow::Activate() ui->allowListAllowedListConnectionsListView->setModel(&m_allowedListAddresses); connect(ui->allowedListRejectedConnectionsListView, &QListView::clicked, this, &MainWindow::OnRejectedConnectionsListViewClicked); ui->allowedListRejectedConnectionsListView->setModel(&m_rejectedAddresses); - + connect(ui->allowedListEnableCheckBox, &QCheckBox::toggled, this, &MainWindow::OnAllowedListCheckBoxToggled); - + connect(ui->allowedListAddHostNameToolButton, &QToolButton::clicked, this, &MainWindow::OnAddHostNameAllowedListButtonClicked); connect(ui->allowedListAddIPToolButton, &QPushButton::clicked, this, &MainWindow::OnAddIPAllowedListButtonClicked); - + connect(ui->allowedListToAllowedListToolButton, &QPushButton::clicked, this, &MainWindow::OnToAllowedListButtonClicked); connect(ui->allowedListToRejectedListToolButton, &QToolButton::clicked, this, &MainWindow::OnToRejectedListButtonClicked); @@ -204,7 +204,7 @@ void MainWindow::Activate() QRegExpValidator* hostNameValidator = new QRegExpValidator(validHostName, this); ui->allowedListAddHostNameLineEdit->setValidator(hostNameValidator); - + QRegExpValidator* ipValidator = new QRegExpValidator(validIP, this); ui->allowedListAddIPLineEdit->setValidator(ipValidator); @@ -235,7 +235,7 @@ void MainWindow::Activate() m_logSortFilterProxy->setSourceModel(m_logsModel); m_logSortFilterProxy->setFilterKeyColumn(AzToolsFramework::Logging::LogTableModel::ColumnMessage); m_logSortFilterProxy->setFilterCaseSensitivity(Qt::CaseInsensitive); - + ui->jobLogTableView->setModel(m_logSortFilterProxy); ui->jobLogTableView->setItemDelegate(new AzToolsFramework::Logging::LogTableItemDelegate(ui->jobLogTableView)); ui->jobLogTableView->setExpandOnSelection(); @@ -400,7 +400,7 @@ void MainWindow::Activate() bool zeroAnalysisModeFromSettings = settings.value("EnableZeroAnalysis", QVariant(true)).toBool(); settings.endGroup(); - QObject::connect(ui->modtimeSkippingCheckBox, &QCheckBox::stateChanged, this, + QObject::connect(ui->modtimeSkippingCheckBox, &QCheckBox::stateChanged, this, [this](int newCheckState) { bool newOption = newCheckState == Qt::Checked ? true : false; @@ -543,7 +543,7 @@ void MainWindow::OnAddConnection(bool /*checked*/) m_guiApplicationManager->GetConnectionManager()->addUserConnection(); } -void MainWindow::OnAllowedListConnectionsListViewClicked() +void MainWindow::OnAllowedListConnectionsListViewClicked() { ui->allowedListRejectedConnectionsListView->clearSelection(); } @@ -553,7 +553,7 @@ void MainWindow::OnRejectedConnectionsListViewClicked() ui->allowListAllowedListConnectionsListView->clearSelection(); } -void MainWindow::OnAllowedListCheckBoxToggled() +void MainWindow::OnAllowedListCheckBoxToggled() { if (!ui->allowedListEnableCheckBox->isChecked()) { @@ -588,7 +588,7 @@ void MainWindow::OnAllowedListCheckBoxToggled() ui->allowedListToAllowedListToolButton->setEnabled(true); ui->allowedListToRejectedListToolButton->setEnabled(true); } - + m_guiApplicationManager->GetConnectionManager()->AllowedListingEnabled(ui->allowedListEnableCheckBox->isChecked()); } @@ -858,7 +858,7 @@ void MainWindow::OnAssetProcessorStatusChanged(const AssetProcessor::AssetProces text = tr("Working, analyzing jobs remaining %1, processing jobs remaining %2...").arg(m_createJobCount).arg(m_processJobsCount); ui->timerContainerWidget->setVisible(false); ui->productAssetDetailsPanel->SetScanQueueEnabled(false); - + IntervalAssetTabFilterRefresh(); } else @@ -877,7 +877,7 @@ void MainWindow::OnAssetProcessorStatusChanged(const AssetProcessor::AssetProces break; case AssetProcessorStatus::Processing_Jobs: CheckStartProcessTimers(); - m_processJobsCount = entry.m_count; + m_processJobsCount = entry.m_count; if (m_processJobsCount + m_createJobCount > 0) { @@ -983,7 +983,7 @@ void MainWindow::ApplyConfig() ui->jobLogTableView->header()->resizeSection(AzToolsFramework::Logging::LogTableModel::ColumnType, m_config.logTypeColumnWidth); } -MainWindow::LogSortFilterProxy::LogSortFilterProxy(QObject* parentOjbect) : QSortFilterProxyModel(parentOjbect) +MainWindow::LogSortFilterProxy::LogSortFilterProxy(QObject* parentOjbect) : QSortFilterProxyModel(parentOjbect) { } @@ -1302,7 +1302,7 @@ void MainWindow::ShowJobViewContextMenu(const QPoint& pos) ui->sourceAssetDetailsPanel->GoToSource(item->m_elementId.GetInputAssetName().toUtf8().constData()); }); - QString productMenuTitle(tr("View product asset...")); + QString productMenuTitle(tr("View product asset...")); if (item->m_jobState != AzToolsFramework::AssetSystem::JobStatus::Completed) { QString disabledActionTooltip(tr("Only completed jobs are available in the Assets tab.")); @@ -1610,7 +1610,7 @@ void MainWindow::ShowProductAssetContextMenu(const QPoint& pos) { AzQtComponents::ShowFileOnDesktop(pathToProduct.GetValue()); } - + }); QString fileOrFolder(cachedAsset->getChildCount() > 0 ? tr("folder") : tr("file")); diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp index 7a14f158d6..57884b304f 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp @@ -231,44 +231,6 @@ bool ApplicationManager::InitiatedShutdown() const return m_duringShutdown; } -void ApplicationManager::GetExternalBuilderFileList(QStringList& externalBuilderModules) -{ - externalBuilderModules.clear(); - - static const char* builder_folder_name = "Builders"; - - // LY_ASSET_BUILDERS is defined by the CMakeLists.txt. The asset builders add themselves to a variable that - // is populated to allow selective building of those asset builder targets. - // This allows left over Asset builders in the output directory to not be loaded by the AssetProcessor -#if !defined(LY_ASSET_BUILDERS) - #error LY_ASSET_BUILDERS was not defined for ApplicationManager.cpp -#endif - - QDir builderDir = QDir::toNativeSeparators(QString(this->m_frameworkApp.GetExecutableFolder())); - builderDir.cd(QString(builder_folder_name)); - if (builderDir.exists()) - { - AZStd::vector tokens; - AZ::StringFunc::Tokenize(AZStd::string_view(LY_ASSET_BUILDERS), tokens, ','); - AZStd::string builderLibrary; - for (const AZStd::string& token : tokens) - { - QString assetBuilderPath(token.c_str()); - if (builderDir.exists(assetBuilderPath)) - { - externalBuilderModules.push_back(builderDir.absoluteFilePath(assetBuilderPath)); - } - } - } - - if (externalBuilderModules.empty()) - { - AZ_TracePrintf(AssetProcessor::ConsoleChannel, "AssetProcessor was unable to locate any external builders\n"); - } -} - - - QDir ApplicationManager::GetSystemRoot() const { return m_systemRoot; @@ -459,15 +421,6 @@ void ApplicationManager::PopulateApplicationDependencies() m_filesOfInterest.push_back(dir.absoluteFilePath(pathWithPlatformExtension)); } - // Get the external builder modules to add to the files of interest - QStringList builderModuleFileList; - GetExternalBuilderFileList(builderModuleFileList); - for (const QString& builderModuleFile : builderModuleFileList) - { - m_filesOfInterest.push_back(builderModuleFile); - } - - QDir assetRoot; AssetUtilities::ComputeAssetRoot(assetRoot); diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.h b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.h index 91cf2185b7..56d65d6784 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.h +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.h @@ -139,7 +139,7 @@ protected: void RegisterObjectForQuit(QObject* source, bool insertInFront = false); bool NeedRestart() const; void addRunningThread(AssetProcessor::ThreadWorker* thread); - + template void RegisterInternalBuilder(const QString& builderName); @@ -151,9 +151,6 @@ protected: bool m_duringStartup = true; AssetProcessorAZApplication m_frameworkApp; QCoreApplication* m_qApp = nullptr; - - //! Get the list of external builder files for this asset processor - void GetExternalBuilderFileList(QStringList& externalBuilderModules); virtual void Reflect() = 0; virtual const char* GetLogBaseName() = 0; diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp index 8837e9dc3f..04036602db 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -32,9 +33,6 @@ #include -//! Amount of time to wait between checking the status of the AssetBuilder process -static const int s_MaximumSleepTimeMS = 10; - //! CreateJobs will wait up to 2 minutes before timing out //! This shouldn't need to be so high but very large slices can take a while to process currently //! This should be reduced down to something more reasonable after slice jobs are sped up @@ -64,6 +62,7 @@ ApplicationManagerBase::~ApplicationManagerBase() AZ::Debug::TraceMessageBus::Handler::BusDisconnect(); AssetProcessor::AssetBuilderRegistrationBus::Handler::BusDisconnect(); AssetBuilderSDK::AssetBuilderBus::Handler::BusDisconnect(); + AssetProcessor::AssetBuilderInfoBus::Handler::BusDisconnect(); if (m_settingsRegistryBuilder) { @@ -192,7 +191,7 @@ void ApplicationManagerBase::InitAssetProcessorManager() { m_assetProcessorManager->SetEnableModtimeSkippingFeature(true); } - + if (commandLine->HasSwitch(Command_enableQueryLogging.m_switch)) { m_assetProcessorManager->SetQueryLogging(true); @@ -206,7 +205,7 @@ void ApplicationManagerBase::InitAssetProcessorManager() { m_dependencyScanPattern = commandLine->GetSwitchValue(Command_dsp.m_switch, 0).c_str(); } - + m_fileDependencyScanPattern = "*"; if (commandLine->HasSwitch(Command_fileDependencyScanPattern.m_switch)) @@ -327,7 +326,7 @@ void ApplicationManagerBase::InitAssetCatalog() AssetProcessor::AssetCatalog* catalog = new AssetCatalog(assetCatalogHelper, m_platformConfiguration); // Using a direct connection so we know the catalog has been updated before continuing on with code might depend on the asset being in the catalog - connect(m_assetProcessorManager, &AssetProcessorManager::AssetMessage, catalog, &AssetCatalog::OnAssetMessage, Qt::DirectConnection); + connect(m_assetProcessorManager, &AssetProcessorManager::AssetMessage, catalog, &AssetCatalog::OnAssetMessage, Qt::DirectConnection); connect(m_assetProcessorManager, &AssetProcessorManager::SourceQueued, catalog, &AssetCatalog::OnSourceQueued); connect(m_assetProcessorManager, &AssetProcessorManager::SourceFinished, catalog, &AssetCatalog::OnSourceFinished); connect(m_assetProcessorManager, &AssetProcessorManager::PathDependencyResolved, catalog, &AssetCatalog::OnDependencyResolved); @@ -379,12 +378,12 @@ void ApplicationManagerBase::InitAssetScanner() QObject::connect(m_assetScanner, &AssetScanner::FilesFound, [this](QSet files) { m_fileStateCache->AddInfoSet(files); }); QObject::connect(m_assetScanner, &AssetScanner::FoldersFound, [this](QSet files) { m_fileStateCache->AddInfoSet(files); }); QObject::connect(m_assetScanner, &AssetScanner::ExcludedFound, [this](QSet files) { m_fileStateCache->AddInfoSet(files); }); - + // file table QObject::connect(m_assetScanner, &AssetScanner::AssetScanningStatusChanged, m_fileProcessor.get(), &FileProcessor::OnAssetScannerStatusChange); QObject::connect(m_assetScanner, &AssetScanner::FilesFound, m_fileProcessor.get(), &FileProcessor::AssessFilesFromScanner); QObject::connect(m_assetScanner, &AssetScanner::FoldersFound, m_fileProcessor.get(), &FileProcessor::AssessFoldersFromScanner); - + } void ApplicationManagerBase::DestroyAssetScanner() @@ -591,6 +590,51 @@ void ApplicationManagerBase::InitConnectionManager() }, AZStd::placeholders::_1, AZStd::placeholders::_2, AZStd::placeholders::_3, AZStd::placeholders::_4) ); + m_connectionManager->RegisterService( + AssetBuilder::BuilderRegistrationRequest::MessageType, + [this](unsigned int /*connId*/, unsigned int /*type*/, unsigned int /*serial*/, QByteArray payload, QString) + { + AssetBuilder::BuilderRegistrationRequest registrationRequest; + + if (m_builderRegistrationComplete) + { + return; + } + + m_builderRegistrationComplete = true; + + if (AssetProcessor::UnpackMessage(payload, registrationRequest)) + { + for (const auto& builder : registrationRequest.m_builders) + { + AssetBuilderSDK::AssetBuilderDesc desc; + desc.m_name = builder.m_name; + desc.m_patterns = builder.m_patterns; + desc.m_version = builder.m_version; + desc.m_analysisFingerprint = builder.m_analysisFingerprint; + desc.m_flags = builder.m_flags; + desc.m_busId = builder.m_busId; + desc.m_flagsByJobKey = builder.m_flagsByJobKey; + desc.m_productsToKeepOnFailure = builder.m_productsToKeepOnFailure; + + // Builders registered this way are always external builders + desc.m_builderType = AssetBuilderSDK::AssetBuilderDesc::AssetBuilderType::External; + + RegisterBuilderInformation(desc); + } + + QTimer::singleShot( + 0, this, + [this]() + { + if (!PostActivate()) + { + QuitRequested(); + } + }); + } + }); + //You can get Asset Processor Current State using AzFramework::AssetSystem::RequestAssetProcessorStatus; auto GetState = [this](unsigned int connId, unsigned int, unsigned int serial, QByteArray payload, QString) @@ -633,11 +677,11 @@ void ApplicationManagerBase::InitConnectionManager() AssetProcessorPlatformStatusRequest requestMessage; if (AssetProcessor::UnpackMessage(payload, requestMessage)) { - AzToolsFramework::AssetSystemRequestBus::BroadcastResult(responseMessage.m_isPlatformEnabled, + AzToolsFramework::AssetSystemRequestBus::BroadcastResult(responseMessage.m_isPlatformEnabled, &AzToolsFramework::AssetSystemRequestBus::Events::IsAssetPlatformEnabled, requestMessage.m_platform.c_str()); } - AssetProcessor::ConnectionBus::Event(connId, + AssetProcessor::ConnectionBus::Event(connId, &AssetProcessor::ConnectionBus::Events::SendResponse, serial, responseMessage); }); @@ -653,11 +697,11 @@ void ApplicationManagerBase::InitConnectionManager() if (AssetProcessor::UnpackMessage(payload, requestMessage)) { const char* platformIdentifier = requestMessage.m_platform.c_str(); - responseMessage.m_numberOfPendingJobs = + responseMessage.m_numberOfPendingJobs = GetRCController()->NumberOfPendingJobsPerPlatform(platformIdentifier); } - AssetProcessor::ConnectionBus::Event(connId, + AssetProcessor::ConnectionBus::Event(connId, &AssetProcessor::ConnectionBus::Events::SendResponse, serial, responseMessage); }); } @@ -696,7 +740,7 @@ void ApplicationManagerBase::InitAssetRequestHandler(AssetProcessor::AssetReques QObject::connect(GetAssetProcessorManager(), &AssetProcessorManager::SendAssetExistsResponse, m_assetRequestHandler, &AssetRequestHandler::OnRequestAssetExistsResponse); QObject::connect(GetAssetProcessorManager(), &AssetProcessorManager::FenceFileDetected, m_assetRequestHandler, &AssetRequestHandler::OnFenceFileDetected); - + // connect the Asset Request Handler to RC: QObject::connect(m_assetRequestHandler, &AssetRequestHandler::RequestCompileGroup, GetRCController(), &RCController::OnRequestCompileGroup); QObject::connect(m_assetRequestHandler, &AssetRequestHandler::RequestEscalateAssetBySearchTerm, GetRCController(), &RCController::OnEscalateJobsBySearchTerm); @@ -840,14 +884,6 @@ bool ApplicationManagerBase::Run() return false; } - bool startedSuccessfully = true; - - if (!PostActivate()) - { - QuitRequested(); - startedSuccessfully = false; - } - AZ_Printf(AssetProcessor::ConsoleChannel, "Asset Processor Batch Processing Started.\n"); AZ_Printf(AssetProcessor::ConsoleChannel, "-----------------------------------------\n"); QElapsedTimer allAssetsProcessingTimer; @@ -867,7 +903,7 @@ bool ApplicationManagerBase::Run() RemoveOldTempFolders(); Destroy(); - return (startedSuccessfully && FailedAssetsCount() == 0); + return FailedAssetsCount() == 0; } void ApplicationManagerBase::HandleFileRelocation() const @@ -899,7 +935,7 @@ void ApplicationManagerBase::HandleFileRelocation() const while(!m_sourceControlReady) { // We need to wait for source control to be ready before continuing - + if (printCounter % 10 == 0) { AZ_TracePrintf(AssetProcessor::ConsoleChannel, "Waiting for Source Control connection\n"); @@ -1129,7 +1165,7 @@ void ApplicationManagerBase::CheckForIdle() TryScanProductDependencies(); TryHandleFileRelocation(); - + // since we are shutting down, we save the registry and then we quit. AZ_Printf(AssetProcessor::ConsoleChannel, "No assets remain in the build queue. Saving the catalog, and then shutting down.\n"); // stop accepting any further idle messages, as we will shut down - don't want this function to repeat! @@ -1173,7 +1209,7 @@ void ApplicationManagerBase::InitBuilderManager() { m_builderManager->ConnectionLost(connId); }); - + } void ApplicationManagerBase::ShutdownBuilderManager() @@ -1207,7 +1243,7 @@ void ApplicationManagerBase::ShutDownAssetDatabase() AzToolsFramework::AssetDatabase::AssetDatabaseRequests::Bus::Handler::BusDisconnect(); } -void ApplicationManagerBase::InitFileProcessor() +void ApplicationManagerBase::InitFileProcessor() { AssetProcessor::ThreadController* fileProcessorHelper = new AssetProcessor::ThreadController(); @@ -1298,22 +1334,13 @@ bool ApplicationManagerBase::Activate() } InitBuilderConfiguration(); - - m_isCurrentlyLoadingGems = true; - if (!ActivateModules()) - { - // ActivateModules reports any errors it encounters. - m_isCurrentlyLoadingGems = false; - return false; - } - - m_isCurrentlyLoadingGems = false; PopulateApplicationDependencies(); InitAssetProcessorManager(); AssetBuilderSDK::InitializeSerializationContext(); AssetBuilderSDK::InitializeBehaviorContext(); - + AssetBuilder::InitializeSerializationContext(); + InitFileStateCache(); InitFileProcessor(); @@ -1341,7 +1368,7 @@ bool ApplicationManagerBase::Activate() RegisterObjectForQuit(m_rcController); m_connectionsToRemoveOnShutdown << QObject::connect( - m_assetProcessorManager, &AssetProcessor::AssetProcessorManager::AssetProcessorManagerIdleState, + m_assetProcessorManager, &AssetProcessor::AssetProcessorManager::AssetProcessorManagerIdleState, this, [this](bool state) { if (state) @@ -1362,7 +1389,7 @@ bool ApplicationManagerBase::Activate() }); m_connectionsToRemoveOnShutdown << QObject::connect( - this, &ApplicationManagerBase::CheckAssetProcessorManagerIdleState, + this, &ApplicationManagerBase::CheckAssetProcessorManagerIdleState, m_assetProcessorManager, &AssetProcessor::AssetProcessorManager::CheckAssetProcessorIdleState); MakeActivationConnections(); @@ -1376,6 +1403,22 @@ bool ApplicationManagerBase::Activate() return false; } } + + AssetProcessor::AssetProcessorStatusEntry entry(AssetProcessor::AssetProcessorStatus::Initializing_Builders, 0, QString()); + Q_EMIT AssetProcessorStatusChanged(entry); + + AZStd::thread_desc desc; + desc.m_name = "Builder Component Registration"; + AZStd::thread builderRegistrationThread( + desc, + []() + { + AssetProcessor::BuilderRef builder; + AssetProcessor::BuilderManagerBus::BroadcastResult(builder, &AssetProcessor::BuilderManagerBus::Events::GetBuilder, true); + }); + + builderRegistrationThread.detach(); + return true; } @@ -1384,11 +1427,6 @@ bool ApplicationManagerBase::PostActivate() m_connectionManager->LoadConnections(); InitializeInternalBuilders(); - if (!InitializeExternalBuilders()) - { - AZ_Error("AssetProcessor", false, "AssetProcessor is closing. Failed to initialize and load all the external builders. Please ensure that Builders_Temp directory is not read-only. Please see log for more information.\n"); - return false; - } Q_EMIT OnBuildersRegistered(); @@ -1401,7 +1439,7 @@ bool ApplicationManagerBase::PostActivate() AZ::SystemTickBus::Broadcast(&AZ::SystemTickEvents::OnSystemTick); }); - // now that everything is up and running, we start scanning. Before this, we don't want file events to start percolating through the + // now that everything is up and running, we start scanning. Before this, we don't want file events to start percolating through the // asset system. GetAssetScanner()->StartScan(); @@ -1425,192 +1463,87 @@ bool ApplicationManagerBase::InitializeInternalBuilders() return result; } -bool ApplicationManagerBase::InitializeExternalBuilders() -{ - AssetProcessor::AssetProcessorStatusEntry entry(AssetProcessor::AssetProcessorStatus::Initializing_Builders); - Q_EMIT AssetProcessorStatusChanged(entry); - QCoreApplication::processEvents(QEventLoop::AllEvents); - - - // Get the list of external build modules (full paths) - QStringList fileList; - GetExternalBuilderFileList(fileList); - - for (const QString& filePath : fileList) - { - if (QLibrary::isLibrary(filePath)) - { - AssetProcessor::ExternalModuleAssetBuilderInfo* externalAssetBuilderInfo = new AssetProcessor::ExternalModuleAssetBuilderInfo(filePath); - AssetProcessor::AssetBuilderType assetBuilderType = externalAssetBuilderInfo->Load(); - AZ_TracePrintf(AssetProcessor::ConsoleChannel, "AssetProcessor is loading library %s\n", filePath.toUtf8().data()); - if (assetBuilderType == AssetProcessor::AssetBuilderType::None) - { - AZ_Warning(AssetProcessor::DebugChannel, false, "Non-builder DLL was found in Builders directory %s, skipping. \n", filePath.toUtf8().data()); - delete externalAssetBuilderInfo; - continue; - } - - if (assetBuilderType == AssetProcessor::AssetBuilderType::Invalid) - { - AZ_Warning(AssetProcessor::DebugChannel, false, "AssetProcessor was not able to load the library: %s\n", filePath.toUtf8().data()); - delete externalAssetBuilderInfo; - return false; - } - - AZ_TracePrintf(AssetProcessor::ConsoleChannel, "Initializing and registering builder %s\n", externalAssetBuilderInfo->GetName().toUtf8().data()); - - m_currentExternalAssetBuilder = externalAssetBuilderInfo; - - externalAssetBuilderInfo->Initialize(); - - m_currentExternalAssetBuilder = nullptr; - - m_externalAssetBuilders.push_back(externalAssetBuilderInfo); - } - } - - // Also init external builders which may be inside of Gems - AzToolsFramework::ToolsApplicationRequestBus::Broadcast( - &AzToolsFramework::ToolsApplicationRequests::CreateAndAddEntityFromComponentTags, - AZStd::vector({ AssetBuilderSDK::ComponentTags::AssetBuilder }), "AssetBuilders Entity"); - - return true; -} - -bool ApplicationManagerBase::WaitForBuilderExit(AzFramework::ProcessWatcher* processWatcher, AssetBuilderSDK::JobCancelListener* jobCancelListener, AZ::u32 processTimeoutLimitInSeconds) +void ApplicationManagerBase::RegisterBuilderInformation(const AssetBuilderSDK::AssetBuilderDesc& builderDesc) { - AZ::u32 exitCode = 0; - bool finishedOK = false; - QElapsedTimer ticker; - ProcessCommunicatorTracePrinter tracer(processWatcher->GetCommunicator(), "AssetBuilder"); - - ticker.start(); - - while (!finishedOK) - { - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(s_MaximumSleepTimeMS)); - - tracer.Pump(); - - if (ticker.elapsed() > processTimeoutLimitInSeconds * 1000 || (jobCancelListener && jobCancelListener->IsCancelled())) - { - break; - } - - if (!processWatcher->IsProcessRunning(&exitCode)) - { - finishedOK = true; // we either cant wait for it, or it finished. - break; - } - } - - tracer.Pump(); // empty whats left if possible. - - if (processWatcher->IsProcessRunning(&exitCode)) + if (!builderDesc.IsExternalBuilder()) { - processWatcher->TerminateProcess(1); - } + // Create Job Function validation + AZ_Error( + AssetProcessor::ConsoleChannel, builderDesc.m_createJobFunction, + "Create Job Function (m_createJobFunction) for %s builder is empty.\n", builderDesc.m_name.c_str()); - if (exitCode != 0) - { - AZ_Error(AssetProcessor::ConsoleChannel, false, "AssetBuilder exited with error code %d", exitCode); - return false; - } - else if (jobCancelListener && jobCancelListener->IsCancelled()) - { - AZ_TracePrintf(AssetProcessor::DebugChannel, "AssetBuilder was terminated. There was a request to cancel the job.\n"); - return false; - } - else if (!finishedOK) - { - AZ_Error(AssetProcessor::ConsoleChannel, false, "AssetBuilder failed to terminate within %d seconds", processTimeoutLimitInSeconds); - return false; + // Process Job Function validation + AZ_Error( + AssetProcessor::ConsoleChannel, builderDesc.m_processJobFunction, + "Process Job Function (m_processJobFunction) for %s builder is empty.\n", builderDesc.m_name.c_str()); } - return true; -} - -void ApplicationManagerBase::RegisterBuilderInformation(const AssetBuilderSDK::AssetBuilderDesc& builderDesc) -{ - // Create Job Function validation - AZ_Error(AssetProcessor::ConsoleChannel, - builderDesc.m_createJobFunction, - "Create Job Function (m_createJobFunction) for %s builder is empty.\n", - builderDesc.m_name.c_str()); - - // Process Job Function validation - AZ_Error(AssetProcessor::ConsoleChannel, - builderDesc.m_processJobFunction, - "Process Job Function (m_processJobFunction) for %s builder is empty.\n", - builderDesc.m_name.c_str()); - // Bus ID validation AZ_Error(AssetProcessor::ConsoleChannel, !builderDesc.m_busId.IsNull(), "Bus ID for %s builder is empty.\n", builderDesc.m_name.c_str()); - // This is an external builder registering, we will want to track its builder desc since it can register multiple ones - AZStd::string builderFilePath; - if (m_currentExternalAssetBuilder) - { - m_currentExternalAssetBuilder->RegisterBuilderDesc(builderDesc.m_busId); - builderFilePath = m_currentExternalAssetBuilder->GetModuleFullPath().toUtf8().data(); - } - AssetBuilderSDK::AssetBuilderDesc modifiedBuilderDesc = builderDesc; // Allow for overrides defined in a BuilderConfig.ini file to update our code defined default values AssetProcessor::BuilderConfigurationRequestBus::Broadcast(&AssetProcessor::BuilderConfigurationRequests::UpdateBuilderDescriptor, builderDesc.m_name, modifiedBuilderDesc); if (builderDesc.IsExternalBuilder()) { - // We're going to override the createJob function so we can run it externally in AssetBuilder, rather than having it run inside the AP - modifiedBuilderDesc.m_createJobFunction = [builderFilePath](const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response) - { - AssetProcessor::BuilderRef builderRef; - AssetProcessor::BuilderManagerBus::BroadcastResult(builderRef, &AssetProcessor::BuilderManagerBusTraits::GetBuilder); + // We're going to override the createJob function so we can run it externally in AssetBuilder, rather than having it run + // inside the AP + modifiedBuilderDesc.m_createJobFunction = + [](const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response) + { + AssetProcessor::BuilderRef builderRef; + AssetProcessor::BuilderManagerBus::BroadcastResult(builderRef, &AssetProcessor::BuilderManagerBusTraits::GetBuilder, false); - if (builderRef) - { - int retryCount = 0; - AssetProcessor::BuilderRunJobOutcome result; + if (builderRef) + { + int retryCount = 0; + AssetProcessor::BuilderRunJobOutcome result; - do - { - retryCount++; - result = builderRef->RunJob(request, response, s_MaximumCreateJobsTimeSeconds, "create", builderFilePath, nullptr); - } while (result == AssetProcessor::BuilderRunJobOutcome::LostConnection && retryCount <= AssetProcessor::RetriesForJobNetworkError); - } - else + do { - AZ_Error("AssetProcessor", false, "Failed to retrieve a valid builder to process job"); - } - }; + retryCount++; + result = builderRef->RunJob( + request, response, s_MaximumCreateJobsTimeSeconds, "create", "", nullptr); + } while (result == AssetProcessor::BuilderRunJobOutcome::LostConnection && + retryCount <= AssetProcessor::RetriesForJobNetworkError); + } + else + { + AZ_Error("AssetProcessor", false, "Failed to retrieve a valid builder to process job"); + } + }; // Also override the processJob function to run externally - modifiedBuilderDesc.m_processJobFunction = [builderFilePath](const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) - { - AssetBuilderSDK::JobCancelListener jobCancelListener(request.m_jobId); + modifiedBuilderDesc.m_processJobFunction = + [](const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) + { + AssetBuilderSDK::JobCancelListener jobCancelListener(request.m_jobId); - AssetProcessor::BuilderRef builderRef; - AssetProcessor::BuilderManagerBus::BroadcastResult(builderRef, &AssetProcessor::BuilderManagerBusTraits::GetBuilder); + AssetProcessor::BuilderRef builderRef; + AssetProcessor::BuilderManagerBus::BroadcastResult(builderRef, &AssetProcessor::BuilderManagerBusTraits::GetBuilder, false); - if (builderRef) - { - int retryCount = 0; - AssetProcessor::BuilderRunJobOutcome result; + if (builderRef) + { + int retryCount = 0; + AssetProcessor::BuilderRunJobOutcome result; - do - { - retryCount++; - result = builderRef->RunJob(request, response, s_MaximumProcessJobsTimeSeconds, "process", builderFilePath, &jobCancelListener, request.m_tempDirPath); - } while (result == AssetProcessor::BuilderRunJobOutcome::LostConnection && retryCount <= AssetProcessor::RetriesForJobNetworkError); - } - else + do { - AZ_Error("AssetProcessor", false, "Failed to retrieve a valid builder to process job"); - } - }; + retryCount++; + result = builderRef->RunJob( + request, response, s_MaximumProcessJobsTimeSeconds, "process", "", &jobCancelListener, request.m_tempDirPath); + } while (result == AssetProcessor::BuilderRunJobOutcome::LostConnection && + retryCount <= AssetProcessor::RetriesForJobNetworkError); + } + else + { + AZ_Error("AssetProcessor", false, "Failed to retrieve a valid builder to process job"); + } + }; } if (m_builderDescMap.find(modifiedBuilderDesc.m_busId) != m_builderDescMap.end()) @@ -1768,7 +1701,7 @@ bool ApplicationManagerBase::CheckSufficientDiskSpace(const QString& savePath, q [[maybe_unused]] bool result = AzToolsFramework::ToolsFileUtils::GetFreeDiskSpace(savePath, bytesFree); AZ_Assert(result, "Unable to determine the amount of free space on drive containing path (%s).", savePath.toUtf8().constData()); - + if (bytesFree < requiredSpace + s_ReservedDiskSpaceInBytes) { if (shutdownIfInsufficient) @@ -1806,8 +1739,8 @@ void ApplicationManagerBase::RemoveOldTempFolders() return; } - // We will remove old temp folders if either their modified time is older than the cutoff time or - // if the total number of temp folders have exceeded the maximum number of temp folders. + // We will remove old temp folders if either their modified time is older than the cutoff time or + // if the total number of temp folders have exceeded the maximum number of temp folders. QFileInfoList entries = root.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Time); // sorting by modification time int folderCount = 0; bool removeFolder = false; @@ -1821,9 +1754,9 @@ void ApplicationManagerBase::RemoveOldTempFolders() // Since we are sorting the folders list from latest to oldest, we will either be in a state where we have to delete all the remaining folders or not // because either we have reached the folder limit or reached the cutoff date limit. - removeFolder = removeFolder || (folderCount++ >= s_MaximumTempFolders) || + removeFolder = removeFolder || (folderCount++ >= s_MaximumTempFolders) || (entry.lastModified() < cutoffTime); - + if (removeFolder) { QDir dir(entry.absoluteFilePath()); @@ -1837,8 +1770,6 @@ void ApplicationManagerBase::ConnectivityStateChanged(const AzToolsFramework::So Q_EMIT SourceControlReady(); } - - void ApplicationManagerBase::OnAssetProcessorManagerIdleState(bool isIdle) { // these can come in during shutdown. diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.h b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.h index 886880df3a..dbc4841599 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.h +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.h @@ -149,7 +149,6 @@ protected: void CreateQtApplication() override; bool InitializeInternalBuilders(); - bool InitializeExternalBuilders(); void InitBuilderManager(); void ShutdownBuilderManager(); bool InitAssetDatabase(); @@ -173,8 +172,6 @@ protected: AssetProcessor::AssetCatalog* GetAssetCatalog() const { return m_assetCatalog; } - static bool WaitForBuilderExit(AzFramework::ProcessWatcher* processWatcher, AssetBuilderSDK::JobCancelListener* jobCancelListener, AZ::u32 processTimeoutLimitInSeconds); - ApplicationServer* m_applicationServer = nullptr; ConnectionManager* m_connectionManager = nullptr; @@ -218,6 +215,8 @@ protected: AZStd::shared_ptr m_internalBuilder; AZStd::shared_ptr m_settingsRegistryBuilder; + bool m_builderRegistrationComplete = false; + // Builder description map based on the builder id AZStd::unordered_map m_builderDescMap; @@ -231,7 +230,7 @@ protected: AZStd::list m_externalAssetBuilders; AssetProcessor::ExternalModuleAssetBuilderInfo* m_currentExternalAssetBuilder = nullptr; - + QAtomicInt m_connectionsAwaitingAssetCatalogSave = 0; int m_remainingAPMJobs = 0; bool m_assetProcessorManagerIsReady = false; diff --git a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.cpp b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.cpp index ddaa5aa777..75c84630f5 100644 --- a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.cpp @@ -16,6 +16,7 @@ #include #include #include +#include namespace AssetProcessor { @@ -138,7 +139,7 @@ namespace AssetProcessor } } - bool Builder::Start() + bool Builder::Start(bool doRegistration) { // Get the current BinXXX folder based on the current running AP QString applicationDir = QCoreApplication::instance()->applicationDirPath(); @@ -155,7 +156,7 @@ namespace AssetProcessor return false; } - const AZStd::vector params = BuildParams("resident", buildersFolder.c_str(), UuidString(), "", ""); + const AZStd::vector params = BuildParams("resident", buildersFolder.c_str(), UuidString(), "", "", doRegistration); m_processWatcher = LaunchProcess(fullExePathString.c_str(), params); @@ -179,7 +180,7 @@ namespace AssetProcessor return !m_processWatcher || (m_processWatcher && m_processWatcher->IsProcessRunning(exitCode)); } - AZStd::vector Builder::BuildParams(const char* task, const char* moduleFilePath, const AZStd::string& builderGuid, const AZStd::string& jobDescriptionFile, const AZStd::string& jobResponseFile) const + AZStd::vector Builder::BuildParams(const char* task, const char* moduleFilePath, const AZStd::string& builderGuid, const AZStd::string& jobDescriptionFile, const AZStd::string& jobResponseFile, bool doRegistration) const { QDir projectCacheRoot; AssetUtilities::ComputeProjectCacheRoot(projectCacheRoot); @@ -200,6 +201,11 @@ namespace AssetProcessor params.emplace_back(AZStd::string::format(R"(-engine-path="%s")", enginePath.c_str())); params.emplace_back(AZStd::string::format("-port=%d", portNumber)); + if(doRegistration) + { + params.emplace_back("--register"); + } + if (moduleFilePath && moduleFilePath[0]) { params.emplace_back(AZStd::string::format(R"(-module="%s")", moduleFilePath)); @@ -232,7 +238,7 @@ namespace AssetProcessor { AzFramework::ProcessLauncher::ProcessLaunchInfo processLaunchInfo; processLaunchInfo.m_processExecutableString = fullExePath; - + AZStd::vector commandLineArray{ fullExePath }; commandLineArray.insert(commandLineArray.end(), params.begin(), params.end()); processLaunchInfo.m_commandlineParameters = AZStd::move(commandLineArray); @@ -350,17 +356,19 @@ namespace AssetProcessor BuilderManager::BuilderManager(ConnectionManager* connectionManager) { using namespace AZStd::placeholders; - connectionManager->RegisterService(AssetBuilderSDK::BuilderHelloRequest::MessageType(), AZStd::bind(&BuilderManager::IncomingBuilderPing, this, _1, _2, _3, _4, _5)); + connectionManager->RegisterService(AssetBuilder::BuilderHelloRequest::MessageType(), AZStd::bind(&BuilderManager::IncomingBuilderPing, this, _1, _2, _3, _4, _5)); // Setup a background thread to pump the idle builders so they don't get blocked trying to output to stdout/err - m_pollingThread = AZStd::thread([this]() + AZStd::thread_desc desc; + desc.m_name = "BuilderManager Idle Pump"; + m_pollingThread = AZStd::thread(desc, [this]() + { + while (!m_quitListener.WasQuitRequested()) { - while (!m_quitListener.WasQuitRequested()) - { - PumpIdleBuilders(); - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(s_IdleBuilderPumpingDelayMS)); - } - }); + PumpIdleBuilders(); + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(s_IdleBuilderPumpingDelayMS)); + } + }); m_quitListener.BusConnect(); BusConnect(); @@ -399,8 +407,8 @@ namespace AssetProcessor void BuilderManager::IncomingBuilderPing(AZ::u32 connId, AZ::u32 /*type*/, AZ::u32 serial, QByteArray payload, QString platform) { - AssetBuilderSDK::BuilderHelloRequest requestPing; - AssetBuilderSDK::BuilderHelloResponse responsePing; + AssetBuilder::BuilderHelloRequest requestPing; + AssetBuilder::BuilderHelloResponse responsePing; if (!AZ::Utils::LoadObjectFromBufferInPlace(payload.data(), payload.length(), requestPing)) { @@ -476,7 +484,7 @@ namespace AssetProcessor return builder; } - BuilderRef BuilderManager::GetBuilder() + BuilderRef BuilderManager::GetBuilder(bool doRegistration) { AZStd::shared_ptr newBuilder; BuilderRef builderRef; @@ -484,27 +492,30 @@ namespace AssetProcessor { AZStd::unique_lock lock(m_buildersMutex); - for (auto itr = m_builders.begin(); itr != m_builders.end(); ) + if (!doRegistration) { - auto& builder = itr->second; - - if (!builder->m_busy) + for (auto itr = m_builders.begin(); itr != m_builders.end();) { - builder->PumpCommunicator(); + auto& builder = itr->second; - if (builder->IsValid()) + if (!builder->m_busy) { - return BuilderRef(builder); + builder->PumpCommunicator(); + + if (builder->IsValid()) + { + return BuilderRef(builder); + } + else + { + itr = m_builders.erase(itr); + } } else { - itr = m_builders.erase(itr); + ++itr; } } - else - { - ++itr; - } } AZ_TracePrintf("BuilderManager", "Starting new builder for job request\n"); @@ -516,7 +527,7 @@ namespace AssetProcessor builderRef = BuilderRef(newBuilder); } - if (!newBuilder->Start()) + if (!newBuilder->Start(doRegistration)) { AZ_Error("BuilderManager", false, "Builder failed to start"); diff --git a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.h b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.h index 1208345a39..64241b106e 100644 --- a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.h +++ b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.h @@ -39,7 +39,7 @@ namespace AssetProcessor virtual ~BuilderManagerBusTraits() = default; //! Returns a builder for doing work - virtual BuilderRef GetBuilder() = 0; + virtual BuilderRef GetBuilder(bool doRegistration) = 0; }; using BuilderManagerBus = AZ::EBus; @@ -98,12 +98,12 @@ namespace AssetProcessor private: //! Starts the builder process and waits for it to connect - bool Start(); + bool Start(bool doRegistration); //! Sets the connection id and signals that the builder has connected void SetConnection(AZ::u32 connId); - AZStd::vector BuildParams(const char* task, const char* moduleFilePath, const AZStd::string& builderGuid, const AZStd::string& jobDescriptionFile, const AZStd::string& jobResponseFile) const; + AZStd::vector BuildParams(const char* task, const char* moduleFilePath, const AZStd::string& builderGuid, const AZStd::string& jobDescriptionFile, const AZStd::string& jobResponseFile, bool doRegistration) const; AZStd::unique_ptr LaunchProcess(const char* fullExePath, const AZStd::vector& params) const; //! Waits for the builder exe to send the job response and pumps stdout/err @@ -169,7 +169,7 @@ namespace AssetProcessor void ConnectionLost(AZ::u32 connId); //BuilderManagerBus - BuilderRef GetBuilder() override; + BuilderRef GetBuilder(bool doRegistration) override; private: diff --git a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.inl b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.inl index 9893f32f6a..039680dfae 100644 --- a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.inl +++ b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.inl @@ -50,7 +50,7 @@ namespace AssetProcessor if (!netResponse.m_response.Succeeded() || s_createRequestFileForSuccessfulJob) { - // we write the request out to disk for failure or debugging + // we write the request out to disk for failure or debugging if (!DebugWriteRequestFile(tempFolderPath.c_str(), request, task, modulePath)) { return BuilderRunJobOutcome::FailedToWriteDebugRequest; @@ -83,7 +83,7 @@ namespace AssetProcessor return false; } - auto params = BuildParams(task.c_str(), modulePath.c_str(), "", jobRequestFile, jobResponseFile); + auto params = BuildParams(task.c_str(), modulePath.c_str(), "", jobRequestFile, jobResponseFile, false); AZStd::string paramString; AZ::StringFunc::Join(paramString, params.begin(), params.end(), " "); diff --git a/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp b/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp index 7652b67db0..13a6b0699a 100644 --- a/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp @@ -318,16 +318,8 @@ bool GUIApplicationManager::Run() qApp->setQuitOnLastWindowClosed(false); - QTimer::singleShot(0, this, [this]() - { - if (!PostActivate()) - { - QuitRequested(); - m_startedSuccessfully = false; - } - }); - m_duringStartup = false; + m_startedSuccessfully = true; int resultCode = qApp->exec(); // this blocks until the last window is closed. @@ -483,6 +475,7 @@ bool GUIApplicationManager::PostActivate() { if (!ApplicationManagerBase::PostActivate()) { + m_startedSuccessfully = false; return false; } From 2b9d1ca8132085b6bda548bdefb5a49bd3e63340 Mon Sep 17 00:00:00 2001 From: Vincent Liu <5900509+onecent1101@users.noreply.github.com> Date: Tue, 4 Jan 2022 12:45:51 -0800 Subject: [PATCH 246/399] Update to use AWSNativeSDK 1.9.50 (#6618) * Update to use AWSNativeSDK 1.9.50 * After SDK upgrade, some AWS objects are bound to SDK allocator, init AWS SDK for unit test --- .../AWSNativeSDKInit/AWSLogSystemInterface.h | 2 +- .../AWSNativeSDKInit/AWSMemoryInterface.h | 1 + .../AWSNativeSDKInit/AWSNativeSDKInit.h | 2 +- Gems/AWSCore/Code/CMakeLists.txt | 1 + .../Platform/Windows/AWSCore_Traits_Windows.h | 2 +- .../Code/Tests/AWSCoreSystemComponentTest.cpp | 4 + .../AWSCoreConfigurationTest.cpp | 87 +++----------- .../AWSCVarCredentialHandlerTest.cpp | 5 + .../Tests/Credential/AWSCredentialBusTest.cpp | 20 ++-- .../AWSDefaultCredentialHandlerTest.cpp | 16 ++- .../AWSAttributionServiceApiTest.cpp | 4 +- .../AWSCoreAttributionManagerTest.cpp | 21 ++-- .../Framework/AWSApiClientJobConfigTest.cpp | 13 +-- .../Tests/Framework/AWSApiJobConfigTest.cpp | 7 +- .../Tests/Framework/HttpRequestJobTest.cpp | 6 +- .../Tests/Framework/JsonObjectHandlerTest.cpp | 4 +- .../Code/Tests/Framework/JsonWriterTest.cpp | 4 +- .../Tests/Framework/RequestBuilderTest.cpp | 4 +- .../Framework/ServiceClientJobConfigTest.cpp | 8 +- .../Tests/Framework/ServiceJobUtilTest.cpp | 4 +- .../Tests/Framework/ServiceRequestJobTest.cpp | 4 +- .../AWSCore/Code/Tests/Framework/UtilTest.cpp | 4 +- .../AWSResourceMappingManagerTest.cpp | 110 +++++------------- .../AWSResourceMappingUtilsTest.cpp | 4 +- .../AWSScriptBehaviorDynamoDBTest.cpp | 3 +- .../AWSScriptBehaviorLambdaTest.cpp | 6 +- .../ScriptCanvas/AWSScriptBehaviorS3Test.cpp | 13 ++- .../AWSScriptBehaviorsComponentTest.cpp | 5 +- .../Code/Tests/TestFramework/AWSCoreFixture.h | 15 ++- .../Windows/BuiltInPackages_windows.cmake | 2 +- 30 files changed, 143 insertions(+), 238 deletions(-) diff --git a/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSLogSystemInterface.h b/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSLogSystemInterface.h index 4982d3efbd..901e37cd7b 100644 --- a/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSLogSystemInterface.h +++ b/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSLogSystemInterface.h @@ -10,7 +10,7 @@ #if defined(PLATFORM_SUPPORTS_AWS_NATIVE_SDK) -#include +#include AZ_PUSH_DISABLE_WARNING(4251 4996, "-Wunknown-warning-option") #include diff --git a/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSMemoryInterface.h b/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSMemoryInterface.h index 805088563f..26126057e2 100644 --- a/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSMemoryInterface.h +++ b/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSMemoryInterface.h @@ -8,6 +8,7 @@ #pragma once +#include #if defined(PLATFORM_SUPPORTS_AWS_NATIVE_SDK) #include #else diff --git a/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSNativeSDKInit.h b/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSNativeSDKInit.h index 32bf02a247..f50d7002eb 100644 --- a/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSNativeSDKInit.h +++ b/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSNativeSDKInit.h @@ -13,7 +13,7 @@ #include #if defined(PLATFORM_SUPPORTS_AWS_NATIVE_SDK) - +#include // The AWS Native SDK AWSAllocator triggers a warning due to accessing members of std::allocator directly. // AWSAllocator.h(70): warning C4996: 'std::allocator::pointer': warning STL4010: Various members of std::allocator are deprecated in C++17. // Use std::allocator_traits instead of accessing these members directly. diff --git a/Gems/AWSCore/Code/CMakeLists.txt b/Gems/AWSCore/Code/CMakeLists.txt index 974f3f03bf..877696e26c 100644 --- a/Gems/AWSCore/Code/CMakeLists.txt +++ b/Gems/AWSCore/Code/CMakeLists.txt @@ -202,6 +202,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) 3rdParty::Qt::Gui 3rdParty::Qt::Widgets AZ::AzTest + AZ::AWSNativeSDKInit Gem::AWSCore.Static Gem::AWSCore.Editor.Static ) diff --git a/Gems/AWSCore/Code/Platform/Windows/AWSCore_Traits_Windows.h b/Gems/AWSCore/Code/Platform/Windows/AWSCore_Traits_Windows.h index d7b1f32461..2cacfb0d34 100644 --- a/Gems/AWSCore/Code/Platform/Windows/AWSCore_Traits_Windows.h +++ b/Gems/AWSCore/Code/Platform/Windows/AWSCore_Traits_Windows.h @@ -7,4 +7,4 @@ */ #pragma once -#define AWSCORE_BACKWARD_INCOMPATIBLE_CHANGE 0 +#define AWSCORE_BACKWARD_INCOMPATIBLE_CHANGE 1 diff --git a/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp b/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp index 648648e945..b66b43f735 100644 --- a/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp +++ b/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -103,6 +104,9 @@ public: TEST_F(AWSCoreSystemComponentTest, ComponentActivateTest) { + // Shutdown SDK which is init in fixture setup step + AWSNativeSDKInit::InitializationManager::Shutdown(); + EXPECT_FALSE(m_coreSystemsComponent->IsAWSApiInitialized()); // activate component diff --git a/Gems/AWSCore/Code/Tests/Configuration/AWSCoreConfigurationTest.cpp b/Gems/AWSCore/Code/Tests/Configuration/AWSCoreConfigurationTest.cpp index e54a55f728..696dfd25d3 100644 --- a/Gems/AWSCore/Code/Tests/Configuration/AWSCoreConfigurationTest.cpp +++ b/Gems/AWSCore/Code/Tests/Configuration/AWSCoreConfigurationTest.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include @@ -39,12 +38,11 @@ class AWSCoreConfigurationTest : public AWSCoreFixture { public: - void CreateTestSetRegFile(const AZStd::string& setregContent) + AWSCoreConfigurationTest() { - m_normalizedSetRegFilePath = AZStd::string::format("%s/%s", - m_normalizedSetRegFolderPath.c_str(), AWSCore::AWSCoreConfiguration::AWSCoreConfigurationFileName); - AzFramework::StringFunc::Path::Normalize(m_normalizedSetRegFilePath); - CreateTestFile(m_normalizedSetRegFilePath, setregContent); + m_setRegFilePath = (GetTestTempDirectoryPath() / + AZ::SettingsRegistryInterface::RegistryFolder / + AWSCore::AWSCoreConfiguration::AWSCoreConfigurationFileName).LexicallyNormal(); } void SetUp() override @@ -53,22 +51,13 @@ public: m_awsCoreConfiguration = AZStd::make_unique(); - m_normalizedSourceProjectFolder = AZStd::string::format("%s/%s%s/", AZ::Test::GetCurrentExecutablePath().c_str(), - "AWSResourceMappingManager", AZ::Uuid::CreateRandom().ToString(false, false).c_str()); - AzFramework::StringFunc::Path::Normalize(m_normalizedSourceProjectFolder); - m_normalizedSetRegFolderPath = AZStd::string::format("%s/%s/", - m_normalizedSourceProjectFolder.c_str(), AZ::SettingsRegistryInterface::RegistryFolder); - AzFramework::StringFunc::Path::Normalize(m_normalizedSetRegFolderPath); - - m_localFileIO->SetAlias("@projectroot@", m_normalizedSourceProjectFolder.c_str()); - - CreateTestSetRegFile(TEST_VALID_RESOURCE_MAPPING_SETREG); + CreateFile(m_setRegFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_SETREG); + m_localFileIO->SetAlias("@projectroot@", GetTestTempDirectoryPath().Native().c_str()); } void TearDown() override { - RemoveTestFile(); - RemoveTestDirectory(); + RemoveFile(m_setRegFilePath.Native()); m_awsCoreConfiguration.reset(); @@ -76,52 +65,12 @@ public: } AZStd::unique_ptr m_awsCoreConfiguration; - AZStd::string m_normalizedSetRegFilePath; - -private: - AZStd::string m_normalizedSourceProjectFolder; - AZStd::string m_normalizedSetRegFolderPath; - - void CreateTestFile(const AZStd::string& filePath, const AZStd::string& fileContent) - { - AZ::IO::SystemFile file; - if (!file.Open(filePath.c_str(), - AZ::IO::SystemFile::OpenMode::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_CREATE_PATH | AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY)) - { - AZ_Assert(false, "Failed to open test file"); - } - - if (file.Write(fileContent.c_str(), fileContent.size()) != fileContent.size()) - { - AZ_Assert(false, "Failed to write test file"); - } - file.Close(); - } - - void RemoveTestFile() - { - if (!m_normalizedSetRegFilePath.empty()) - { - AZ_Assert(AZ::IO::SystemFile::Delete(m_normalizedSetRegFilePath.c_str()), - "Failed to delete test settings registry file at %s", m_normalizedSetRegFilePath.c_str()); - } - } - - void RemoveTestDirectory() - { - if (!m_normalizedSetRegFilePath.empty()) - { - AZ_Assert(AZ::IO::SystemFile::DeleteDir(m_normalizedSetRegFolderPath.c_str()), - "Failed to delete test settings registry folder at %s", m_normalizedSetRegFolderPath.c_str()); - AZ_Assert(AZ::IO::SystemFile::DeleteDir(m_normalizedSourceProjectFolder.c_str()), - "Failed to delete test folder at %s", m_normalizedSourceProjectFolder.c_str()); - } - } + AZ::IO::Path m_setRegFilePath; }; TEST_F(AWSCoreConfigurationTest, InitConfig_NoSourceProjectFolderFound_ReturnEmptyConfigFilePath) { - m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); + m_settingsRegistry->MergeSettingsFile(m_setRegFilePath.Native(), AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_localFileIO->ClearAlias("@projectroot@"); AZ_TEST_START_TRACE_SUPPRESSION; @@ -134,8 +83,8 @@ TEST_F(AWSCoreConfigurationTest, InitConfig_NoSourceProjectFolderFound_ReturnEmp TEST_F(AWSCoreConfigurationTest, InitConfig_SettingsRegistryIsEmpty_ReturnEmptyConfigFilePath) { - CreateTestSetRegFile(TEST_INVALID_RESOURCE_MAPPING_SETREG); - m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); + CreateFile(m_setRegFilePath.Native(), TEST_INVALID_RESOURCE_MAPPING_SETREG); + m_settingsRegistry->MergeSettingsFile(m_setRegFilePath.Native(), AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_awsCoreConfiguration->InitConfig(); auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); @@ -144,7 +93,7 @@ TEST_F(AWSCoreConfigurationTest, InitConfig_SettingsRegistryIsEmpty_ReturnEmptyC TEST_F(AWSCoreConfigurationTest, InitConfig_LoadValidSettingsRegistry_ReturnNonEmptyConfigFilePath) { - m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); + m_settingsRegistry->MergeSettingsFile(m_setRegFilePath.Native(), AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_awsCoreConfiguration->InitConfig(); auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); @@ -153,7 +102,7 @@ TEST_F(AWSCoreConfigurationTest, InitConfig_LoadValidSettingsRegistry_ReturnNonE TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_NoSourceProjectFolderFound_ReturnEmptyConfigFilePath) { - m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); + m_settingsRegistry->MergeSettingsFile(m_setRegFilePath.Native(), AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_localFileIO->ClearAlias("@projectroot@"); m_awsCoreConfiguration->ReloadConfiguration(); @@ -163,8 +112,8 @@ TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_NoSourceProjectFolderFound_ TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_LoadValidSettingsRegistryAfterInvalidOne_ReturnNonEmptyConfigFilePath) { - CreateTestSetRegFile(TEST_INVALID_RESOURCE_MAPPING_SETREG); - m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); + CreateFile(m_setRegFilePath.Native(), TEST_INVALID_RESOURCE_MAPPING_SETREG); + m_settingsRegistry->MergeSettingsFile(m_setRegFilePath.Native(), AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_awsCoreConfiguration->InitConfig(); auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); @@ -172,7 +121,7 @@ TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_LoadValidSettingsRegistryAf EXPECT_TRUE(actualConfigFilePath.empty()); EXPECT_TRUE(actualProfileName == AWSCoreConfiguration::AWSCoreDefaultProfileName); - CreateTestSetRegFile(TEST_VALID_RESOURCE_MAPPING_SETREG); + CreateFile(m_setRegFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_SETREG); m_awsCoreConfiguration->ReloadConfiguration(); actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); @@ -183,7 +132,7 @@ TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_LoadValidSettingsRegistryAf TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_LoadInvalidSettingsRegistryAfterValidOne_ReturnEmptyConfigFilePath) { - m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); + m_settingsRegistry->MergeSettingsFile(m_setRegFilePath.Native(), AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_awsCoreConfiguration->InitConfig(); auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); @@ -191,7 +140,7 @@ TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_LoadInvalidSettingsRegistry EXPECT_FALSE(actualConfigFilePath.empty()); EXPECT_TRUE(actualProfileName != AWSCoreConfiguration::AWSCoreDefaultProfileName); - CreateTestSetRegFile(TEST_INVALID_RESOURCE_MAPPING_SETREG); + CreateFile(m_setRegFilePath.Native(), TEST_INVALID_RESOURCE_MAPPING_SETREG); m_awsCoreConfiguration->ReloadConfiguration(); actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); diff --git a/Gems/AWSCore/Code/Tests/Credential/AWSCVarCredentialHandlerTest.cpp b/Gems/AWSCore/Code/Tests/Credential/AWSCVarCredentialHandlerTest.cpp index 244c945af9..248737fbe6 100644 --- a/Gems/AWSCore/Code/Tests/Credential/AWSCVarCredentialHandlerTest.cpp +++ b/Gems/AWSCore/Code/Tests/Credential/AWSCVarCredentialHandlerTest.cpp @@ -25,6 +25,11 @@ public: m_credentialHandler = AZStd::make_unique(); } + void TearDown() override + { + m_credentialHandler.reset(); + } + AZStd::unique_ptr m_credentialHandler; }; diff --git a/Gems/AWSCore/Code/Tests/Credential/AWSCredentialBusTest.cpp b/Gems/AWSCore/Code/Tests/Credential/AWSCredentialBusTest.cpp index 82c8c84b81..1b4318f472 100644 --- a/Gems/AWSCore/Code/Tests/Credential/AWSCredentialBusTest.cpp +++ b/Gems/AWSCore/Code/Tests/Credential/AWSCredentialBusTest.cpp @@ -6,8 +6,6 @@ * */ -#include - #include #include @@ -19,14 +17,10 @@ class TestCredentialHandlerOne : AWSCredentialRequestBus::Handler { public: - TestCredentialHandlerOne() + void ActivateHandler() { m_handlerCounter = 0; m_credentialsProvider = std::make_shared(); - } - - void ActivateHandler() - { AWSCredentialRequestBus::Handler::BusConnect(); } @@ -55,14 +49,10 @@ class TestCredentialHandlerTwo : AWSCredentialRequestBus::Handler { public: - TestCredentialHandlerTwo() + void ActivateHandler() { m_handlerCounter = 0; m_credentialsProvider = std::make_shared(); - } - - void ActivateHandler() - { AWSCredentialRequestBus::Handler::BusConnect(); } @@ -88,7 +78,7 @@ public: }; class AWSCredentialBusTest - : public UnitTest::ScopedAllocatorSetupFixture + : public AWSCoreFixture { public: AWSCredentialBusTest() @@ -99,6 +89,8 @@ public: void SetUp() override { + AWSCoreFixture::SetUpFixture(); + m_handlerOne->ActivateHandler(); m_handlerTwo->ActivateHandler(); } @@ -107,6 +99,8 @@ public: { m_handlerOne->DeactivateHandler(); m_handlerTwo->DeactivateHandler(); + + AWSCoreFixture::TearDownFixture(); } AZStd::unique_ptr m_handlerOne; diff --git a/Gems/AWSCore/Code/Tests/Credential/AWSDefaultCredentialHandlerTest.cpp b/Gems/AWSCore/Code/Tests/Credential/AWSDefaultCredentialHandlerTest.cpp index af03afb337..4ff82bcb62 100644 --- a/Gems/AWSCore/Code/Tests/Credential/AWSDefaultCredentialHandlerTest.cpp +++ b/Gems/AWSCore/Code/Tests/Credential/AWSDefaultCredentialHandlerTest.cpp @@ -6,11 +6,9 @@ * */ -#include -#include - #include #include +#include using namespace AWSCore; @@ -18,13 +16,15 @@ static constexpr char AWSDEFAULTCREDENTIALHANDLERTEST_ALLOC_TAG[] = "AWSDefaultC static constexpr const char* AWS_ACCESS_KEY = "AWSACCESSKEY"; static constexpr const char* AWS_SECRET_KEY = "AWSSECRETKEY"; -class EnvironmentAWSCredentialsProviderMock : public Aws::Auth::EnvironmentAWSCredentialsProvider +class EnvironmentAWSCredentialsProviderMock + : public Aws::Auth::EnvironmentAWSCredentialsProvider { public: MOCK_METHOD0(GetAWSCredentials, Aws::Auth::AWSCredentials()); }; -class ProfileConfigFileAWSCredentialsProviderMock : public Aws::Auth::ProfileConfigFileAWSCredentialsProvider +class ProfileConfigFileAWSCredentialsProviderMock + : public Aws::Auth::ProfileConfigFileAWSCredentialsProvider { public: MOCK_METHOD0(GetAWSCredentials, Aws::Auth::AWSCredentials()); @@ -44,7 +44,7 @@ public: }; class AWSDefaultCredentialHandlerTest - : public UnitTest::ScopedAllocatorSetupFixture + : public AWSCoreFixture , public AWSCoreInternalRequestBus::Handler { public: @@ -53,6 +53,8 @@ public: void SetUp() override { + AWSCoreFixture::SetUpFixture(); + AWSCoreInternalRequestBus::Handler::BusConnect(); m_environmentCredentialsProviderMock = Aws::MakeShared(AWSDEFAULTCREDENTIALHANDLERTEST_ALLOC_TAG); m_profileCredentialsProviderMock = Aws::MakeShared(AWSDEFAULTCREDENTIALHANDLERTEST_ALLOC_TAG); @@ -68,6 +70,8 @@ public: m_profileCredentialsProviderMock.reset(); m_environmentCredentialsProviderMock.reset(); AWSCoreInternalRequestBus::Handler::BusDisconnect(); + + AWSCoreFixture::TearDownFixture(); } // AWSCoreInternalRequestBus interface implementation diff --git a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSAttributionServiceApiTest.cpp b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSAttributionServiceApiTest.cpp index 4290713e5c..7ce0290ea3 100644 --- a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSAttributionServiceApiTest.cpp +++ b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSAttributionServiceApiTest.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include using namespace AWSCore; @@ -36,7 +36,7 @@ namespace AWSCoreUnitTest }; class AWSAttributionServiceApiTest - : public UnitTest::ScopedAllocatorSetupFixture + : public AWSCoreFixture { public: testing::NiceMock JsonReader; diff --git a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp index e996e0b9c0..b78bfe29c8 100644 --- a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp +++ b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include #include @@ -23,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -167,7 +165,6 @@ namespace AWSAttributionUnitTest AZStd::unique_ptr m_jobManager; AZStd::array m_resolvedSettingsPath; ModuleManagerRequestBusMock m_moduleManagerRequestBusMock; - AWSCredentialRquestsBusMock m_credentialRequestBusMock; void SetUp() override { @@ -221,6 +218,7 @@ namespace AWSAttributionUnitTest TEST_F(AttributionManagerTest, MetricsSettings_ConsentShown_AttributionDisabled_SkipsSend) { // GIVEN + AWSCredentialRquestsBusMock credentialRequestBusMock; AWSAttributionManagerMock manager; CreateFile(m_resolvedSettingsPath.data(), R"({ @@ -239,7 +237,7 @@ namespace AWSAttributionUnitTest EXPECT_CALL(manager, SubmitMetric(testing::_)).Times(0); EXPECT_CALL(m_moduleManagerRequestBusMock, EnumerateModules(testing::_)).Times(0); - EXPECT_CALL(m_credentialRequestBusMock, GetCredentialsProvider()).Times(1); + EXPECT_CALL(credentialRequestBusMock, GetCredentialsProvider()).Times(1); // WHEN manager.MetricCheck(); @@ -255,6 +253,7 @@ namespace AWSAttributionUnitTest TEST_F(AttributionManagerTest, AttributionEnabled_ContentShown_NoPreviousTimeStamp_SendSuccess) { // GIVEN + AWSCredentialRquestsBusMock credentialRequestBusMock; AWSAttributionManagerMock manager; CreateFile(m_resolvedSettingsPath.data(), R"({ @@ -272,7 +271,7 @@ namespace AWSAttributionUnitTest EXPECT_CALL(manager, SubmitMetric(testing::_)).Times(1); EXPECT_CALL(m_moduleManagerRequestBusMock, EnumerateModules(testing::_)).Times(1); - EXPECT_CALL(m_credentialRequestBusMock, GetCredentialsProvider()).Times(1); + EXPECT_CALL(credentialRequestBusMock, GetCredentialsProvider()).Times(1); // WHEN manager.MetricCheck(); @@ -289,6 +288,7 @@ namespace AWSAttributionUnitTest TEST_F(AttributionManagerTest, AttributionEnabled_ContentShown_ValidPreviousTimeStamp_SendSuccess) { // GIVEN + AWSCredentialRquestsBusMock credentialRequestBusMock; AWSAttributionManagerMock manager; CreateFile(m_resolvedSettingsPath.data(), R"({ @@ -308,7 +308,7 @@ namespace AWSAttributionUnitTest EXPECT_CALL(manager, SubmitMetric(testing::_)).Times(1); EXPECT_CALL(m_moduleManagerRequestBusMock, EnumerateModules(testing::_)).Times(1); - EXPECT_CALL(m_credentialRequestBusMock, GetCredentialsProvider()).Times(1); + EXPECT_CALL(credentialRequestBusMock, GetCredentialsProvider()).Times(1); // WHEN manager.MetricCheck(); @@ -324,6 +324,7 @@ namespace AWSAttributionUnitTest TEST_F(AttributionManagerTest, AttributionEnabled_ContentShown_DelayNotSatisfied_SendFail) { // GIVEN + AWSCredentialRquestsBusMock credentialRequestBusMock; AWSAttributionManagerMock manager; CreateFile(m_resolvedSettingsPath.data(), R"({ @@ -346,7 +347,7 @@ namespace AWSAttributionUnitTest EXPECT_CALL(manager, SubmitMetric(testing::_)).Times(0); EXPECT_CALL(m_moduleManagerRequestBusMock, EnumerateModules(testing::_)).Times(0); - EXPECT_CALL(m_credentialRequestBusMock, GetCredentialsProvider()).Times(1); + EXPECT_CALL(credentialRequestBusMock, GetCredentialsProvider()).Times(1); // WHEN manager.MetricCheck(); @@ -362,6 +363,7 @@ namespace AWSAttributionUnitTest TEST_F(AttributionManagerTest, AttributionEnabledNotFound_ContentShown_SendFail) { // GIVEN + AWSCredentialRquestsBusMock credentialRequestBusMock; AWSAttributionManagerMock manager; CreateFile(m_resolvedSettingsPath.data(), R"({ @@ -378,7 +380,7 @@ namespace AWSAttributionUnitTest EXPECT_CALL(manager, SubmitMetric(testing::_)).Times(0); EXPECT_CALL(m_moduleManagerRequestBusMock, EnumerateModules(testing::_)).Times(0); - EXPECT_CALL(m_credentialRequestBusMock, GetCredentialsProvider()).Times(1); + EXPECT_CALL(credentialRequestBusMock, GetCredentialsProvider()).Times(1); // WHEN manager.MetricCheck(); @@ -394,12 +396,13 @@ namespace AWSAttributionUnitTest TEST_F(AttributionManagerTest, AttributionEnabledNotFound_ContentNotShown_SendFail) { // GIVEN + AWSCredentialRquestsBusMock credentialRequestBusMock; AWSAttributionManagerMock manager; manager.Init(); EXPECT_CALL(manager, SubmitMetric(testing::_)).Times(0); EXPECT_CALL(m_moduleManagerRequestBusMock, EnumerateModules(testing::_)).Times(0); - EXPECT_CALL(m_credentialRequestBusMock, GetCredentialsProvider()).Times(1); + EXPECT_CALL(credentialRequestBusMock, GetCredentialsProvider()).Times(1); EXPECT_CALL(manager, ShowConsentDialog()).Times(1); // WHEN diff --git a/Gems/AWSCore/Code/Tests/Framework/AWSApiClientJobConfigTest.cpp b/Gems/AWSCore/Code/Tests/Framework/AWSApiClientJobConfigTest.cpp index db433062ad..0eca8a37ed 100644 --- a/Gems/AWSCore/Code/Tests/Framework/AWSApiClientJobConfigTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/AWSApiClientJobConfigTest.cpp @@ -6,9 +6,6 @@ * */ -#include - -#include #include #include @@ -19,7 +16,7 @@ using namespace AWSCore; class AWSApiClientJobConfigTest - : public UnitTest::ScopedAllocatorSetupFixture + : public AWSCoreFixture , public AWSCredentialRequestBus::Handler { public: @@ -30,13 +27,9 @@ public: void SetUp() override { - AWSNativeSDKInit::InitializationManager::InitAwsApi(); - m_credentialHandlerCounter = 0; - } + AWSCoreFixture::SetUpFixture(); - void TearDown() override - { - AWSNativeSDKInit::InitializationManager::Shutdown(); + m_credentialHandlerCounter = 0; } // AWSCredentialRequestBus interface implementation diff --git a/Gems/AWSCore/Code/Tests/Framework/AWSApiJobConfigTest.cpp b/Gems/AWSCore/Code/Tests/Framework/AWSApiJobConfigTest.cpp index 6976856b60..8caf0ac013 100644 --- a/Gems/AWSCore/Code/Tests/Framework/AWSApiJobConfigTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/AWSApiJobConfigTest.cpp @@ -8,7 +8,6 @@ #include #include -#include #include @@ -20,14 +19,14 @@ using namespace AWSCore; class AwsApiJobConfigTest - : public UnitTest::ScopedAllocatorSetupFixture + : public AWSCoreFixture , AWSCredentialRequestBus::Handler , AWSCoreRequestBus::Handler { public: void SetUp() override { - AZ::AllocatorInstance::Create(); + AWSCoreFixture::SetUpFixture(); m_credentialsHandler = std::make_shared(); AZ::JobManagerDesc jobDesc; @@ -45,7 +44,7 @@ public: m_jobManager.reset(); m_credentialsHandler.reset(); - AZ::AllocatorInstance::Destroy(); + AWSCoreFixture::TearDownFixture(); } // AWSCredentialRequestBus interface implementation diff --git a/Gems/AWSCore/Code/Tests/Framework/HttpRequestJobTest.cpp b/Gems/AWSCore/Code/Tests/Framework/HttpRequestJobTest.cpp index e04cdcb2d9..cee5ec0624 100644 --- a/Gems/AWSCore/Code/Tests/Framework/HttpRequestJobTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/HttpRequestJobTest.cpp @@ -6,24 +6,24 @@ * */ -#include - #include #include using namespace AWSCore; class HttpRequestJobTest - : public UnitTest::ScopedAllocatorSetupFixture + : public AWSCoreFixture { void SetUp() override { + AWSCoreFixture::SetUpFixture(); HttpRequestJob::StaticInit(); } void TearDown() override { HttpRequestJob::StaticShutdown(); + AWSCoreFixture::TearDownFixture(); } }; diff --git a/Gems/AWSCore/Code/Tests/Framework/JsonObjectHandlerTest.cpp b/Gems/AWSCore/Code/Tests/Framework/JsonObjectHandlerTest.cpp index f7b1546561..49e77be35f 100644 --- a/Gems/AWSCore/Code/Tests/Framework/JsonObjectHandlerTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/JsonObjectHandlerTest.cpp @@ -6,8 +6,6 @@ * */ -#include - #include #include @@ -18,7 +16,7 @@ using OBJECT_TYPE = TestObject; using ARRAY_TYPE = AZStd::vector; using ARRAY_OF_ARRAY_TYPE = AZStd::vector>; using ARRAY_OF_OBJECT_TYPE = AZStd::vector>; -using JsonReaderTest = UnitTest::ScopedAllocatorSetupFixture; +using JsonReaderTest = AWSCoreFixture; template void TestJsonReaderSuccess(const ValueType& expectedValue, const char* valueString) diff --git a/Gems/AWSCore/Code/Tests/Framework/JsonWriterTest.cpp b/Gems/AWSCore/Code/Tests/Framework/JsonWriterTest.cpp index 12ada1188c..9a08e6f111 100644 --- a/Gems/AWSCore/Code/Tests/Framework/JsonWriterTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/JsonWriterTest.cpp @@ -6,8 +6,6 @@ * */ -#include - #include #include @@ -17,7 +15,7 @@ using namespace AWSCoreTestingUtils; using OBJECT_TYPE = TestObject; using ARRAY_TYPE = AZStd::vector; -using JsonWriterTest = UnitTest::ScopedAllocatorSetupFixture; +using JsonWriterTest = AWSCoreFixture; template void TestJsonWriterSuccess(const ValueType& actualValue, const char* valueString) diff --git a/Gems/AWSCore/Code/Tests/Framework/RequestBuilderTest.cpp b/Gems/AWSCore/Code/Tests/Framework/RequestBuilderTest.cpp index 0c08868100..35ce262f30 100644 --- a/Gems/AWSCore/Code/Tests/Framework/RequestBuilderTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/RequestBuilderTest.cpp @@ -6,15 +6,13 @@ * */ -#include - #include #include using namespace AWSCore; using namespace AWSCoreTestingUtils; -using RequestBuilderTest = UnitTest::ScopedAllocatorSetupFixture; +using RequestBuilderTest = AWSCoreFixture; TEST_F(RequestBuilderTest, WriteJsonBodyParameter_UseTestJsonBody_GetExpectedValue) { diff --git a/Gems/AWSCore/Code/Tests/Framework/ServiceClientJobConfigTest.cpp b/Gems/AWSCore/Code/Tests/Framework/ServiceClientJobConfigTest.cpp index 9bc43482cd..3907b097db 100644 --- a/Gems/AWSCore/Code/Tests/Framework/ServiceClientJobConfigTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/ServiceClientJobConfigTest.cpp @@ -6,8 +6,6 @@ * */ -#include - #include #include #include @@ -19,17 +17,21 @@ static constexpr const char TEST_EXPECTED_FEATURE_SERVICE_URL[] = "https://featu static constexpr const char TEST_EXPECTED_CUSTOM_SERVICE_URL[] = "https://custom.service.com"; class ServiceClientJobConfigTest - : public UnitTest::ScopedAllocatorSetupFixture + : public AWSCoreFixture , AWSResourceMappingRequestBus::Handler { void SetUp() override { + AWSCoreFixture::SetUpFixture(); + AWSResourceMappingRequestBus::Handler::BusConnect(); } void TearDown() override { AWSResourceMappingRequestBus::Handler::BusDisconnect(); + + AWSCoreFixture::TearDownFixture(); } // AWSResourceMappingRequestBus interface implementation diff --git a/Gems/AWSCore/Code/Tests/Framework/ServiceJobUtilTest.cpp b/Gems/AWSCore/Code/Tests/Framework/ServiceJobUtilTest.cpp index 230fd304d2..c162a0fa13 100644 --- a/Gems/AWSCore/Code/Tests/Framework/ServiceJobUtilTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/ServiceJobUtilTest.cpp @@ -6,12 +6,10 @@ * */ -#include - #include #include -using ServiceJobUtilTest = UnitTest::ScopedAllocatorSetupFixture; +using ServiceJobUtilTest = AWSCoreFixture; TEST_F(ServiceJobUtilTest, DetermineRegionFromRequestUrl_DefaultUrlFormat_Success) { diff --git a/Gems/AWSCore/Code/Tests/Framework/ServiceRequestJobTest.cpp b/Gems/AWSCore/Code/Tests/Framework/ServiceRequestJobTest.cpp index bf4f6dd4fd..23fa78cc23 100644 --- a/Gems/AWSCore/Code/Tests/Framework/ServiceRequestJobTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/ServiceRequestJobTest.cpp @@ -6,15 +6,13 @@ * */ -#include - #include #include #include using namespace AWSCore; -using ServiceRequestJobTest = UnitTest::ScopedAllocatorSetupFixture; +using ServiceRequestJobTest = AWSCoreFixture; #define TEST_SERVICE_REQUEST(SERVICE_NAME, METHOD, PATH) \ static const char* Path() { return PATH; } \ diff --git a/Gems/AWSCore/Code/Tests/Framework/UtilTest.cpp b/Gems/AWSCore/Code/Tests/Framework/UtilTest.cpp index 5a1589c073..a0320a894c 100644 --- a/Gems/AWSCore/Code/Tests/Framework/UtilTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/UtilTest.cpp @@ -6,14 +6,12 @@ * */ -#include - #include #include using namespace AWSCoreTestingUtils; -using FrameworkUtilTest = UnitTest::ScopedAllocatorSetupFixture; +using FrameworkUtilTest = AWSCoreFixture; TEST_F(FrameworkUtilTest, ToAwsString_UseAzString_GetExpectedAwsString) { diff --git a/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp b/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp index fd37e6e228..6c798dbeca 100644 --- a/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp +++ b/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include @@ -112,31 +111,21 @@ public: m_resourceMappingManager = AZStd::make_unique(); } - void CreateTestConfigFile(const AZStd::string& configContent) - { - m_normalizedConfigFilePath = AZStd::string::format("%s/%s", m_normalizedConfigFolderPath.c_str(), "test_aws_resource_mappings.json"); - AzFramework::StringFunc::Path::Normalize(m_normalizedConfigFilePath); - CreateTestFile(m_normalizedConfigFilePath, configContent); - } - void SetUp() override { AWSCoreFixture::SetUpFixture(false); - m_normalizedSourceProjectFolder = AZStd::string::format("%s/%s%s/", AZ::Test::GetCurrentExecutablePath().c_str(), - "AWSResourceMappingManager", AZ::Uuid::CreateRandom().ToString(false, false).c_str()); - AzFramework::StringFunc::Path::Normalize(m_normalizedSourceProjectFolder); - m_normalizedConfigFolderPath = AZStd::string::format("%s/%s/", - m_normalizedSourceProjectFolder.c_str(), AWSCore::AWSCoreConfiguration::AWSCoreResourceMappingConfigFolderName); - AzFramework::StringFunc::Path::Normalize(m_normalizedConfigFolderPath); + m_configFilePath = (GetTestTempDirectoryPath() / + AWSCore::AWSCoreConfiguration::AWSCoreResourceMappingConfigFolderName / + "test_aws_resource_mappings.json").LexicallyNormal(); AWSCoreInternalRequestBus::Handler::BusConnect(); } void TearDown() override { AWSCoreInternalRequestBus::Handler::BusDisconnect(); - RemoveTestFile(); - RemoveTestDirectory(); + RemoveFile(m_configFilePath.Native()); + m_configFilePath.clear(); m_reloadConfigurationCounter = 0; m_resourceMappingManager->DeactivateManager(); @@ -147,57 +136,17 @@ public: // AWSCoreInternalRequestBus interface implementation AZStd::string GetProfileName() const override { return ""; } - AZStd::string GetResourceMappingConfigFilePath() const override { return m_normalizedConfigFilePath; } + AZStd::string GetResourceMappingConfigFilePath() const override { return m_configFilePath.Native(); } void ReloadConfiguration() override { m_reloadConfigurationCounter++; } AZStd::unique_ptr m_resourceMappingManager; AZ::u8 m_reloadConfigurationCounter; - -private: - AZStd::string m_normalizedSourceProjectFolder; - AZStd::string m_normalizedConfigFolderPath; - AZStd::string m_normalizedConfigFilePath; - - void CreateTestFile(const AZStd::string& filePath, const AZStd::string& fileContent) - { - AZ::IO::SystemFile file; - if (!file.Open(filePath.c_str(), - AZ::IO::SystemFile::OpenMode::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_CREATE_PATH | AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY)) - { - AZ_Assert(false, "Failed to open test file"); - } - - if (file.Write(fileContent.c_str(), fileContent.size()) != fileContent.size()) - { - AZ_Assert(false, "Failed to write test file"); - } - file.Close(); - } - - void RemoveTestFile() - { - if (!m_normalizedConfigFilePath.empty()) - { - AZ_Assert(AZ::IO::SystemFile::Delete(m_normalizedConfigFilePath.c_str()), - "Failed to delete test config file at %s", m_normalizedConfigFilePath.c_str()); - } - } - - void RemoveTestDirectory() - { - if (!m_normalizedConfigFilePath.empty()) - { - AZ_Assert(AZ::IO::SystemFile::DeleteDir(m_normalizedConfigFolderPath.c_str()), - "Failed to delete test config folder at %s", m_normalizedConfigFolderPath.c_str()); - AZ_Assert(AZ::IO::SystemFile::DeleteDir(m_normalizedSourceProjectFolder.c_str()), - "Failed to delete test folder at %s", m_normalizedSourceProjectFolder.c_str()); - } - } + AZ::IO::Path m_configFilePath; }; TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseInvalidConfigFile_ConfigDataIsEmpty) { - CreateTestConfigFile(TEST_INVALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_INVALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -212,7 +161,7 @@ TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseInvalidConfigFile_Con TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseValidConfigFile_ConfigDataIsNotEmpty) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -227,7 +176,7 @@ TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseValidConfigFile_Confi TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseTemplateConfigFile_ConfigDataIsNotEmpty) { - CreateTestConfigFile(TEST_TEMPLATE_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_TEMPLATE_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -242,7 +191,7 @@ TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseTemplateConfigFile_Co TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseValidConfigFile_ConfigDataIsNotEmptyWithMultithreadCalls) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); constexpr int testThreadNumber = 10; @@ -267,7 +216,7 @@ TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseValidConfigFile_Confi TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseValidConfigFile_GlobalAccountIdEmpty) { - CreateTestConfigFile(TEST_VALID_EMPTY_ACCOUNTID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_EMPTY_ACCOUNTID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -282,7 +231,7 @@ TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseValidConfigFile_Globa TEST_F(AWSResourceMappingManagerTest, DeactivateManager_AfterActivatingWithValidConfigFile_ConfigDataGetCleanedUp) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -302,7 +251,7 @@ TEST_F(AWSResourceMappingManagerTest, DeactivateManager_AfterActivatingWithValid TEST_F(AWSResourceMappingManagerTest, GetDefaultAccountId_AfterParsingValidConfigFile_GetExpectedDefaultAccountId) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -313,7 +262,7 @@ TEST_F(AWSResourceMappingManagerTest, GetDefaultAccountId_AfterParsingValidConfi TEST_F(AWSResourceMappingManagerTest, GetDefaultRegion_AfterParsingValidConfigFile_GetExpectedDefaultRegion) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualRegion; @@ -324,7 +273,7 @@ TEST_F(AWSResourceMappingManagerTest, GetDefaultRegion_AfterParsingValidConfigFi TEST_F(AWSResourceMappingManagerTest, GetResourceAccountId_AfterParsingValidConfigFile_GetExpectedAccountId) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -341,7 +290,7 @@ TEST_F(AWSResourceMappingManagerTest, GetResourceAccountId_AfterParsingValidConf TEST_F(AWSResourceMappingManagerTest, GetResourceAccountId_QueryNonexistResourceMappingKeyName_GetEmptyAccountId) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -352,7 +301,7 @@ TEST_F(AWSResourceMappingManagerTest, GetResourceAccountId_QueryNonexistResource TEST_F(AWSResourceMappingManagerTest, GetResourceNameId_AfterParsingValidConfigFile_GetExpectedNameId) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualNameId; @@ -369,7 +318,7 @@ TEST_F(AWSResourceMappingManagerTest, GetResourceNameId_AfterParsingValidConfigF TEST_F(AWSResourceMappingManagerTest, GetResourceNameId_QueryNonexistResourceMappingKeyName_GetEmptyNameId) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualNameId; @@ -380,7 +329,7 @@ TEST_F(AWSResourceMappingManagerTest, GetResourceNameId_QueryNonexistResourceMap TEST_F(AWSResourceMappingManagerTest, GetResourceRegion_AfterParsingValidConfigFile_GetExpectedRegion) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualRegion; @@ -397,7 +346,7 @@ TEST_F(AWSResourceMappingManagerTest, GetResourceRegion_AfterParsingValidConfigF TEST_F(AWSResourceMappingManagerTest, GetResourceRegion_QueryNonexistResourceMappingKeyName_GetEmptyRegion) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualRegion; @@ -408,7 +357,7 @@ TEST_F(AWSResourceMappingManagerTest, GetResourceRegion_QueryNonexistResourceMap TEST_F(AWSResourceMappingManagerTest, GetResourceType_AfterParsingValidConfigFile_GetExpectedType) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualType; @@ -425,7 +374,7 @@ TEST_F(AWSResourceMappingManagerTest, GetResourceType_AfterParsingValidConfigFil TEST_F(AWSResourceMappingManagerTest, GetResourceType_QueryNonexistResourceMappingKeyName_GetEmptyType) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualType; @@ -436,7 +385,7 @@ TEST_F(AWSResourceMappingManagerTest, GetResourceType_QueryNonexistResourceMappi TEST_F(AWSResourceMappingManagerTest, GetServiceUrl_PassingEmptyServiceName_GetEmptyUrl) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualServiceUrl; @@ -447,7 +396,7 @@ TEST_F(AWSResourceMappingManagerTest, GetServiceUrl_PassingEmptyServiceName_GetE TEST_F(AWSResourceMappingManagerTest, GetServiceUrl_PassingEmptyRESTApiIdAndStage_GetEmptyUrl) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualServiceUrl; @@ -458,7 +407,7 @@ TEST_F(AWSResourceMappingManagerTest, GetServiceUrl_PassingEmptyRESTApiIdAndStag TEST_F(AWSResourceMappingManagerTest, GetServiceUrl_RESTApiIdAndStageHaveInconsistentRegion_GetEmptyUrl) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualServiceUrl; @@ -469,7 +418,7 @@ TEST_F(AWSResourceMappingManagerTest, GetServiceUrl_RESTApiIdAndStageHaveInconsi TEST_F(AWSResourceMappingManagerTest, ReloadConfigFile_ParseValidConfigFileAfterParsingInvalid_ConfigDataGetParsed) { - CreateTestConfigFile(TEST_INVALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_INVALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -481,7 +430,7 @@ TEST_F(AWSResourceMappingManagerTest, ReloadConfigFile_ParseValidConfigFileAfter EXPECT_TRUE(actualRegion.empty()); EXPECT_TRUE(m_resourceMappingManager->GetStatus() == AWSResourceMappingManager::Status::Error); - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ReloadConfigFile(); AWSResourceMappingRequestBus::BroadcastResult(actualAccountId, &AWSResourceMappingRequests::GetDefaultAccountId); @@ -494,7 +443,7 @@ TEST_F(AWSResourceMappingManagerTest, ReloadConfigFile_ParseValidConfigFileAfter TEST_F(AWSResourceMappingManagerTest, ReloadConfigFile_ReloadConfigFileNameAndParseValidConfigFile_ConfigDataGetParsed) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ReloadConfigFile(true); EXPECT_EQ(m_reloadConfigurationCounter, 1); @@ -505,6 +454,7 @@ TEST_F(AWSResourceMappingManagerTest, ReloadConfigFile_ReloadConfigFileNameAndPa TEST_F(AWSResourceMappingManagerTest, ReloadConfigFile_MissingSetRegFile_ConfigDataIsNotParsed) { + m_configFilePath.clear(); m_resourceMappingManager->ReloadConfigFile(true); EXPECT_EQ(m_reloadConfigurationCounter, 1); diff --git a/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingUtilsTest.cpp b/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingUtilsTest.cpp index f1a90aa2ae..f5215f89c2 100644 --- a/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingUtilsTest.cpp +++ b/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingUtilsTest.cpp @@ -6,8 +6,6 @@ * */ -#include - #include #include @@ -18,7 +16,7 @@ static constexpr const char TEST_VALID_RESTAPI_REGION[] = "us-west-2"; static constexpr const char TEST_VALID_RESTAPI_CHINA_REGION[] = "cn-north-1"; static constexpr const char TEST_VALID_RESTAPI_STAGE[] = "prod"; -using AWSResourceMappingUtilsTest = UnitTest::ScopedAllocatorSetupFixture; +using AWSResourceMappingUtilsTest = AWSCoreFixture; TEST_F(AWSResourceMappingUtilsTest, FormatRESTApiUrl_PassingValidArguments_ReturnExpectedResult) { diff --git a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorDynamoDBTest.cpp b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorDynamoDBTest.cpp index e42e270bc2..bd66ccb309 100644 --- a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorDynamoDBTest.cpp +++ b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorDynamoDBTest.cpp @@ -7,7 +7,6 @@ */ #include -#include #include #include @@ -32,7 +31,7 @@ public: MOCK_METHOD1(OnGetItemError, void(const AZStd::string&)); }; -using AWSScriptBehaviorDynamoDBTest = UnitTest::ScopedAllocatorSetupFixture; +using AWSScriptBehaviorDynamoDBTest = AWSCoreFixture; TEST_F(AWSScriptBehaviorDynamoDBTest, GetItemRaw_CallWithEmptyTableName_InvokeOnError) { diff --git a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorLambdaTest.cpp b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorLambdaTest.cpp index 42ccd6eddc..0b2dc8e30c 100644 --- a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorLambdaTest.cpp +++ b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorLambdaTest.cpp @@ -7,14 +7,14 @@ */ #include -#include #include #include using namespace AWSCore; -class AWSScriptBehaviorLambdaNotificationBusHandlerMock : public AWSScriptBehaviorLambdaNotificationBusHandler +class AWSScriptBehaviorLambdaNotificationBusHandlerMock + : public AWSScriptBehaviorLambdaNotificationBusHandler { public: AWSScriptBehaviorLambdaNotificationBusHandlerMock() @@ -31,7 +31,7 @@ public: MOCK_METHOD1(OnInvokeError, void(const AZStd::string&)); }; -using AWSScriptBehaviorLambdaTest = UnitTest::ScopedAllocatorSetupFixture; +using AWSScriptBehaviorLambdaTest = AWSCoreFixture; TEST_F(AWSScriptBehaviorLambdaTest, InvokeRaw_CallWithEmptyFunctionName_InvokeOnError) { diff --git a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorS3Test.cpp b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorS3Test.cpp index 34a0166e32..da754a0de6 100644 --- a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorS3Test.cpp +++ b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorS3Test.cpp @@ -145,17 +145,18 @@ TEST_F(AWSScriptBehaviorS3Test, GetObjectRaw_CallWithOutfileDirectoryNoExist_Inv AWSScriptBehaviorS3::GetObjectRaw("dummyBucket", "dummyObject", "dummyRegion", dummyDirectory); } +#if defined(AZ_DEBUG_BUILD) || defined(AZ_PROFILE_BUILD) +// The preparation step for this test case does not work in release mode TEST_F(AWSScriptBehaviorS3Test, GetObjectRaw_CallWithOutfileIsReadOnly_InvokeOnError) { AWSScriptBehaviorS3NotificationBusHandlerMock s3HandlerMock; EXPECT_CALL(s3HandlerMock, OnGetObjectError(::testing::_)).Times(1); - AZStd::string randomTestFile = AZStd::string::format("%s/test%s.txt", - AZ::Test::GetCurrentExecutablePath().c_str(), AZ::Uuid::CreateRandom().ToString(false, false).c_str()); - AzFramework::StringFunc::Path::Normalize(randomTestFile); - CreateReadOnlyTestFile(randomTestFile); - AWSScriptBehaviorS3::GetObjectRaw("dummyBucket", "dummyObject", "dummyRegion", randomTestFile); - RemoveReadOnlyTestFile(randomTestFile); + AZ::IO::Path randomTestFilePath = (GetTestTempDirectoryPath() / "random_test.txt").LexicallyNormal(); + CreateReadOnlyTestFile(randomTestFilePath.Native()); + AWSScriptBehaviorS3::GetObjectRaw("dummyBucket", "dummyObject", "dummyRegion", randomTestFilePath.Native()); + RemoveReadOnlyTestFile(randomTestFilePath.Native()); } +#endif TEST_F(AWSScriptBehaviorS3Test, GetObject_NoBucketNameInResourceMappingFound_InvokeOnError) { diff --git a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorsComponentTest.cpp b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorsComponentTest.cpp index caba8b5ae7..387aa932f6 100644 --- a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorsComponentTest.cpp +++ b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorsComponentTest.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -17,11 +16,12 @@ using namespace AWSCore; class AWSScriptBehaviorsComponentTest - : public UnitTest::ScopedAllocatorSetupFixture + : public AWSCoreFixture { public: void SetUp() override { + AWSCoreFixture::SetUpFixture(); m_serializeContext = AZStd::make_unique(); m_serializeContext->CreateEditContext(); m_behaviorContext = AZStd::make_unique(); @@ -39,6 +39,7 @@ public: m_componentDescriptor.reset(); m_behaviorContext.reset(); m_serializeContext.reset(); + AWSCoreFixture::TearDownFixture(); } protected: diff --git a/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h b/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h index 65e609b490..6ea5593d0e 100644 --- a/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h +++ b/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h @@ -17,6 +17,8 @@ #include #include +#include + namespace AWSCoreTestingUtils { static const AZStd::string STRING_VALUE{"s"}; @@ -135,6 +137,8 @@ public: { m_app = AZStd::make_unique(); } + + AWSNativeSDKInit::InitializationManager::InitAwsApi(); } void TearDown() override @@ -144,6 +148,8 @@ public: void TearDownFixture(bool mockSettingsRegistry = true) { + AWSNativeSDKInit::InitializationManager::Shutdown(); + if (mockSettingsRegistry) { AZ::SettingsRegistry::Unregister(m_settingsRegistry.get()); @@ -171,7 +177,7 @@ public: bool CreateFile(const AZStd::string& filePath, const AZStd::string& content) { AZ::IO::HandleType fileHandle; - if (!m_localFileIO->Open(filePath.c_str(), AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeText, fileHandle)) + if (!m_localFileIO->Open(filePath.c_str(), AZ::IO::OpenMode::ModeCreatePath | AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeText, fileHandle)) { return false; } @@ -197,6 +203,13 @@ private: AZ::IO::FileIOBase* m_otherFileIO = nullptr; protected: + AZ::IO::Path GetTestTempDirectoryPath() + { + AZ::IO::Path testTempDirPath{ m_testTempDirectory.GetDirectory() }; + return testTempDirPath; + } + + AZ::Test::ScopedAutoTempDirectory m_testTempDirectory; AZStd::unique_ptr m_settingsRegistry; AZStd::unique_ptr m_app; }; diff --git a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake index 90d44a3658..5441bcd76f 100644 --- a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake +++ b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake @@ -26,7 +26,7 @@ ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxc-1.6.2104-o3de-rev3-wi ly_associate_package(PACKAGE_NAME SPIRVCross-2021.04.29-rev1-windows TARGETS SPIRVCross PACKAGE_HASH 7d601ea9d625b1d509d38bd132a1f433d7e895b16adab76bac6103567a7a6817) ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-rev3-windows TARGETS TIFF PACKAGE_HASH c6000a906e6d2a0816b652e93dfbeab41c9ed73cdd5a613acd53e553d0510b60) ly_associate_package(PACKAGE_NAME freetype-2.10.4.16-windows TARGETS freetype PACKAGE_HASH 9809255f1c59b07875097aa8d8c6c21c97c47a31fb35e30f2bb93188e99a85ff) -ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev4-windows TARGETS AWSNativeSDK PACKAGE_HASH a900e80f7259e43aed5c847afee2599ada37f29db70505481397675bcbb6c76c) +ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.9.50-rev2-windows TARGETS AWSNativeSDK PACKAGE_HASH 047de23fa57d33196666c22f45afc9c628bae354a6c39d774cbeee8054b2eb53) ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev5-windows TARGETS Lua PACKAGE_HASH 136faccf1f73891e3fa3b95f908523187792e56f5b92c63c6a6d7e72d1158d40) ly_associate_package(PACKAGE_NAME PhysX-4.1.2.29882248-rev5-windows TARGETS PhysX PACKAGE_HASH 4e31a3e1f5bf3952d8af8e28d1a29f04167995a6362fc3a7c20c25f74bf01e23) ly_associate_package(PACKAGE_NAME mcpp-2.7.2_az.2-rev1-windows TARGETS mcpp PACKAGE_HASH 794789aba639bfe2f4e8fcb4424d679933dd6290e523084aa0a4e287ac44acb2) From 641037e30c11cac03cb67066cef502c2062d2149 Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Tue, 4 Jan 2022 15:40:10 -0600 Subject: [PATCH 247/399] Revert "added pass class (#6244)" This reverts commit 515e363151185c1270838f8155cf08e198549ed5. Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- .../Assets/Passes/DiffuseComposite.pass | 2 +- .../Code/Source/CommonSystemComponent.cpp | 2 - .../DiffuseCompositePass.cpp | 45 ------------------- .../DiffuseCompositePass.h | 36 --------------- .../Code/atom_feature_common_files.cmake | 2 - 5 files changed, 1 insertion(+), 86 deletions(-) delete mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp delete mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.h diff --git a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseComposite.pass b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseComposite.pass index 3ad5c06c90..615ee8a162 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseComposite.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseComposite.pass @@ -5,7 +5,7 @@ "ClassData": { "PassTemplate": { "Name": "DiffuseCompositePassTemplate", - "PassClass": "DiffuseCompositePass", + "PassClass": "FullScreenTriangle", "Slots": [ { "Name": "DownsampledIrradianceInput", diff --git a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp index 04098f5c20..a06defff08 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp @@ -96,7 +96,6 @@ #include #include #include -#include #include #include #include @@ -279,7 +278,6 @@ namespace AZ passSystem->AddPassCreator(Name("DiffuseProbeGridClassificationPass"), &Render::DiffuseProbeGridClassificationPass::Create); passSystem->AddPassCreator(Name("DiffuseProbeGridDownsamplePass"), &Render::DiffuseProbeGridDownsamplePass::Create); passSystem->AddPassCreator(Name("DiffuseProbeGridRenderPass"), &Render::DiffuseProbeGridRenderPass::Create); - passSystem->AddPassCreator(Name("DiffuseCompositePass"), &Render::DiffuseCompositePass::Create); passSystem->AddPassCreator(Name("LuminanceHistogramGeneratorPass"), &LuminanceHistogramGeneratorPass::Create); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp deleted file mode 100644 index 0b0dfda391..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include - -namespace AZ -{ - namespace Render - { - // --- Dedicated class for disabling --- - - RPI::Ptr DiffuseCompositePass::Create(const RPI::PassDescriptor& descriptor) - { - RPI::Ptr pass = aznew DiffuseCompositePass(descriptor); - return AZStd::move(pass); - } - - DiffuseCompositePass::DiffuseCompositePass(const RPI::PassDescriptor& descriptor) - : RPI::FullscreenTrianglePass(descriptor) - { } - - bool DiffuseCompositePass::IsEnabled() const - { - const RPI::Scene* scene = GetScene(); - if (!scene) - { - return false; - } - DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = - scene->GetFeatureProcessor(); - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) - { - // no diffuse probe grids - return false; - } - return true; - } - } // namespace Render -} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.h deleted file mode 100644 index 333c66ebea..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - -#include - -namespace AZ -{ - namespace Render - { - //! A class for DiffuseComposite to allow for disabling - class DiffuseCompositePass final - : public RPI::FullscreenTrianglePass - { - AZ_RPI_PASS(DiffuseCompositePass); - - public: - AZ_RTTI(DiffuseCompositePass, "{F3DBEBCB-66F8-465C-A06B-DFA76B9D4856}", AZ::RPI::FullscreenTrianglePass); - AZ_CLASS_ALLOCATOR(DiffuseCompositePass, SystemAllocator, 0); - - ~DiffuseCompositePass() = default; - static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); - - bool IsEnabled() const override; - - private: - DiffuseCompositePass(const RPI::PassDescriptor& descriptor); - - }; - } // namespace Render -} // namespace AZ \ No newline at end of file diff --git a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake index 952085e136..375dbd9724 100644 --- a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake +++ b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake @@ -134,8 +134,6 @@ set(FILES Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.h Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.h - Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp - Source/DiffuseGlobalIllumination/DiffuseCompositePass.h Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h Source/DiffuseGlobalIllumination/DiffuseProbeGridTextureReadback.cpp From c83bf11a3d81d848d11bfbca56c7ebcc68afbbd4 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Tue, 4 Jan 2022 14:21:06 -0800 Subject: [PATCH 248/399] on demand reflect az events when they are the return value of ebuses (#6625) Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../View/Widgets/NodePalette/NodePaletteModel.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp index 0efdf071f5..113c43682f 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp @@ -1159,7 +1159,7 @@ namespace ScriptCanvasEditor , AZStd::string_view eventName , const ScriptCanvas::EBusBusId& busId , const ScriptCanvas::EBusEventId& eventId - , const AZ::BehaviorEBusEventSender& + , const AZ::BehaviorEBusEventSender& sender , ScriptCanvas::PropertyStatus propertyStatus , bool isOverload) { @@ -1193,6 +1193,17 @@ namespace ScriptCanvasEditor senderInformation->m_displayName = details.m_name.empty() ? eventName : details.m_name.c_str(); senderInformation->m_toolTip = details.m_tooltip.empty() ? "" : details.m_tooltip; + auto safeRegister = [](AZ::BehaviorMethod* method) + { + if (method && AZ::MethodReturnsAzEventByReferenceOrPointer(*method)) + { + const AZ::BehaviorParameter* resultParameter = method->GetResult(); + ScriptCanvas::ReflectEventTypeOnDemand(resultParameter->m_typeId, resultParameter->m_name, resultParameter->m_azRtti); + } + }; + + safeRegister(sender.m_event); + safeRegister(sender.m_broadcast); m_registeredNodes.emplace(AZStd::make_pair(nodeIdentifier, senderInformation)); } } From c773c9e9aa512062f097ecf3cbb4211500e462a6 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 4 Jan 2022 16:39:04 -0600 Subject: [PATCH 249/399] Removed some unused classes from Editor/Controls Signed-off-by: Chris Galvan --- Code/Editor/Controls/ConsoleSCBMFC.h | 111 ---- Code/Editor/Controls/ConsoleSCBMFC.ui | 132 ----- Code/Editor/Controls/HotTrackingTreeCtrl.cpp | 48 -- Code/Editor/Controls/HotTrackingTreeCtrl.h | 33 -- Code/Editor/Controls/ImageListCtrl.cpp | 567 ------------------- Code/Editor/Controls/ImageListCtrl.h | 97 ---- Code/Editor/Controls/MultiMonHelper.cpp | 67 --- Code/Editor/Controls/MultiMonHelper.h | 44 -- Code/Editor/Controls/NumberCtrl.cpp | 143 ----- Code/Editor/Controls/NumberCtrl.h | 64 --- Code/Editor/Controls/TextEditorCtrl.cpp | 93 --- Code/Editor/Controls/TextEditorCtrl.h | 42 -- Code/Editor/Controls/TreeCtrlUtils.h | 322 ----------- Code/Editor/EditorPanelUtils.cpp | 542 ------------------ Code/Editor/EditorPanelUtils.h | 16 - Code/Editor/IEditor.h | 3 - Code/Editor/IEditorImpl.cpp | 13 - Code/Editor/IEditorImpl.h | 2 - Code/Editor/IEditorPanelUtils.h | 131 ----- Code/Editor/Lib/Tests/IEditorMock.h | 1 - Code/Editor/editor_lib_files.cmake | 14 - 21 files changed, 2485 deletions(-) delete mode 100644 Code/Editor/Controls/ConsoleSCBMFC.h delete mode 100644 Code/Editor/Controls/ConsoleSCBMFC.ui delete mode 100644 Code/Editor/Controls/HotTrackingTreeCtrl.cpp delete mode 100644 Code/Editor/Controls/HotTrackingTreeCtrl.h delete mode 100644 Code/Editor/Controls/ImageListCtrl.cpp delete mode 100644 Code/Editor/Controls/ImageListCtrl.h delete mode 100644 Code/Editor/Controls/MultiMonHelper.cpp delete mode 100644 Code/Editor/Controls/MultiMonHelper.h delete mode 100644 Code/Editor/Controls/NumberCtrl.cpp delete mode 100644 Code/Editor/Controls/NumberCtrl.h delete mode 100644 Code/Editor/Controls/TextEditorCtrl.cpp delete mode 100644 Code/Editor/Controls/TextEditorCtrl.h delete mode 100644 Code/Editor/Controls/TreeCtrlUtils.h delete mode 100644 Code/Editor/EditorPanelUtils.cpp delete mode 100644 Code/Editor/EditorPanelUtils.h delete mode 100644 Code/Editor/IEditorPanelUtils.h diff --git a/Code/Editor/Controls/ConsoleSCBMFC.h b/Code/Editor/Controls/ConsoleSCBMFC.h deleted file mode 100644 index fcf7f71df7..0000000000 --- a/Code/Editor/Controls/ConsoleSCBMFC.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_CONTROLS_CONSOLESCBMFC_H -#define CRYINCLUDE_EDITOR_CONTROLS_CONSOLESCBMFC_H -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#include - -#include "ConsoleSCB.h" -#endif - -class QMenu; -class ConsoleWidget; -class QFocusEvent; - -namespace Ui { - class ConsoleMFC; -} - -namespace MFC -{ - -struct ConsoleLine -{ - QString text; - bool newLine; -}; -typedef std::deque Lines; - -class ConsoleLineEdit - : public QLineEdit -{ - Q_OBJECT -public: - explicit ConsoleLineEdit(QWidget* parent = nullptr); - -protected: - void mousePressEvent(QMouseEvent* ev) override; - void mouseDoubleClickEvent(QMouseEvent* ev) override; - void keyPressEvent(QKeyEvent* ev) override; - bool event(QEvent* ev) override; - -signals: - void variableEditorRequested(); - void setWindowTitle(const QString&); - -private: - void DisplayHistory(bool bForward); - QStringList m_history; - unsigned int m_historyIndex; - bool m_bReusedHistory; -}; - -class ConsoleTextEdit - : public QTextEdit -{ - Q_OBJECT -public: - explicit ConsoleTextEdit(QWidget* parent = nullptr); -}; - -class CConsoleSCB - : public QWidget -{ - Q_OBJECT -public: - explicit CConsoleSCB(QWidget* parent = nullptr); - ~CConsoleSCB(); - - static void RegisterViewClass(); - void SetInputFocus(); - void AddToConsole(const QString& text, bool bNewLine); - void FlushText(); - void showPopupAndSetTitle(); - QSize sizeHint() const override; - QSize minimumSizeHint() const override; - static CConsoleSCB* GetCreatedInstance(); - - static void AddToPendingLines(const QString& text, bool bNewLine); // call this function instead of AddToConsole() until an instance of CConsoleSCB exists to prevent messages from getting lost - -public Q_SLOTS: - void OnStyleSettingsChanged(); - -private Q_SLOTS: - void showVariableEditor(); - -private: - QScopedPointer ui; - int m_richEditTextLength; - - Lines m_lines; - static Lines s_pendingLines; - - QList m_colorTable; - SEditorSettings::ConsoleColorTheme m_backgroundTheme; -}; - -} // namespace MFC - -#endif // CRYINCLUDE_EDITOR_CONTROLS_CONSOLESCB_H - diff --git a/Code/Editor/Controls/ConsoleSCBMFC.ui b/Code/Editor/Controls/ConsoleSCBMFC.ui deleted file mode 100644 index b9386558ed..0000000000 --- a/Code/Editor/Controls/ConsoleSCBMFC.ui +++ /dev/null @@ -1,132 +0,0 @@ - - - ConsoleMFC - - - - 0 - 0 - 400 - 120 - - - - - 0 - 0 - - - - Console - - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - - 0 - 20 - - - - - 16777215 - 20 - - - - true - - - - - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 20 - 0 - - - - - 20 - 30 - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - - - - - - - - - MFC::ConsoleLineEdit - QLineEdit -
ConsoleSCBMFC.h
-
-
- - - - -
diff --git a/Code/Editor/Controls/HotTrackingTreeCtrl.cpp b/Code/Editor/Controls/HotTrackingTreeCtrl.cpp deleted file mode 100644 index 54152a9fd4..0000000000 --- a/Code/Editor/Controls/HotTrackingTreeCtrl.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "HotTrackingTreeCtrl.h" - -// Qt -#include - - -CHotTrackingTreeCtrl::CHotTrackingTreeCtrl(QWidget* parent) - : QTreeWidget(parent) -{ - setMouseTracking(true); - m_hHoverItem = nullptr; -} - -void CHotTrackingTreeCtrl::mouseMoveEvent(QMouseEvent* event) -{ - QTreeWidgetItem* hItem = itemAt(event->pos()); - - if (m_hHoverItem != nullptr) - { - QFont font = m_hHoverItem->font(0); - font.setBold(false); - m_hHoverItem->setFont(0, font); - m_hHoverItem = nullptr; - } - - if (hItem != nullptr) - { - QFont font = hItem->font(0); - font.setBold(true); - hItem->setFont(0, font); - m_hHoverItem = hItem; - } - - QTreeWidget::mouseMoveEvent(event); -} - -#include diff --git a/Code/Editor/Controls/HotTrackingTreeCtrl.h b/Code/Editor/Controls/HotTrackingTreeCtrl.h deleted file mode 100644 index 2ca7e11a91..0000000000 --- a/Code/Editor/Controls/HotTrackingTreeCtrl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_CONTROLS_HOTTRACKINGTREECTRL_H -#define CRYINCLUDE_EDITOR_CONTROLS_HOTTRACKINGTREECTRL_H -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#endif - -class CHotTrackingTreeCtrl - : public QTreeWidget -{ - Q_OBJECT - -public: - CHotTrackingTreeCtrl(QWidget* parent = 0); - virtual ~CHotTrackingTreeCtrl(){}; - -protected: - void mouseMoveEvent(QMouseEvent* event) override; - -private: - QTreeWidgetItem* m_hHoverItem; -}; -#endif // CRYINCLUDE_EDITOR_CONTROLS_HOTTRACKINGTREECTRL_H diff --git a/Code/Editor/Controls/ImageListCtrl.cpp b/Code/Editor/Controls/ImageListCtrl.cpp deleted file mode 100644 index 9c8451c2e9..0000000000 --- a/Code/Editor/Controls/ImageListCtrl.cpp +++ /dev/null @@ -1,567 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "ImageListCtrl.h" - -// Qt -#include -#include - -////////////////////////////////////////////////////////////////////////// -CImageListCtrl::CImageListCtrl(QWidget* parent) - : QAbstractItemView(parent) - , m_itemSize(60, 60) - , m_borderSize(4, 4) - , m_style(DefaultStyle) -{ - setItemDelegate(new QImageListDelegate(this)); - setAutoFillBackground(false); - - QPalette p = palette(); - p.setColor(QPalette::Highlight, QColor(255, 55, 50)); - setPalette(p); - - horizontalScrollBar()->setRange(0, 0); - verticalScrollBar()->setRange(0, 0); -} - -////////////////////////////////////////////////////////////////////////// -CImageListCtrl::~CImageListCtrl() -{ -} - -////////////////////////////////////////////////////////////////////////// -CImageListCtrl::ListStyle CImageListCtrl::Style() const -{ - return m_style; -} - -////////////////////////////////////////////////////////////////////////// -void CImageListCtrl::SetStyle(ListStyle style) -{ - m_style = style; - scheduleDelayedItemsLayout(); -} - -////////////////////////////////////////////////////////////////////////// -const QSize& CImageListCtrl::ItemSize() const -{ - return m_itemSize; -} - -////////////////////////////////////////////////////////////////////////// -void CImageListCtrl::SetItemSize(QSize size) -{ - Q_ASSERT(size.isValid()); - m_itemSize = size; - scheduleDelayedItemsLayout(); -} - -////////////////////////////////////////////////////////////////////////// -const QSize& CImageListCtrl::BorderSize() const -{ - return m_borderSize; -} - -////////////////////////////////////////////////////////////////////////// -void CImageListCtrl::SetBorderSize(QSize size) -{ - Q_ASSERT(size.isValid()); - m_borderSize = size; - scheduleDelayedItemsLayout(); -} - -////////////////////////////////////////////////////////////////////////// -QModelIndexList CImageListCtrl::ItemsInRect(const QRect& rect) const -{ - QModelIndexList list; - - if (!model()) - { - return list; - } - - QHash::const_iterator i; - QHash::const_iterator c = m_geometry.cend(); - for (i = m_geometry.cbegin(); i != c; ++i) - { - if (i.value().intersects(rect)) - { - list << model()->index(i.key(), 0, rootIndex()); - } - } - - return list; -} - -////////////////////////////////////////////////////////////////////////// -void CImageListCtrl::paintEvent(QPaintEvent* event) -{ - QAbstractItemView::paintEvent(event); - - if (!model()) - { - return; - } - - const int rowCount = model()->rowCount(); - - if (m_geometry.isEmpty() && rowCount) - { - updateGeometries(); - } - - QPainter painter(viewport()); - painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing); - painter.setBackground(palette().window()); - painter.setFont(font()); - - QStyleOptionViewItem option; - option.palette = palette(); - option.font = font(); - option.fontMetrics = fontMetrics(); - option.decorationAlignment = Qt::AlignCenter; - - const QRect visibleRect(QPoint(horizontalOffset(), verticalOffset()), viewport()->contentsRect().size()); - - painter.translate(-horizontalOffset(), -verticalOffset()); - - for (int r = 0; r < rowCount; ++r) - { - const QModelIndex& index = model()->index(r, 0, rootIndex()); - - option.rect = m_geometry.value(r); - if (!option.rect.intersects(visibleRect)) - { - continue; - } - - option.state = QStyle::State_None; - - if (selectionModel()->isSelected(index)) - { - option.state |= QStyle::State_Selected; - } - - if (currentIndex() == index) - { - option.state |= QStyle::State_HasFocus; - } - - QAbstractItemDelegate* idt = itemDelegate(index); - idt->paint(&painter, option, index); - } -} - -////////////////////////////////////////////////////////////////////////// -void CImageListCtrl::rowsInserted(const QModelIndex& parent, int start, int end) -{ - QAbstractItemView::rowsInserted(parent, start, end); - - if (isVisible()) - { - scheduleDelayedItemsLayout(); - } -} - -////////////////////////////////////////////////////////////////////////// -void CImageListCtrl::updateGeometries() -{ - ClearItemGeometries(); - - if (!model()) - { - return; - } - - const int rowCount = model()->rowCount(); - - const int nPageHorz = viewport()->width(); - const int nPageVert = viewport()->height(); - - if (nPageHorz == 0 || nPageVert == 0 || rowCount <= 0) - { - return; - } - - int x = m_borderSize.width(); - int y = m_borderSize.height(); - - const int nItemWidth = m_itemSize.width() + m_borderSize.width(); - - if (m_style == HorizontalStyle) - { - for (int row = 0; row < rowCount; ++row) - { - m_geometry.insert(row, QRect(QPoint(x, y), m_itemSize)); - x += nItemWidth; - } - - horizontalScrollBar()->setPageStep(viewport()->width()); - horizontalScrollBar()->setRange(0, x - viewport()->width()); - } - else - { - const int nTextHeight = fontMetrics().height(); - const int nItemHeight = m_itemSize.height() + m_borderSize.height() + nTextHeight; - - int nNumOfHorzItems = nPageHorz / nItemWidth; - if (nNumOfHorzItems <= 0) - { - nNumOfHorzItems = 1; - } - - for (int row = 0; row < rowCount; ++row) - { - m_geometry.insert(row, QRect(QPoint(x, y), m_itemSize)); - - if ((row + 1) % nNumOfHorzItems == 0) - { - y += nItemHeight; - x = m_borderSize.width(); - } - else - { - x += nItemWidth; - } - } - - verticalScrollBar()->setPageStep(viewport()->height()); - verticalScrollBar()->setRange(0, (y + nItemHeight) - viewport()->height()); - } -} - -////////////////////////////////////////////////////////////////////////// -QModelIndex CImageListCtrl::indexAt(const QPoint& point) const -{ - if (!model()) - { - return QModelIndex(); - } - - const QPoint p = point + - QPoint(horizontalOffset(), verticalOffset()); - - QHash::const_iterator i; - QHash::const_iterator c = m_geometry.cend(); - for (i = m_geometry.cbegin(); i != c; ++i) - { - if (i.value().contains(p)) - { - return model()->index(i.key(), 0, rootIndex()); - } - } - - return QModelIndex(); -} - -////////////////////////////////////////////////////////////////////////// -void CImageListCtrl::scrollTo(const QModelIndex& index, ScrollHint hint) -{ - if (!index.isValid()) - { - return; - } - - QRect rect = m_geometry.value(index.row()); - - switch (hint) - { - case EnsureVisible: - if (horizontalOffset() > rect.right()) - { - horizontalScrollBar()->setValue(rect.left()); - } - else if ((horizontalOffset() + viewport()->width()) < rect.left()) - { - horizontalScrollBar()->setValue(rect.right() - viewport()->width()); - } - - if (verticalOffset() > rect.bottom()) - { - verticalScrollBar()->setValue(rect.top()); - } - else if ((verticalOffset() + viewport()->height()) < rect.top()) - { - verticalScrollBar()->setValue(rect.bottom() - viewport()->height()); - } - break; - - case PositionAtTop: - horizontalScrollBar()->setValue(rect.left()); - verticalScrollBar()->setValue(rect.top()); - break; - - case PositionAtBottom: - horizontalScrollBar()->setValue(rect.right() - viewport()->width()); - verticalScrollBar()->setValue(rect.bottom() - viewport()->height()); - break; - - case PositionAtCenter: - horizontalScrollBar()->setValue(rect.center().x() - (viewport()->width() / 2)); - verticalScrollBar()->setValue(rect.center().y() - (viewport()->height() / 2)); - break; - } -} - -////////////////////////////////////////////////////////////////////////// -QRect CImageListCtrl::visualRect(const QModelIndex& index) const -{ - if (!index.isValid()) - { - return QRect(); - } - - - if (!m_geometry.contains(index.row())) - { - return QRect(); - } - - return m_geometry.value(index.row()) - .translated(-horizontalOffset(), -verticalOffset()); -} - -////////////////////////////////////////////////////////////////////////// -QRect CImageListCtrl::ItemGeometry(const QModelIndex& index) const -{ - Q_ASSERT(index.model() == model()); - Q_ASSERT(m_geometry.contains(index.row())); - - return m_geometry.value(index.row()); -} - -void CImageListCtrl::SetItemGeometry(const QModelIndex& index, const QRect& rect) -{ - Q_ASSERT(index.model() == model()); - m_geometry.insert(index.row(), rect); - update(rect); -} - -void CImageListCtrl::ClearItemGeometries() -{ - m_geometry.clear(); -} - -////////////////////////////////////////////////////////////////////////// -int CImageListCtrl::horizontalOffset() const -{ - return horizontalScrollBar()->value(); -} - -////////////////////////////////////////////////////////////////////////// -int CImageListCtrl::verticalOffset() const -{ - return verticalScrollBar()->value(); -} - -////////////////////////////////////////////////////////////////////////// -bool CImageListCtrl::isIndexHidden([[maybe_unused]] const QModelIndex& index) const -{ - return false; /* not supported */ -} - -////////////////////////////////////////////////////////////////////////// -QModelIndex CImageListCtrl::moveCursor(CursorAction cursorAction, [[maybe_unused]] Qt::KeyboardModifiers modifiers) -{ - if (!model()) - { - return QModelIndex(); - } - - const int rowCount = model()->rowCount(); - - if (0 == rowCount) - { - return QModelIndex(); - } - - switch (cursorAction) - { - case MoveHome: - return model()->index(0, 0, rootIndex()); - - case MoveEnd: - return model()->index(rowCount - 1, 0, rootIndex()); - - case MovePrevious: - { - QModelIndex current = currentIndex(); - if (current.isValid()) - { - return model()->index((current.row() - 1) % rowCount, 0, rootIndex()); - } - } break; - - case MoveNext: - { - QModelIndex current = currentIndex(); - if (current.isValid()) - { - return model()->index((current.row() + 1) % rowCount, 0, rootIndex()); - } - } break; - - case MoveUp: - case MoveDown: - case MoveLeft: - case MoveRight: - case MovePageUp: - case MovePageDown: - /* TODO */ - break; - } - return QModelIndex(); -} - -////////////////////////////////////////////////////////////////////////// -void CImageListCtrl::setSelection(const QRect& rect, QItemSelectionModel::SelectionFlags flags) -{ - if (!model()) - { - return; - } - - const QRect lrect = - rect.translated(horizontalOffset(), verticalOffset()); - - QHash::const_iterator i; - QHash::const_iterator c = m_geometry.cend(); - for (i = m_geometry.cbegin(); i != c; ++i) - { - if (i.value().intersects(lrect)) - { - selectionModel()->select(model()->index(i.key(), 0, rootIndex()), flags); - } - } -} - -////////////////////////////////////////////////////////////////////////// -QRegion CImageListCtrl::visualRegionForSelection(const QItemSelection& selection) const -{ - QRegion region; - - foreach(const QModelIndex &index, selection.indexes()) - { - region += visualRect(index); - } - - return region; -} - -////////////////////////////////////////////////////////////////////////// -QImageListDelegate::QImageListDelegate(QObject* parent) - : QAbstractItemDelegate(parent) -{ -} - -////////////////////////////////////////////////////////////////////////// -void QImageListDelegate::paint(QPainter* painter, - const QStyleOptionViewItem& option, const QModelIndex& index) const -{ - painter->save(); - - painter->setFont(option.font); - - if (option.rect.isValid()) - { - painter->setClipRect(option.rect); - } - - QRect innerRect = option.rect.adjusted(1, 1, -1, -1); - - QRect textRect(innerRect.left(), innerRect.bottom() - option.fontMetrics.height(), - innerRect.width(), option.fontMetrics.height() + 1); - - /* fill item background */ - - painter->fillRect(option.rect, option.palette.color(QPalette::Base)); - - /* draw image */ - - if (index.data(Qt::DecorationRole).isValid()) - { - const QPixmap& p = index.data(Qt::DecorationRole).value(); - if (p.isNull() || p.size() == QSize(1, 1)) - { - emit InvalidPixmapGenerated(index); - } - else - { - painter->drawPixmap(innerRect, p); - } - } - - /* draw text */ - - const QColor trColor = option.palette.color(QPalette::Shadow); - painter->fillRect(textRect, (option.state & QStyle::State_Selected) ? - trColor.lighter() : trColor); - - if (option.state & QStyle::State_Selected) - { - painter->setPen(QPen(option.palette.color(QPalette::HighlightedText))); - - QFont f = painter->font(); - f.setBold(true); - painter->setFont(f); - } - else - { - painter->setPen(QPen(option.palette.color(QPalette::Text))); - } - - painter->drawText(textRect, index.data(Qt::DisplayRole).toString(), - QTextOption(option.decorationAlignment)); - - painter->setPen(QPen(option.palette.color(QPalette::Shadow))); - painter->drawRect(textRect); - - /* draw border */ - - if (option.state & QStyle::State_Selected) - { - QPen pen(option.palette.color(QPalette::Highlight)); - pen.setWidth(2); - painter->setPen(pen); - painter->drawRect(innerRect); - } - else - { - painter->setPen(QPen(option.palette.color(QPalette::Shadow))); - painter->drawRect(option.rect); - } - - if (option.state & QStyle::State_HasFocus) - { - QPen pen(Qt::DotLine); - pen.setColor(option.palette.color(QPalette::AlternateBase)); - painter->setPen(pen); - painter->drawRect(option.rect); - } - - painter->restore(); -} - -////////////////////////////////////////////////////////////////////////// -QSize QImageListDelegate::sizeHint(const QStyleOptionViewItem& option, - [[maybe_unused]] const QModelIndex& index) const -{ - return option.rect.size(); -} - -////////////////////////////////////////////////////////////////////////// -QVector QImageListDelegate::paintingRoles() const -{ - return QVector() << Qt::DecorationRole << Qt::DisplayRole; -} - -#include diff --git a/Code/Editor/Controls/ImageListCtrl.h b/Code/Editor/Controls/ImageListCtrl.h deleted file mode 100644 index db393c8497..0000000000 --- a/Code/Editor/Controls/ImageListCtrl.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_CONTROLS_IMAGELISTCTRL_H -#define CRYINCLUDE_EDITOR_CONTROLS_IMAGELISTCTRL_H -#pragma once - -#if !defined(Q_MOC_RUN) -#include - -#include -#endif - -////////////////////////////////////////////////////////////////////////// -// Custom control to display list of images. -////////////////////////////////////////////////////////////////////////// -class CImageListCtrl - : public QAbstractItemView -{ - Q_OBJECT -public: - enum ListStyle - { - DefaultStyle, - HorizontalStyle - }; - -public: - CImageListCtrl(QWidget* parent = nullptr); - ~CImageListCtrl(); - - ListStyle Style() const; - void SetStyle(ListStyle style); - - const QSize& ItemSize() const; - void SetItemSize(QSize size); - - const QSize& BorderSize() const; - void SetBorderSize(QSize size); - - // Get all items inside specified rectangle. - QModelIndexList ItemsInRect(const QRect& rect) const; - - QModelIndex indexAt(const QPoint& point) const override; - void scrollTo(const QModelIndex& index, ScrollHint hint = EnsureVisible) override; - QRect visualRect(const QModelIndex& index) const override; - -protected: - QRect ItemGeometry(const QModelIndex& index) const; - void SetItemGeometry(const QModelIndex& index, const QRect& rect); - void ClearItemGeometries(); - - int horizontalOffset() const override; - int verticalOffset() const override; - bool isIndexHidden(const QModelIndex& index) const override; - QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override; - void setSelection(const QRect& rect, QItemSelectionModel::SelectionFlags flags) override; - QRegion visualRegionForSelection(const QItemSelection& selection) const override; - - void paintEvent(QPaintEvent* event) override; - void rowsInserted(const QModelIndex& parent, int start, int end) override; - - void updateGeometries() override; - -private: - QHash m_geometry; - QSize m_itemSize; - QSize m_borderSize; - ListStyle m_style; -}; - -class QImageListDelegate - : public QAbstractItemDelegate -{ - Q_OBJECT -signals: - void InvalidPixmapGenerated(const QModelIndex& index) const; -public: - QImageListDelegate(QObject* parent = nullptr); - - void paint(QPainter* painter, - const QStyleOptionViewItem& option, - const QModelIndex& index) const override; - - QSize sizeHint(const QStyleOptionViewItem& option, - const QModelIndex& index) const override; - - QVector paintingRoles() const override; -}; - -#endif // CRYINCLUDE_EDITOR_CONTROLS_IMAGELISTCTRL_H diff --git a/Code/Editor/Controls/MultiMonHelper.cpp b/Code/Editor/Controls/MultiMonHelper.cpp deleted file mode 100644 index 5b3ed3a204..0000000000 --- a/Code/Editor/Controls/MultiMonHelper.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "MultiMonHelper.h" - -// Qt -#include - -//////////////////////////////////////////////////////////////////////////// -void ClipOrCenterRectToMonitor(QRect *prc, const UINT flags) -{ - const QScreen* currentScreen = nullptr; - QRect rc; - - Q_ASSERT(prc); - - const auto screens = qApp->screens(); - for (auto screen : screens) - { - if (screen->geometry().contains(prc->center())) - { - currentScreen = screen; - break; - } - } - - if (!currentScreen) - { - return; - } - - const int w = prc->width(); - const int h = prc->height(); - - if (flags & MONITOR_WORKAREA) - { - rc = currentScreen->availableGeometry(); - } - else - { - rc = currentScreen->geometry(); - } - - // center or clip the passed rect to the monitor rect - if (flags & MONITOR_CENTER) - { - prc->setLeft(rc.left() + (rc.right() - rc.left() - w) / 2); - prc->setTop(rc.top() + (rc.bottom() - rc.top() - h) / 2); - prc->setRight(prc->left() + w); - prc->setBottom(prc->top() + h); - } - else - { - prc->setLeft(qMax(rc.left(), qMin(rc.right() - w, prc->left()))); - prc->setTop(qMax(rc.top(), qMin(rc.bottom() - h, prc->top()))); - prc->setRight(prc->left() + w); - prc->setBottom(prc->top() + h); - } -} diff --git a/Code/Editor/Controls/MultiMonHelper.h b/Code/Editor/Controls/MultiMonHelper.h deleted file mode 100644 index 54e47bf022..0000000000 --- a/Code/Editor/Controls/MultiMonHelper.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_CONTROLS_MULTIMONHELPER_H -#define CRYINCLUDE_EDITOR_CONTROLS_MULTIMONHELPER_H -#pragma once - -// Taken from: http://msdn.microsoft.com/en-us/library/dd162826(v=vs.85).aspx -#define MONITOR_CENTER 0x0001 // center rect to monitor -#define MONITOR_CLIP 0x0000 // clip rect to monitor -#define MONITOR_WORKAREA 0x0002 // use monitor work area -#define MONITOR_AREA 0x0000 // use monitor entire area - -// -// ClipOrCenterRectToMonitor -// -// The most common problem apps have when running on a -// multimonitor system is that they "clip" or "pin" windows -// based on the SM_CXSCREEN and SM_CYSCREEN system metrics. -// Because of app compatibility reasons these system metrics -// return the size of the primary monitor. -// -// This shows how you use the multi-monitor functions -// to do the same thing. -// -// params: -// prc : pointer to QRect to modify -// flags : some combination of the MONITOR_* flags above -// -// example: -// -// ClipOrCenterRectToMonitor(&aRect, MONITOR_CLIP | MONITOR_WORKAREA); -// -// Takes parameter pointer to RECT "aRect" and flags MONITOR_CLIP | MONITOR_WORKAREA -// This will modify aRect without resizing it so that it remains within the on-screen boundaries. -void ClipOrCenterRectToMonitor(QRect *prc, const UINT flags); - -#endif // CRYINCLUDE_EDITOR_CONTROLS_MULTIMONHELPER_H diff --git a/Code/Editor/Controls/NumberCtrl.cpp b/Code/Editor/Controls/NumberCtrl.cpp deleted file mode 100644 index 473dd7e4af..0000000000 --- a/Code/Editor/Controls/NumberCtrl.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "NumberCtrl.h" - - -QNumberCtrl::QNumberCtrl(QWidget* parent) - : QDoubleSpinBox(parent) - , m_bMouseDown(false) - , m_bDragged(false) - , m_bUndoEnabled(false) - , m_prevValue(0) -{ - connect(this, &QAbstractSpinBox::editingFinished, this, &QNumberCtrl::onEditingFinished); -} - -void QNumberCtrl::changeEvent(QEvent* event) -{ - if (event->type() == QEvent::EnabledChange) - { - setButtonSymbols(isEnabled() ? UpDownArrows : NoButtons); - } - - QDoubleSpinBox::changeEvent(event); -} - - -void QNumberCtrl::SetRange(double newMin, double newMax) -{ - // Avoid setting this value if its close to the current value, because otherwise qt will pump events into the queue to redraw/etc. - if ( (!AZ::IsClose(this->minimum(), newMin, DBL_EPSILON)) || (!AZ::IsClose(this->maximum(), newMax, DBL_EPSILON)) ) - { - setRange(newMin, newMax); - } -} - - -void QNumberCtrl::mousePressEvent(QMouseEvent* event) -{ - if (event->button() == Qt::LeftButton) - { - emit mousePressed(); - - m_bMouseDown = true; - m_bDragged = false; - m_mousePos = event->pos(); - - if (m_bUndoEnabled && !CUndo::IsRecording()) - { - GetIEditor()->BeginUndo(); - } - - emit dragStarted(); - - grabMouse(); - } - - QDoubleSpinBox::mousePressEvent(event); -} - -void QNumberCtrl::mouseReleaseEvent(QMouseEvent* event) -{ - QDoubleSpinBox::mouseReleaseEvent(event); - - if (event->button() == Qt::LeftButton) - { - m_bMouseDown = m_bDragged = false; - - emit valueUpdated(); - emit valueChanged(); - - if (m_bUndoEnabled && CUndo::IsRecording()) - { - GetIEditor()->AcceptUndo(m_undoText); - } - - emit dragFinished(); - - releaseMouse(); - - m_prevValue = value(); - - emit mouseReleased(); - } -} - -void QNumberCtrl::mouseMoveEvent(QMouseEvent* event) -{ - QDoubleSpinBox::mousePressEvent(event); - - if (m_bMouseDown) - { - m_bDragged = true; - - int dy = event->pos().y() - m_mousePos.y(); - setValue(value() - singleStep() * dy); - - emit valueUpdated(); - - m_mousePos = event->pos(); - } -} - -void QNumberCtrl::EnableUndo(const QString& undoText) -{ - m_undoText = undoText; - m_bUndoEnabled = true; -} - -void QNumberCtrl::focusInEvent(QFocusEvent* event) -{ - m_prevValue = value(); - QDoubleSpinBox::focusInEvent(event); -} - -void QNumberCtrl::onEditingFinished() -{ - bool undo = m_bUndoEnabled && !CUndo::IsRecording() && m_prevValue != value(); - if (undo) - { - GetIEditor()->BeginUndo(); - } - - emit valueUpdated(); - emit valueChanged(); - - if (undo) - { - GetIEditor()->AcceptUndo(m_undoText); - } - - m_prevValue = value(); -} - -#include diff --git a/Code/Editor/Controls/NumberCtrl.h b/Code/Editor/Controls/NumberCtrl.h deleted file mode 100644 index 22ee7b867f..0000000000 --- a/Code/Editor/Controls/NumberCtrl.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_CONTROLS_NUMBERCTRL_H -#define CRYINCLUDE_EDITOR_CONTROLS_NUMBERCTRL_H -#pragma once - -// NumberCtrl.h : header file -// - -#if !defined(Q_MOC_RUN) -#include -#endif - -class QNumberCtrl - : public QDoubleSpinBox -{ - Q_OBJECT - -public: - QNumberCtrl(QWidget* parent = nullptr); - - bool IsDragging() const { return m_bDragged; } - - //! If called will enable undo with given text when control is modified. - void EnableUndo(const QString& undoText); - void SetRange(double newMin, double maxRange); - -Q_SIGNALS: - void dragStarted(); - void dragFinished(); - - void valueUpdated(); - void valueChanged(); - - void mouseReleased(); - void mousePressed(); - -protected: - void changeEvent(QEvent* event) override; - void focusInEvent(QFocusEvent* event) override; - void mousePressEvent(QMouseEvent* event) override; - void mouseMoveEvent(QMouseEvent* event) override; - void mouseReleaseEvent(QMouseEvent* event) override; - -private: - void onEditingFinished(); - void onValueChanged(double d); - - bool m_bMouseDown; - bool m_bDragged; - QPoint m_mousePos; - bool m_bUndoEnabled; - double m_prevValue; - QString m_undoText; -}; - -#endif // CRYINCLUDE_EDITOR_CONTROLS_NUMBERCTRL_H diff --git a/Code/Editor/Controls/TextEditorCtrl.cpp b/Code/Editor/Controls/TextEditorCtrl.cpp deleted file mode 100644 index c372138d80..0000000000 --- a/Code/Editor/Controls/TextEditorCtrl.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "TextEditorCtrl.h" - - -// CTextEditorCtrl -CTextEditorCtrl::CTextEditorCtrl(QWidget* pParent) - : QTextEdit(pParent) -{ - m_bModified = true; - - QFont font; - font.setFamily("Courier New"); - font.setFixedPitch(true); - font.setPointSize(10); - setFont(font); - - setLineWrapMode(NoWrap); - - connect(this, &QTextEdit::textChanged, this, &CTextEditorCtrl::OnChange); -} - -CTextEditorCtrl::~CTextEditorCtrl() -{ -} - - -// CTextEditorCtrl message handlers - -void CTextEditorCtrl::LoadFile(const QString& sFileName) -{ - if (m_filename == sFileName) - { - return; - } - - m_filename = sFileName; - - clear(); - - CCryFile file(sFileName.toUtf8().data(), "rb"); - if (file.Open(sFileName.toUtf8().data(), "rb")) - { - size_t length = file.GetLength(); - - QByteArray text; - text.resize(static_cast(length)); - file.ReadRaw(text.data(), length); - - setPlainText(text); - } - - m_bModified = false; -} - -////////////////////////////////////////////////////////////////////////// -void CTextEditorCtrl::SaveFile(const QString& sFileName) -{ - if (sFileName.isEmpty()) - { - return; - } - - if (!CFileUtil::OverwriteFile(sFileName.toUtf8().data())) - { - return; - } - - QFile file(sFileName); - file.open(QFile::WriteOnly); - - file.write(toPlainText().toUtf8()); - - m_bModified = false; -} - -////////////////////////////////////////////////////////////////////////// -void CTextEditorCtrl::OnChange() -{ - - m_bModified = true; -} - -#include diff --git a/Code/Editor/Controls/TextEditorCtrl.h b/Code/Editor/Controls/TextEditorCtrl.h deleted file mode 100644 index e155185f90..0000000000 --- a/Code/Editor/Controls/TextEditorCtrl.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_CONTROLS_TEXTEDITORCTRL_H -#define CRYINCLUDE_EDITOR_CONTROLS_TEXTEDITORCTRL_H -#pragma once - -// CTextEditorCtrl -#if !defined(Q_MOC_RUN) -#include -#endif - -class CTextEditorCtrl - : public QTextEdit -{ - Q_OBJECT - -public: - CTextEditorCtrl(QWidget* pParent = nullptr); - virtual ~CTextEditorCtrl(); - - void LoadFile(const QString& sFileName); - void SaveFile(const QString& sFileName); - QString GetFilename() const { return m_filename; } - - bool IsModified() const { return m_bModified; } - - //! Must be called after OnChange message. - void OnChange(); - -protected: - QString m_filename; - bool m_bModified; -}; - -#endif // CRYINCLUDE_EDITOR_CONTROLS_TEXTEDITORCTRL_H diff --git a/Code/Editor/Controls/TreeCtrlUtils.h b/Code/Editor/Controls/TreeCtrlUtils.h deleted file mode 100644 index 7498360d2e..0000000000 --- a/Code/Editor/Controls/TreeCtrlUtils.h +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_CONTROLS_TREECTRLUTILS_H -#define CRYINCLUDE_EDITOR_CONTROLS_TREECTRLUTILS_H -#pragma once - -#include - -namespace TreeCtrlUtils -{ - template - class TreeItemIterator - : public P - { - public: - typedef P Traits; - - //iterator traits, required by STL - typedef ptrdiff_t difference_type; - typedef HTREEITEM value_type; - typedef HTREEITEM* pointer; - typedef HTREEITEM& reference; - typedef std::forward_iterator_tag iterator_category; - - TreeItemIterator() - : pCtrl(0) - , hItem(0) {} - explicit TreeItemIterator(const P& traits) - : P(traits) - , pCtrl(0) - , hItem(0) {} - TreeItemIterator(const TreeItemIterator& other) - : P(other) - , pCtrl(other.pCtrl) - , hItem(other.hItem) {} - TreeItemIterator(CTreeCtrl* pCtrl, HTREEITEM hItem) - : pCtrl(pCtrl) - , hItem(hItem) {} - TreeItemIterator(CTreeCtrl* pCtrl, HTREEITEM hItem, const P& traits) - : P(traits) - , pCtrl(pCtrl) - , hItem(hItem) {} - - HTREEITEM operator*() {return hItem; } - bool operator==(const TreeItemIterator& other) const {return pCtrl == other.pCtrl && hItem == other.hItem; } - bool operator!=(const TreeItemIterator& other) const {return pCtrl != other.pCtrl || hItem != other.hItem; } - - TreeItemIterator& operator++() - { - HTREEITEM hNextItem = 0; - if (RecurseToChildren(hItem)) - { - hNextItem = (pCtrl ? pCtrl->GetChildItem(hItem) : 0); - } - while (pCtrl && hItem && !hNextItem) - { - hNextItem = pCtrl->GetNextSiblingItem(hItem); - if (!hNextItem) - { - hItem = pCtrl->GetParentItem(hItem); - } - } - hItem = hNextItem; - - return *this; - } - - TreeItemIterator operator++(int) {TreeItemIterator old = *this; ++(*this); return old; } - - CTreeCtrl* pCtrl; - HTREEITEM hItem; - }; - - class NonRecursiveTreeItemIteratorTraits - { - public: - bool RecurseToChildren(HTREEITEM hItem) {return false; } - }; - typedef TreeItemIterator NonRecursiveTreeItemIterator; - - class RecursiveTreeItemIteratorTraits - { - public: - bool RecurseToChildren(HTREEITEM hItem) {return true; } - }; - typedef TreeItemIterator RecursiveTreeItemIterator; - - inline RecursiveTreeItemIterator BeginTreeItemsRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0) - { - if (hItem == 0) - { - hItem = (pCtrl ? pCtrl->GetRootItem() : 0); - } - return RecursiveTreeItemIterator(pCtrl, hItem); - } - - inline RecursiveTreeItemIterator EndTreeItemsRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0) - { - HTREEITEM hEndItem = 0; - HTREEITEM hParent = hItem; - do - { - if (hParent) - { - hEndItem = pCtrl->GetNextSiblingItem(hParent); - } - hParent = (pCtrl && hParent ? pCtrl->GetParentItem(hParent) : 0); - } - while (hParent && !hEndItem); - return RecursiveTreeItemIterator(pCtrl, hEndItem); - } - - inline NonRecursiveTreeItemIterator BeginTreeItemsNonRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0) - { - if (hItem == 0) - { - hItem = (pCtrl ? pCtrl->GetRootItem() : 0); - } - if (hItem) - { - hItem = pCtrl->GetChildItem(hItem); - } - return NonRecursiveTreeItemIterator(pCtrl, hItem); - } - - inline NonRecursiveTreeItemIterator EndTreeItemsNonRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0) - { - HTREEITEM hEndItem = 0; - HTREEITEM hParent = 0; - while (hParent && !hEndItem) - { - hParent = (pCtrl && hItem ? pCtrl->GetParentItem(hItem) : 0); - if (hParent) - { - hEndItem = pCtrl->GetNextSiblingItem(hParent); - } - } - return NonRecursiveTreeItemIterator(pCtrl, hEndItem); - } - - template - class TreeItemDataIterator - { - public: - typedef T Type; - typedef TreeItemIterator

InternalIterator; - - //iterator traits, required by STL - typedef ptrdiff_t difference_type; - typedef Type* value_type; - typedef Type** pointer; - typedef Type*& reference; - typedef std::forward_iterator_tag iterator_category; - - TreeItemDataIterator() {} - TreeItemDataIterator(const TreeItemDataIterator& other) - : iterator(other.iterator) {AdvanceToValidIterator(); } - explicit TreeItemDataIterator(const InternalIterator& iterator) - : iterator(iterator) {AdvanceToValidIterator(); } - - Type* operator*() {return reinterpret_cast(iterator.pCtrl->GetItemData(iterator.hItem)); } - bool operator==(const TreeItemDataIterator& other) const {return iterator == other.iterator; } - bool operator!=(const TreeItemDataIterator& other) const {return iterator != other.iterator; } - - HTREEITEM GetTreeItem() {return iterator.hItem; } - - TreeItemDataIterator& operator++() - { - ++iterator; - AdvanceToValidIterator(); - return *this; - } - - TreeItemDataIterator operator++(int) {TreeItemDataIterator old = *this; ++(*this); return old; } - - private: - void AdvanceToValidIterator() - { - while (iterator.pCtrl && iterator.hItem && !iterator.pCtrl->GetItemData(iterator.hItem)) - { - ++iterator; - } - } - - InternalIterator iterator; - }; - - template - class RecursiveItemDataIteratorType - { - public: typedef TreeItemDataIterator type; - }; - template - inline TreeItemDataIterator BeginTreeItemDataRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0) - { - return TreeItemDataIterator(BeginTreeItemsRecursive(pCtrl, hItem)); - } - - template - inline TreeItemDataIterator EndTreeItemDataRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0) - { - return TreeItemDataIterator(EndTreeItemsRecursive(pCtrl, hItem)); - } - - template - class NonRecursiveItemDataIteratorType - { - typedef TreeItemDataIterator type; - }; - template - inline TreeItemDataIterator BeginTreeItemDataNonRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0) - { - return TreeItemDataIterator(BeginTreeItemsNonRecursive(pCtrl, hItem)); - } - - template - inline TreeItemDataIterator EndTreeItemDataNonRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0) - { - return TreeItemDataIterator(EndTreeItemsNonRecursive(pCtrl, hItem)); - } - - class SelectedTreeItemIterator - { - public: - SelectedTreeItemIterator() - : pCtrl(0) - , hItem(0) {} - SelectedTreeItemIterator(const SelectedTreeItemIterator& other) - : pCtrl(other.pCtrl) - , hItem(other.hItem) {} - SelectedTreeItemIterator(CXTTreeCtrl* pCtrl, HTREEITEM hItem) - : pCtrl(pCtrl) - , hItem(hItem) {} - - HTREEITEM operator*() {return hItem; } - bool operator==(const SelectedTreeItemIterator& other) const {return pCtrl == other.pCtrl && hItem == other.hItem; } - bool operator!=(const SelectedTreeItemIterator& other) const {return pCtrl != other.pCtrl || hItem != other.hItem; } - - SelectedTreeItemIterator& operator++() - { - hItem = (pCtrl ? pCtrl->GetNextSelectedItem(hItem) : 0); - - return *this; - } - - SelectedTreeItemIterator operator++(int) {SelectedTreeItemIterator old = *this; ++(*this); return old; } - - CXTTreeCtrl* pCtrl; - HTREEITEM hItem; - }; - - SelectedTreeItemIterator BeginSelectedTreeItems(CXTTreeCtrl* pCtrl) - { - return SelectedTreeItemIterator(pCtrl, (pCtrl ? pCtrl->GetFirstSelectedItem() : 0)); - } - - SelectedTreeItemIterator EndSelectedTreeItems(CXTTreeCtrl* pCtrl) - { - return SelectedTreeItemIterator(pCtrl, 0); - } - - template - class SelectedTreeItemDataIterator - { - public: - typedef T Type; - typedef SelectedTreeItemIterator InternalIterator; - - SelectedTreeItemDataIterator() {} - SelectedTreeItemDataIterator(const SelectedTreeItemDataIterator& other) - : iterator(other.iterator) {AdvanceToValidIterator(); } - explicit SelectedTreeItemDataIterator(const InternalIterator& iterator) - : iterator(iterator) {AdvanceToValidIterator(); } - - Type* operator*() {return reinterpret_cast(iterator.pCtrl->GetItemData(iterator.hItem)); } - bool operator==(const SelectedTreeItemDataIterator& other) const {return iterator == other.iterator; } - bool operator!=(const SelectedTreeItemDataIterator& other) const {return iterator != other.iterator; } - - HTREEITEM GetTreeItem() {return iterator.hItem; } - - SelectedTreeItemDataIterator& operator++() - { - ++iterator; - AdvanceToValidIterator(); - return *this; - } - - SelectedTreeItemDataIterator operator++(int) {SelectedTreeItemDataIterator old = *this; ++(*this); return old; } - - private: - void AdvanceToValidIterator() - { - while (iterator.pCtrl && iterator.hItem && !iterator.pCtrl->GetItemData(iterator.hItem)) - { - ++iterator; - } - } - - InternalIterator iterator; - }; - - template - SelectedTreeItemDataIterator BeginSelectedTreeItemData(CXTTreeCtrl* pCtrl) - { - return SelectedTreeItemDataIterator(BeginSelectedTreeItems(pCtrl)); - } - - template - SelectedTreeItemDataIterator EndSelectedTreeItemData(CXTTreeCtrl* pCtrl) - { - return SelectedTreeItemDataIterator(EndSelectedTreeItems(pCtrl)); - } -} - -#endif // CRYINCLUDE_EDITOR_CONTROLS_TREECTRLUTILS_H diff --git a/Code/Editor/EditorPanelUtils.cpp b/Code/Editor/EditorPanelUtils.cpp deleted file mode 100644 index 1a3c9bcb4a..0000000000 --- a/Code/Editor/EditorPanelUtils.cpp +++ /dev/null @@ -1,542 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - - -#include "EditorDefs.h" - -#include "EditorPanelUtils.h" - -#include - -// Qt -#include -#include -#include - -// Editor -#include "IEditorPanelUtils.h" -#include "Objects/EntityObject.h" -#include "CryEditDoc.h" -#include "ViewManager.h" -#include "Controls/QToolTipWidget.h" -#include "Objects/SelectionGroup.h" - - - -#ifndef PI -#define PI 3.14159265358979323f -#endif - - -struct ToolTip -{ - bool isValid; - QString title; - QString content; - QString specialContent; - QString disabledContent; -}; - -// internal implementation for better compile times - should also never be used externally, use IParticleEditorUtils interface for that. -class CEditorPanelUtils_Impl - : public IEditorPanelUtils -{ -public: - void SetViewportDragOperation(void(* dropCallback)(CViewport* viewport, int dragPointX, int dragPointY, void* custom), void* custom) override - { - for (int i = 0; i < GetIEditor()->GetViewManager()->GetViewCount(); i++) - { - GetIEditor()->GetViewManager()->GetView(i)->SetGlobalDropCallback(dropCallback, custom); - } - } - -public: - - int PreviewWindow_GetDisplaySettingsDebugFlags(CDisplaySettings* settings) override - { - CRY_ASSERT(settings); - return settings->GetDebugFlags(); - } - - void PreviewWindow_SetDisplaySettingsDebugFlags(CDisplaySettings* settings, int flags) override - { - CRY_ASSERT(settings); - settings->SetDebugFlags(flags); - } - -protected: - QVector hotkeys; - bool m_hotkeysAreEnabled; -public: - - bool HotKey_Import() override - { - QVector > keys; - QString filepath = QFileDialog::getOpenFileName(nullptr, "Select shortcut configuration to load", - QString(), "HotKey Config Files (*.hkxml)"); - QFile file(filepath); - if (!file.open(QIODevice::ReadOnly)) - { - return false; - } - QXmlStreamReader stream(&file); - bool result = true; - - while (!stream.isEndDocument()) - { - if (stream.isStartElement()) - { - if (stream.name() == "HotKey") - { - QPair key; - QXmlStreamAttributes att = stream.attributes(); - for (QXmlStreamAttribute attr : att) - { - if (attr.name().compare(QLatin1String("path"), Qt::CaseInsensitive) == 0) - { - key.first = attr.value().toString(); - } - if (attr.name().compare(QLatin1String("sequence"), Qt::CaseInsensitive) == 0) - { - key.second = attr.value().toString(); - } - } - if (!key.first.isEmpty()) - { - keys.push_back(key); // we allow blank key sequences for unassigned shortcuts - } - else - { - result = false; //but not blank paths! - } - } - } - stream.readNext(); - } - file.close(); - - if (result) - { - HotKey_BuildDefaults(); - for (QPair key : keys) - { - for (int j = 0; j < hotkeys.count(); j++) - { - if (hotkeys[j].path.compare(key.first, Qt::CaseInsensitive) == 0) - { - hotkeys[j].SetPath(key.first.toStdString().c_str()); - hotkeys[j].SetSequenceFromString(key.second.toStdString().c_str()); - } - } - } - } - return result; - } - - void HotKey_Export() override - { - auto settingDir = AZ::IO::FixedMaxPath(AZ::Utils::GetEnginePath()) / "Editor" / "Plugins" / "ParticleEditorPlugin" / "settings"; - QString filepath = QFileDialog::getSaveFileName(nullptr, "Select shortcut configuration to load", settingDir.c_str(), "HotKey Config Files (*.hkxml)"); - QFile file(filepath); - if (!file.open(QIODevice::WriteOnly)) - { - return; - } - - QXmlStreamWriter stream(&file); - stream.setAutoFormatting(true); - stream.writeStartDocument(); - stream.writeStartElement("HotKeys"); - - for (HotKey key : hotkeys) - { - stream.writeStartElement("HotKey"); - stream.writeAttribute("path", key.path); - stream.writeAttribute("sequence", key.sequence.toString()); - stream.writeEndElement(); - } - stream.writeEndElement(); - stream.writeEndDocument(); - file.close(); - } - - QKeySequence HotKey_GetShortcut(const char* path) override - { - for (HotKey combo : hotkeys) - { - if (combo.IsMatch(path)) - { - return combo.sequence; - } - } - return QKeySequence(); - } - - bool HotKey_IsPressed(const QKeyEvent* event, const char* path) override - { - if (!m_hotkeysAreEnabled) - { - return false; - } - unsigned int keyInt = 0; - //Capture any modifiers - Qt::KeyboardModifiers modifiers = QApplication::keyboardModifiers(); - if (modifiers & Qt::ShiftModifier) - { - keyInt += Qt::SHIFT; - } - if (modifiers & Qt::ControlModifier) - { - keyInt += Qt::CTRL; - } - if (modifiers & Qt::AltModifier) - { - keyInt += Qt::ALT; - } - if (modifiers & Qt::MetaModifier) - { - keyInt += Qt::META; - } - //Capture any key - keyInt += event->key(); - - QString t0 = QKeySequence(keyInt).toString(); - QString t1 = HotKey_GetShortcut(path).toString(); - - //if strings match then shortcut is pressed - if (t1.compare(t0, Qt::CaseInsensitive) == 0) - { - return true; - } - return false; - } - - bool HotKey_IsPressed(const QShortcutEvent* event, const char* path) override - { - if (!m_hotkeysAreEnabled) - { - return false; - } - - QString t0 = event->key().toString(); - QString t1 = HotKey_GetShortcut(path).toString(); - - //if strings match then shortcut is pressed - if (t1.compare(t0, Qt::CaseInsensitive) == 0) - { - return true; - } - return false; - } - - bool HotKey_LoadExisting() override - { - QSettings settings("O3DE", "O3DE"); - QString group = "Hotkeys/"; - - HotKey_BuildDefaults(); - - int size = settings.beginReadArray(group); - - for (int i = 0; i < size; i++) - { - settings.setArrayIndex(i); - QPair hotkey; - hotkey.first = settings.value("name").toString(); - hotkey.second = settings.value("keySequence").toString(); - if (!hotkey.first.isEmpty()) - { - for (int j = 0; j < hotkeys.count(); j++) - { - if (hotkeys[j].path.compare(hotkey.first, Qt::CaseInsensitive) == 0) - { - hotkeys[j].SetPath(hotkey.first.toStdString().c_str()); - hotkeys[j].SetSequenceFromString(hotkey.second.toStdString().c_str()); - } - } - } - } - - settings.endArray(); - if (hotkeys.isEmpty()) - { - return false; - } - return true; - } - - void HotKey_SaveCurrent() override - { - QSettings settings("O3DE", "O3DE"); - QString group = "Hotkeys/"; - settings.remove("Hotkeys/"); - settings.sync(); - settings.beginWriteArray(group); - int saveIndex = 0; - for (HotKey key : hotkeys) - { - if (!key.path.isEmpty()) - { - settings.setArrayIndex(saveIndex++); - settings.setValue("name", key.path); - settings.setValue("keySequence", key.sequence.toString()); - } - } - settings.endArray(); - settings.sync(); - } - - void HotKey_BuildDefaults() override - { - m_hotkeysAreEnabled = true; - QVector > keys; - while (hotkeys.count() > 0) - { - hotkeys.takeAt(0); - } - - //MENU SELECTION SHORTCUTS//////////////////////////////////////////////// - keys.push_back(QPair("Menus.File Menu", "Alt+F")); - keys.push_back(QPair("Menus.Edit Menu", "Alt+E")); - keys.push_back(QPair("Menus.View Menu", "Alt+V")); - //FILE MENU SHORTCUTS///////////////////////////////////////////////////// - keys.push_back(QPair("File Menu.Create new emitter", "Ctrl+N")); - keys.push_back(QPair("File Menu.Create new library", "Ctrl+Shift+N")); - keys.push_back(QPair("File Menu.Create new folder", "")); - keys.push_back(QPair("File Menu.Import", "Ctrl+I")); - keys.push_back(QPair("File Menu.Import level library", "Ctrl+Shift+I")); - keys.push_back(QPair("File Menu.Save", "Ctrl+S")); - keys.push_back(QPair("File Menu.Close", "Ctrl+Q")); - //EDIT MENU SHORTCUTS///////////////////////////////////////////////////// - keys.push_back(QPair("Edit Menu.Copy", "Ctrl+C")); - keys.push_back(QPair("Edit Menu.Paste", "Ctrl+V")); - keys.push_back(QPair("Edit Menu.Duplicate", "Ctrl+D")); - keys.push_back(QPair("Edit Menu.Undo", "Ctrl+Z")); - keys.push_back(QPair("Edit Menu.Redo", "Ctrl+Shift+Z")); - keys.push_back(QPair("Edit Menu.Group", "Ctrl+Alt+O")); - keys.push_back(QPair("Edit Menu.Ungroup", "Ctrl+Alt+P")); - keys.push_back(QPair("Edit Menu.Rename", "Ctrl+R")); - keys.push_back(QPair("Edit Menu.Reset", "")); - keys.push_back(QPair("Edit Menu.Edit Hotkeys", "")); - keys.push_back(QPair("Edit Menu.Assign to selected", "Ctrl+Space")); - keys.push_back(QPair("Edit Menu.Insert Comment", "Ctrl+Alt+M")); - keys.push_back(QPair("Edit Menu.Enable/Disable Emitter", "Ctrl+E")); - keys.push_back(QPair("File Menu.Enable All", "")); - keys.push_back(QPair("File Menu.Disable All", "")); - keys.push_back(QPair("Edit Menu.Delete", "Del")); - //VIEW MENU SHORTCUTS///////////////////////////////////////////////////// - keys.push_back(QPair("View Menu.Reset Layout", "")); - //PLAYBACK CONTROL//////////////////////////////////////////////////////// - keys.push_back(QPair("Previewer.Play/Pause Toggle", "Space")); - keys.push_back(QPair("Previewer.Step forward through time", "c")); - keys.push_back(QPair("Previewer.Loop Toggle", "z")); - keys.push_back(QPair("Previewer.Reset Playback", "x")); - keys.push_back(QPair("Previewer.Focus", "Ctrl+F")); - keys.push_back(QPair("Previewer.Zoom In", "w")); - keys.push_back(QPair("Previewer.Zoom Out", "s")); - keys.push_back(QPair("Previewer.Pan Left", "a")); - keys.push_back(QPair("Previewer.Pan Right", "d")); - - for (QPair key : keys) - { - unsigned int index = hotkeys.count(); - hotkeys.push_back(HotKey()); - hotkeys[index].SetPath(key.first.toStdString().c_str()); - hotkeys[index].SetSequenceFromString(key.second.toStdString().c_str()); - } - } - - void HotKey_SetKeys(QVector keys) override - { - hotkeys = keys; - } - - QVector HotKey_GetKeys() override - { - return hotkeys; - } - - QString HotKey_GetPressedHotkey(const QKeyEvent* event) override - { - if (!m_hotkeysAreEnabled) - { - return ""; - } - for (HotKey key : hotkeys) - { - if (HotKey_IsPressed(event, key.path.toUtf8())) - { - return key.path; - } - } - return ""; - } - QString HotKey_GetPressedHotkey(const QShortcutEvent* event) override - { - if (!m_hotkeysAreEnabled) - { - return ""; - } - for (HotKey key : hotkeys) - { - if (HotKey_IsPressed(event, key.path.toUtf8())) - { - return key.path; - } - } - return ""; - } - //building the default hotkey list re-enables hotkeys - //do not use this when rebuilding the default list is a possibility. - void HotKey_SetEnabled(bool val) override - { - m_hotkeysAreEnabled = val; - } - - bool HotKey_IsEnabled() const override - { - return m_hotkeysAreEnabled; - } - -protected: - QMap m_tooltips; - - void ToolTip_ParseNode(XmlNodeRef node) - { - if (QString(node->getTag()).compare("tooltip", Qt::CaseInsensitive) != 0) - { - unsigned int childCount = node->getChildCount(); - - for (unsigned int i = 0; i < childCount; i++) - { - ToolTip_ParseNode(node->getChild(i)); - } - } - - QString title = node->getAttr("title"); - QString content = node->getAttr("content"); - QString specialContent = node->getAttr("special_content"); - QString disabledContent = node->getAttr("disabled_content"); - - QMap::iterator itr = m_tooltips.insert(node->getAttr("path"), ToolTip()); - itr->isValid = true; - itr->title = title; - itr->content = content; - itr->specialContent = specialContent; - itr->disabledContent = disabledContent; - - unsigned int childCount = node->getChildCount(); - - for (unsigned int i = 0; i < childCount; i++) - { - ToolTip_ParseNode(node->getChild(i)); - } - } - - ToolTip GetToolTip(QString path) - { - if (m_tooltips.contains(path)) - { - return m_tooltips[path]; - } - ToolTip temp; - temp.isValid = false; - return temp; - } - -public: - void ToolTip_LoadConfigXML(QString filepath) override - { - XmlNodeRef node = GetIEditor()->GetSystem()->LoadXmlFromFile(filepath.toStdString().c_str()); - ToolTip_ParseNode(node); - } - - void ToolTip_BuildFromConfig(IQToolTip* tooltip, QString path, QString option, QString optionalData = "", bool isEnabled = true) override - { - AZ_Assert(tooltip, "tooltip cannot be null"); - - QString title = ToolTip_GetTitle(path, option); - QString content = ToolTip_GetContent(path, option); - QString specialContent = ToolTip_GetSpecialContentType(path, option); - QString disabledContent = ToolTip_GetDisabledContent(path, option); - - // Even if these items are empty, we set them anyway to clear out any data that was left over from when the tooltip was used for a different object. - tooltip->SetTitle(title); - tooltip->SetContent(content); - - //this only handles simple creation...if you need complex call this then add specials separate - if (!specialContent.contains("::")) - { - tooltip->AddSpecialContent(specialContent, optionalData); - } - - if (!isEnabled) // If disabled, add disabled value - { - tooltip->AppendContent(disabledContent); - } - } - - QString ToolTip_GetTitle(QString path, QString option) override - { - if (!option.isEmpty() && GetToolTip(path + "." + option).isValid) - { - return GetToolTip(path + "." + option).title; - } - if (!option.isEmpty() && GetToolTip("Options." + option).isValid) - { - return GetToolTip("Options." + option).title; - } - return GetToolTip(path).title; - } - - QString ToolTip_GetContent(QString path, QString option) override - { - if (!option.isEmpty() && GetToolTip(path + "." + option).isValid) - { - return GetToolTip(path + "." + option).content; - } - if (!option.isEmpty() && GetToolTip("Options." + option).isValid) - { - return GetToolTip("Options." + option).content; - } - return GetToolTip(path).content; - } - - QString ToolTip_GetSpecialContentType(QString path, QString option) override - { - if (!option.isEmpty() && GetToolTip(path + "." + option).isValid) - { - return GetToolTip(path + "." + option).specialContent; - } - if (!option.isEmpty() && GetToolTip("Options." + option).isValid) - { - return GetToolTip("Options." + option).specialContent; - } - return GetToolTip(path).specialContent; - } - - QString ToolTip_GetDisabledContent(QString path, QString option) override - { - if (!option.isEmpty() && GetToolTip(path + "." + option).isValid) - { - return GetToolTip(path + "." + option).disabledContent; - } - if (!option.isEmpty() && GetToolTip("Options." + option).isValid) - { - return GetToolTip("Options." + option).disabledContent; - } - return GetToolTip(path).disabledContent; - } -}; - -IEditorPanelUtils* CreateEditorPanelUtils() -{ - return new CEditorPanelUtils_Impl(); -} - diff --git a/Code/Editor/EditorPanelUtils.h b/Code/Editor/EditorPanelUtils.h deleted file mode 100644 index 6ac15ebfc9..0000000000 --- a/Code/Editor/EditorPanelUtils.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -// Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. -#ifndef CRYINCLUDE_CRYEDITOR_EDITORPANELUTILS_H -#define CRYINCLUDE_CRYEDITOR_EDITORPANELUTILS_H -#pragma once - -struct IEditorPanelUtils; -IEditorPanelUtils* CreateEditorPanelUtils(); - -#endif diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h index c6f72a7dbc..d2d4998187 100644 --- a/Code/Editor/IEditor.h +++ b/Code/Editor/IEditor.h @@ -69,7 +69,6 @@ class CSelectionTreeManager; struct SEditorSettings; class CGameExporter; class IAWSResourceManager; -struct IEditorPanelUtils; namespace WinWidget { @@ -526,8 +525,6 @@ struct IEditor virtual IEditorMaterialManager* GetIEditorMaterialManager() = 0; // Vladimir@Conffx //! Returns IconManager. virtual IIconManager* GetIconManager() = 0; - //! Get Panel Editor Utilities - virtual IEditorPanelUtils* GetEditorPanelUtils() = 0; //! Get Music Manager. virtual CMusicManager* GetMusicManager() = 0; virtual float GetTerrainElevation(float x, float y) = 0; diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp index 5bd816174c..0846cf8a9e 100644 --- a/Code/Editor/IEditorImpl.cpp +++ b/Code/Editor/IEditorImpl.cpp @@ -81,9 +81,6 @@ AZ_POP_DISABLE_WARNING // AWSNativeSDK #include -#include "IEditorPanelUtils.h" -#include "EditorPanelUtils.h" - #include "Core/QtEditorApplication.h" // for Editor::EditorQtApplication static CCryEditDoc * theDocument; @@ -143,7 +140,6 @@ CEditorImpl::CEditorImpl() , m_QtApplication(static_cast(qApp)) , m_pImageUtil(nullptr) , m_pLogFile(nullptr) - , m_panelEditorUtils(nullptr) { // note that this is a call into EditorCore.dll, which stores the g_pEditorPointer for all shared modules that share EditorCore.dll // this means that they don't need to do SetIEditor(...) themselves and its available immediately @@ -167,8 +163,6 @@ CEditorImpl::CEditorImpl() m_pDisplaySettings->LoadRegistry(); m_pPluginManager = new CPluginManager; - m_panelEditorUtils = CreateEditorPanelUtils(); - m_pObjectManager = new CObjectManager; m_pViewManager = new CViewManager; m_pIconManager = new CIconManager; @@ -301,8 +295,6 @@ CEditorImpl::~CEditorImpl() SAFE_DELETE(m_pViewManager) SAFE_DELETE(m_pObjectManager) // relies on prefab manager - SAFE_DELETE(m_panelEditorUtils); - // some plugins may be exporter - this must be above plugin manager delete. SAFE_DELETE(m_pExportManager); @@ -1658,8 +1650,3 @@ void CEditorImpl::DestroyQMimeData(QMimeData* data) const { delete data; } - -IEditorPanelUtils* CEditorImpl::GetEditorPanelUtils() -{ - return m_panelEditorUtils; -} diff --git a/Code/Editor/IEditorImpl.h b/Code/Editor/IEditorImpl.h index 4976c0c1ca..d99b8ae802 100644 --- a/Code/Editor/IEditorImpl.h +++ b/Code/Editor/IEditorImpl.h @@ -298,7 +298,6 @@ public: IEditorMaterialManager* GetIEditorMaterialManager() override; // Vladimir@Conffx IImageUtil* GetImageUtil() override; // Vladimir@conffx SEditorSettings* GetEditorSettings() override; - IEditorPanelUtils* GetEditorPanelUtils() override; ILogFile* GetLogFile() override { return m_pLogFile; } void UnloadPlugins() override; @@ -356,7 +355,6 @@ protected: CErrorsDlg* m_pErrorsDlg; //! Source control interface. ISourceControl* m_pSourceControl; - IEditorPanelUtils* m_panelEditorUtils; CSelectionTreeManager* m_pSelectionTreeManager; diff --git a/Code/Editor/IEditorPanelUtils.h b/Code/Editor/IEditorPanelUtils.h deleted file mode 100644 index 4649213ae7..0000000000 --- a/Code/Editor/IEditorPanelUtils.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -#ifndef CRYINCLUDE_CRYEDITOR_IPANELEDITORUTILS_H -#define CRYINCLUDE_CRYEDITOR_IPANELEDITORUTILS_H -#pragma once - -#include "Cry_Vector3.h" - -#include "DisplaySettings.h" -#include "Include/IDisplayViewport.h" -#include "Include/IIconManager.h" -#include -#include -#include -#include - -class CBaseObject; -class CViewport; -class IQToolTip; - -struct HotKey -{ - HotKey() - : path("") - , sequence(QKeySequence()) - { - } - void CopyFrom(const HotKey& other) - { - path = other.path; - sequence = other.sequence; - } - void SetPath(const char* _path) - { - path = QString(_path); - } - void SetSequenceFromString(const char* _sequence) - { - sequence = QKeySequence::fromString(_sequence); - } - void SetSequence(const QKeySequence& other) - { - sequence = other; - } - bool IsMatch(QString _path) - { - return path.compare(_path, Qt::CaseInsensitive) == 0; - } - bool IsMatch(QKeySequence _sequence) - { - return sequence.matches(_sequence); - } - bool operator < (const HotKey& other) const - { - //split the paths into lists compare per level - QStringList m_categories = path.split('.'); - QStringList o_categories = other.path.split('.'); - int m_catSize = m_categories.size(); - int o_catSize = o_categories.size(); - int size = (m_catSize < o_catSize) ? m_catSize : o_catSize; - - //sort categories to keep them together - for (int i = 0; i < size; i++) - { - if (m_categories[i] < o_categories[i]) - { - return true; - } - if (m_categories[i] > o_categories[i]) - { - return false; - } - } - //if comparing a category and a item in that category the category is < item - return m_catSize > o_catSize; - } - QKeySequence sequence; - QString path; -}; - -struct IEditorPanelUtils -{ - virtual ~IEditorPanelUtils() {} - virtual void SetViewportDragOperation(void(*)(CViewport* viewport, int dragPointX, int dragPointY, void* custom), void* custom) = 0; - - //PREVIEW WINDOW UTILS//////////////////////////////////////////////////// - virtual int PreviewWindow_GetDisplaySettingsDebugFlags(CDisplaySettings* settings) = 0; - virtual void PreviewWindow_SetDisplaySettingsDebugFlags(CDisplaySettings* settings, int flags) = 0; - - //HOTKEY UTILS//////////////////////////////////////////////////////////// - virtual bool HotKey_Import() = 0; - virtual void HotKey_Export() = 0; - virtual QKeySequence HotKey_GetShortcut(const char* path) = 0; - virtual bool HotKey_IsPressed(const QKeyEvent* event, const char* path) = 0; - virtual bool HotKey_IsPressed(const QShortcutEvent* event, const char* path) = 0; - virtual bool HotKey_LoadExisting() = 0; - virtual void HotKey_SaveCurrent() = 0; - virtual void HotKey_BuildDefaults() = 0; - virtual void HotKey_SetKeys(QVector keys) = 0; - virtual QVector HotKey_GetKeys() = 0; - virtual QString HotKey_GetPressedHotkey(const QKeyEvent* event) = 0; - virtual QString HotKey_GetPressedHotkey(const QShortcutEvent* event) = 0; - virtual void HotKey_SetEnabled(bool val) = 0; - virtual bool HotKey_IsEnabled() const = 0; - - //TOOLTIP UTILS/////////////////////////////////////////////////////////// - - //! Loads a table of tooltip configuration data from an xml file. - virtual void ToolTip_LoadConfigXML(QString filepath) = 0; - - //! Initializes a QToolTipWidget from loaded configuration data (see ToolTip_LoadConfigXML()) - //! \param tooltip Will be initialized using loaded configuration data - //! \param path Variable serialization path. Will be used as the key for looking up data in the configuration table. (ex: "Rotation.Rotation_Rate_X") - //! \param option Name of a sub-option of the variable specified by "path". (ex: "Emitter_Strength" will look up the tooltip data for "Rotation.Rotation_Rate_X.Emitter_Strength") - //! \param optionalData The argument to be used with "special_content" feature. See ToolTip_GetSpecialContentType() and QToolTipWidget::AddSpecialContent(). - //! \param isEnabled If false, the tooltip will indicate the reason why the widget is disabled. - virtual void ToolTip_BuildFromConfig(IQToolTip* tooltip, QString path, QString option, QString optionalData = "", bool isEnabled = true) = 0; - - virtual QString ToolTip_GetTitle(QString path, QString option = "") = 0; - virtual QString ToolTip_GetContent(QString path, QString option = "") = 0; - virtual QString ToolTip_GetSpecialContentType(QString path, QString option = "") = 0; - virtual QString ToolTip_GetDisabledContent(QString path, QString option = "") = 0; -}; - - -#endif diff --git a/Code/Editor/Lib/Tests/IEditorMock.h b/Code/Editor/Lib/Tests/IEditorMock.h index 390ffebe79..590f98e6d7 100644 --- a/Code/Editor/Lib/Tests/IEditorMock.h +++ b/Code/Editor/Lib/Tests/IEditorMock.h @@ -187,6 +187,5 @@ public: MOCK_METHOD0(UnloadPlugins, void()); MOCK_METHOD0(LoadPlugins, void()); MOCK_METHOD1(GetSearchPath, QString(EEditorPathName)); - MOCK_METHOD0(GetEditorPanelUtils, IEditorPanelUtils* ()); }; diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index a63a74f01d..a018333925 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -334,23 +334,12 @@ set(FILES Controls/ConsoleSCB.qrc Controls/FolderTreeCtrl.cpp Controls/FolderTreeCtrl.h - Controls/HotTrackingTreeCtrl.cpp - Controls/HotTrackingTreeCtrl.h Controls/ImageHistogramCtrl.cpp Controls/ImageHistogramCtrl.h - Controls/ImageListCtrl.cpp - Controls/ImageListCtrl.h - Controls/MultiMonHelper.cpp - Controls/MultiMonHelper.h - Controls/NumberCtrl.cpp - Controls/NumberCtrl.h - Controls/NumberCtrl.h Controls/SplineCtrl.cpp Controls/SplineCtrl.h Controls/SplineCtrlEx.cpp Controls/SplineCtrlEx.h - Controls/TextEditorCtrl.cpp - Controls/TextEditorCtrl.h Controls/TimelineCtrl.cpp Controls/TimelineCtrl.h Controls/WndGridHelper.h @@ -796,9 +785,6 @@ set(FILES ViewportTitleDlg.h EditorEnvironment.cpp EditorEnvironment.h - IEditorPanelUtils.h - EditorPanelUtils.h - EditorPanelUtils.cpp ) From 30e21bc2d115f9309a3629df0ac71837861d8e8a Mon Sep 17 00:00:00 2001 From: mrieggeramzn Date: Tue, 4 Jan 2022 14:52:00 -0800 Subject: [PATCH 250/399] Updating formatting Signed-off-by: mrieggeramzn --- .../UI/PropertyEditor/PropertyIntCtrlCommon.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h index 7d3e7191e3..504e3fd0dc 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h @@ -92,15 +92,11 @@ namespace AzToolsFramework { toolTipString += "\n"; } - toolTipString += "["; const QString minString = QLocale().toString(propertyControl->minimum()); const QString maxString = QLocale().toString(propertyControl->maximum()); + toolTipString += QString("[%1, %2]").arg(minString).arg(maxString); - toolTipString += minString; - toolTipString += ", "; - toolTipString += maxString; - toolTipString += "]"; return true; } return false; @@ -121,10 +117,8 @@ namespace AzToolsFramework const QString minString = QLocale().toString(propertyControl->minimum()); const QString maxString = QLocale().toString(propertyControl->maximum()); + toolTipString += QString("[%1, %2]").arg(minString).arg(maxString); - toolTipString += "[" + minString + ", "; - toolTipString += maxString; - toolTipString += "]"; return true; } return false; From daf4dbb54d94b1c4240a273a9fdd831cce543339 Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Tue, 4 Jan 2022 15:14:35 -0800 Subject: [PATCH 251/399] Fix LyShine debug display to work with Atom (#6516) * LyShine cleanup pass for Atom conversion Signed-off-by: abrmich * Add GHI numbers to comments Signed-off-by: abrmich * Fix debug texture data Signed-off-by: abrmich * Fix debug canvas and draw call data Signed-off-by: abrmich * Add GHI issue Signed-off-by: abrmich * Address PR feedback Signed-off-by: abrmich * Remove unused variable Signed-off-by: abrmich --- Gems/LyShine/Code/Include/LyShine/Draw2d.h | 3 + Gems/LyShine/Code/Source/Draw2d.cpp | 6 + Gems/LyShine/Code/Source/RenderGraph.cpp | 15 ++- Gems/LyShine/Code/Source/UiCanvasManager.cpp | 30 ++--- Gems/LyShine/Code/Source/UiRenderer.cpp | 123 +++++++++---------- Gems/LyShine/Code/Source/UiRenderer.h | 7 +- 6 files changed, 92 insertions(+), 92 deletions(-) diff --git a/Gems/LyShine/Code/Include/LyShine/Draw2d.h b/Gems/LyShine/Code/Include/LyShine/Draw2d.h index 8123a834a1..881479bd23 100644 --- a/Gems/LyShine/Code/Include/LyShine/Draw2d.h +++ b/Gems/LyShine/Code/Include/LyShine/Draw2d.h @@ -205,6 +205,9 @@ public: // member functions //! Get the height of the rendering viewport (in pixels). float GetViewportHeight() const; + //! Get dpi scale factor + float GetViewportDpiScalingFactor() const; + //! Get the default values that would be used if no image options were passed in // //! This is a convenient way to initialize the imageOptions struct diff --git a/Gems/LyShine/Code/Source/Draw2d.cpp b/Gems/LyShine/Code/Source/Draw2d.cpp index f2c7c360d2..6b6356aa4f 100644 --- a/Gems/LyShine/Code/Source/Draw2d.cpp +++ b/Gems/LyShine/Code/Source/Draw2d.cpp @@ -452,6 +452,12 @@ float CDraw2d::GetViewportHeight() const return viewHeight; } +//////////////////////////////////////////////////////////////////////////////////////////////////// +float CDraw2d::GetViewportDpiScalingFactor() const +{ + return GetViewportContext()->GetDpiScalingFactor(); +} + //////////////////////////////////////////////////////////////////////////////////////////////////// const CDraw2d::ImageOptions& CDraw2d::GetDefaultImageOptions() const { diff --git a/Gems/LyShine/Code/Source/RenderGraph.cpp b/Gems/LyShine/Code/Source/RenderGraph.cpp index db17fde601..c05e87bc64 100644 --- a/Gems/LyShine/Code/Source/RenderGraph.cpp +++ b/Gems/LyShine/Code/Source/RenderGraph.cpp @@ -122,14 +122,10 @@ namespace LyShine uint32_t isClampTextureMode = 0; for (int i = 0; i < m_numTextures; ++i) { - const AZ::RHI::ImageView* imageView = m_textures[i].m_texture ? m_textures[i].m_texture->GetImageView() : nullptr; - - if (!imageView) - { - // Default to white texture - auto image = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::White); - imageView = image->GetImageView(); - } + // Default to white texture + const AZ::Data::Instance& image = m_textures[i].m_texture ? m_textures[i].m_texture + : AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::White); + const AZ::RHI::ImageView* imageView = image->GetImageView(); if (imageView) { @@ -138,6 +134,9 @@ namespace LyShine { isClampTextureMode |= (1 << i); } +#ifndef _RELEASE + uiRenderer->DebugUseTexture(image); +#endif } } diff --git a/Gems/LyShine/Code/Source/UiCanvasManager.cpp b/Gems/LyShine/Code/Source/UiCanvasManager.cpp index 62d1c6e2a8..c6564f9b3a 100644 --- a/Gems/LyShine/Code/Source/UiCanvasManager.cpp +++ b/Gems/LyShine/Code/Source/UiCanvasManager.cpp @@ -999,26 +999,23 @@ void UiCanvasManager::DebugDisplayCanvasData(int setting) const CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); - float xOffset = 20.0f; - float yOffset = 20.0f; + float dpiScale = draw2d->GetViewportDpiScalingFactor(); + float xOffset = 20.0f * dpiScale; + float yOffset = 20.0f * dpiScale; const int elementNameFieldLength = 20; auto blackTexture = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Black); - float textOpacity = 1.0f; - float backgroundRectOpacity = 0.75f; + float backgroundRectOpacity = 0.0f; // 0.75f; // [GHI #6515] Reenable background rect const AZ::Vector3 white(1.0f, 1.0f, 1.0f); const AZ::Vector3 grey(0.5f, 0.5f, 0.5f); const AZ::Vector3 red(1.0f, 0.3f, 0.3f); const AZ::Vector3 blue(0.3f, 0.3f, 1.0f); - // If the viewport is narrow then a font size of 16 might be too large, so we use a size between 12 and 16 depending - // on the viewport width. - float fontSize(draw2d->GetViewportWidth() / 75.f); - fontSize = AZ::GetClamp(fontSize, 12.f, 16.f); - const float lineSpacing = fontSize; + const float fontSize = 8.0f; + const float lineSpacing = 20.0f * dpiScale; // local function to write a line of text (with a background rect) and increment Y offset AZStd::function WriteLine = [&](const char* buffer, const AZ::Vector3& color) @@ -1157,13 +1154,13 @@ void UiCanvasManager::DebugDisplayDrawCallData() const { CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); - float xOffset = 20.0f; - float yOffset = 20.0f; + float dpiScale = draw2d->GetViewportDpiScalingFactor(); + float xOffset = 20.0f * dpiScale; + float yOffset = 20.0f * dpiScale; auto blackTexture = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Black); float textOpacity = 1.0f; - float backgroundRectOpacity = 0.75f; - const float lineSpacing = 20.0f; + float backgroundRectOpacity = 0.0f; // 0.75f; // [GHI #6515] Reenable background rect const AZ::Vector3 white(1,1,1); const AZ::Vector3 red(1,0.3f,0.3f); @@ -1171,16 +1168,19 @@ void UiCanvasManager::DebugDisplayDrawCallData() const const AZ::Vector3 green(0.3f,1,0.3f); const AZ::Vector3 yellow(0.7f,0.7f,0.2f); + const float fontSize = 8.0f; + const float lineSpacing = 20.0f * dpiScale; + // local function to write a line of text (with a background rect) and increment Y offset AZStd::function WriteLine = [&](const char* buffer, const AZ::Vector3& color) { CDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); textOptions.color = color; - AZ::Vector2 textSize = draw2d->GetTextSize(buffer, 16, &textOptions); + AZ::Vector2 textSize = draw2d->GetTextSize(buffer, fontSize, &textOptions); AZ::Vector2 rectTopLeft = AZ::Vector2(xOffset - 2, yOffset); AZ::Vector2 rectSize = AZ::Vector2(textSize.GetX() + 4, lineSpacing); draw2d->DrawImage(blackTexture, rectTopLeft, rectSize, backgroundRectOpacity); - draw2d->DrawText(buffer, AZ::Vector2(xOffset, yOffset), 16, textOpacity, &textOptions); + draw2d->DrawText(buffer, AZ::Vector2(xOffset, yOffset), fontSize, textOpacity, &textOptions); yOffset += lineSpacing; }; diff --git a/Gems/LyShine/Code/Source/UiRenderer.cpp b/Gems/LyShine/Code/Source/UiRenderer.cpp index b43be90a36..64ec1bb485 100644 --- a/Gems/LyShine/Code/Source/UiRenderer.cpp +++ b/Gems/LyShine/Code/Source/UiRenderer.cpp @@ -216,17 +216,11 @@ void UiRenderer::BeginUiFrameRender() m_texturesUsedInFrame.clear(); } #endif - - // Various platform drivers expect all texture slots used in the shader to be bound - BindNullTexture(); } //////////////////////////////////////////////////////////////////////////////////////////////////// void UiRenderer::EndUiFrameRender() { - // We never want to leave a texture bound that could get unloaded before the next render - // So bind the global white texture for all the texture units we use. - BindNullTexture(); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -384,45 +378,6 @@ void UiRenderer::DecrementStencilRef() --m_stencilRef; } -#ifdef LYSHINE_ATOM_TODO -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiRenderer::SetTexture(ITexture* texture, int texUnit, bool clamp) -{ - if (!texture) - { - texture = m_renderer->GetWhiteTexture(); - } - else - { - texture->SetClamp(clamp); - } - - m_renderer->SetTexture(texture->GetTextureID(), texUnit); - -#ifndef _RELEASE - if (m_debugTextureDataRecordLevel > 0) - { - m_texturesUsedInFrame.insert(texture); - } -#endif -} -#endif - - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiRenderer::BindNullTexture() -{ -#ifdef LYSHINE_ATOM_TODO - // Bind the global white texture for all the texture units we use - const int MaxTextures = 16; - int whiteTexId = m_renderer->GetWhiteTextureId(); - for (int texUnit = 0; texUnit < MaxTextures; ++texUnit) - { - m_renderer->SetTexture(whiteTexId, texUnit); - } -#endif -} - #ifndef _RELEASE //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -436,38 +391,42 @@ void UiRenderer::DebugDisplayTextureData(int recordingOption) { if (recordingOption > 0) { -#ifdef LYSHINE_ATOM_TODO // [GHI #3568] Support canvas debug display with Atom // compute the total area of all the textures, also create a vector that we can sort by area - AZStd::vector textures; + AZStd::vector, uint32_t>> textures; int totalArea = 0; int totalDataSize = 0; - for (ITexture* texture : m_texturesUsedInFrame) + for (AZ::Data::Instance image : m_texturesUsedInFrame) { - int area = texture->GetWidth() * texture->GetHeight(); - int dataSize = texture->GetDataSize(); + const AZ::RHI::ImageDescriptor& imageDescriptor = image->GetRHIImage()->GetDescriptor(); + AZ::RHI::Size size = imageDescriptor.m_size; + int area = size.m_width * size.m_height; + uint32_t dataSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format) * area; + totalArea += area; totalDataSize += dataSize; - textures.push_back(texture); + textures.push_back(AZStd::pair, uint32_t>(image, dataSize)); } // sort the vector by data size - std::sort( textures.begin( ), textures.end( ), [ ]( const ITexture* lhs, const ITexture* rhs ) + std::sort( textures.begin( ), textures.end( ), [ ]( const AZStd::pair, uint32_t> lhs, const AZStd::pair, uint32_t> rhs ) { - return lhs->GetDataSize() > rhs->GetDataSize(); + return lhs.second > rhs.second; }); CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); // setup to render lines of text for the debug display - float xOffset = 20.0f; - float yOffset = 20.0f; + float dpiScale = GetViewportContext()->GetDpiScalingFactor(); + float xOffset = 20.0f * dpiScale; + float yOffset = 20.0f * dpiScale; auto blackTexture = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Black); float textOpacity = 1.0f; - float backgroundRectOpacity = 0.75f; - const float lineSpacing = 20.0f; + float backgroundRectOpacity = 0.0f; // 0.75f; // [GHI #6515] Reenable background rect + const float fontSize = 8.0f; + const float lineSpacing = 20.0f * dpiScale; const AZ::Vector3 white(1,1,1); const AZ::Vector3 red(1,0.3f,0.3f); @@ -492,29 +451,61 @@ void UiRenderer::DebugDisplayTextureData(int recordingOption) { CDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); textOptions.color = color; - AZ::Vector2 textSize = draw2d->GetTextSize(buffer, 16, &textOptions); + AZ::Vector2 textSize = draw2d->GetTextSize(buffer, fontSize, &textOptions); AZ::Vector2 rectTopLeft = AZ::Vector2(xOffset - 2, yOffset); AZ::Vector2 rectSize = AZ::Vector2(textSize.GetX() + 4, lineSpacing); draw2d->DrawImage(blackTexture, rectTopLeft, rectSize, backgroundRectOpacity); - draw2d->DrawText(buffer, AZ::Vector2(xOffset, yOffset), 16, textOpacity, &textOptions); + draw2d->DrawText(buffer, AZ::Vector2(xOffset, yOffset), fontSize, textOpacity, &textOptions); yOffset += lineSpacing; }; - int numTexturesUsedInFrame = m_texturesUsedInFrame.size(); + size_t numTexturesUsedInFrame = m_texturesUsedInFrame.size(); char buffer[200]; - sprintf_s(buffer, "There are %d unique UI textures rendered in this frame, the total texture area is %d (%d x %d), total data size is %d (%.2f MB)", + sprintf_s(buffer, "There are %zu unique UI textures rendered in this frame, the total texture area is %d (%d x %d), total data size is %d (%.2f MB)", numTexturesUsedInFrame, totalArea, xDim, yDim, totalDataSize, totalDataSizeMB); WriteLine(buffer, white); - sprintf_s(buffer, "Dimensions Data Size Format Texture name"); + sprintf_s(buffer, "Dimensions Data Size Format Texture name"); WriteLine(buffer, blue); - for (ITexture* texture : textures) + for (auto texture : textures) { - sprintf_s(buffer, "%4d x %4d, %9d %8s %s", - texture->GetWidth(), texture->GetHeight(), texture->GetDataSize(), texture->GetFormatName(), texture->GetName()); + AZ::Data::Instance image = texture.first; + const AZ::RHI::ImageDescriptor& imageDescriptor = image->GetRHIImage()->GetDescriptor(); + uint32_t width = imageDescriptor.m_size.m_width; + uint32_t height = imageDescriptor.m_size.m_height; + uint32_t dataSize = texture.second; + + const char* displayName = "Unnamed Texture"; + AZStd::string imagePath; + // Check if the image has been assigned a name (ex. if it's an attachment image or a cpu generated image) + const AZ::Name& imageName = image->GetRHIImage()->GetName(); + if (!imageName.IsEmpty()) + { + displayName = imageName.GetCStr(); + } + else + { + // Use the image's asset path as the display name + AZ::Data::AssetCatalogRequestBus::BroadcastResult(imagePath, + &AZ::Data::AssetCatalogRequests::GetAssetPathById, image->GetAssetId()); + if (!imagePath.empty()) + { + displayName = imagePath.c_str(); + } + } + + sprintf_s(buffer, "%4u x %4u, %9u %19s %s", + width, height, dataSize, AZ::RHI::ToString(imageDescriptor.m_format), displayName); WriteLine(buffer, white); } -#endif + } +} + +void UiRenderer::DebugUseTexture(AZ::Data::Instance image) +{ + if (m_debugTextureDataRecordLevel > 0) + { + m_texturesUsedInFrame.insert(image); } } diff --git a/Gems/LyShine/Code/Source/UiRenderer.h b/Gems/LyShine/Code/Source/UiRenderer.h index 3ff3de5507..35705441f5 100644 --- a/Gems/LyShine/Code/Source/UiRenderer.h +++ b/Gems/LyShine/Code/Source/UiRenderer.h @@ -19,8 +19,6 @@ #include #endif -class ITexture; - //////////////////////////////////////////////////////////////////////////////////////////////////// //! UI render interface // @@ -137,6 +135,9 @@ public: // member functions //! Display debug texture data after rendering void DebugDisplayTextureData(int recordingOption); + + //! Track textures being used in the current frame + void DebugUseTexture(AZ::Data::Instance image); #endif private: // member functions @@ -179,6 +180,6 @@ protected: // attributes #ifndef _RELEASE int m_debugTextureDataRecordLevel = 0; - AZStd::unordered_set m_texturesUsedInFrame; // [LYN-7857] - Support debug display with Atom + AZStd::unordered_set> m_texturesUsedInFrame; #endif }; From 04f4d5e0318eac4d01f8f72e5a2b06a0da6d5388 Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Tue, 26 Oct 2021 16:36:35 -0700 Subject: [PATCH 252/399] [Linux] Avoid recursive inotify when a watch folder is set to recursive=false Signed-off-by: Chris Burel --- .../native/FileWatcher/FileWatcher_linux.cpp | 31 +++++++++++++++---- .../native/FileWatcher/FileWatcher.cpp | 6 ++-- .../native/FileWatcher/FileWatcher.h | 5 +-- .../utilities/ApplicationManagerBase.cpp | 2 +- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp index b7f7affd6d..f63282abfc 100644 --- a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp +++ b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp @@ -63,7 +63,7 @@ struct FolderRootWatch::PlatformImplementation } } - void AddWatchFolder(QString folder) + void AddWatchFolder(QString folder, bool recursive) { if (m_iNotifyHandle >= 0) { @@ -75,6 +75,11 @@ struct FolderRootWatch::PlatformImplementation cleanPath.toUtf8().constData(), IN_CREATE | IN_CLOSE_WRITE | IN_DELETE | IN_DELETE_SELF | IN_MODIFY | IN_MOVE); + if (watchHandle < 0) + { + AZ_Error("FileWatcher", false, "inotify_add_watch failed for path %s", cleanPath.toUtf8().constData()); + return; + } if (!m_handleToFolderMapLock.tryLock(s_handleToFolderMapLockTimeout)) { AZ_Error("FileWatcher", false, "Unable to obtain inotify handle lock on thread"); @@ -83,6 +88,11 @@ struct FolderRootWatch::PlatformImplementation m_handleToFolderMap[watchHandle] = cleanPath; m_handleToFolderMapLock.unlock(); + if (!recursive) + { + return; + } + // Add all the subfolders to watch and track them QDirIterator dirIter(folder, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks); @@ -97,6 +107,11 @@ struct FolderRootWatch::PlatformImplementation int watchHandle = inotify_add_watch(m_iNotifyHandle, dirName.toUtf8().constData(), IN_CREATE | IN_CLOSE_WRITE | IN_DELETE | IN_DELETE_SELF | IN_MODIFY | IN_MOVE); + if (watchHandle < 0) + { + AZ_Error("FileWatcher", false, "inotify_add_watch failed for path %s", dirName.toUtf8().constData()); + return; + } if (!m_handleToFolderMapLock.tryLock(s_handleToFolderMapLockTimeout)) { @@ -133,10 +148,11 @@ struct FolderRootWatch::PlatformImplementation ////////////////////////////////////////////////////////////////////////////// /// FolderWatchRoot -FolderRootWatch::FolderRootWatch(const QString rootFolder) +FolderRootWatch::FolderRootWatch(const QString rootFolder, bool recursive) : m_root(rootFolder) , m_shutdownThreadSignal(false) , m_fileWatcher(nullptr) + , m_recursive(recursive) , m_platformImpl(new PlatformImplementation()) { } @@ -156,10 +172,13 @@ bool FolderRootWatch::Start() { return false; } - m_platformImpl->AddWatchFolder(m_root); + m_platformImpl->AddWatchFolder(m_root, m_recursive); m_shutdownThreadSignal = false; - m_thread = std::thread([this]() { WatchFolderLoop(); }); + if (m_platformImpl->m_iNotifyHandle >= 0) + { + m_thread = std::thread([this]() { WatchFolderLoop(); }); + } return true; } @@ -200,10 +219,10 @@ void FolderRootWatch::WatchFolderLoop() if (event->mask & (IN_CREATE | IN_MOVED_TO)) { - if ( event->mask & IN_ISDIR ) + if ( event->mask & IN_ISDIR && m_recursive) { // New Directory, add it to the watch - m_platformImpl->AddWatchFolder(pathStr); + m_platformImpl->AddWatchFolder(pathStr, true); } else { diff --git a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp index ff9876ebdd..4d4b4e9690 100644 --- a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp +++ b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp @@ -49,7 +49,7 @@ FileWatcher::~FileWatcher() { } -int FileWatcher::AddFolderWatch(FolderWatchBase* pFolderWatch) +int FileWatcher::AddFolderWatch(FolderWatchBase* pFolderWatch, bool recursive) { if (!pFolderWatch) { @@ -72,7 +72,7 @@ int FileWatcher::AddFolderWatch(FolderWatchBase* pFolderWatch) if (!pFolderRootWatch) { //create a new root and start listening for changes - pFolderRootWatch = new FolderRootWatch(pFolderWatch->m_folder); + pFolderRootWatch = new FolderRootWatch(pFolderWatch->m_folder, recursive); //make sure the folder watcher(s) get deleted before this pFolderRootWatch->setParent(this); @@ -93,7 +93,7 @@ int FileWatcher::AddFolderWatch(FolderWatchBase* pFolderWatch) //of other roots, if it is then then fold those roots into the new super root for (auto rootsIter = m_folderWatchRoots.begin(); rootsIter != m_folderWatchRoots.end(); ) { - if (FolderWatchBase::IsSubfolder((*rootsIter)->m_root, pFolderWatch->m_folder)) + if (pFolderWatch->m_watchSubtree && FolderWatchBase::IsSubfolder((*rootsIter)->m_root, pFolderWatch->m_folder)) { //union the sub folder map over to the new root pFolderRootWatch->m_subFolderWatchesMap.insert((*rootsIter)->m_subFolderWatchesMap); diff --git a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.h b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.h index 392f8194a6..fc3f109604 100644 --- a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.h +++ b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.h @@ -33,7 +33,7 @@ class FolderRootWatch friend class FileWatcher; public: - FolderRootWatch(const QString rootFolder); + FolderRootWatch(const QString rootFolder, bool recursive = true); virtual ~FolderRootWatch(); void ProcessNewFileEvent(const QString& file); @@ -54,6 +54,7 @@ private: QMap m_subFolderWatchesMap; volatile bool m_shutdownThreadSignal; FileWatcher* m_fileWatcher; + bool m_recursive; // Can't use unique_ptr because this is a QObject and Qt's magic sauce is // unable to determine the size of the unique_ptr and so fails to compile @@ -76,7 +77,7 @@ public: virtual ~FileWatcher(); ////////////////////////////////////////////////////////////////////////// - virtual int AddFolderWatch(FolderWatchBase* pFolderWatch); + virtual int AddFolderWatch(FolderWatchBase* pFolderWatch, bool recursive = true); virtual void RemoveFolderWatch(int handle); ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp index 04036602db..f9827bda2e 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp @@ -461,7 +461,7 @@ void ApplicationManagerBase::InitFileMonitor() m_fileProcessor.get(), &AssetProcessor::FileProcessor::AssessDeletedFile); m_folderWatches.push_back(AZStd::unique_ptr(newFolderWatch)); - m_watchHandles.push_back(m_fileWatcher.AddFolderWatch(newFolderWatch)); + m_watchHandles.push_back(m_fileWatcher.AddFolderWatch(newFolderWatch, info.RecurseSubFolders())); } // also hookup monitoring for the cache (output directory) From 7ac5bc3d5cb54701b9ffea18ebb660d2fa673081 Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Mon, 15 Nov 2021 11:06:32 -0800 Subject: [PATCH 253/399] [Linux] Display a warning in AP if inotify fails to initialize Signed-off-by: Chris Burel --- .../Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp index f63282abfc..d20bb6c5b4 100644 --- a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp +++ b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp @@ -34,6 +34,12 @@ struct FolderRootWatch::PlatformImplementation { // The CLOEXEC flag prevents the inotify watchers from copying on fork/exec m_iNotifyHandle = inotify_init1(IN_CLOEXEC); + const auto err = errno; + + if (m_iNotifyHandle < 0) + { + AZ_Warning("FileWatcher", false, "Unable to initialize inotify, file monitoring will not be available: %s\n", strerror(err)); + } } return (m_iNotifyHandle >= 0); } From ce0bb1ca2be99c7677c6a94d9b96bc5796f48e77 Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Mon, 15 Nov 2021 11:30:37 -0800 Subject: [PATCH 254/399] [AssetProcessor] Refactor the FileWatcher to use only one watch thread This change reworks the AssetProcessor's FileWatcher so that it only uses one thread. This is motivated by getting better support for inotify on Linux. The previous architecture required calling `inotify_init` once for each directory that was being watched, and using separate inotify instances for each watched tree. In addition, having separate threads per watched tree is not necessary, and just consumes system resources. Each platform supports watching multiple directories with the same platform-specific watcher API, so each platform has been updated accordingly. The interface to the FileWatcher class is greatly simplified. Previously, it supported client-supplied filtering of the paths that would generate notifications. This was done by subclassing `FolderWatchBase` and implementing `OnFileChange`. However, only one filter was ever used, so that filter is now hard-coded in the FileWatcher class, and the classes driving the old filtering mechanism are removed. Users of the interface now have a much easier time, they just call `AddFolderWatch` with the path to watch, and only have to connect to one set of signals, instead of separate signals per watched directory. Signed-off-by: Chris Burel --- .../Linux/assetprocessor_linux_files.cmake | 2 + .../native/FileWatcher/FileWatcher_linux.cpp | 287 +++++++----------- .../native/FileWatcher/FileWatcher_linux.h | 26 ++ .../native/FileWatcher/FileWatcher_platform.h | 11 + .../Mac/assetprocessor_mac_files.cmake | 2 + .../Mac/native/FileWatcher/FileWatcher_mac.h | 20 ++ .../native/FileWatcher/FileWatcher_macos.cpp | 84 ++--- .../native/FileWatcher/FileWatcher_platform.h | 11 + .../native/FileWatcher/FileWatcher_win.cpp | 130 -------- .../assetprocessor_windows_files.cmake | 2 + .../native/FileWatcher/FileWatcher_platform.h | 11 + .../native/FileWatcher/FileWatcher_win.cpp | 199 ++++++------ .../native/FileWatcher/FileWatcher_windows.h | 65 ++++ .../assetprocessor_static_files.cmake | 1 - .../native/FileWatcher/FileWatcher.cpp | 248 ++++++++------- .../native/FileWatcher/FileWatcher.h | 96 +++--- .../native/FileWatcher/FileWatcherAPI.h | 222 -------------- .../native/unittests/FileWatcherUnitTests.cpp | 16 +- .../native/utilities/ApplicationManager.h | 1 - .../utilities/ApplicationManagerBase.cpp | 98 +++--- .../native/utilities/ApplicationManagerBase.h | 3 - .../native/utilities/AssetBuilderInfo.h | 1 - 22 files changed, 631 insertions(+), 905 deletions(-) create mode 100644 Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.h create mode 100644 Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_platform.h create mode 100644 Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_mac.h create mode 100644 Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_platform.h delete mode 100644 Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_win.cpp create mode 100644 Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_platform.h create mode 100644 Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_windows.h delete mode 100644 Code/Tools/AssetProcessor/native/FileWatcher/FileWatcherAPI.h diff --git a/Code/Tools/AssetProcessor/Platform/Linux/assetprocessor_linux_files.cmake b/Code/Tools/AssetProcessor/Platform/Linux/assetprocessor_linux_files.cmake index 25f5c41445..b21393bcaa 100644 --- a/Code/Tools/AssetProcessor/Platform/Linux/assetprocessor_linux_files.cmake +++ b/Code/Tools/AssetProcessor/Platform/Linux/assetprocessor_linux_files.cmake @@ -8,4 +8,6 @@ set(FILES native/FileWatcher/FileWatcher_linux.cpp + native/FileWatcher/FileWatcher_linux.h + native/FileWatcher/FileWatcher_platform.h ) diff --git a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp index d20bb6c5b4..7d38372e18 100644 --- a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp +++ b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp @@ -5,7 +5,10 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ + +#include #include +#include #include #include @@ -15,180 +18,127 @@ #include -static constexpr int s_handleToFolderMapLockTimeout = 1000; // 1 sec timeout for obtaining the handle to folder map lock -static constexpr size_t s_iNotifyMaxEntries = 1024 * 16; // Control the maximum number of entries (from inotify) that can be read at one time -static constexpr size_t s_iNotifyEventSize = sizeof(struct inotify_event); -static constexpr size_t s_iNotifyReadBufferSize = s_iNotifyMaxEntries * s_iNotifyEventSize; +static constexpr size_t s_inotifyMaxEntries = 1024 * 16; // Control the maximum number of entries (from inotify) that can be read at one time +static constexpr size_t s_inotifyEventSize = sizeof(struct inotify_event); +static constexpr size_t s_inotifyReadBufferSize = s_inotifyMaxEntries * s_inotifyEventSize; -struct FolderRootWatch::PlatformImplementation +bool FileWatcher::PlatformImplementation::Initialize() { - PlatformImplementation() = default; - - int m_iNotifyHandle = -1; - QMutex m_handleToFolderMapLock; - QHash m_handleToFolderMap; - - bool Initialize() + if (m_inotifyHandle < 0) { - if (m_iNotifyHandle < 0) - { - // The CLOEXEC flag prevents the inotify watchers from copying on fork/exec - m_iNotifyHandle = inotify_init1(IN_CLOEXEC); - const auto err = errno; + // The CLOEXEC flag prevents the inotify watchers from copying on fork/exec + m_inotifyHandle = inotify_init1(IN_CLOEXEC); - if (m_iNotifyHandle < 0) - { - AZ_Warning("FileWatcher", false, "Unable to initialize inotify, file monitoring will not be available: %s\n", strerror(err)); - } - } - return (m_iNotifyHandle >= 0); + [[maybe_unused]] const auto err = errno; + [[maybe_unused]] AZStd::fixed_string<255> errorString; + AZ_Warning("FileWatcher", (m_inotifyHandle >= 0), "Unable to initialize inotify, file monitoring will not be available: %s\n", strerror_r(err, errorString.data(), errorString.capacity())); } + return (m_inotifyHandle >= 0); +} - void Finalize() +void FileWatcher::PlatformImplementation::Finalize() +{ + if (m_inotifyHandle < 0) { - if (m_iNotifyHandle >= 0) - { - if (!m_handleToFolderMapLock.tryLock(s_handleToFolderMapLockTimeout)) - { - AZ_Error("FileWatcher", false, "Unable to obtain inotify handle lock on thread"); - return; - } - - QHashIterator iter(m_handleToFolderMap); - while (iter.hasNext()) - { - iter.next(); - int watchHandle = iter.key(); - inotify_rm_watch(m_iNotifyHandle, watchHandle); - } - m_handleToFolderMap.clear(); - m_handleToFolderMapLock.unlock(); - - ::close(m_iNotifyHandle); - m_iNotifyHandle = -1; - } + return; } - void AddWatchFolder(QString folder, bool recursive) { - if (m_iNotifyHandle >= 0) + QMutexLocker lock{&m_handleToFolderMapLock}; + for (const auto& watchHandle : m_handleToFolderMap.keys()) { - // Clean up the path before accepting it as a watch folder - QString cleanPath = QDir::cleanPath(folder); + inotify_rm_watch(m_inotifyHandle, watchHandle); + } + m_handleToFolderMap.clear(); + } - // Add the folder to watch and track it - int watchHandle = inotify_add_watch(m_iNotifyHandle, - cleanPath.toUtf8().constData(), - IN_CREATE | IN_CLOSE_WRITE | IN_DELETE | IN_DELETE_SELF | IN_MODIFY | IN_MOVE); - - if (watchHandle < 0) - { - AZ_Error("FileWatcher", false, "inotify_add_watch failed for path %s", cleanPath.toUtf8().constData()); - return; - } - if (!m_handleToFolderMapLock.tryLock(s_handleToFolderMapLockTimeout)) - { - AZ_Error("FileWatcher", false, "Unable to obtain inotify handle lock on thread"); - return; - } - m_handleToFolderMap[watchHandle] = cleanPath; - m_handleToFolderMapLock.unlock(); + ::close(m_inotifyHandle); + m_inotifyHandle = -1; +} - if (!recursive) - { - return; - } +void FileWatcher::PlatformImplementation::AddWatchFolder(QString folder, bool recursive) +{ + if (m_inotifyHandle < 0) + { + return; + } - // Add all the subfolders to watch and track them - QDirIterator dirIter(folder, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks); + // Clean up the path before accepting it as a watch folder + QString cleanPath = QDir::cleanPath(folder); - while (dirIter.hasNext()) - { - QString dirName = dirIter.next(); - if (dirName.endsWith("/.") || dirName.endsWith("/..")) - { - continue; - } - - int watchHandle = inotify_add_watch(m_iNotifyHandle, - dirName.toUtf8().constData(), - IN_CREATE | IN_CLOSE_WRITE | IN_DELETE | IN_DELETE_SELF | IN_MODIFY | IN_MOVE); - if (watchHandle < 0) - { - AZ_Error("FileWatcher", false, "inotify_add_watch failed for path %s", dirName.toUtf8().constData()); - return; - } + // Add the folder to watch and track it + int watchHandle = inotify_add_watch(m_inotifyHandle, + cleanPath.toUtf8().constData(), + IN_CREATE | IN_CLOSE_WRITE | IN_DELETE | IN_DELETE_SELF | IN_MODIFY | IN_MOVE); - if (!m_handleToFolderMapLock.tryLock(s_handleToFolderMapLockTimeout)) - { - AZ_Error("FileWatcher", false, "Unable to obtain inotify handle lock on thread"); - return; - } - m_handleToFolderMap[watchHandle] = dirName; - m_handleToFolderMapLock.unlock(); - } - } + if (watchHandle < 0) + { + [[maybe_unused]] const auto err = errno; + [[maybe_unused]] AZStd::fixed_string<255> errorString; + AZ_Warning("FileWatcher", false, "inotify_add_watch failed for path %s: %s", cleanPath.toUtf8().constData(), strerror_r(err, errorString.data(), errorString.capacity())); + return; } - - void RemoveWatchFolder(int watchHandle) { - if (m_iNotifyHandle >= 0) - { - if (!m_handleToFolderMapLock.tryLock(s_handleToFolderMapLockTimeout)) - { - AZ_Error("FileWatcher", false, "Unable to obtain inotify handle lock on thread"); - return; - } + QMutexLocker lock{&m_handleToFolderMapLock}; + m_handleToFolderMap[watchHandle] = cleanPath; + } - QHash::iterator handleToRemove = m_handleToFolderMap.find(watchHandle); - if (handleToRemove != m_handleToFolderMap.end()) - { - inotify_rm_watch(m_iNotifyHandle, watchHandle); - m_handleToFolderMap.erase(handleToRemove); - } + // Add all the contents (files and directories) to watch and track them + QDirIterator dirIter(folder, QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files, (recursive ? QDirIterator::Subdirectories : QDirIterator::NoIteratorFlags) | QDirIterator::FollowSymlinks); + + while (dirIter.hasNext()) + { + QString dirName = dirIter.next(); - m_handleToFolderMapLock.unlock(); + watchHandle = inotify_add_watch(m_inotifyHandle, + dirName.toUtf8().constData(), + IN_CREATE | IN_CLOSE_WRITE | IN_DELETE | IN_DELETE_SELF | IN_MODIFY | IN_MOVE); + if (watchHandle < 0) + { + [[maybe_unused]] const auto err = errno; + [[maybe_unused]] AZStd::fixed_string<255> errorString; + AZ_Warning("FileWatcher", false, "inotify_add_watch failed for path %s: %s", dirName.toUtf8().constData(), strerror_r(err, errorString.data(), errorString.capacity())); + return; } - } -}; -////////////////////////////////////////////////////////////////////////////// -/// FolderWatchRoot -FolderRootWatch::FolderRootWatch(const QString rootFolder, bool recursive) - : m_root(rootFolder) - , m_shutdownThreadSignal(false) - , m_fileWatcher(nullptr) - , m_recursive(recursive) - , m_platformImpl(new PlatformImplementation()) -{ + QMutexLocker lock{&m_handleToFolderMapLock}; + m_handleToFolderMap[watchHandle] = dirName; + } } -FolderRootWatch::~FolderRootWatch() +void FileWatcher::PlatformImplementation::RemoveWatchFolder(int watchHandle) { - // Destructor is required in here since this file contains the definition of struct PlatformImplementation - Stop(); + if (m_inotifyHandle < 0) + { + return; + } - delete m_platformImpl; + QMutexLocker lock{&m_handleToFolderMapLock}; + if (m_handleToFolderMap.remove(watchHandle)) + { + inotify_rm_watch(m_inotifyHandle, watchHandle); + } } -bool FolderRootWatch::Start() +bool FileWatcher::PlatformStart() { // inotify will be used by linux to monitor file changes within directories under the root folder if (!m_platformImpl->Initialize()) { return false; } - m_platformImpl->AddWatchFolder(m_root, m_recursive); - - m_shutdownThreadSignal = false; - if (m_platformImpl->m_iNotifyHandle >= 0) + for (const auto& [directory, recursive] : m_folderWatchRoots) { - m_thread = std::thread([this]() { WatchFolderLoop(); }); + if (QDir(directory).exists()) + { + m_platformImpl->AddWatchFolder(directory, recursive); + } } + return true; } -void FolderRootWatch::Stop() +void FileWatcher::PlatformStop() { m_shutdownThreadSignal = true; @@ -197,64 +147,63 @@ void FolderRootWatch::Stop() if (m_thread.joinable()) { m_thread.join(); // wait for the thread to finish - m_thread = std::thread(); //destroy } } -void FolderRootWatch::WatchFolderLoop() +void FileWatcher::WatchFolderLoop() { - char eventBuffer[s_iNotifyReadBufferSize]; + char eventBuffer[s_inotifyReadBufferSize]; while (!m_shutdownThreadSignal) { - ssize_t bytesRead = ::read(m_platformImpl->m_iNotifyHandle, eventBuffer, s_iNotifyReadBufferSize); + ssize_t bytesRead = ::read(m_platformImpl->m_inotifyHandle, eventBuffer, s_inotifyReadBufferSize); if (bytesRead < 0) { // Break out of the loop when the notify handle was closed (outside of this thread) break; } - else if (bytesRead > 0) + if (!bytesRead) + { + continue; + } + for (size_t index=0; index(&eventBuffer[index]); + + if (event->mask & (IN_CREATE | IN_DELETE | IN_MODIFY | IN_MOVE)) { - struct inotify_event *event = ( struct inotify_event * ) &eventBuffer[ index ]; + const QString pathStr = QDir(m_platformImpl->m_handleToFolderMap[event->wd]).absoluteFilePath(event->name); - if (event->mask & (IN_CREATE | IN_DELETE | IN_MODIFY | IN_MOVE )) + if (event->mask & (IN_CREATE | IN_MOVED_TO)) { - QString pathStr = QString("%1%2%3").arg(m_platformImpl->m_handleToFolderMap[event->wd], QDir::separator(), event->name); - - if (event->mask & (IN_CREATE | IN_MOVED_TO)) + if (event->mask & IN_ISDIR /*&& m_recursive*/) + { + // New Directory, add it to the watch + m_platformImpl->AddWatchFolder(pathStr, true); + } + else { - if ( event->mask & IN_ISDIR && m_recursive) - { - // New Directory, add it to the watch - m_platformImpl->AddWatchFolder(pathStr, true); - } - else - { - ProcessNewFileEvent(pathStr); - } + rawFileAdded(pathStr, {}); } - else if (event->mask & (IN_DELETE | IN_MOVED_FROM)) + } + else if (event->mask & (IN_DELETE | IN_MOVED_FROM)) + { + if (event->mask & IN_ISDIR) { - if (event->mask & IN_ISDIR) - { - // Directory Deleted, remove it from the watch - m_platformImpl->RemoveWatchFolder(event->wd); - } - else - { - ProcessDeleteFileEvent(pathStr); - } + // Directory Deleted, remove it from the watch + m_platformImpl->RemoveWatchFolder(event->wd); } - else if ((event->mask & IN_MODIFY) && ((event->mask & IN_ISDIR) != IN_ISDIR)) + else { - ProcessModifyFileEvent(pathStr); + rawFileRemoved(pathStr, {}); } } - index += s_iNotifyEventSize + event->len; + else if ((event->mask & IN_MODIFY) && ((event->mask & IN_ISDIR) != IN_ISDIR)) + { + rawFileModified(pathStr, {}); + } } + index += s_inotifyEventSize + event->len; } } } - diff --git a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.h b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.h new file mode 100644 index 0000000000..a6fead401c --- /dev/null +++ b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include + +class FileWatcher::PlatformImplementation +{ +public: + bool Initialize(); + void Finalize(); + void AddWatchFolder(QString folder, bool recursive); + void RemoveWatchFolder(int watchHandle); + + int m_inotifyHandle = -1; + QMutex m_handleToFolderMapLock; + QHash m_handleToFolderMap; +}; diff --git a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_platform.h b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_platform.h new file mode 100644 index 0000000000..e3cb91d73a --- /dev/null +++ b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_platform.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include diff --git a/Code/Tools/AssetProcessor/Platform/Mac/assetprocessor_mac_files.cmake b/Code/Tools/AssetProcessor/Platform/Mac/assetprocessor_mac_files.cmake index 0f20ef2f38..476bcde500 100644 --- a/Code/Tools/AssetProcessor/Platform/Mac/assetprocessor_mac_files.cmake +++ b/Code/Tools/AssetProcessor/Platform/Mac/assetprocessor_mac_files.cmake @@ -8,4 +8,6 @@ set(FILES native/FileWatcher/FileWatcher_macos.cpp + native/FileWatcher/FileWatcher_mac.h + native/FileWatcher/FileWatcher_platform.h ) diff --git a/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_mac.h b/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_mac.h new file mode 100644 index 0000000000..ade2497c4d --- /dev/null +++ b/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_mac.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +#include + +class FileWatcher::PlatformImplementation +{ +public: + FSEventStreamRef m_stream = nullptr; + CFRunLoopRef m_runLoop = nullptr; +}; diff --git a/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_macos.cpp b/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_macos.cpp index 1dd6e65a15..47b344ff81 100644 --- a/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_macos.cpp +++ b/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_macos.cpp @@ -6,47 +6,23 @@ * */ #include +#include #include #include -#include void FileEventStreamCallback(ConstFSEventStreamRef streamRef, void *clientCallBackInfo, size_t numEvents, void *eventPaths, const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId eventIds[]); -struct FolderRootWatch::PlatformImplementation -{ - PlatformImplementation() : m_stream(nullptr), m_runLoop(nullptr) { } - - FSEventStreamRef m_stream; - CFRunLoopRef m_runLoop; - QString m_renameFileDirectory; -}; - -////////////////////////////////////////////////////////////////////////////// -/// FolderWatchRoot -FolderRootWatch::FolderRootWatch(const QString rootFolder) - : m_root(rootFolder) - , m_shutdownThreadSignal(false) - , m_fileWatcher(nullptr) - , m_platformImpl(new PlatformImplementation()) -{ -} - -FolderRootWatch::~FolderRootWatch() -{ - // Destructor is required in here since this file contains the definition of struct PlatformImplementation - Stop(); - - delete m_platformImpl; -} - -bool FolderRootWatch::Start() +bool FileWatcher::PlatformStart() { m_shutdownThreadSignal = false; - CFStringRef rootPath = CFStringCreateWithCString(kCFAllocatorDefault, m_root.toStdString().data(), kCFStringEncodingMacRoman); - CFArrayRef pathsToWatch = CFArrayCreate(NULL, (const void **)&rootPath, 1, NULL); + CFMutableArrayRef pathsToWatch = CFArrayCreateMutable(nullptr, this->m_folderWatchRoots.size(), nullptr); + for (const auto& root : this->m_folderWatchRoots) + { + CFArrayAppendValue(pathsToWatch, root.m_directory.toCFString()); + } // The larger this number, the larger the delay between the kernel knowing a file changed // and us actually consuming the event. It is very important for asset processor to deal with @@ -60,11 +36,12 @@ bool FolderRootWatch::Start() // Set ourselves as the value for the context info field so that in the callback // we get passed into it and the callback can call our public API to handle // the file change events - FSEventStreamContext streamContext; - ::memset(&streamContext, 0, sizeof(streamContext)); - streamContext.info = this; + FSEventStreamContext streamContext{ + /*.version =*/ 0, + /*.info =*/ this, + }; - m_platformImpl->m_stream = FSEventStreamCreate(NULL, + m_platformImpl->m_stream = FSEventStreamCreate(nullptr, FileEventStreamCallback, &streamContext, pathsToWatch, @@ -72,24 +49,25 @@ bool FolderRootWatch::Start() timeBetweenKernelUpdateAndNotification, kFSEventStreamCreateFlagFileEvents); - AZ_Error("FileWatcher", (m_platformImpl->m_stream != nullptr), "FSEventStreamCreate returned a nullptr. No file events will be reported for %s", m_root.toStdString().c_str()); - - m_thread = std::thread(std::bind(&FolderRootWatch::WatchFolderLoop, this)); + AZ_Error("FileWatcher", (m_platformImpl->m_stream != nullptr), "FSEventStreamCreate returned a nullptr. No file events will be reported."); + const CFIndex pathCount = CFArrayGetCount(pathsToWatch); + for(CFIndex i = 0; i < pathCount; ++i) + { + CFRelease(CFArrayGetValueAtIndex(pathsToWatch, i)); + } CFRelease(pathsToWatch); - CFRelease(rootPath); - return (m_platformImpl->m_stream != nullptr); + return m_platformImpl->m_stream != nullptr; } -void FolderRootWatch::Stop() +void FileWatcher::PlatformStop() { m_shutdownThreadSignal = true; if (m_thread.joinable()) { m_thread.join(); // wait for the thread to finish - m_thread = std::thread(); //destroy } FSEventStreamStop(m_platformImpl->m_stream); @@ -97,7 +75,7 @@ void FolderRootWatch::Stop() FSEventStreamRelease(m_platformImpl->m_stream); } -void FolderRootWatch::WatchFolderLoop() +void FileWatcher::WatchFolderLoop() { // Use a half second timeout interval so that we can check if // m_shutdownThreadSignal has been changed while we were running the RunLoop @@ -117,14 +95,14 @@ void FolderRootWatch::WatchFolderLoop() void FileEventStreamCallback(ConstFSEventStreamRef streamRef, void *clientCallBackInfo, size_t numEvents, void *eventPaths, const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId eventIds[]) { - FolderRootWatch* watcher = reinterpret_cast(clientCallBackInfo); + auto* watcher = reinterpret_cast(clientCallBackInfo); const char** filePaths = reinterpret_cast(eventPaths); for (int i = 0; i < numEvents; ++i) { - QFileInfo fileInfo(QDir::cleanPath(filePaths[i])); - QString fileAndPath = fileInfo.absoluteFilePath(); + const QFileInfo fileInfo(QDir::cleanPath(filePaths[i])); + const QString fileAndPath = fileInfo.absoluteFilePath(); if (!fileInfo.isHidden()) { @@ -133,38 +111,38 @@ void FileEventStreamCallback(ConstFSEventStreamRef streamRef, void *clientCallBa // so check for all of them if (eventFlags[i] & kFSEventStreamEventFlagItemCreated) { - watcher->ProcessNewFileEvent(fileAndPath); + watcher->rawFileAdded(fileAndPath, {}); } if (eventFlags[i] & kFSEventStreamEventFlagItemModified) { - watcher->ProcessModifyFileEvent(fileAndPath); + watcher->rawFileModified(fileAndPath, {}); } if (eventFlags[i] & kFSEventStreamEventFlagItemRemoved) { - watcher->ProcessDeleteFileEvent(fileAndPath); + watcher->rawFileRemoved(fileAndPath, {}); } if (eventFlags[i] & kFSEventStreamEventFlagItemRenamed) { if (fileInfo.exists()) { - watcher->ProcessNewFileEvent(fileAndPath); + watcher->rawFileAdded(fileAndPath, {}); // macOS does not send out an event for the directory being // modified when a file has been renamed but the FileWatcher // API expects it so send out the modification event ourselves. - watcher->ProcessModifyFileEvent(fileInfo.absolutePath()); + watcher->rawFileModified(fileInfo.absolutePath(), {}); } else { - watcher->ProcessDeleteFileEvent(fileAndPath); + watcher->rawFileRemoved(fileAndPath, {}); // macOS does not send out an event for the directory being // modified when a file has been renamed but the FileWatcher // API expects it so send out the modification event ourselves. - watcher->ProcessModifyFileEvent(fileInfo.absolutePath()); + watcher->rawFileModified(fileInfo.absolutePath(), {}); } } } diff --git a/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_platform.h b/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_platform.h new file mode 100644 index 0000000000..58b60354e7 --- /dev/null +++ b/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_platform.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include diff --git a/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_win.cpp b/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_win.cpp deleted file mode 100644 index a6b0841f05..0000000000 --- a/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_win.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include - -#include - -struct FolderRootWatch::PlatformImplementation -{ - PlatformImplementation() : m_directoryHandle(nullptr), m_ioHandle(nullptr) { } - HANDLE m_directoryHandle; - HANDLE m_ioHandle; -}; - -////////////////////////////////////////////////////////////////////////////// -/// FolderWatchRoot -FolderRootWatch::FolderRootWatch(const QString rootFolder) - : m_root(rootFolder) - , m_shutdownThreadSignal(false) - , m_fileWatcher(nullptr) - , m_platformImpl(new PlatformImplementation()) -{ -} - -FolderRootWatch::~FolderRootWatch() -{ - // Destructor is required in here since this file contains the definition of struct PlatformImplementation - Stop(); - - delete m_platformImpl; -} - -bool FolderRootWatch::Start() -{ - m_platformImpl->m_directoryHandle = ::CreateFileW(m_root.toStdWString().data(), FILE_LIST_DIRECTORY, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, nullptr, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, nullptr); - - if (m_platformImpl->m_directoryHandle != INVALID_HANDLE_VALUE) - { - m_platformImpl->m_ioHandle = ::CreateIoCompletionPort(m_platformImpl->m_directoryHandle, nullptr, 1, 0); - if (m_platformImpl->m_ioHandle != INVALID_HANDLE_VALUE) - { - m_shutdownThreadSignal = false; - m_thread = std::thread(std::bind(&FolderRootWatch::WatchFolderLoop, this)); - return true; - } - } - return false; -} - -void FolderRootWatch::Stop() -{ - m_shutdownThreadSignal = true; - CloseHandle(m_platformImpl->m_ioHandle); - m_platformImpl->m_ioHandle = nullptr; - - if (m_thread.joinable()) - { - m_thread.join(); // wait for the thread to finish - m_thread = std::thread(); //destroy - } - CloseHandle(m_platformImpl->m_directoryHandle); - m_platformImpl->m_directoryHandle = nullptr; -} - -void FolderRootWatch::WatchFolderLoop() -{ - FILE_NOTIFY_INFORMATION aFileNotifyInformationList[50000]; - QString path; - OVERLAPPED aOverlapped; - LPOVERLAPPED pOverlapped; - DWORD dwByteCount; - ULONG_PTR ulKey; - - while (!m_shutdownThreadSignal) - { - ::memset(aFileNotifyInformationList, 0, sizeof(aFileNotifyInformationList)); - ::memset(&aOverlapped, 0, sizeof(aOverlapped)); - - if (::ReadDirectoryChangesW(m_platformImpl->m_directoryHandle, aFileNotifyInformationList, sizeof(aFileNotifyInformationList), true, FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_ATTRIBUTES | FILE_NOTIFY_CHANGE_FILE_NAME, nullptr, &aOverlapped, nullptr)) - { - //wait for up to a second for I/O to signal - dwByteCount = 0; - if (::GetQueuedCompletionStatus(m_platformImpl->m_ioHandle, &dwByteCount, &ulKey, &pOverlapped, INFINITE)) - { - //if we are signaled to shutdown bypass - if (!m_shutdownThreadSignal && ulKey) - { - if (dwByteCount) - { - int offset = 0; - FILE_NOTIFY_INFORMATION* pFileNotifyInformation = aFileNotifyInformationList; - do - { - pFileNotifyInformation = (FILE_NOTIFY_INFORMATION*)((char*)pFileNotifyInformation + offset); - - path.clear(); - path.append(m_root); - path.append(QString::fromWCharArray(pFileNotifyInformation->FileName, pFileNotifyInformation->FileNameLength / 2)); - - QString file = QDir::toNativeSeparators(QDir::cleanPath(path)); - - switch (pFileNotifyInformation->Action) - { - case FILE_ACTION_ADDED: - case FILE_ACTION_RENAMED_NEW_NAME: - ProcessNewFileEvent(file); - break; - case FILE_ACTION_REMOVED: - case FILE_ACTION_RENAMED_OLD_NAME: - ProcessDeleteFileEvent(file); - break; - case FILE_ACTION_MODIFIED: - ProcessModifyFileEvent(file); - break; - } - - offset = pFileNotifyInformation->NextEntryOffset; - } while (offset); - } - } - } - } - } -} - diff --git a/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake b/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake index 5d1f4d1eed..2bd9fa6470 100644 --- a/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake +++ b/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake @@ -7,6 +7,8 @@ # set(FILES + native/FileWatcher/FileWatcher_platform.h native/FileWatcher/FileWatcher_win.cpp + native/FileWatcher/FileWatcher_windows.h native/resource.h ) diff --git a/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_platform.h b/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_platform.h new file mode 100644 index 0000000000..5fe5f05f87 --- /dev/null +++ b/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_platform.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include diff --git a/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_win.cpp b/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_win.cpp index a6b0841f05..b7d1d4c74c 100644 --- a/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_win.cpp +++ b/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_win.cpp @@ -6,125 +6,148 @@ * */ +#include +#include #include +#include +#include -#include - -struct FolderRootWatch::PlatformImplementation -{ - PlatformImplementation() : m_directoryHandle(nullptr), m_ioHandle(nullptr) { } - HANDLE m_directoryHandle; - HANDLE m_ioHandle; -}; - -////////////////////////////////////////////////////////////////////////////// -/// FolderWatchRoot -FolderRootWatch::FolderRootWatch(const QString rootFolder) - : m_root(rootFolder) - , m_shutdownThreadSignal(false) - , m_fileWatcher(nullptr) - , m_platformImpl(new PlatformImplementation()) +bool FileWatcher::PlatformStart() { + m_shutdownThreadSignal = false; + + bool allSucceeded = true; + for (const auto& [directory, recursive] : m_folderWatchRoots) + { + if (QDir(directory).exists()) + { + allSucceeded &= m_platformImpl->AddWatchFolder(directory, recursive); + } + } + return allSucceeded; } -FolderRootWatch::~FolderRootWatch() +bool FileWatcher::PlatformImplementation::AddWatchFolder(QString root, bool recursive) { - // Destructor is required in here since this file contains the definition of struct PlatformImplementation - Stop(); + HandleUniquePtr directoryHandle{::CreateFileW( + root.toStdWString().data(), + FILE_LIST_DIRECTORY, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + nullptr, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, + nullptr + )}; + + if (directoryHandle.get() == INVALID_HANDLE_VALUE) + { + AZ_Warning("FileWatcher", false, "Failed to start watching %s", root.toUtf8().constData()); + return false; + } - delete m_platformImpl; -} + // Associate this file handle with our existing io completion port handle + if (!::CreateIoCompletionPort(directoryHandle.get(), m_ioHandle.get(), /*CompletionKey =*/ static_cast(PlatformImplementation::EventType::FileRead), 1)) + { + return false; + } -bool FolderRootWatch::Start() -{ - m_platformImpl->m_directoryHandle = ::CreateFileW(m_root.toStdWString().data(), FILE_LIST_DIRECTORY, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, nullptr, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, nullptr); + auto id = AZStd::make_unique(); + auto* idp = id.get(); + const auto& [folderWatch, inserted] = m_folderRootWatches.emplace(AZStd::piecewise_construct, AZStd::forward_as_tuple(idp), + AZStd::forward_as_tuple(AZStd::move(id), AZStd::move(directoryHandle), root, recursive)); - if (m_platformImpl->m_directoryHandle != INVALID_HANDLE_VALUE) + if (!inserted) { - m_platformImpl->m_ioHandle = ::CreateIoCompletionPort(m_platformImpl->m_directoryHandle, nullptr, 1, 0); - if (m_platformImpl->m_ioHandle != INVALID_HANDLE_VALUE) - { - m_shutdownThreadSignal = false; - m_thread = std::thread(std::bind(&FolderRootWatch::WatchFolderLoop, this)); - return true; - } + return false; } - return false; + + return folderWatch->second.ReadChanges(); } -void FolderRootWatch::Stop() +bool FileWatcher::PlatformImplementation::FolderRootWatch::ReadChanges() +{ + // Register to get directory change notifications for our directory handle + return ::ReadDirectoryChangesW( + m_directoryHandle.get(), + &m_fileNotifyInformationList, + sizeof(m_fileNotifyInformationList), + m_recursive, + FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_ATTRIBUTES | FILE_NOTIFY_CHANGE_FILE_NAME, + nullptr, + m_overlapped.get(), + nullptr + ); +} + +void FileWatcher::PlatformStop() { m_shutdownThreadSignal = true; - CloseHandle(m_platformImpl->m_ioHandle); - m_platformImpl->m_ioHandle = nullptr; + // Send a special signal to the child thread, that is blocked in a GetQueuedCompletionStatus call, with a completion + // key set to Shutdown. The child thread will stop its processing when it receives this value for the completion key + PostQueuedCompletionStatus(m_platformImpl->m_ioHandle.get(), 0, /*CompletionKey =*/ static_cast(PlatformImplementation::EventType::Shutdown), nullptr); if (m_thread.joinable()) { m_thread.join(); // wait for the thread to finish - m_thread = std::thread(); //destroy } - CloseHandle(m_platformImpl->m_directoryHandle); - m_platformImpl->m_directoryHandle = nullptr; } -void FolderRootWatch::WatchFolderLoop() +void FileWatcher::WatchFolderLoop() { - FILE_NOTIFY_INFORMATION aFileNotifyInformationList[50000]; - QString path; - OVERLAPPED aOverlapped; - LPOVERLAPPED pOverlapped; - DWORD dwByteCount; - ULONG_PTR ulKey; + LPOVERLAPPED directoryId = nullptr; + ULONG_PTR completionKey = 0; while (!m_shutdownThreadSignal) { - ::memset(aFileNotifyInformationList, 0, sizeof(aFileNotifyInformationList)); - ::memset(&aOverlapped, 0, sizeof(aOverlapped)); - - if (::ReadDirectoryChangesW(m_platformImpl->m_directoryHandle, aFileNotifyInformationList, sizeof(aFileNotifyInformationList), true, FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_ATTRIBUTES | FILE_NOTIFY_CHANGE_FILE_NAME, nullptr, &aOverlapped, nullptr)) + DWORD dwByteCount = 0; + if (::GetQueuedCompletionStatus(m_platformImpl->m_ioHandle.get(), &dwByteCount, &completionKey, &directoryId, INFINITE)) { - //wait for up to a second for I/O to signal - dwByteCount = 0; - if (::GetQueuedCompletionStatus(m_platformImpl->m_ioHandle, &dwByteCount, &ulKey, &pOverlapped, INFINITE)) + if (m_shutdownThreadSignal || completionKey == static_cast(PlatformImplementation::EventType::Shutdown)) + { + break; + } + if (dwByteCount == 0) + { + continue; + } + + const auto foundFolderRoot = m_platformImpl->m_folderRootWatches.find(directoryId); + if (foundFolderRoot == end(m_platformImpl->m_folderRootWatches)) { - //if we are signaled to shutdown bypass - if (!m_shutdownThreadSignal && ulKey) + continue; + } + + PlatformImplementation::FolderRootWatch& folderRoot = foundFolderRoot->second; + + // Initialize offset to 1 to ensure that the first iteration is always processed + DWORD offset = 1; + for ( + const FILE_NOTIFY_INFORMATION* pFileNotifyInformation = reinterpret_cast(&folderRoot.m_fileNotifyInformationList); + offset; + pFileNotifyInformation = reinterpret_cast(reinterpret_cast(pFileNotifyInformation) + offset) + ){ + const QString file = QDir::toNativeSeparators(QDir(folderRoot.m_directoryRoot) + .filePath(QString::fromWCharArray(pFileNotifyInformation->FileName, pFileNotifyInformation->FileNameLength / 2))); + + switch (pFileNotifyInformation->Action) { - if (dwByteCount) - { - int offset = 0; - FILE_NOTIFY_INFORMATION* pFileNotifyInformation = aFileNotifyInformationList; - do - { - pFileNotifyInformation = (FILE_NOTIFY_INFORMATION*)((char*)pFileNotifyInformation + offset); - - path.clear(); - path.append(m_root); - path.append(QString::fromWCharArray(pFileNotifyInformation->FileName, pFileNotifyInformation->FileNameLength / 2)); - - QString file = QDir::toNativeSeparators(QDir::cleanPath(path)); - - switch (pFileNotifyInformation->Action) - { - case FILE_ACTION_ADDED: - case FILE_ACTION_RENAMED_NEW_NAME: - ProcessNewFileEvent(file); - break; - case FILE_ACTION_REMOVED: - case FILE_ACTION_RENAMED_OLD_NAME: - ProcessDeleteFileEvent(file); - break; - case FILE_ACTION_MODIFIED: - ProcessModifyFileEvent(file); - break; - } - - offset = pFileNotifyInformation->NextEntryOffset; - } while (offset); - } + case FILE_ACTION_ADDED: + case FILE_ACTION_RENAMED_NEW_NAME: + rawFileAdded(file, {}); + break; + case FILE_ACTION_REMOVED: + case FILE_ACTION_RENAMED_OLD_NAME: + rawFileRemoved(file, {}); + break; + case FILE_ACTION_MODIFIED: + rawFileModified(file, {}); + break; } + + offset = pFileNotifyInformation->NextEntryOffset; } + + folderRoot.ReadChanges(); } } } - diff --git a/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_windows.h b/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_windows.h new file mode 100644 index 0000000000..28092961f5 --- /dev/null +++ b/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_windows.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include + +#include +#include + +struct HandleDeleter +{ + void operator()(HANDLE handle) + { + if (handle && handle != INVALID_HANDLE_VALUE) + { + CloseHandle(handle); + } + } +}; + +using HandleUniquePtr = AZStd::unique_ptr, HandleDeleter>; + +class FileWatcher::PlatformImplementation +{ +public: + bool AddWatchFolder(QString folder, bool recursive); + + struct FolderRootWatch + { + FolderRootWatch(AZStd::unique_ptr&& overlapped, HandleUniquePtr&& directoryHandle, QString root, bool recursive) + : m_overlapped(AZStd::move(overlapped)) + , m_directoryHandle(AZStd::move(directoryHandle)) + , m_directoryRoot(AZStd::move(root)) + , m_recursive(recursive) + { + } + + bool ReadChanges(); + + AZStd::unique_ptr m_overlapped; // Identifies this root watch + HandleUniquePtr m_directoryHandle; + QString m_directoryRoot; + bool m_recursive; + AZStd::aligned_storage_t<64 * 1024, sizeof(DWORD)> m_fileNotifyInformationList{}; + }; + + enum class EventType + { + FileRead, + Shutdown + }; + + AZStd::unordered_map m_folderRootWatches; + + HandleUniquePtr m_ioHandle{CreateIoCompletionPort(INVALID_HANDLE_VALUE, nullptr, /*CompletionKey =*/ static_cast(EventType::FileRead), 1)}; +}; diff --git a/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake b/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake index 7daca9bbc1..6dda9af682 100644 --- a/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake +++ b/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake @@ -44,7 +44,6 @@ set(FILES native/FileProcessor/FileProcessor.h native/FileWatcher/FileWatcher.cpp native/FileWatcher/FileWatcher.h - native/FileWatcher/FileWatcherAPI.h native/InternalBuilders/SettingsRegistryBuilder.cpp native/InternalBuilders/SettingsRegistryBuilder.h native/resourcecompiler/JobsModel.cpp diff --git a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp index 4d4b4e9690..c1c1a29d74 100644 --- a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp +++ b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp @@ -6,154 +6,122 @@ * */ #include "FileWatcher.h" +#include "AzCore/std/containers/vector.h" #include +#include +#include -////////////////////////////////////////////////////////////////////////////// -/// FolderWatchRoot -void FolderRootWatch::ProcessNewFileEvent(const QString& file) +//! IsSubfolder(folderA, folderB) +//! returns whether folderA is a subfolder of folderB +//! assumptions: absolute paths, case insensitive +static bool IsSubfolder(const QString& folderA, const QString& folderB) { - FileChangeInfo info; - info.m_action = FileAction::FileAction_Added; - info.m_filePath = file; - const bool invoked = QMetaObject::invokeMethod(m_fileWatcher, "AnyFileChange", Qt::QueuedConnection, Q_ARG(FileChangeInfo, info)); - Q_ASSERT(invoked); -} + // lets avoid allocating or messing with memory - this is a MAJOR hotspot as it is called for any file change even in the cache! + int sizeB = folderB.length(); + int sizeA = folderA.length(); -void FolderRootWatch::ProcessDeleteFileEvent(const QString& file) -{ - FileChangeInfo info; - info.m_action = FileAction::FileAction_Removed; - info.m_filePath = file; - const bool invoked = QMetaObject::invokeMethod(m_fileWatcher, "AnyFileChange", Qt::QueuedConnection, Q_ARG(FileChangeInfo, info)); - Q_ASSERT(invoked); -} + if (sizeA <= sizeB) + { + return false; + } -void FolderRootWatch::ProcessModifyFileEvent(const QString& file) -{ - FileChangeInfo info; - info.m_action = FileAction::FileAction_Modified; - info.m_filePath = file; - const bool invoked = QMetaObject::invokeMethod(m_fileWatcher, "AnyFileChange", Qt::QueuedConnection, Q_ARG(FileChangeInfo, info)); - Q_ASSERT(invoked); + QChar slash1 = QChar('\\'); + QChar slash2 = QChar('/'); + int posA = 0; + + // A is going to be the longer one, so use B: + for (int idx = 0; idx < sizeB; ++idx) + { + QChar charAtA = folderA.at(posA); + QChar charAtB = folderB.at(idx); + + if ((charAtB == slash1) || (charAtB == slash2)) + { + if ((charAtA != slash1) && (charAtA != slash2)) + { + return false; + } + ++posA; + } + else + { + if (charAtA.toLower() != charAtB.toLower()) + { + return false; + } + ++posA; + } + } + return true; } ////////////////////////////////////////////////////////////////////////// /// FileWatcher FileWatcher::FileWatcher() - : m_nextHandle(0) + : m_platformImpl(AZStd::make_unique()) { - qRegisterMetaType("FileChangeInfo"); + auto makeFilter = [this](auto signal) + { + return [this, signal](QString path) + { + const auto foundWatchRoot = AZStd::find_if(begin(m_folderWatchRoots), end(m_folderWatchRoots), [path](const WatchRoot& watchRoot) + { + return Filter(path, watchRoot); + }); + if (foundWatchRoot == end(m_folderWatchRoots)) + { + return; + } + AZStd::invoke(signal, this, path); + }; + }; + + // The rawFileAdded signals are emitted by the watcher thread. Use a queued + // connection so that the consumers of the notification process the + // notification on the main thread. + connect(this, &FileWatcher::rawFileAdded, this, makeFilter(&FileWatcher::fileAdded), Qt::QueuedConnection); + connect(this, &FileWatcher::rawFileRemoved, this, makeFilter(&FileWatcher::fileRemoved), Qt::QueuedConnection); + connect(this, &FileWatcher::rawFileModified, this, makeFilter(&FileWatcher::fileModified), Qt::QueuedConnection); } FileWatcher::~FileWatcher() { + disconnect(); + StopWatching(); } -int FileWatcher::AddFolderWatch(FolderWatchBase* pFolderWatch, bool recursive) +void FileWatcher::AddFolderWatch(QString directory, bool recursive) { - if (!pFolderWatch) + // Search for an already monitored root that is a parent of `directory`, + // that is already watching subdirectories recursively + const auto found = AZStd::find_if(begin(m_folderWatchRoots), end(m_folderWatchRoots), [directory](const WatchRoot& root) { - return -1; - } - - FolderRootWatch* pFolderRootWatch = nullptr; + return root.m_recursive && IsSubfolder(directory, root.m_directory); + }); - //see if this a sub folder of an already watched root - for (auto rootsIter = m_folderWatchRoots.begin(); !pFolderRootWatch && rootsIter != m_folderWatchRoots.end(); ++rootsIter) + if (found != end(m_folderWatchRoots)) { - if (FolderWatchBase::IsSubfolder(pFolderWatch->m_folder, (*rootsIter)->m_root)) - { - pFolderRootWatch = *rootsIter; - } - } - - bool bCreatedNewRoot = false; - //if its not a sub folder - if (!pFolderRootWatch) - { - //create a new root and start listening for changes - pFolderRootWatch = new FolderRootWatch(pFolderWatch->m_folder, recursive); - - //make sure the folder watcher(s) get deleted before this - pFolderRootWatch->setParent(this); - bCreatedNewRoot = true; + // This directory is already watched + return; } - pFolderRootWatch->m_fileWatcher = this; - QObject::connect(this, &FileWatcher::AnyFileChange, pFolderWatch, &FolderWatchBase::OnAnyFileChange); + //create a new root and start listening for changes + m_folderWatchRoots.push_back({directory, recursive}); - if (bCreatedNewRoot) + //since we created a new root, see if the new root is a super folder + //of other roots, if it is then then fold those roots into the new super root + if (recursive) { - if (m_startedWatching) + AZStd::erase_if(m_folderWatchRoots, [directory](const WatchRoot& root) { - pFolderRootWatch->Start(); - } - - //since we created a new root, see if the new root is a super folder - //of other roots, if it is then then fold those roots into the new super root - for (auto rootsIter = m_folderWatchRoots.begin(); rootsIter != m_folderWatchRoots.end(); ) - { - if (pFolderWatch->m_watchSubtree && FolderWatchBase::IsSubfolder((*rootsIter)->m_root, pFolderWatch->m_folder)) - { - //union the sub folder map over to the new root - pFolderRootWatch->m_subFolderWatchesMap.insert((*rootsIter)->m_subFolderWatchesMap); - - //clear the old root sub folders map so they don't get deleted when we - //delete the old root as they are now pointed to by the new root - (*rootsIter)->m_subFolderWatchesMap.clear(); - - //delete the empty old root, deleting a root will call Stop() - //automatically which kills the thread - delete *rootsIter; - - //remove the old root pointer form the watched list - rootsIter = m_folderWatchRoots.erase(rootsIter); - } - else - { - ++rootsIter; - } - } - - //add the new root to the watched roots - m_folderWatchRoots.push_back(pFolderRootWatch); + return IsSubfolder(root.m_directory, directory); + }); } - - //add to the root - pFolderRootWatch->m_subFolderWatchesMap.insert(m_nextHandle, pFolderWatch); - - m_nextHandle++; - - return m_nextHandle - 1; } -void FileWatcher::RemoveFolderWatch(int handle) +void FileWatcher::ClearFolderWatches() { - for (auto rootsIter = m_folderWatchRoots.begin(); rootsIter != m_folderWatchRoots.end(); ) - { - //find an element by the handle - auto foundIter = (*rootsIter)->m_subFolderWatchesMap.find(handle); - if (foundIter != (*rootsIter)->m_subFolderWatchesMap.end()) - { - //remove the element - (*rootsIter)->m_subFolderWatchesMap.erase(foundIter); - - //we removed a folder watch, if it's empty then there is no reason to keep watching it. - if ((*rootsIter)->m_subFolderWatchesMap.empty()) - { - delete(*rootsIter); - rootsIter = m_folderWatchRoots.erase(rootsIter); - } - else - { - ++rootsIter; - } - } - else - { - ++rootsIter; - } - } + m_folderWatchRoots.clear(); } void FileWatcher::StartWatching() @@ -164,12 +132,18 @@ void FileWatcher::StartWatching() return; } - for (FolderRootWatch* root : m_folderWatchRoots) + if (PlatformStart()) + { + m_thread = AZStd::thread({/*.name=*/ "AssetProcessor FileWatcher thread"}, [this]{ + WatchFolderLoop(); + }); + AZ_TracePrintf(AssetProcessor::ConsoleChannel, "File Change Monitoring started.\n"); + } + else { - root->Start(); + AZ_TracePrintf(AssetProcessor::ConsoleChannel, "File Change Monitoring failed to start.\n"); } - AZ_TracePrintf(AssetProcessor::ConsoleChannel, "File Change Monitoring started.\n"); m_startedWatching = true; } @@ -177,17 +151,35 @@ void FileWatcher::StopWatching() { if (!m_startedWatching) { - AZ_Warning("FileWatcher", false, "StartWatching() called when is not watching for file changes."); + AZ_Warning("FileWatcher", false, "StopWatching() called when is not watching for file changes."); return; } - for (FolderRootWatch* root : m_folderWatchRoots) - { - root->Stop(); - } + PlatformStop(); m_startedWatching = false; } -#include "native/FileWatcher/moc_FileWatcher.cpp" -#include "native/FileWatcher/moc_FileWatcherAPI.cpp" +bool FileWatcher::Filter(QString path, const WatchRoot& watchRoot) +{ + if (!IsSubfolder(path, watchRoot.m_directory)) + { + return false; + } + if (!watchRoot.m_recursive) + { + // filter out subtrees too. + QStringRef subRef = path.rightRef(path.length() - watchRoot.m_directory.length()); + if ((subRef.indexOf('/') != -1) || (subRef.indexOf('\\') != -1)) + { + return false; // filter this out. + } + + // we don't care about subdirs. IsDir is more expensive so we do it after the above filter. + if (QFileInfo(path).isDir()) + { + return false; + } + } + return true; +} diff --git a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.h b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.h index fc3f109604..b7d8cbe1a4 100644 --- a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.h +++ b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.h @@ -5,63 +5,21 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef FILEWATCHER_COMPONENT_H -#define FILEWATCHER_COMPONENT_H -////////////////////////////////////////////////////////////////////////// -#if !defined(Q_MOC_RUN) -#include "FileWatcherAPI.h" +#pragma once +#if !defined(Q_MOC_RUN) +#include #include +#include +#include #include #include #include +#include -#include #endif -class FileWatcher; - -////////////////////////////////////////////////////////////////////////// -//! FolderRootWatch -/*! Class used for holding a point in the files system from which file changes are tracked. - * */ -class FolderRootWatch - : public QObject -{ - Q_OBJECT - - friend class FileWatcher; -public: - FolderRootWatch(const QString rootFolder, bool recursive = true); - virtual ~FolderRootWatch(); - - void ProcessNewFileEvent(const QString& file); - void ProcessDeleteFileEvent(const QString& file); - void ProcessModifyFileEvent(const QString& file); - void ProcessRenameFileEvent(const QString& fileOld, const QString& fileNew); - -public Q_SLOTS: - bool Start(); - void Stop(); - -private: - void WatchFolderLoop(); - -private: - std::thread m_thread; - QString m_root; - QMap m_subFolderWatchesMap; - volatile bool m_shutdownThreadSignal; - FileWatcher* m_fileWatcher; - bool m_recursive; - - // Can't use unique_ptr because this is a QObject and Qt's magic sauce is - // unable to determine the size of the unique_ptr and so fails to compile - struct PlatformImplementation; - PlatformImplementation* m_platformImpl; -}; - ////////////////////////////////////////////////////////////////////////// //! FileWatcher /*! Class that handles creation and deletion of FolderRootWatches based on @@ -74,23 +32,47 @@ class FileWatcher public: FileWatcher(); - virtual ~FileWatcher(); + ~FileWatcher() override; ////////////////////////////////////////////////////////////////////////// - virtual int AddFolderWatch(FolderWatchBase* pFolderWatch, bool recursive = true); - virtual void RemoveFolderWatch(int handle); + void AddFolderWatch(QString directory, bool recursive = true); + void ClearFolderWatches(); ////////////////////////////////////////////////////////////////////////// - + void StartWatching(); void StopWatching(); Q_SIGNALS: - void AnyFileChange(FileChangeInfo info); + // These signals are emitted when a file under a watched path changes + void fileAdded(QString filePath); + void fileRemoved(QString filePath); + void fileModified(QString filePath); + + // These signals are emitted by the platform implementations when files + // change. Some platforms' file watch APIs do not support non-recursive + // watches, so the signals are filtered before being forwarded to the + // non-"raw" fileAdded/Removed/Modified signals above. + void rawFileAdded(QString filePath, QPrivateSignal); + void rawFileRemoved(QString filePath, QPrivateSignal); + void rawFileModified(QString filePath, QPrivateSignal); private: - int m_nextHandle; - AZStd::vector m_folderWatchRoots; + bool PlatformStart(); + void PlatformStop(); + void WatchFolderLoop(); + + class PlatformImplementation; + friend class PlatformImplementation; + struct WatchRoot + { + QString m_directory; + bool m_recursive; + }; + static bool Filter(QString path, const WatchRoot& watchRoot); + + AZStd::unique_ptr m_platformImpl; + AZStd::vector m_folderWatchRoots; + AZStd::thread m_thread; bool m_startedWatching = false; + AZStd::atomic_bool m_shutdownThreadSignal = false; }; - -#endif//FILEWATCHER_COMPONENT_H diff --git a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcherAPI.h b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcherAPI.h deleted file mode 100644 index 155056d477..0000000000 --- a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcherAPI.h +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef FILEWATCHERAPI_H -#define FILEWATCHERAPI_H - -#include -#include -#include - -////////////////////////////////////////////////////////////////////////// -//! FileAction -/*! Enum for which file changes are tracked. - * */ -enum FileAction -{ - FileAction_None = 0x00, - FileAction_Added = 0x01, - FileAction_Removed = 0x02, - FileAction_Modified = 0x04, - FileAction_Any = 0xFF, -}; -inline FileAction operator | (FileAction a, FileAction b) -{ - return static_cast(static_cast(a) | static_cast(b)); -} -inline FileAction operator & (FileAction a, FileAction b) -{ - return static_cast(static_cast(a) & static_cast(b)); -} - -////////////////////////////////////////////////////////////////////////// -//! FileChangeInfo -/*! Struct for passing along information about file changes. - * */ -struct FileChangeInfo -{ - FileChangeInfo() - : m_action(FileAction::FileAction_None) - {} - FileChangeInfo(const FileChangeInfo& rhs) - : m_action(rhs.m_action) - , m_filePath(rhs.m_filePath) - , m_filePathOld(rhs.m_filePathOld) - { - } - - FileAction m_action; - QString m_filePath; - QString m_filePathOld; -}; - -Q_DECLARE_METATYPE(FileChangeInfo) - -////////////////////////////////////////////////////////////////////////// -//! FolderWatchBase -/*! Class for filtering file changes generated from a root watch. Define your own - *! custom filtering by deriving from this base class and implement your own - *! custom code for what to do when receiving a file change notification. - * */ -class FolderWatchBase - : public QObject -{ - Q_OBJECT - -public: - FolderWatchBase(const QString strFolder, bool bWatchSubtree = true, FileAction fileAction = FileAction::FileAction_Any) - : m_folder(strFolder) - , m_watchSubtree(bWatchSubtree) - , m_fileAction(fileAction) - { - m_folder = QDir::toNativeSeparators(QDir::cleanPath(m_folder) + "/"); - } - - //! IsSubfolder(folderA, folderB) - //! returns whether folderA is a subfolder of folderB - //! assumptions: absolute paths, case insensitive - static bool IsSubfolder(const QString& folderA, const QString& folderB) - { - // lets avoid allocating or messing with memory - this is a MAJOR hotspot as it is called for any file change even in the cache! - int sizeB = folderB.length(); - int sizeA = folderA.length(); - - if (sizeA <= sizeB) - { - return false; - } - - QChar slash1 = QChar('\\'); - QChar slash2 = QChar('/'); - int posA = 0; - - // A is going to be the longer one, so use B: - for (int idx = 0; idx < sizeB; ++idx) - { - QChar charAtA = folderA.at(posA); - QChar charAtB = folderB.at(idx); - - if ((charAtB == slash1) || (charAtB == slash2)) - { - if ((charAtA != slash1) && (charAtA != slash2)) - { - return false; - } - ++posA; - } - else - { - if (charAtA.toLower() != charAtB.toLower()) - { - return false; - } - ++posA; - } - } - return true; - } - - QString m_folder; - bool m_watchSubtree; - FileAction m_fileAction; - -public Q_SLOTS: - void OnAnyFileChange(FileChangeInfo info) - { - //if they set a file action then respect it by rejecting non matching file actions - if (info.m_action & m_fileAction) - { - //is the file is in the folder or subtree (if specified) then call OnFileChange - - if (FolderWatchBase::IsSubfolder(info.m_filePath, m_folder)) - { - OnFileChange(info); - } - } - } - - virtual void OnFileChange(const FileChangeInfo& info) = 0; -}; - -////////////////////////////////////////////////////////////////////////// -//! FolderWatchCallbackEx -/*! Class implements a more complex filtering that can optionally filter for file - *! extension and call different callback for different kinds of file changes - *! generated from a root watch. - *! Notes: - *! - empty extension "" catches all file changes - *! - extension should not include the leading "." - * */ -class FolderWatchCallbackEx - : public FolderWatchBase -{ - Q_OBJECT - -public: - FolderWatchCallbackEx(const QString strFolder, const QString extension, bool bWatchSubtree) - : FolderWatchBase(strFolder, bWatchSubtree) - , m_extension(extension) - { - } - - QString m_extension; - - //on file change call the change callback if passes extension then route - //to specific file action type callback - virtual void OnFileChange(const FileChangeInfo& info) - { - //if they set an extension to watch for only let matching extensions through - QFileInfo fileInfo(info.m_filePath); - - if (!m_watchSubtree) - { - // filter out subtrees too. - QStringRef subRef = info.m_filePath.rightRef(info.m_filePath.length() - m_folder.length()); - if ((subRef.indexOf('/') != -1) || (subRef.indexOf('\\') != -1)) - { - return; // filter this out. - } - - // we don't care about subdirs. IsDir is more expensive so we do it after the above filter. - if (fileInfo.isDir()) - { - return; - } - } - - if (m_extension.isEmpty() || fileInfo.completeSuffix().compare(m_extension, Qt::CaseInsensitive) == 0) - { - if (info.m_action & FileAction::FileAction_Any) - { - Q_EMIT fileChange(info); - } - - if (info.m_action & FileAction::FileAction_Added) - { - Q_EMIT fileAdded(info.m_filePath); - } - - if (info.m_action & FileAction::FileAction_Removed) - { - Q_EMIT fileRemoved(info.m_filePath); - } - - if (info.m_action & FileAction::FileAction_Modified) - { - Q_EMIT fileModified(info.m_filePath); - } - } - } - -Q_SIGNALS: - void fileChange(FileChangeInfo info); - void fileAdded(QString filePath); - void fileRemoved(QString filePath); - void fileModified(QString filePath); -}; - -#endif//FILEWATCHERAPI_H diff --git a/Code/Tools/AssetProcessor/native/unittests/FileWatcherUnitTests.cpp b/Code/Tools/AssetProcessor/native/unittests/FileWatcherUnitTests.cpp index a68b116f3d..2dd911b662 100644 --- a/Code/Tools/AssetProcessor/native/unittests/FileWatcherUnitTests.cpp +++ b/Code/Tools/AssetProcessor/native/unittests/FileWatcherUnitTests.cpp @@ -24,14 +24,12 @@ void FileWatcherUnitTestRunner::StartTest() FileWatcher fileWatcher; - FolderWatchCallbackEx folderWatch(tempPath, "", true); - - fileWatcher.AddFolderWatch(&folderWatch); + fileWatcher.AddFolderWatch(tempPath); fileWatcher.StartWatching(); { // test a single file create/write bool foundFile = false; - auto connection = QObject::connect(&folderWatch, &FolderWatchCallbackEx::fileAdded, this, [&](QString filename) + auto connection = QObject::connect(&fileWatcher, &FileWatcher::fileAdded, this, [&](QString filename) { AZ_TracePrintf(AssetProcessor::DebugChannel, "Single file test Found asset: %s.\n", filename.toUtf8().data()); foundFile = true; @@ -66,7 +64,7 @@ void FileWatcherUnitTestRunner::StartTest() const unsigned long maxFiles = 10000; QSet outstandingFiles; - auto connection = QObject::connect(&folderWatch, &FolderWatchCallbackEx::fileAdded, this, [&](QString filename) + auto connection = QObject::connect(&fileWatcher, &FileWatcher::fileAdded, this, [&](QString filename) { outstandingFiles.remove(filename); }); @@ -122,7 +120,7 @@ void FileWatcherUnitTestRunner::StartTest() { // test deletion bool foundFile = false; - auto connection = QObject::connect(&folderWatch, &FolderWatchCallbackEx::fileRemoved, this, [&](QString filename) + auto connection = QObject::connect(&fileWatcher, &FileWatcher::fileRemoved, this, [&](QString filename) { AZ_TracePrintf(AssetProcessor::DebugChannel, "Deleted asset: %s...\n", filename.toUtf8().data()); foundFile = true; @@ -155,7 +153,7 @@ void FileWatcherUnitTestRunner::StartTest() { bool fileAddCalled = false; QString fileAddName; - auto connectionAdd = QObject::connect(&folderWatch, &FolderWatchCallbackEx::fileAdded, this, [&](QString filename) + auto connectionAdd = QObject::connect(&fileWatcher, &FileWatcher::fileAdded, this, [&](QString filename) { fileAddCalled = true; fileAddName = filename; @@ -163,7 +161,7 @@ void FileWatcherUnitTestRunner::StartTest() bool fileRemoveCalled = false; QString fileRemoveName; - auto connectionRemove = QObject::connect(&folderWatch, &FolderWatchCallbackEx::fileRemoved, this, [&](QString filename) + auto connectionRemove = QObject::connect(&fileWatcher, &FileWatcher::fileRemoved, this, [&](QString filename) { fileRemoveCalled = true; fileRemoveName = filename; @@ -171,7 +169,7 @@ void FileWatcherUnitTestRunner::StartTest() QStringList fileModifiedNames; bool fileModifiedCalled = false; - auto connectionModified = QObject::connect(&folderWatch, &FolderWatchCallbackEx::fileModified, this, [&](QString filename) + auto connectionModified = QObject::connect(&fileWatcher, &FileWatcher::fileModified, this, [&](QString filename) { fileModifiedCalled = true; fileModifiedNames.append(filename); diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.h b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.h index 56d65d6784..2ecea4e512 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.h +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.h @@ -21,7 +21,6 @@ #include "native/assetprocessor.h" #endif -class FolderWatchCallbackEx; class QCoreApplication; namespace AZ diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp index f9827bda2e..36450c4e65 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp @@ -433,63 +433,77 @@ void ApplicationManagerBase::DestroyPlatformConfiguration() void ApplicationManagerBase::InitFileMonitor() { - m_folderWatches.reserve(m_platformConfiguration->GetScanFolderCount()); - m_watchHandles.reserve(m_platformConfiguration->GetScanFolderCount()); for (int folderIdx = 0; folderIdx < m_platformConfiguration->GetScanFolderCount(); ++folderIdx) { const AssetProcessor::ScanFolderInfo& info = m_platformConfiguration->GetScanFolderAt(folderIdx); - - FolderWatchCallbackEx* newFolderWatch = new FolderWatchCallbackEx(info.ScanPath(), "", info.RecurseSubFolders()); - // hook folder watcher to assess files on add/modify - // relevant files will be sent to resource compiler - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileAdded, - m_assetProcessorManager, &AssetProcessor::AssetProcessorManager::AssessAddedFile); - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileModified, - m_assetProcessorManager, &AssetProcessor::AssetProcessorManager::AssessModifiedFile); - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileRemoved, - m_assetProcessorManager, &AssetProcessor::AssetProcessorManager::AssessDeletedFile); - - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileAdded, [this](QString path) { m_fileStateCache->AddFile(path); }); - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileModified, [this](QString path) { m_fileStateCache->UpdateFile(path); }); - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileRemoved, [this](QString path) { m_fileStateCache->RemoveFile(path); }); - - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileAdded, [](QString path) { AZ::Interface::Get()->FileAdded(path); }); - - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileAdded, - m_fileProcessor.get(), &AssetProcessor::FileProcessor::AssessAddedFile); - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileRemoved, - m_fileProcessor.get(), &AssetProcessor::FileProcessor::AssessDeletedFile); - - m_folderWatches.push_back(AZStd::unique_ptr(newFolderWatch)); - m_watchHandles.push_back(m_fileWatcher.AddFolderWatch(newFolderWatch, info.RecurseSubFolders())); + m_fileWatcher.AddFolderWatch(info.ScanPath(), info.RecurseSubFolders()); } - // also hookup monitoring for the cache (output directory) QDir cacheRoot; if (AssetUtilities::ComputeProjectCacheRoot(cacheRoot)) { - FolderWatchCallbackEx* newFolderWatch = new FolderWatchCallbackEx(cacheRoot.absolutePath(), "", true); + m_fileWatcher.AddFolderWatch(cacheRoot.absolutePath(), true); + } - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileAdded, [this](QString path) { m_fileStateCache->AddFile(path); }); - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileModified, [this](QString path) { m_fileStateCache->UpdateFile(path); }); - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileRemoved, [this](QString path) { m_fileStateCache->RemoveFile(path); }); + if (m_platformConfiguration->GetScanFolderCount() || !cacheRoot.path().isEmpty()) + { + const auto cachePath = QDir::toNativeSeparators(cacheRoot.absolutePath()); - // we only care about cache root deletions. - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileRemoved, - m_assetProcessorManager, &AssetProcessor::AssetProcessorManager::AssessDeletedFile); + const auto OnFileAdded = [this, cachePath](QString path) + { + const bool isCacheRoot = path.startsWith(cachePath); + if (isCacheRoot) + { + m_fileStateCache->AddFile(path); + } + else + { + m_assetProcessorManager->AssessAddedFile(path); + m_fileStateCache->AddFile(path); + AZ::Interface::Get()->FileAdded(path); + m_fileProcessor->AssetProcessor::FileProcessor::AssessAddedFile(path); + } + }; - m_folderWatches.push_back(AZStd::unique_ptr(newFolderWatch)); - m_watchHandles.push_back(m_fileWatcher.AddFolderWatch(newFolderWatch)); + const auto OnFileModified = [this, cachePath](QString path) + { + const bool isCacheRoot = path.startsWith(cachePath); + if (isCacheRoot) + { + m_assetProcessorManager->AssessModifiedFile(path); + } + else + { + m_assetProcessorManager->AssessModifiedFile(path); + m_fileStateCache->UpdateFile(path); + } + }; + + const auto OnFileRemoved = [this, cachePath](QString path) + { + const bool isCacheRoot = path.startsWith(cachePath); + if (isCacheRoot) + { + m_fileStateCache->RemoveFile(path); + m_assetProcessorManager->AssessDeletedFile(path); + } + else + { + m_assetProcessorManager->AssessDeletedFile(path); + m_fileStateCache->RemoveFile(path); + m_fileProcessor->AssessDeletedFile(path); + } + }; + + connect(&m_fileWatcher, &FileWatcher::fileAdded, OnFileAdded); + connect(&m_fileWatcher, &FileWatcher::fileModified, OnFileModified); + connect(&m_fileWatcher, &FileWatcher::fileRemoved, OnFileRemoved); } } void ApplicationManagerBase::DestroyFileMonitor() { - for (int watchHandle : m_watchHandles) - { - m_fileWatcher.RemoveFolderWatch(watchHandle); - } - m_folderWatches.resize(0); + m_fileWatcher.ClearFolderWatches(); } void ApplicationManagerBase::DestroyApplicationServer() @@ -798,8 +812,6 @@ ApplicationManager::BeforeRunStatus ApplicationManagerBase::BeforeRun() qRegisterMetaType("AzFramework::AssetSystem::AssetStatus"); qRegisterMetaType("AssetStatus"); - qRegisterMetaType("FileChangeInfo"); - qRegisterMetaType("AssetScanningStatus"); qRegisterMetaType("NetworkRequestID"); diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.h b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.h index dbc4841599..8591228375 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.h +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.h @@ -47,7 +47,6 @@ namespace AssetProcessor class ApplicationServer; class ConnectionManager; -class FolderWatchCallbackEx; class ControlRequestHandler; class ApplicationManagerBase @@ -192,9 +191,7 @@ protected: bool m_sourceControlReady = false; bool m_fullIdle = false; - AZStd::vector > m_folderWatches; FileWatcher m_fileWatcher; - AZStd::vector m_watchHandles; AssetProcessor::PlatformConfiguration* m_platformConfiguration = nullptr; AssetProcessor::AssetProcessorManager* m_assetProcessorManager = nullptr; AssetProcessor::AssetCatalog* m_assetCatalog = nullptr; diff --git a/Code/Tools/AssetProcessor/native/utilities/AssetBuilderInfo.h b/Code/Tools/AssetProcessor/native/utilities/AssetBuilderInfo.h index 5ace9e1aaf..20a1d808fd 100644 --- a/Code/Tools/AssetProcessor/native/utilities/AssetBuilderInfo.h +++ b/Code/Tools/AssetProcessor/native/utilities/AssetBuilderInfo.h @@ -23,7 +23,6 @@ #include #include -class FolderWatchCallbackEx; class QCoreApplication; namespace AssetProcessor From 484e27c109a1f8107730a897f0f23362b912cfb0 Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Mon, 13 Dec 2021 09:02:03 -0800 Subject: [PATCH 255/399] Use AZStd::equal to implement path comparison Signed-off-by: Chris Burel --- .../native/FileWatcher/FileWatcher.cpp | 49 +++++++++---------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp index c1c1a29d74..f802bdbada 100644 --- a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp +++ b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp @@ -13,46 +13,43 @@ //! IsSubfolder(folderA, folderB) //! returns whether folderA is a subfolder of folderB -//! assumptions: absolute paths, case insensitive +//! assumptions: absolute paths static bool IsSubfolder(const QString& folderA, const QString& folderB) { // lets avoid allocating or messing with memory - this is a MAJOR hotspot as it is called for any file change even in the cache! - int sizeB = folderB.length(); - int sizeA = folderA.length(); - - if (sizeA <= sizeB) + if (folderA.length() <= folderB.length()) { return false; } - QChar slash1 = QChar('\\'); - QChar slash2 = QChar('/'); - int posA = 0; + using AZStd::begin; + using AZStd::end; - // A is going to be the longer one, so use B: - for (int idx = 0; idx < sizeB; ++idx) + constexpr auto isSlash = [](const QChar c) constexpr { - QChar charAtA = folderA.at(posA); - QChar charAtB = folderB.at(idx); + return c == AZ::IO::WindowsPathSeparator || c == AZ::IO::PosixPathSeparator; + }; - if ((charAtB == slash1) || (charAtB == slash2)) + const auto firstPathSeparator = AZStd::find_if(begin(folderB), end(folderB), [&isSlash](const QChar c) + { + return isSlash(c); + }); + + // Follow the convention used by AZ::IO::Path, and use a case-sensitive comparison on Posix paths + const bool useCaseSensitiveCompare = (firstPathSeparator == end(folderB)) ? true : (*firstPathSeparator == AZ::IO::PosixPathSeparator); + + return AZStd::equal(begin(folderB), end(folderB), begin(folderA), [isSlash, useCaseSensitiveCompare](const QChar charAtB, const QChar charAtA) + { + if (isSlash(charAtA)) { - if ((charAtA != slash1) && (charAtA != slash2)) - { - return false; - } - ++posA; + return isSlash(charAtB); } - else + if (useCaseSensitiveCompare) { - if (charAtA.toLower() != charAtB.toLower()) - { - return false; - } - ++posA; + return charAtA == charAtB; } - } - return true; + return charAtA.toLower() == charAtB.toLower(); + }); } ////////////////////////////////////////////////////////////////////////// From 2bc1d8620e5dc7260a043c7ac89141125930de3f Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Mon, 20 Dec 2021 08:13:45 -0800 Subject: [PATCH 256/399] Rename file to adhere to PAL conventions Signed-off-by: Chris Burel --- .../Platform/Windows/assetprocessor_windows_files.cmake | 2 +- .../{FileWatcher_win.cpp => FileWatcher_windows.cpp} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/{FileWatcher_win.cpp => FileWatcher_windows.cpp} (100%) diff --git a/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake b/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake index 2bd9fa6470..96dd7434c1 100644 --- a/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake +++ b/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake @@ -8,7 +8,7 @@ set(FILES native/FileWatcher/FileWatcher_platform.h - native/FileWatcher/FileWatcher_win.cpp + native/FileWatcher/FileWatcher_windows.cpp native/FileWatcher/FileWatcher_windows.h native/resource.h ) diff --git a/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_win.cpp b/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_windows.cpp similarity index 100% rename from Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_win.cpp rename to Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_windows.cpp From 648a21ab5c310860f9dcf8415aa4f105c5bf982a Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Tue, 4 Jan 2022 16:11:45 -0800 Subject: [PATCH 257/399] [Linux] Correct handling of new dirs added to non-recursive watch roots Signed-off-by: Chris Burel --- .../native/FileWatcher/FileWatcher_linux.cpp | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp index 7d38372e18..4ca41c0cb9 100644 --- a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp +++ b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp @@ -176,10 +176,25 @@ void FileWatcher::WatchFolderLoop() if (event->mask & (IN_CREATE | IN_MOVED_TO)) { - if (event->mask & IN_ISDIR /*&& m_recursive*/) + if (event->mask & IN_ISDIR) { - // New Directory, add it to the watch - m_platformImpl->AddWatchFolder(pathStr, true); + // New Directory, see if it should be added to the watched directories + // It is only added if it is a child of a recursively watched directory + const auto found = AZStd::find_if(begin(m_folderWatchRoots), end(m_folderWatchRoots), [this, event](const WatchRoot& watchRoot) + { + return watchRoot.m_directory == m_platformImpl->m_handleToFolderMap[event->wd]; + }); + + // If the path is not in m_folderWatchRoots, it must + // be a new subdirectory of a subdirectory of some + // other root that is being watched recursively. + // Maintain the recursive nature of that root. + const bool shouldAddFolder = (found == end(m_folderWatchRoots)) ? true : found->m_recursive; + + if (shouldAddFolder) + { + m_platformImpl->AddWatchFolder(pathStr, true); + } } else { From 41c0fb2b02a285c2682785d8ae22e54a652a1f0a Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Tue, 4 Jan 2022 17:41:58 -0800 Subject: [PATCH 258/399] Address some review feedback Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp | 2 +- Code/Framework/AzCore/AzCore/DOM/DomUtils.h | 2 +- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 244 +++++++++++------- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 38 +-- .../AzCore/AzCore/DOM/DomValueWriter.cpp | 4 +- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 4 +- .../AzCore/Tests/DOM/DomValueTests.cpp | 46 ++-- 7 files changed, 201 insertions(+), 139 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp index d65497e194..73c4bd2d76 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp @@ -22,7 +22,7 @@ namespace AZ::Dom::Utils return backend.ReadFromBufferInPlace(string.data(), string.size(), visitor); } - AZ::Outcome WriteToValue(Backend::WriteCallback writeCallback) + AZ::Outcome WriteToValue(const Backend::WriteCallback& writeCallback) { Value value; AZStd::unique_ptr writer = value.GetWriteHandler(); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomUtils.h b/Code/Framework/AzCore/AzCore/DOM/DomUtils.h index f03e5b66b8..ebe4273b48 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomUtils.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomUtils.h @@ -16,5 +16,5 @@ namespace AZ::Dom::Utils Visitor::Result ReadFromString(Backend& backend, AZStd::string_view string, AZ::Dom::Lifetime lifetime, Visitor& visitor); Visitor::Result ReadFromStringInPlace(Backend& backend, AZStd::string& string, Visitor& visitor); - AZ::Outcome WriteToValue(Backend::WriteCallback writeCallback); + AZ::Outcome WriteToValue(const Backend::WriteCallback& writeCallback); } // namespace AZ::Dom::Utils diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 7401a5ac98..8c002b7091 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -12,22 +12,22 @@ namespace AZ::Dom { - template - AZStd::shared_ptr& CheckCopyOnWrite(AZStd::shared_ptr& refCountedPointer) + namespace Internal { - if (refCountedPointer.use_count() == 1) + template + AZStd::shared_ptr& CheckCopyOnWrite(AZStd::shared_ptr& refCountedPointer) { - return refCountedPointer; - } - else - { - refCountedPointer = AZStd::allocate_shared(StdValueAllocator(), *refCountedPointer); - return refCountedPointer; + if (refCountedPointer.use_count() == 1) + { + return refCountedPointer; + } + else + { + refCountedPointer = AZStd::allocate_shared(StdValueAllocator(), *refCountedPointer); + return refCountedPointer; + } } - } - namespace Internal - { template constexpr size_t GetTypeIndexInternal(size_t index = 0); @@ -288,107 +288,173 @@ namespace AZ::Dom Type Dom::Value::GetType() const { - switch (m_value.index()) - { - case GetTypeIndex(): - return Type::Null; - case GetTypeIndex(): - return Type::Int64; - case GetTypeIndex(): - return Type::Uint64; - case GetTypeIndex(): - return Type::Double; - case GetTypeIndex(): - return Type::Bool; - case GetTypeIndex(): - case GetTypeIndex(): - case GetTypeIndex(): - return Type::String; - case GetTypeIndex(): - return Type::Object; - case GetTypeIndex(): - return Type::Array; - case GetTypeIndex(): - return Type::Node; - case GetTypeIndex>(): - return Type::Opaque; - } - AZ_Assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); - return Type::Null; + return AZStd::visit( + [](auto&& value) -> Type + { + using CurrentType = AZStd::decay_t; + if constexpr (AZStd::is_same_v) + { + return Type::Null; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Int64; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Uint64; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Double; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Bool; + } + else if constexpr (AZStd::is_same_v) + { + return Type::String; + } + else if constexpr (AZStd::is_same_v) + { + return Type::String; + } + else if constexpr (AZStd::is_same_v) + { + return Type::String; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Object; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Array; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Node; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Opaque; + } + else + { + static_assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); + } + }, + m_value); } bool Value::IsNull() const { - return GetType() == Type::Null; + return AZStd::holds_alternative(m_value); } bool Value::IsFalse() const { - return IsBool() && !AZStd::get(m_value); + const bool* value = AZStd::get_if(&m_value); + return value != nullptr ? !(*value) : false; } bool Value::IsTrue() const { - return IsBool() && AZStd::get(m_value); + const bool* value = AZStd::get_if(&m_value); + return value != nullptr ? *value : false; } bool Value::IsBool() const { - return GetType() == Type::Bool; + return AZStd::holds_alternative(m_value); } bool Value::IsNode() const { - return GetType() == Type::Node; + return AZStd::holds_alternative(m_value); } bool Value::IsObject() const { - return GetType() == Type::Object; + return AZStd::holds_alternative(m_value); } bool Value::IsArray() const { - return GetType() == Type::Array; + return AZStd::holds_alternative(m_value); } bool Value::IsOpaqueValue() const { - return GetType() == Type::Opaque; + return AZStd::holds_alternative(m_value); } bool Value::IsNumber() const { - switch (GetType()) - { - case Type::Int64: - [[fallthrough]]; - case Type::Uint64: - [[fallthrough]]; - case Type::Double: - return true; - } - return false; + return AZStd::visit( + [](auto&& value) -> bool + { + using CurrentType = AZStd::decay_t; + if constexpr (AZStd::is_same_v) + { + return true; + } + else if constexpr (AZStd::is_same_v) + { + return true; + } + else if constexpr (AZStd::is_same_v) + { + return true; + } + else + { + return false; + } + }, + m_value); } bool Value::IsInt() const { - return GetType() == Type::Int64; + return AZStd::holds_alternative(m_value); } bool Value::IsUint() const { - return GetType() == Type::Uint64; + return AZStd::holds_alternative(m_value); } bool Value::IsDouble() const { - return GetType() == Type::Double; + return AZStd::holds_alternative(m_value); } bool Value::IsString() const { - return GetType() == Type::String; + return AZStd::visit( + [](auto&& value) -> bool + { + using CurrentType = AZStd::decay_t; + if constexpr (AZStd::is_same_v) + { + return true; + } + else if constexpr (AZStd::is_same_v) + { + return true; + } + else if constexpr (AZStd::is_same_v) + { + return true; + } + else + { + return false; + } + }, + m_value); } Value& Value::SetObject() @@ -406,7 +472,7 @@ namespace AZ::Dom Node& Value::GetNodeInternal() { AZ_Assert(GetType() == Type::Node, "AZ::Dom::Value: attempted to retrieve a node from a non-node value"); - return *CheckCopyOnWrite(AZStd::get(m_value)); + return *Internal::CheckCopyOnWrite(AZStd::get(m_value)); } const Object::ContainerType& Value::GetObjectInternal() const @@ -433,11 +499,11 @@ namespace AZ::Dom "AZ::Dom::Value: attempted to retrieve an object from a value that isn't an object or a node"); if (type == Type::Object) { - return CheckCopyOnWrite(AZStd::get(m_value))->m_values; + return Internal::CheckCopyOnWrite(AZStd::get(m_value))->m_values; } else { - return CheckCopyOnWrite(AZStd::get(m_value))->GetProperties(); + return Internal::CheckCopyOnWrite(AZStd::get(m_value))->GetProperties(); } } @@ -465,11 +531,11 @@ namespace AZ::Dom "AZ::Dom::Value: attempted to retrieve an array from a value that isn't an array or node"); if (type == Type::Array) { - return CheckCopyOnWrite(AZStd::get(m_value))->m_values; + return Internal::CheckCopyOnWrite(AZStd::get(m_value))->m_values; } else { - return CheckCopyOnWrite(AZStd::get(m_value))->GetChildren(); + return Internal::CheckCopyOnWrite(AZStd::get(m_value))->GetChildren(); } } @@ -698,22 +764,22 @@ namespace AZ::Dom return *this; } - size_t Value::Size() const + size_t Value::ArraySize() const { return GetArrayInternal().size(); } - size_t Value::Capacity() const + size_t Value::ArrayCapacity() const { return GetArrayInternal().capacity(); } - bool Value::Empty() const + bool Value::IsArrayEmpty() const { return GetArrayInternal().empty(); } - void Value::Clear() + void Value::ClearArray() { GetArrayInternal().clear(); } @@ -728,43 +794,43 @@ namespace AZ::Dom return GetArrayInternal()[index]; } - Value& Value::MutableAt(size_t index) + Value& Value::MutableArrayAt(size_t index) { return operator[](index); } - const Value& Value::At(size_t index) const + const Value& Value::ArrayAt(size_t index) const { return operator[](index); } - Array::ConstIterator Value::Begin() const + Array::ConstIterator Value::ArrayBegin() const { return GetArrayInternal().begin(); } - Array::ConstIterator Value::End() const + Array::ConstIterator Value::ArrayEnd() const { return GetArrayInternal().end(); } - Array::Iterator Value::Begin() + Array::Iterator Value::ArrayBegin() { return GetArrayInternal().begin(); } - Array::Iterator Value::End() + Array::Iterator Value::ArrayEnd() { return GetArrayInternal().end(); } - Value& Value::Reserve(size_t newCapacity) + Value& Value::ArrayReserve(size_t newCapacity) { GetArrayInternal().reserve(newCapacity); return *this; } - Value& Value::PushBack(Value value) + Value& Value::ArrayPushBack(Value value) { Array::ContainerType& array = GetArrayInternal(); array.reserve((array.size() / Array::ReserveIncrement + 1) * Array::ReserveIncrement); @@ -772,18 +838,18 @@ namespace AZ::Dom return *this; } - Value& Value::PopBack() + Value& Value::ArrayPopBack() { GetArrayInternal().pop_back(); return *this; } - Array::Iterator Value::Erase(Array::ConstIterator pos) + Array::Iterator Value::ArrayErase(Array::ConstIterator pos) { return GetArrayInternal().erase(pos); } - Array::Iterator Value::Erase(Array::ConstIterator first, Array::ConstIterator last) + Array::Iterator Value::ArrayErase(Array::ConstIterator first, Array::ConstIterator last) { return GetArrayInternal().erase(first, last); } @@ -1007,13 +1073,6 @@ namespace AZ::Dom void Value::SetString(AZStd::string_view value) { - if (value.size() <= ShortStringSize) - { - ShortStringType buffer; - buffer.resize_no_construct(value.size()); - memcpy(buffer.data(), value.data(), value.size()); - m_value = buffer; - } m_value = value; } @@ -1021,7 +1080,10 @@ namespace AZ::Dom { if (value.size() <= ShortStringSize) { - SetString(value); + ShortStringType buffer; + buffer.resize_no_construct(value.size()); + memcpy(buffer.data(), value.data(), value.size()); + m_value = buffer; } else { @@ -1035,9 +1097,9 @@ namespace AZ::Dom return *AZStd::get(m_value); } - void Value::SetOpaqueValue(const AZStd::any& value) + void Value::SetOpaqueValue(AZStd::any value) { - m_value = AZStd::allocate_shared(StdValueAllocator(), value); + m_value = AZStd::allocate_shared(StdValueAllocator(), AZStd::move(value)); } void Value::SetNull() diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index b73da92d23..d67947dd0a 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -103,9 +103,9 @@ namespace AZ::Dom { public: Node() = default; + Node(const Node&) = default; + Node(Node&&) = default; explicit Node(AZ::Name name); - explicit Node(const Node&) = default; - explicit Node(Node&&) = default; Node& operator=(const Node&) = default; Node& operator=(Node&&) = default; @@ -174,7 +174,7 @@ namespace AZ::Dom double, // Bool bool, - // StringType + // String AZStd::string_view, SharedStringType, ShortStringType, @@ -280,28 +280,28 @@ namespace AZ::Dom // Array API (also used by Node)... Value& SetArray(); - size_t Size() const; - size_t Capacity() const; - bool Empty() const; - void Clear(); + size_t ArraySize() const; + size_t ArrayCapacity() const; + bool IsArrayEmpty() const; + void ClearArray(); Value& operator[](size_t index); const Value& operator[](size_t index) const; - Value& MutableAt(size_t index); - const Value& At(size_t index) const; + Value& MutableArrayAt(size_t index); + const Value& ArrayAt(size_t index) const; - Array::ConstIterator Begin() const; - Array::ConstIterator End() const; - Array::Iterator Begin(); - Array::Iterator End(); + Array::ConstIterator ArrayBegin() const; + Array::ConstIterator ArrayEnd() const; + Array::Iterator ArrayBegin(); + Array::Iterator ArrayEnd(); - Value& Reserve(size_t newCapacity); - Value& PushBack(Value value); - Value& PopBack(); + Value& ArrayReserve(size_t newCapacity); + Value& ArrayPushBack(Value value); + Value& ArrayPopBack(); - Array::Iterator Erase(Array::ConstIterator pos); - Array::Iterator Erase(Array::ConstIterator first, Array::ConstIterator last); + Array::Iterator ArrayErase(Array::ConstIterator pos); + Array::Iterator ArrayErase(Array::ConstIterator first, Array::ConstIterator last); Array::ContainerType& GetMutableArray(); const Array::ContainerType& GetArray() const; @@ -365,7 +365,7 @@ namespace AZ::Dom //! serialize an opaque type into a DOM value instead, as serializers //! and other systems will have no means of dealing with fully arbitrary //! values. - void SetOpaqueValue(const AZStd::any&); + void SetOpaqueValue(AZStd::any); // Null API... void SetNull(); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index 210d1fa123..433e650d04 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -129,7 +129,7 @@ namespace AZ::Dom AZStd::string::format("AZ::Dom::ValueWriter: %s called from within a different container type", endMethodName)); } - if (static_cast(buffer.m_attributes.size()) != attributeCount) + if (aznumeric_cast(buffer.m_attributes.size()) != attributeCount) { return VisitorFailure( VisitorErrorCode::InternalError, @@ -138,7 +138,7 @@ namespace AZ::Dom buffer.m_attributes.size())); } - if (static_cast(buffer.m_elements.size()) != elementCount) + if (aznumeric_cast(buffer.m_elements.size()) != elementCount) { return VisitorFailure( VisitorErrorCode::InternalError, diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index 12684c64bc..74eb78be00 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -77,7 +77,7 @@ namespace AZ::Dom::Benchmark Value array(Type::Array); for (int i = 0; i < entryCount; ++i) { - array.PushBack(createEntry(i)); + array.ArrayPushBack(createEntry(i)); } return array; }; @@ -152,7 +152,7 @@ namespace AZ::Dom::Benchmark for (auto _ : state) { Value copy = original; - copy["entries"]["Key0"].PushBack(42); + copy["entries"]["Key0"].ArrayPushBack(42); TakeAndDiscardWithoutTimingDtor(AZStd::move(copy), state); } diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp index b88ab746b9..3cbd532b13 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -55,7 +55,7 @@ namespace AZ::Dom::Tests m_value.SetArray(); EXPECT_TRUE(m_value.IsArray()); - EXPECT_EQ(m_value.Size(), 0); + EXPECT_EQ(m_value.ArraySize(), 0); PerformValueChecks(); } @@ -66,8 +66,8 @@ namespace AZ::Dom::Tests for (int i = 0; i < 5; ++i) { - m_value.PushBack(Value(i)); - EXPECT_EQ(m_value.Size(), i + 1); + m_value.ArrayPushBack(Value(i)); + EXPECT_EQ(m_value.ArraySize(), i + 1); EXPECT_EQ(m_value[i].GetInt32(), i); } @@ -82,15 +82,15 @@ namespace AZ::Dom::Tests Value nestedArray(Type::Array); for (int i = 0; i < 5; ++i) { - nestedArray.PushBack(Value(i)); + nestedArray.ArrayPushBack(Value(i)); } - m_value.PushBack(AZStd::move(nestedArray)); + m_value.ArrayPushBack(AZStd::move(nestedArray)); } - EXPECT_EQ(m_value.Size(), 5); + EXPECT_EQ(m_value.ArraySize(), 5); for (int i = 0; i < 3; ++i) { - EXPECT_EQ(m_value[i].Size(), 5); + EXPECT_EQ(m_value[i].ArraySize(), 5); for (int j = 0; j < 5; ++j) { EXPECT_EQ(m_value[i][j].GetInt32(), j); @@ -154,7 +154,7 @@ namespace AZ::Dom::Tests m_value.SetNode("Test"); EXPECT_EQ(m_value.GetNodeName(), AZ::Name("Test")); EXPECT_EQ(m_value.MemberCount(), 0); - EXPECT_EQ(m_value.Size(), 0); + EXPECT_EQ(m_value.ArraySize(), 0); PerformValueChecks(); } @@ -165,8 +165,8 @@ namespace AZ::Dom::Tests for (int i = 0; i < 10; ++i) { - m_value.PushBack(Value(i)); - EXPECT_EQ(m_value.Size(), i + 1); + m_value.ArrayPushBack(Value(i)); + EXPECT_EQ(m_value.ArraySize(), i + 1); EXPECT_EQ(m_value[i].GetInt32(), i); if (i < 5) @@ -196,10 +196,10 @@ namespace AZ::Dom::Tests childNode.AddMember("foo", i); childNode.AddMember("bar", Value("test", false)); - m_value.PushBack(childNode); + m_value.ArrayPushBack(childNode); } - EXPECT_EQ(m_value.Size(), 5); + EXPECT_EQ(m_value.ArraySize(), 5); for (int i = 0; i < 5; ++i) { const Value& childNode = m_value[i]; @@ -334,30 +334,30 @@ namespace AZ::Dom::Tests TEST_F(DomValueTests, CopyOnWrite_Array) { Value v1(Type::Array); - v1.PushBack(1); - v1.PushBack(2); + v1.ArrayPushBack(1); + v1.ArrayPushBack(2); Value nestedArray(Type::Array); - v1.PushBack(nestedArray); + v1.ArrayPushBack(nestedArray); Value v2 = v1; EXPECT_EQ(&v1.GetArray(), &v2.GetArray()); - EXPECT_EQ(&v1.At(2).GetArray(), &v2.At(2).GetArray()); + EXPECT_EQ(&v1.ArrayAt(2).GetArray(), &v2.ArrayAt(2).GetArray()); v2[0] = 0; EXPECT_NE(&v1.GetArray(), &v2.GetArray()); - EXPECT_EQ(&v1.At(2).GetArray(), &v2.At(2).GetArray()); + EXPECT_EQ(&v1.ArrayAt(2).GetArray(), &v2.ArrayAt(2).GetArray()); - v2[2].PushBack(42); + v2[2].ArrayPushBack(42); EXPECT_NE(&v1.GetArray(), &v2.GetArray()); - EXPECT_NE(&v1.At(2).GetArray(), &v2.At(2).GetArray()); + EXPECT_NE(&v1.ArrayAt(2).GetArray(), &v2.ArrayAt(2).GetArray()); v2 = v1; EXPECT_EQ(&v1.GetArray(), &v2.GetArray()); - EXPECT_EQ(&v1.At(2).GetArray(), &v2.At(2).GetArray()); + EXPECT_EQ(&v1.ArrayAt(2).GetArray(), &v2.ArrayAt(2).GetArray()); } TEST_F(DomValueTests, CopyOnWrite_Node) @@ -365,8 +365,8 @@ namespace AZ::Dom::Tests Value v1; v1.SetNode("TopLevel"); - v1.PushBack(1); - v1.PushBack(2); + v1.ArrayPushBack(1); + v1.ArrayPushBack(2); v1["obj"].SetNode("Nested"); Value v2 = v1; @@ -378,7 +378,7 @@ namespace AZ::Dom::Tests EXPECT_NE(&v1.GetNode(), &v2.GetNode()); EXPECT_EQ(&v1["obj"].GetNode(), &v2["obj"].GetNode()); - v2["obj"].PushBack(42); + v2["obj"].ArrayPushBack(42); EXPECT_NE(&v1.GetNode(), &v2.GetNode()); EXPECT_NE(&v1["obj"].GetNode(), &v2["obj"].GetNode()); From 5eb6c2d24be1805dffce03e9ef773e9f5c69395d Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Tue, 4 Jan 2022 18:13:44 -0800 Subject: [PATCH 259/399] Update UiCustomImageComponent to use Atom (#6628) Signed-off-by: abrmich --- Gems/LyShine/Code/Source/UiImageComponent.cpp | 10 +----- .../Code/Source/UiCustomImageComponent.cpp | 32 +++++++------------ 2 files changed, 12 insertions(+), 30 deletions(-) diff --git a/Gems/LyShine/Code/Source/UiImageComponent.cpp b/Gems/LyShine/Code/Source/UiImageComponent.cpp index 100bee6bf6..baf210a629 100644 --- a/Gems/LyShine/Code/Source/UiImageComponent.cpp +++ b/Gems/LyShine/Code/Source/UiImageComponent.cpp @@ -353,7 +353,6 @@ void UiImageComponent::SetOverrideSprite(ISprite* sprite, AZ::u32 cellIndex) //////////////////////////////////////////////////////////////////////////////////////////////////// void UiImageComponent::Render(LyShine::IRenderGraph* renderGraph) { - // get fade value (tracked by UiRenderer) and compute the desired alpha for the image float fade = renderGraph->GetAlphaFade(); float desiredAlpha = m_overrideAlpha * fade; @@ -376,9 +375,8 @@ void UiImageComponent::Render(LyShine::IRenderGraph* renderGraph) ImageType imageType = m_imageType; -#ifdef LYSHINE_ATOM_TODO // support default white texture // if there is no texture we will just use a white texture and want to stretch it - const bool spriteOrTextureIsNull = sprite == nullptr || sprite->GetTexture() == nullptr; + const bool spriteOrTextureIsNull = sprite == nullptr || sprite->GetImage() == nullptr; // Zero texture size may occur even if the UiImageComponent has a valid non-zero-sized texture, // because a canvas can be requested to Render() before the texture asset is done loading. @@ -399,12 +397,6 @@ void UiImageComponent::Render(LyShine::IRenderGraph* renderGraph) { imageType = ImageType::Stretched; } -#else - if (sprite == nullptr) - { - imageType = ImageType::Stretched; - } -#endif switch (imageType) { diff --git a/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp b/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp index 09ea375923..542e18b98c 100644 --- a/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp +++ b/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp @@ -72,36 +72,25 @@ namespace LyShineExamples } //////////////////////////////////////////////////////////////////////////////////////////////////// - void UiCustomImageComponent::Render([[maybe_unused]] LyShine::IRenderGraph* renderGraph) + void UiCustomImageComponent::Render(LyShine::IRenderGraph* renderGraph) { -#ifdef LYSHINE_ATOM_TODO // [GHI #3568] Convert draws to use Atom // get fade value (tracked by UiRenderer) and compute the desired alpha for the image float fade = renderGraph->GetAlphaFade(); float desiredAlpha = m_overrideAlpha * fade; uint8 desiredPackedAlpha = static_cast(desiredAlpha * 255.0f); - // if desired alpha is zero then no need to do any more - if (desiredPackedAlpha == 0) - { - return; - } - - ISprite* sprite = (m_overrideSprite) ? m_overrideSprite : m_sprite; - ITexture* texture = (sprite) ? sprite->GetTexture() : nullptr; - - if (!texture) - { - // if there is no texture we will just use a white texture - // TODO: Get a default atom texture here when possible - //texture = ???->EF_GetTextureByID(???->GetWhiteTextureId()); - } - if (m_isRenderCacheDirty) { RenderToCache(renderGraph); m_isRenderCacheDirty = false; } + // if desired alpha is zero then no need to do any more + if (desiredPackedAlpha == 0) + { + return; + } + // Render cache is now valid - render using the cache // If the fade value has changed we need to update the alpha values in the vertex colors but we do @@ -109,7 +98,7 @@ namespace LyShineExamples if (m_cachedPrimitive.m_vertices[0].color.a != desiredPackedAlpha) { // go through all the cached vertices and update the alpha values - UCol desiredPackedColor = m_cachedPrimitive.m_vertices[0].color; + LyShine::UCol desiredPackedColor = m_cachedPrimitive.m_vertices[0].color; desiredPackedColor.a = desiredPackedAlpha; for (int i = 0; i < m_cachedPrimitive.m_numVertices; ++i) { @@ -117,11 +106,12 @@ namespace LyShineExamples } } + ISprite* sprite = (m_overrideSprite) ? m_overrideSprite : m_sprite; + AZ::Data::Instance image = sprite->GetImage(); bool isTextureSRGB = false; bool isTexturePremultipliedAlpha = false; // we are not rendering from a render target with alpha in it LyShine::BlendMode blendMode = LyShine::BlendMode::Normal; - renderGraph->AddPrimitive(&m_cachedPrimitive, texture, m_clamp, isTextureSRGB, isTexturePremultipliedAlpha, blendMode); -#endif + renderGraph->AddPrimitive(&m_cachedPrimitive, image, m_clamp, isTextureSRGB, isTexturePremultipliedAlpha, blendMode); } //////////////////////////////////////////////////////////////////////////////////////////////////// From 40ca1dcbf90a16bae76553f7f184a58d7e5a950b Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Wed, 5 Jan 2022 09:10:12 +0100 Subject: [PATCH 260/399] EMotion FX: Extendable pose data and pose debug visualization (#6639) * Added debug draw function to the pose class for sharable and easy-to-use pose debug visualization that includes pose data debug rendering. * Extended the pose data factory with the ability to add pose data types from outside of the EMFX SDK and external gems. * In order to get access to the pose data factory, it got added to the EMFX manager. Signed-off-by: Benjamin Jillich --- .../EMotionFX/Source/EMotionFXManager.cpp | 7 +++- .../Code/EMotionFX/Source/EMotionFXManager.h | 7 ++++ Gems/EMotionFX/Code/EMotionFX/Source/Pose.cpp | 36 ++++++++++++++++++- Gems/EMotionFX/Code/EMotionFX/Source/Pose.h | 14 +++++--- .../Code/EMotionFX/Source/PoseData.h | 4 ++- .../Code/EMotionFX/Source/PoseDataFactory.cpp | 21 +++++++---- .../Code/EMotionFX/Source/PoseDataFactory.h | 13 ++++++- 7 files changed, 86 insertions(+), 16 deletions(-) diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.cpp index 4ecd1c0117..864c193a9a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.cpp @@ -6,7 +6,6 @@ * */ -// include the required headers #include "EMotionFXConfig.h" #include "EMotionFXManager.h" #include "Importer/Importer.h" @@ -29,6 +28,7 @@ #include #include #include +#include #include namespace EMotionFX @@ -76,6 +76,7 @@ namespace EMotionFX gEMFX.Get()->SetRecorder (Recorder::Create()); gEMFX.Get()->SetMotionInstancePool (MotionInstancePool::Create()); gEMFX.Get()->SetDebugDraw (aznew DebugDraw()); + gEMFX.Get()->SetPoseDataFactory (aznew PoseDataFactory()); gEMFX.Get()->SetGlobalSimulationSpeed (1.0f); // set the number of threads @@ -124,6 +125,7 @@ namespace EMotionFX m_recorder = nullptr; m_motionInstancePool = nullptr; m_debugDraw = nullptr; + m_poseDataFactory = nullptr; m_unitType = MCore::Distance::UNITTYPE_METERS; m_globalSimulationSpeed = 1.0f; m_isInEditorMode = false; @@ -170,6 +172,9 @@ namespace EMotionFX delete m_debugDraw; m_debugDraw = nullptr; + delete m_poseDataFactory; + m_poseDataFactory = nullptr; + m_renderActorSettings.reset(); m_eventManager->Destroy(); diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.h b/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.h index 4d55143b2f..7276516739 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.h +++ b/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.h @@ -37,6 +37,7 @@ namespace EMotionFX class MotionInstancePool; class EventDataFactory; class DebugDraw; + class PoseDataFactory; // versions #define EMFX_HIGHVERSION 4 @@ -188,6 +189,8 @@ namespace EMotionFX */ MCORE_INLINE DebugDraw* GetDebugDraw() const { return m_debugDraw; } + MCORE_INLINE PoseDataFactory* GetPoseDataFactory() const { return m_poseDataFactory; } + /** * Get the render actor settings * @result A pointer to global render actor settings. @@ -357,6 +360,7 @@ namespace EMotionFX EventManager* m_eventManager; /**< The motion event manager. */ SoftSkinManager* m_softSkinManager; /**< The softskin manager. */ AnimGraphManager* m_animGraphManager; /**< The animgraph manager. */ + PoseDataFactory* m_poseDataFactory; Recorder* m_recorder; /**< The recorder. */ MotionInstancePool* m_motionInstancePool; /**< The motion instance pool. */ DebugDraw* m_debugDraw; /**< The debug drawing system. */ @@ -433,6 +437,8 @@ namespace EMotionFX */ void SetMotionInstancePool(MotionInstancePool* pool); + void SetPoseDataFactory(PoseDataFactory* poseDataFactory) { m_poseDataFactory = poseDataFactory; } + /** * Set the number of threads to use. * @param numThreads The number of threads to use internally. This must be a value of 1 or above. @@ -520,5 +526,6 @@ namespace EMotionFX MCORE_INLINE Recorder& GetRecorder() { return *GetEMotionFX().GetRecorder(); } /**< Get the recorder. */ MCORE_INLINE MotionInstancePool& GetMotionInstancePool() { return *GetEMotionFX().GetMotionInstancePool(); } /**< Get the motion instance pool. */ MCORE_INLINE DebugDraw& GetDebugDraw() { return *GetEMotionFX().GetDebugDraw(); } /**< Get the debug drawing. */ + MCORE_INLINE PoseDataFactory& GetPoseDataFactory() { return *GetEMotionFX().GetPoseDataFactory(); } MCORE_INLINE AZ::Render::RenderActorSettings& GetRenderActorSettings() { return *GetEMotionFX().GetRenderActorSettings(); }/**< Get the render actor settings. */ } // namespace EMotionFX diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Pose.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Pose.cpp index e2bff677ad..232bdacfd1 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Pose.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Pose.cpp @@ -1428,4 +1428,38 @@ namespace EMotionFX GetEMotionFX().GetThreadData(m_actorInstance->GetThreadIndex())->GetPosePool().FreePose(tempPose); } -} // namespace EMotionFX + + void Pose::DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, const AZ::Color& color, bool drawPoseDatas) const + { + debugDisplay.SetColor(color); + debugDisplay.DepthTestOff(); + + const Skeleton* skeleton = m_actorInstance->GetActor()->GetSkeleton(); + const size_t numEnabledJoints = m_actorInstance->GetNumEnabledNodes(); + for (size_t i = 0; i < numEnabledJoints; ++i) + { + const size_t jointIndex = m_actorInstance->GetEnabledNode(i); + const size_t parentIndex = skeleton->GetNode(jointIndex)->GetParentIndex(); + if (parentIndex != InvalidIndex) + { + const AZ::Vector3 startPos = GetWorldSpaceTransform(jointIndex).m_position; + const AZ::Vector3 endPos = GetWorldSpaceTransform(parentIndex).m_position; + + debugDisplay.DrawSolidCylinder(/*center=*/(startPos + endPos) * 0.5f, + /*direction=*/(endPos - startPos).GetNormalizedSafe(), + /*radius=*/0.005f, + /*height=*/(endPos - startPos).GetLength(), + /*drawShaded=*/false); + } + } + + if (drawPoseDatas) + { + for (const auto& poseDataItem : m_poseDatas) + { + PoseData* poseData = poseDataItem.second.get(); + poseData->DebugDraw(debugDisplay, color); + } + } + } +} // namespace EMotionFX diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Pose.h b/Gems/EMotionFX/Code/EMotionFX/Source/Pose.h index b7844276be..451e855150 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Pose.h +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Pose.h @@ -10,10 +10,10 @@ #include #include +#include #include #include - namespace EMotionFX { // forward declarations @@ -25,10 +25,6 @@ namespace EMotionFX class Skeleton; class MotionLinkData; - /** - * - * - */ class EMFX_API Pose { MCORE_MEMORYOBJECTCATEGORY(Pose, EMFX_DEFAULT_ALIGNMENT, EMFX_MEMCATEGORY_POSE); @@ -192,6 +188,14 @@ namespace EMotionFX template T* GetAndPreparePoseData(ActorInstance* linkToActorInstance) { return azdynamic_cast(GetAndPreparePoseData(azrtti_typeid(), linkToActorInstance)); } + /** + * Draw debug visualization for the given pose. + * @param[in] debugDisplay Debug display request bus to spawn the render commands. + * @param[in] color The color the skeletal pose should be in. + * @param[in] drawPoseDatas Draw the pose data debug visualizations (e.g. joint velocities) along with the actual skeletal pose. [Default = false] + */ + void DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, const AZ::Color& color, bool drawPoseDatas = false) const; + private: mutable AZStd::vector m_localSpaceTransforms; mutable AZStd::vector m_modelSpaceTransforms; diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/PoseData.h b/Gems/EMotionFX/Code/EMotionFX/Source/PoseData.h index 31c22a3839..69e8800c0a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/PoseData.h +++ b/Gems/EMotionFX/Code/EMotionFX/Source/PoseData.h @@ -12,9 +12,9 @@ #include #include #include +#include #include - namespace EMotionFX { class Actor; @@ -40,6 +40,8 @@ namespace EMotionFX virtual void Blend(const Pose* destPose, float weight) = 0; + virtual void DebugDraw([[maybe_unused]] AzFramework::DebugDisplayRequests& debugDisplay, [[maybe_unused]] const AZ::Color& color) const {} + bool IsUsed() const { return m_isUsed; } void SetIsUsed(bool isUsed) { m_isUsed = isUsed; } diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/PoseDataFactory.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/PoseDataFactory.cpp index c1c2627c8d..857cc7da7e 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/PoseDataFactory.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/PoseDataFactory.cpp @@ -8,13 +8,20 @@ #include #include +#include #include #include #include - namespace EMotionFX { + AZ_CLASS_ALLOCATOR_IMPL(PoseDataFactory, PoseAllocator, 0) + + PoseDataFactory::PoseDataFactory() + { + AddPoseDataType(azrtti_typeid()); + } + PoseData* PoseDataFactory::Create(Pose* pose, const AZ::TypeId& type) { AZ::SerializeContext* context = nullptr; @@ -34,13 +41,13 @@ namespace EMotionFX return result; } - const AZStd::unordered_set& PoseDataFactory::GetTypeIds() + void PoseDataFactory::AddPoseDataType(const AZ::TypeId& poseDataType) { - static AZStd::unordered_set typeIds = - { - azrtti_typeid() - }; + m_poseDataTypeIds.emplace(poseDataType); + } - return typeIds; + const AZStd::unordered_set& PoseDataFactory::GetTypeIds() const + { + return m_poseDataTypeIds; } } // namespace EMotionFX diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/PoseDataFactory.h b/Gems/EMotionFX/Code/EMotionFX/Source/PoseDataFactory.h index 31bc3e0d3f..624f0aeebf 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/PoseDataFactory.h +++ b/Gems/EMotionFX/Code/EMotionFX/Source/PoseDataFactory.h @@ -25,7 +25,18 @@ namespace EMotionFX class EMFX_API PoseDataFactory { public: + AZ_RTTI(PoseDataFactory, "{F10014A0-2B6A-44E5-BA53-0E11ED566701}") + AZ_CLASS_ALLOCATOR_DECL + + PoseDataFactory(); + virtual ~PoseDataFactory() = default; + static PoseData* Create(Pose* pose, const AZ::TypeId& type); - static const AZStd::unordered_set& GetTypeIds(); + + void AddPoseDataType(const AZ::TypeId& poseDataType); + const AZStd::unordered_set& GetTypeIds() const; + + private: + AZStd::unordered_set m_poseDataTypeIds; }; } // namespace EMotionFX From 4695d36ea5fc5b60a4bf4edb7649ca7cbce3fb1d Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 5 Jan 2022 08:54:34 +0000 Subject: [PATCH 261/399] Fix: Blend node applies both poses at value 1 (#6292) Signed-off-by: T.J. McGrath-Daly Co-authored-by: Tobias Alexander Franke --- Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeBlendNNode.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeBlendNNode.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeBlendNNode.cpp index 7720822655..f4f96e6b93 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeBlendNNode.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeBlendNNode.cpp @@ -224,6 +224,11 @@ namespace EMotionFX poseIndexB = poseIndexA; *outWeight = 0.0f; } + else if ((*outWeight > 1.0f - MCore::Math::epsilon)) + { + poseIndexA = poseIndexB; + *outWeight = 0.0f; + } // Search complete: the input weight is between m_paramWeights[i] and m_paramWeights[i - 1] // Calculate the blend weight and get the nodes and then return From 21d73033b7bd22a7c73bafa97bc082f46389df43 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Wed, 5 Jan 2022 16:53:49 +0100 Subject: [PATCH 262/399] Atom: Frame counter string sometimes extends across the whole width of the viewport (#6689) When going into game mode or after initializing some system that takes a few seconds, the FPS counter showed really large numbers, extending across the whole with of the viewport. In this case, values show "inf" now. Signed-off-by: Benjamin Jillich --- .../AtomViewportDisplayInfoSystemComponent.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp index 91844c9b2f..0b11437620 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp +++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp @@ -285,13 +285,19 @@ namespace AZ::Render const double frameIntervalSeconds = m_fpsInterval.count(); + auto ClampedFloatDisplay = [](double value, const char* format) -> AZStd::string + { + constexpr float upperLimit = 10000.0f; + return value > upperLimit ? "inf" : AZStd::string::format(format, value); + }; + DrawLine( AZStd::string::format( - "FPS %.1f [%.0f..%.0f], %.1fms/frame, avg over %.1fs", - averageFPS, - minFPS, - maxFPS, - averageFrameMs, + "FPS %s [%s..%s], %sms/frame, avg over %.1fs", + ClampedFloatDisplay(averageFPS, "%.1f").c_str(), + ClampedFloatDisplay(minFPS, "%.0f").c_str(), + ClampedFloatDisplay(maxFPS, "%.0f").c_str(), + ClampedFloatDisplay(averageFrameMs, "%.1f").c_str(), frameIntervalSeconds), AZ::Colors::Yellow); } From c548fd7682b2223647410d4e6e18931f4f11877d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 08:15:08 -0800 Subject: [PATCH 263/399] Death test relies on an exception from ocurring, that exception is an access violation, which could not happen (i.e. the memory could be valid for the process) (#6683) The test didnt have to be a death test. Also handled the situation better in the code to be able to continue in that scenario (useful for release configurations)" Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Serialization/Json/RegistrationContext.h | 5 ++--- .../Json/JsonRegistrationContextTests.cpp | 16 ++++++---------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/RegistrationContext.h b/Code/Framework/AzCore/AzCore/Serialization/Json/RegistrationContext.h index dd10e2bff6..202efd3749 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/RegistrationContext.h +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/RegistrationContext.h @@ -45,9 +45,8 @@ namespace AZ } else { - SerializerMap::const_iterator serializerIter = m_jsonSerializers.find(typeId); - AZ_Assert(serializerIter != m_jsonSerializers.end(), "Attempting to unregister a serializer that has not been registered yet with typeid %s", typeId.ToString().c_str()); - m_jsonSerializers.erase(serializerIter); + [[maybe_unused]] size_t erased = m_jsonSerializers.erase(typeId); + AZ_Assert(erased == 1, "Attempting to unregister a serializer that has not been registered yet with typeid %s", typeId.ToString().c_str()); return SerializerBuilder(this, m_jsonSerializers.end()); } } diff --git a/Code/Framework/AzCore/Tests/Serialization/Json/JsonRegistrationContextTests.cpp b/Code/Framework/AzCore/Tests/Serialization/Json/JsonRegistrationContextTests.cpp index 9d4af1def5..9b44f10e89 100644 --- a/Code/Framework/AzCore/Tests/Serialization/Json/JsonRegistrationContextTests.cpp +++ b/Code/Framework/AzCore/Tests/Serialization/Json/JsonRegistrationContextTests.cpp @@ -327,17 +327,13 @@ namespace JsonSerializationTests SerializerWithOneType::Unreflect(m_jsonRegistrationContext.get()); } -#if GTEST_HAS_DEATH_TEST - using JsonSerializationDeathTests = JsonRegistrationContextTests; - TEST_F(JsonSerializationDeathTests, DoubleUnregisterSerializer_Asserts) + TEST_F(JsonRegistrationContextTests, DoubleUnregisterSerializer_Asserts) { - ASSERT_DEATH({ - SerializerWithOneType::Reflect(m_jsonRegistrationContext.get()); - SerializerWithOneType::Unreflect(m_jsonRegistrationContext.get()); - SerializerWithOneType::Unreflect(m_jsonRegistrationContext.get()); - }, ".*" - ); + SerializerWithOneType::Reflect(m_jsonRegistrationContext.get()); + SerializerWithOneType::Unreflect(m_jsonRegistrationContext.get()); + AZ_TEST_START_ASSERTTEST; + SerializerWithOneType::Unreflect(m_jsonRegistrationContext.get()); + AZ_TEST_STOP_ASSERTTEST(1); } -#endif // GTEST_HAS_DEATH_TEST } //namespace JsonSerializationTests From e3bf4311eb1a0c02e5cccc4b01666c1796f069e1 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 5 Jan 2022 08:22:47 -0800 Subject: [PATCH 264/399] bugfix: update attenuation when light intensity changed for mode Automatic (#6499) REF: https://github.com/o3de/o3de/issues/6128 Signed-off-by: Michael Pollind --- .../Code/Source/CoreLights/AreaLightComponentController.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.cpp index 7668477690..d67548c3e9 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.cpp @@ -261,6 +261,11 @@ namespace AZ::Render m_lightShapeDelegate->SetPhotometricUnit(m_configuration.m_intensityMode); m_lightShapeDelegate->SetIntensity(m_configuration.m_intensity); } + + if (m_configuration.m_attenuationRadiusMode == LightAttenuationRadiusMode::Automatic) + { + AttenuationRadiusChanged(); + } } void AreaLightComponentController::ChromaChanged() From 4ce6909aafc4d25c535233666385542e75c11076 Mon Sep 17 00:00:00 2001 From: SWMasterson Date: Wed, 5 Jan 2022 09:03:28 -0800 Subject: [PATCH 265/399] Move, convert, and rename Lucy level to Hermanubis in AutomatedTesting (#6627) Signed-off-by: Sean Masterson --- .../Graphics/hermanubis/hermanubis.prefab | 705 +++++++++++++ .../Levels/Graphics/hermanubis/tags.txt | 12 + .../hermanubis_high/hermanubis_high.prefab | 943 ++++++++++++++++++ .../Levels/Graphics/hermanubis_high/tags.txt | 12 + .../Hermanubis_Curvature.tif} | 0 .../Objects/Hermanubis/Hermanubis_High.fbx | 3 + .../Hermanubis_Normal.png} | 0 .../Hermanubis_Stone_BaseColor.png} | 0 .../Hermanubis_ao.tif} | 0 .../Hermanubis_brass.material} | 26 +- .../Hermanubis_brass_cavity.tif} | 0 .../Hermanubis_bronze_BaseColor.png} | 0 .../Hermanubis_bronze_Metallic.png} | 0 .../Hermanubis_bronze_Roughness.png} | 0 .../Hermanubis_convexity.tif} | 0 .../Objects/Hermanubis/Hermanubis_low.fbx | 3 + .../Hermanubis_stone.material} | 20 +- .../Hermanubis_thickness.tif} | 0 .../Assets/Objects/Lucy/Lucy_High.fbx | 3 - .../Assets/Objects/Lucy/Lucy_low.fbx | 3 - 20 files changed, 1698 insertions(+), 32 deletions(-) create mode 100644 AutomatedTesting/Levels/Graphics/hermanubis/hermanubis.prefab create mode 100644 AutomatedTesting/Levels/Graphics/hermanubis/tags.txt create mode 100644 AutomatedTesting/Levels/Graphics/hermanubis_high/hermanubis_high.prefab create mode 100644 AutomatedTesting/Levels/Graphics/hermanubis_high/tags.txt rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_Curvature.tif => Hermanubis/Hermanubis_Curvature.tif} (100%) create mode 100644 Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_High.fbx rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_Normal.png => Hermanubis/Hermanubis_Normal.png} (100%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_Stone_BaseColor.png => Hermanubis/Hermanubis_Stone_BaseColor.png} (100%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_ao.tif => Hermanubis/Hermanubis_ao.tif} (100%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/lucy_brass.material => Hermanubis/Hermanubis_brass.material} (59%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_brass_cavity.tif => Hermanubis/Hermanubis_brass_cavity.tif} (100%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_bronze_BaseColor.png => Hermanubis/Hermanubis_bronze_BaseColor.png} (100%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_bronze_Metallic.png => Hermanubis/Hermanubis_bronze_Metallic.png} (100%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_bronze_Roughness.png => Hermanubis/Hermanubis_bronze_Roughness.png} (100%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_convexity.tif => Hermanubis/Hermanubis_convexity.tif} (100%) create mode 100644 Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_low.fbx rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/lucy_stone.material => Hermanubis/Hermanubis_stone.material} (77%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_thickness.tif => Hermanubis/Hermanubis_thickness.tif} (100%) delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_High.fbx delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_low.fbx diff --git a/AutomatedTesting/Levels/Graphics/hermanubis/hermanubis.prefab b/AutomatedTesting/Levels/Graphics/hermanubis/hermanubis.prefab new file mode 100644 index 0000000000..2234b02cfe --- /dev/null +++ b/AutomatedTesting/Levels/Graphics/hermanubis/hermanubis.prefab @@ -0,0 +1,705 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "Hermanubis", + "Components": { + "Component_[10182366347512475253]": { + "$type": "EditorPrefabComponent", + "Id": 10182366347512475253 + }, + "Component_[12917798267488243668]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12917798267488243668 + }, + "Component_[3261249813163778338]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3261249813163778338 + }, + "Component_[3837204912784440039]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 3837204912784440039 + }, + "Component_[4272963378099646759]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 4272963378099646759, + "Parent Entity": "" + }, + "Component_[4848458548047175816]": { + "$type": "EditorVisibilityComponent", + "Id": 4848458548047175816 + }, + "Component_[5787060997243919943]": { + "$type": "EditorInspectorComponent", + "Id": 5787060997243919943 + }, + "Component_[7804170251266531779]": { + "$type": "EditorLockComponent", + "Id": 7804170251266531779 + }, + "Component_[7874177159288365422]": { + "$type": "EditorEntitySortComponent", + "Id": 7874177159288365422 + }, + "Component_[8018146290632383969]": { + "$type": "EditorEntityIconComponent", + "Id": 8018146290632383969 + }, + "Component_[8452360690590857075]": { + "$type": "SelectionComponent", + "Id": 8452360690590857075 + } + } + }, + "Entities": { + "Entity_[250006174949]": { + "Id": "Entity_[250006174949]", + "Name": "WorldOrigin", + "Components": { + "Component_[13379444112629774116]": { + "$type": "EditorEntityIconComponent", + "Id": 13379444112629774116 + }, + "Component_[13797113876161133062]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 13797113876161133062, + "Parent Entity": "ContainerEntity" + }, + "Component_[16382506042739704306]": { + "$type": "EditorInspectorComponent", + "Id": 16382506042739704306, + "ComponentOrderEntryArray": [ + { + "ComponentId": 13797113876161133062 + }, + { + "ComponentId": 8816319458242680670, + "SortIndex": 1 + } + ] + }, + "Component_[2147729086581105478]": { + "$type": "EditorOnlyEntityComponent", + "Id": 2147729086581105478 + }, + "Component_[2433100672102773575]": { + "$type": "SelectionComponent", + "Id": 2433100672102773575 + }, + "Component_[4832829387489613630]": { + "$type": "EditorVisibilityComponent", + "Id": 4832829387489613630 + }, + "Component_[5585931842723227683]": { + "$type": "EditorEntitySortComponent", + "Id": 5585931842723227683, + "Child Entity Order": [ + "Entity_[254301142245]" + ] + }, + "Component_[7088004383223117498]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 7088004383223117498 + }, + "Component_[7856264459806503732]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7856264459806503732 + }, + "Component_[8816319458242680670]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 8816319458242680670 + }, + "Component_[930042309700959235]": { + "$type": "EditorLockComponent", + "Id": 930042309700959235 + } + } + }, + "Entity_[254301142245]": { + "Id": "Entity_[254301142245]", + "Name": "GlobalSkylight", + "Components": { + "Component_[10076500561520682485]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10076500561520682485, + "Parent Entity": "Entity_[250006174949]" + }, + "Component_[12626877995248630950]": { + "$type": "EditorInspectorComponent", + "Id": 12626877995248630950, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10076500561520682485 + }, + { + "ComponentId": 8158442301445120126, + "SortIndex": 1 + }, + { + "ComponentId": 7260006984216245935, + "SortIndex": 2 + } + ] + }, + "Component_[13040837632921717329]": { + "$type": "SelectionComponent", + "Id": 13040837632921717329 + }, + "Component_[1390505494369101864]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1390505494369101864 + }, + "Component_[6733278858932131836]": { + "$type": "EditorVisibilityComponent", + "Id": 6733278858932131836 + }, + "Component_[7260006984216245935]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 7260006984216245935, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}", + "subId": 3000 + }, + "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}", + "subId": 2000 + }, + "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[7944006745008331817]": { + "$type": "EditorEntitySortComponent", + "Id": 7944006745008331817 + }, + "Component_[8158442301445120126]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 8158442301445120126, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}", + "subId": 1000 + }, + "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[8255370213772594097]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8255370213772594097 + }, + "Component_[8551180373364097938]": { + "$type": "EditorLockComponent", + "Id": 8551180373364097938 + }, + "Component_[8852330656608249928]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8852330656608249928 + }, + "Component_[8913694496991926693]": { + "$type": "EditorEntityIconComponent", + "Id": 8913694496991926693 + } + } + }, + "Entity_[258596109541]": { + "Id": "Entity_[258596109541]", + "Name": "Hermanubis_stone", + "Components": { + "Component_[1026780512255775175]": { + "$type": "EditorEntityIconComponent", + "Id": 1026780512255775175 + }, + "Component_[10882452951986489612]": { + "$type": "SelectionComponent", + "Id": 10882452951986489612 + }, + "Component_[12454042755417175050]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 12454042755417175050, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{1F650917-AA74-5107-9C49-648C957B33DA}", + "subId": 275904906 + }, + "assetHint": "materialeditor/viewportmodels/hermanubis.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[13691807045809495479]": { + "$type": "EditorMaterialComponent", + "Id": 13691807045809495479, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{FF6412B6-F86E-54C8-835C-04F08190D81B}" + }, + "assetHint": "objects/hermanubis/hermanubis_stone.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[14490373655742304057]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14490373655742304057 + }, + "Component_[15248132570755287431]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15248132570755287431 + }, + "Component_[16950375358457415777]": { + "$type": "EditorVisibilityComponent", + "Id": 16950375358457415777 + }, + "Component_[17852268252813268496]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17852268252813268496, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 1.1189539432525635, + 0.0, + 0.0 + ] + } + }, + "Component_[3867610358542973898]": { + "$type": "EditorEntitySortComponent", + "Id": 3867610358542973898 + }, + "Component_[7717372065847089412]": { + "$type": "EditorOnlyEntityComponent", + "Id": 7717372065847089412 + }, + "Component_[7783943040473764331]": { + "$type": "EditorInspectorComponent", + "Id": 7783943040473764331, + "ComponentOrderEntryArray": [ + { + "ComponentId": 17852268252813268496 + }, + { + "ComponentId": 12454042755417175050, + "SortIndex": 1 + }, + { + "ComponentId": 13691807045809495479, + "SortIndex": 2 + } + ] + }, + "Component_[833407121913837256]": { + "$type": "EditorLockComponent", + "Id": 833407121913837256 + } + } + }, + "Entity_[262891076837]": { + "Id": "Entity_[262891076837]", + "Name": "Hermanubis_brass", + "Components": { + "Component_[1026780512255775175]": { + "$type": "EditorEntityIconComponent", + "Id": 1026780512255775175 + }, + "Component_[10882452951986489612]": { + "$type": "SelectionComponent", + "Id": 10882452951986489612 + }, + "Component_[12454042755417175050]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 12454042755417175050, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{1F650917-AA74-5107-9C49-648C957B33DA}", + "subId": 275904906 + }, + "assetHint": "materialeditor/viewportmodels/hermanubis.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[13691807045809495479]": { + "$type": "EditorMaterialComponent", + "Id": 13691807045809495479, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{B3AC2305-1DE6-54AA-AAD5-5E77C75E5BB5}" + }, + "assetHint": "objects/hermanubis/hermanubis_brass.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[14490373655742304057]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14490373655742304057 + }, + "Component_[15248132570755287431]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15248132570755287431 + }, + "Component_[16950375358457415777]": { + "$type": "EditorVisibilityComponent", + "Id": 16950375358457415777 + }, + "Component_[17852268252813268496]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17852268252813268496, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -1.4824472665786743, + -0.034557100385427475, + 0.0 + ] + } + }, + "Component_[3867610358542973898]": { + "$type": "EditorEntitySortComponent", + "Id": 3867610358542973898 + }, + "Component_[7717372065847089412]": { + "$type": "EditorOnlyEntityComponent", + "Id": 7717372065847089412 + }, + "Component_[7783943040473764331]": { + "$type": "EditorInspectorComponent", + "Id": 7783943040473764331, + "ComponentOrderEntryArray": [ + { + "ComponentId": 17852268252813268496 + }, + { + "ComponentId": 12454042755417175050, + "SortIndex": 1 + }, + { + "ComponentId": 13691807045809495479, + "SortIndex": 2 + } + ] + }, + "Component_[833407121913837256]": { + "$type": "EditorLockComponent", + "Id": 833407121913837256 + } + } + }, + "Entity_[267186044133]": { + "Id": "Entity_[267186044133]", + "Name": "SphereLight", + "Components": { + "Component_[10922228943444131599]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10922228943444131599 + }, + "Component_[11625534306113165068]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11625534306113165068, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 0.2636711895465851, + 2.2845842838287354, + 0.22468790411949158 + ] + } + }, + "Component_[12372418243816154216]": { + "$type": "EditorSphereShapeComponent", + "Id": 12372418243816154216, + "ShapeColor": [ + 0.3289234936237335, + 0.7307698130607605, + 0.14859239757061005, + 1.0 + ] + }, + "Component_[12579170654872581897]": { + "$type": "EditorLockComponent", + "Id": 12579170654872581897 + }, + "Component_[12844637542561882557]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12844637542561882557 + }, + "Component_[13087890528096920855]": { + "$type": "EditorInspectorComponent", + "Id": 13087890528096920855, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11625534306113165068 + }, + { + "ComponentId": 13427905514841050195, + "SortIndex": 1 + }, + { + "ComponentId": 12372418243816154216, + "SortIndex": 2 + } + ] + }, + "Component_[13427905514841050195]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 13427905514841050195, + "Controller": { + "Configuration": { + "LightType": 1, + "Color": [ + 0.3289234936237335, + 0.7307698130607605, + 0.14859239757061005 + ], + "IntensityMode": 1, + "Intensity": 676.7677001953125, + "AttenuationRadius": 226.51287841796875 + } + } + }, + "Component_[15364092815744365073]": { + "$type": "SelectionComponent", + "Id": 15364092815744365073 + }, + "Component_[2481373975540551564]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2481373975540551564 + }, + "Component_[4101167782224846352]": { + "$type": "EditorEntityIconComponent", + "Id": 4101167782224846352 + }, + "Component_[8664715119660216219]": { + "$type": "EditorEntitySortComponent", + "Id": 8664715119660216219 + }, + "Component_[8952093761729701957]": { + "$type": "EditorVisibilityComponent", + "Id": 8952093761729701957, + "VisibilityFlag": false + } + } + }, + "Entity_[275775978725]": { + "Id": "Entity_[275775978725]", + "Name": "TubeLight", + "Components": { + "Component_[10922228943444131599]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10922228943444131599, + "DisabledComponents": [ + { + "$type": "EditorSphereShapeComponent", + "Id": 12372418243816154216, + "ShapeColor": [ + 0.3289234936237335, + 0.7307698130607605, + 0.14859239757061005, + 1.0 + ] + } + ] + }, + "Component_[11625534306113165068]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11625534306113165068, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -4.275930881500244, + 0.5104026794433594, + 2.3807857036590576 + ], + "Rotate": [ + 270.0043029785156, + 0.16617189347743988, + 268.51611328125 + ] + } + }, + "Component_[12579170654872581897]": { + "$type": "EditorLockComponent", + "Id": 12579170654872581897 + }, + "Component_[12844637542561882557]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12844637542561882557 + }, + "Component_[13087890528096920855]": { + "$type": "EditorInspectorComponent", + "Id": 13087890528096920855, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11625534306113165068 + }, + { + "ComponentId": 13427905514841050195, + "SortIndex": 1 + }, + { + "ComponentId": 12372418243816154216, + "SortIndex": 2 + }, + { + "ComponentId": 2193911499802409037, + "SortIndex": 3 + } + ] + }, + "Component_[13427905514841050195]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 13427905514841050195, + "Controller": { + "Configuration": { + "LightType": 3, + "Color": [ + 0.8521705865859985, + 0.7865872979164124, + 0.6079347133636475 + ], + "IntensityMode": 1, + "Intensity": 10000.0, + "AttenuationRadius": 21608.193359375 + } + } + }, + "Component_[15364092815744365073]": { + "$type": "SelectionComponent", + "Id": 15364092815744365073 + }, + "Component_[2193911499802409037]": { + "$type": "EditorCapsuleShapeComponent", + "Id": 2193911499802409037, + "ShapeColor": [ + 0.8521705865859985, + 0.7865872979164124, + 0.6079347133636475, + 1.0 + ], + "CapsuleShape": { + "Configuration": { + "Height": 5.0, + "Radius": 0.10000000149011612 + } + } + }, + "Component_[2481373975540551564]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2481373975540551564 + }, + "Component_[4101167782224846352]": { + "$type": "EditorEntityIconComponent", + "Id": 4101167782224846352 + }, + "Component_[8664715119660216219]": { + "$type": "EditorEntitySortComponent", + "Id": 8664715119660216219 + }, + "Component_[8952093761729701957]": { + "$type": "EditorVisibilityComponent", + "Id": 8952093761729701957, + "VisibilityFlag": false + } + } + }, + "Entity_[482743502241]": { + "Id": "Entity_[482743502241]", + "Name": "Camera1", + "Components": { + "Component_[10672707967016183310]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10672707967016183310 + }, + "Component_[13520081755303040361]": { + "$type": "EditorLockComponent", + "Id": 13520081755303040361 + }, + "Component_[13650522584195762912]": { + "$type": "SelectionComponent", + "Id": 13650522584195762912 + }, + "Component_[14204465933176839167]": { + "$type": "EditorOnlyEntityComponent", + "Id": 14204465933176839167 + }, + "Component_[14509697511269710983]": { + "$type": "EditorEntitySortComponent", + "Id": 14509697511269710983 + }, + "Component_[271930369355383880]": { + "$type": "EditorEntityIconComponent", + "Id": 271930369355383880 + }, + "Component_[5015186380056948439]": { + "$type": "EditorInspectorComponent", + "Id": 5015186380056948439 + }, + "Component_[6297637832938894772]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6297637832938894772, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -0.0018702250672504306, + 2.9982283115386963, + 3.0017592906951904 + ], + "Rotate": [ + 20.080352783203125, + -0.020488755777478218, + 179.92381286621094 + ] + } + }, + "Component_[6611378759823339947]": { + "$type": "EditorPendingCompositionComponent", + "Id": 6611378759823339947 + }, + "Component_[8475839846509409509]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 8475839846509409509, + "Controller": { + "Configuration": { + "Field of View": 90.00020599365234, + "EditorEntityId": 478448534945 + } + } + }, + "Component_[9659542522325095386]": { + "$type": "EditorVisibilityComponent", + "Id": 9659542522325095386 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Graphics/hermanubis/tags.txt b/AutomatedTesting/Levels/Graphics/hermanubis/tags.txt new file mode 100644 index 0000000000..0d6c1880e7 --- /dev/null +++ b/AutomatedTesting/Levels/Graphics/hermanubis/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 diff --git a/AutomatedTesting/Levels/Graphics/hermanubis_high/hermanubis_high.prefab b/AutomatedTesting/Levels/Graphics/hermanubis_high/hermanubis_high.prefab new file mode 100644 index 0000000000..3378a0c144 --- /dev/null +++ b/AutomatedTesting/Levels/Graphics/hermanubis_high/hermanubis_high.prefab @@ -0,0 +1,943 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "hermanubis_high", + "Components": { + "Component_[10182366347512475253]": { + "$type": "EditorPrefabComponent", + "Id": 10182366347512475253 + }, + "Component_[12917798267488243668]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12917798267488243668 + }, + "Component_[3261249813163778338]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3261249813163778338 + }, + "Component_[3837204912784440039]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 3837204912784440039 + }, + "Component_[4272963378099646759]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 4272963378099646759, + "Parent Entity": "" + }, + "Component_[4848458548047175816]": { + "$type": "EditorVisibilityComponent", + "Id": 4848458548047175816 + }, + "Component_[5787060997243919943]": { + "$type": "EditorInspectorComponent", + "Id": 5787060997243919943 + }, + "Component_[7804170251266531779]": { + "$type": "EditorLockComponent", + "Id": 7804170251266531779 + }, + "Component_[7874177159288365422]": { + "$type": "EditorEntitySortComponent", + "Id": 7874177159288365422, + "Child Entity Order": [ + "Entity_[243647107259]", + "Entity_[247179151093]", + "Entity_[262891076837]", + "Entity_[242884183797]", + "Entity_[258596109541]", + "Entity_[267186044133]", + "Entity_[275775978725]", + "Entity_[250006174949]" + ] + }, + "Component_[8018146290632383969]": { + "$type": "EditorEntityIconComponent", + "Id": 8018146290632383969 + }, + "Component_[8452360690590857075]": { + "$type": "SelectionComponent", + "Id": 8452360690590857075 + } + } + }, + "Entities": { + "Entity_[242884183797]": { + "Id": "Entity_[242884183797]", + "Name": "Hermanubis_stone", + "Components": { + "Component_[1026780512255775175]": { + "$type": "EditorEntityIconComponent", + "Id": 1026780512255775175 + }, + "Component_[10882452951986489612]": { + "$type": "SelectionComponent", + "Id": 10882452951986489612 + }, + "Component_[12454042755417175050]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 12454042755417175050, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{35A45F31-F1C1-5076-8B51-FF599E2EEBAA}", + "subId": 274433667 + }, + "assetHint": "objects/hermanubis/hermanubis_high.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[13691807045809495479]": { + "$type": "EditorMaterialComponent", + "Id": 13691807045809495479, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[14490373655742304057]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14490373655742304057 + }, + "Component_[15248132570755287431]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15248132570755287431 + }, + "Component_[16950375358457415777]": { + "$type": "EditorVisibilityComponent", + "Id": 16950375358457415777 + }, + "Component_[17852268252813268496]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17852268252813268496, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 3.810185432434082, + 0.0, + 0.0 + ] + } + }, + "Component_[3867610358542973898]": { + "$type": "EditorEntitySortComponent", + "Id": 3867610358542973898 + }, + "Component_[7717372065847089412]": { + "$type": "EditorOnlyEntityComponent", + "Id": 7717372065847089412 + }, + "Component_[7783943040473764331]": { + "$type": "EditorInspectorComponent", + "Id": 7783943040473764331, + "ComponentOrderEntryArray": [ + { + "ComponentId": 17852268252813268496 + }, + { + "ComponentId": 12454042755417175050, + "SortIndex": 1 + }, + { + "ComponentId": 13691807045809495479, + "SortIndex": 2 + } + ] + }, + "Component_[833407121913837256]": { + "$type": "EditorLockComponent", + "Id": 833407121913837256 + } + } + }, + "Entity_[243647107259]": { + "Id": "Entity_[243647107259]", + "Name": "Camera1", + "Components": { + "Component_[11276153162797125616]": { + "$type": "GenericComponentWrapper", + "Id": 11276153162797125616, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[11484120648160206262]": { + "$type": "EditorLockComponent", + "Id": 11484120648160206262 + }, + "Component_[14251459960897306807]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 14251459960897306807, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -0.10533800721168518, + -4.001697063446045, + 3.061025619506836 + ], + "Rotate": [ + -19.998117446899414, + 0.01881762035191059, + -0.051706261932849884 + ], + "Scale": [ + 0.9999998807907104, + 1.0, + 1.0 + ] + } + }, + "Component_[149351061984148634]": { + "$type": "EditorOnlyEntityComponent", + "Id": 149351061984148634 + }, + "Component_[15121925351155689107]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 15121925351155689107, + "Controller": { + "Configuration": { + "EditorEntityId": 243647107259 + } + } + }, + "Component_[15327903729148812780]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15327903729148812780 + }, + "Component_[17667820301809320373]": { + "$type": "EditorEntityIconComponent", + "Id": 17667820301809320373 + }, + "Component_[17708351813187009272]": { + "$type": "EditorVisibilityComponent", + "Id": 17708351813187009272 + }, + "Component_[17941668830905411554]": { + "$type": "SelectionComponent", + "Id": 17941668830905411554 + }, + "Component_[48451466091772435]": { + "$type": "EditorEntitySortComponent", + "Id": 48451466091772435 + }, + "Component_[6163614082436403601]": { + "$type": "EditorInspectorComponent", + "Id": 6163614082436403601, + "ComponentOrderEntryArray": [ + { + "ComponentId": 14251459960897306807 + }, + { + "ComponentId": 15121925351155689107, + "SortIndex": 1 + }, + { + "ComponentId": 11935019334576395684, + "SortIndex": 2 + } + ] + }, + "Component_[8660334631968180943]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8660334631968180943 + } + } + }, + "Entity_[247179151093]": { + "Id": "Entity_[247179151093]", + "Name": "Hermanubis_brass", + "Components": { + "Component_[1026780512255775175]": { + "$type": "EditorEntityIconComponent", + "Id": 1026780512255775175 + }, + "Component_[10882452951986489612]": { + "$type": "SelectionComponent", + "Id": 10882452951986489612 + }, + "Component_[12454042755417175050]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 12454042755417175050, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{35A45F31-F1C1-5076-8B51-FF599E2EEBAA}", + "subId": 274433667 + }, + "assetHint": "objects/hermanubis/hermanubis_high.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[13691807045809495479]": { + "$type": "EditorMaterialComponent", + "Id": 13691807045809495479, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[14490373655742304057]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14490373655742304057 + }, + "Component_[15248132570755287431]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15248132570755287431 + }, + "Component_[16950375358457415777]": { + "$type": "EditorVisibilityComponent", + "Id": 16950375358457415777 + }, + "Component_[17852268252813268496]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17852268252813268496, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -4.019397258758545, + -0.034557100385427475, + 0.0 + ] + } + }, + "Component_[3867610358542973898]": { + "$type": "EditorEntitySortComponent", + "Id": 3867610358542973898 + }, + "Component_[7717372065847089412]": { + "$type": "EditorOnlyEntityComponent", + "Id": 7717372065847089412 + }, + "Component_[7783943040473764331]": { + "$type": "EditorInspectorComponent", + "Id": 7783943040473764331, + "ComponentOrderEntryArray": [ + { + "ComponentId": 17852268252813268496 + }, + { + "ComponentId": 12454042755417175050, + "SortIndex": 1 + }, + { + "ComponentId": 13691807045809495479, + "SortIndex": 2 + } + ] + }, + "Component_[833407121913837256]": { + "$type": "EditorLockComponent", + "Id": 833407121913837256 + } + } + }, + "Entity_[250006174949]": { + "Id": "Entity_[250006174949]", + "Name": "WorldOrigin", + "Components": { + "Component_[13379444112629774116]": { + "$type": "EditorEntityIconComponent", + "Id": 13379444112629774116 + }, + "Component_[13797113876161133062]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 13797113876161133062, + "Parent Entity": "ContainerEntity" + }, + "Component_[16382506042739704306]": { + "$type": "EditorInspectorComponent", + "Id": 16382506042739704306, + "ComponentOrderEntryArray": [ + { + "ComponentId": 13797113876161133062 + }, + { + "ComponentId": 8816319458242680670, + "SortIndex": 1 + } + ] + }, + "Component_[2147729086581105478]": { + "$type": "EditorOnlyEntityComponent", + "Id": 2147729086581105478 + }, + "Component_[2433100672102773575]": { + "$type": "SelectionComponent", + "Id": 2433100672102773575 + }, + "Component_[4832829387489613630]": { + "$type": "EditorVisibilityComponent", + "Id": 4832829387489613630 + }, + "Component_[5585931842723227683]": { + "$type": "EditorEntitySortComponent", + "Id": 5585931842723227683, + "Child Entity Order": [ + "Entity_[254301142245]" + ] + }, + "Component_[7088004383223117498]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 7088004383223117498 + }, + "Component_[7856264459806503732]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7856264459806503732 + }, + "Component_[8816319458242680670]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 8816319458242680670 + }, + "Component_[930042309700959235]": { + "$type": "EditorLockComponent", + "Id": 930042309700959235 + } + } + }, + "Entity_[254301142245]": { + "Id": "Entity_[254301142245]", + "Name": "GlobalSkylight", + "Components": { + "Component_[10076500561520682485]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10076500561520682485, + "Parent Entity": "Entity_[250006174949]" + }, + "Component_[12626877995248630950]": { + "$type": "EditorInspectorComponent", + "Id": 12626877995248630950, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10076500561520682485 + }, + { + "ComponentId": 8158442301445120126, + "SortIndex": 1 + }, + { + "ComponentId": 7260006984216245935, + "SortIndex": 2 + } + ] + }, + "Component_[13040837632921717329]": { + "$type": "SelectionComponent", + "Id": 13040837632921717329 + }, + "Component_[1390505494369101864]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1390505494369101864 + }, + "Component_[6733278858932131836]": { + "$type": "EditorVisibilityComponent", + "Id": 6733278858932131836 + }, + "Component_[7260006984216245935]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 7260006984216245935, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}", + "subId": 3000 + }, + "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}", + "subId": 2000 + }, + "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[7944006745008331817]": { + "$type": "EditorEntitySortComponent", + "Id": 7944006745008331817 + }, + "Component_[8158442301445120126]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 8158442301445120126, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}", + "subId": 1000 + }, + "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[8255370213772594097]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8255370213772594097 + }, + "Component_[8551180373364097938]": { + "$type": "EditorLockComponent", + "Id": 8551180373364097938 + }, + "Component_[8852330656608249928]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8852330656608249928 + }, + "Component_[8913694496991926693]": { + "$type": "EditorEntityIconComponent", + "Id": 8913694496991926693 + } + } + }, + "Entity_[258596109541]": { + "Id": "Entity_[258596109541]", + "Name": "Hermanubis_stone", + "Components": { + "Component_[1026780512255775175]": { + "$type": "EditorEntityIconComponent", + "Id": 1026780512255775175 + }, + "Component_[10882452951986489612]": { + "$type": "SelectionComponent", + "Id": 10882452951986489612 + }, + "Component_[12454042755417175050]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 12454042755417175050, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{35A45F31-F1C1-5076-8B51-FF599E2EEBAA}", + "subId": 274433667 + }, + "assetHint": "objects/hermanubis/hermanubis_high.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[13691807045809495479]": { + "$type": "EditorMaterialComponent", + "Id": 13691807045809495479, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[14490373655742304057]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14490373655742304057 + }, + "Component_[15248132570755287431]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15248132570755287431 + }, + "Component_[16950375358457415777]": { + "$type": "EditorVisibilityComponent", + "Id": 16950375358457415777 + }, + "Component_[17852268252813268496]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17852268252813268496, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 1.1189539432525635, + 0.0, + 0.0 + ] + } + }, + "Component_[3867610358542973898]": { + "$type": "EditorEntitySortComponent", + "Id": 3867610358542973898 + }, + "Component_[7717372065847089412]": { + "$type": "EditorOnlyEntityComponent", + "Id": 7717372065847089412 + }, + "Component_[7783943040473764331]": { + "$type": "EditorInspectorComponent", + "Id": 7783943040473764331, + "ComponentOrderEntryArray": [ + { + "ComponentId": 17852268252813268496 + }, + { + "ComponentId": 12454042755417175050, + "SortIndex": 1 + }, + { + "ComponentId": 13691807045809495479, + "SortIndex": 2 + } + ] + }, + "Component_[833407121913837256]": { + "$type": "EditorLockComponent", + "Id": 833407121913837256 + } + } + }, + "Entity_[262891076837]": { + "Id": "Entity_[262891076837]", + "Name": "Hermanubis_brass", + "Components": { + "Component_[1026780512255775175]": { + "$type": "EditorEntityIconComponent", + "Id": 1026780512255775175 + }, + "Component_[10882452951986489612]": { + "$type": "SelectionComponent", + "Id": 10882452951986489612 + }, + "Component_[12454042755417175050]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 12454042755417175050, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{35A45F31-F1C1-5076-8B51-FF599E2EEBAA}", + "subId": 274433667 + }, + "assetHint": "objects/hermanubis/hermanubis_high.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[13691807045809495479]": { + "$type": "EditorMaterialComponent", + "Id": 13691807045809495479, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[14490373655742304057]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14490373655742304057 + }, + "Component_[15248132570755287431]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15248132570755287431 + }, + "Component_[16950375358457415777]": { + "$type": "EditorVisibilityComponent", + "Id": 16950375358457415777 + }, + "Component_[17852268252813268496]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17852268252813268496, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -1.4824472665786743, + -0.034557100385427475, + 0.0 + ] + } + }, + "Component_[3867610358542973898]": { + "$type": "EditorEntitySortComponent", + "Id": 3867610358542973898 + }, + "Component_[7717372065847089412]": { + "$type": "EditorOnlyEntityComponent", + "Id": 7717372065847089412 + }, + "Component_[7783943040473764331]": { + "$type": "EditorInspectorComponent", + "Id": 7783943040473764331, + "ComponentOrderEntryArray": [ + { + "ComponentId": 17852268252813268496 + }, + { + "ComponentId": 12454042755417175050, + "SortIndex": 1 + }, + { + "ComponentId": 13691807045809495479, + "SortIndex": 2 + } + ] + }, + "Component_[833407121913837256]": { + "$type": "EditorLockComponent", + "Id": 833407121913837256 + } + } + }, + "Entity_[267186044133]": { + "Id": "Entity_[267186044133]", + "Name": "SphereLight", + "Components": { + "Component_[10922228943444131599]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10922228943444131599 + }, + "Component_[11625534306113165068]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11625534306113165068, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 0.2636711895465851, + 2.2845842838287354, + 0.22468790411949158 + ] + } + }, + "Component_[12372418243816154216]": { + "$type": "EditorSphereShapeComponent", + "Id": 12372418243816154216, + "ShapeColor": [ + 0.3289234936237335, + 0.7307698130607605, + 0.14859239757061005, + 1.0 + ] + }, + "Component_[12579170654872581897]": { + "$type": "EditorLockComponent", + "Id": 12579170654872581897 + }, + "Component_[12844637542561882557]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12844637542561882557 + }, + "Component_[13087890528096920855]": { + "$type": "EditorInspectorComponent", + "Id": 13087890528096920855, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11625534306113165068 + }, + { + "ComponentId": 13427905514841050195, + "SortIndex": 1 + }, + { + "ComponentId": 12372418243816154216, + "SortIndex": 2 + } + ] + }, + "Component_[13427905514841050195]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 13427905514841050195, + "Controller": { + "Configuration": { + "LightType": 1, + "Color": [ + 0.3289234936237335, + 0.7307698130607605, + 0.14859239757061005 + ], + "IntensityMode": 1, + "Intensity": 676.7677001953125, + "AttenuationRadius": 226.51287841796875 + } + } + }, + "Component_[15364092815744365073]": { + "$type": "SelectionComponent", + "Id": 15364092815744365073 + }, + "Component_[2481373975540551564]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2481373975540551564 + }, + "Component_[4101167782224846352]": { + "$type": "EditorEntityIconComponent", + "Id": 4101167782224846352 + }, + "Component_[8664715119660216219]": { + "$type": "EditorEntitySortComponent", + "Id": 8664715119660216219 + }, + "Component_[8952093761729701957]": { + "$type": "EditorVisibilityComponent", + "Id": 8952093761729701957, + "VisibilityFlag": false + } + } + }, + "Entity_[275775978725]": { + "Id": "Entity_[275775978725]", + "Name": "TubeLight", + "Components": { + "Component_[10922228943444131599]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10922228943444131599, + "DisabledComponents": [ + { + "$type": "EditorSphereShapeComponent", + "Id": 12372418243816154216, + "ShapeColor": [ + 0.3289234936237335, + 0.7307698130607605, + 0.14859239757061005, + 1.0 + ] + } + ] + }, + "Component_[11625534306113165068]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11625534306113165068, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -4.275930881500244, + 0.5104026794433594, + 2.3807857036590576 + ], + "Rotate": [ + 270.0043029785156, + 0.16617189347743988, + 268.51611328125 + ] + } + }, + "Component_[12579170654872581897]": { + "$type": "EditorLockComponent", + "Id": 12579170654872581897 + }, + "Component_[12844637542561882557]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12844637542561882557 + }, + "Component_[13087890528096920855]": { + "$type": "EditorInspectorComponent", + "Id": 13087890528096920855, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11625534306113165068 + }, + { + "ComponentId": 13427905514841050195, + "SortIndex": 1 + }, + { + "ComponentId": 12372418243816154216, + "SortIndex": 2 + }, + { + "ComponentId": 2193911499802409037, + "SortIndex": 3 + } + ] + }, + "Component_[13427905514841050195]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 13427905514841050195, + "Controller": { + "Configuration": { + "LightType": 3, + "Color": [ + 0.8521705865859985, + 0.7865872979164124, + 0.6079347133636475 + ], + "IntensityMode": 1, + "Intensity": 10000.0, + "AttenuationRadius": 21608.193359375 + } + } + }, + "Component_[15364092815744365073]": { + "$type": "SelectionComponent", + "Id": 15364092815744365073 + }, + "Component_[2193911499802409037]": { + "$type": "EditorCapsuleShapeComponent", + "Id": 2193911499802409037, + "ShapeColor": [ + 0.8521705865859985, + 0.7865872979164124, + 0.6079347133636475, + 1.0 + ], + "CapsuleShape": { + "Configuration": { + "Height": 5.0, + "Radius": 0.10000000149011612 + } + } + }, + "Component_[2481373975540551564]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2481373975540551564 + }, + "Component_[4101167782224846352]": { + "$type": "EditorEntityIconComponent", + "Id": 4101167782224846352 + }, + "Component_[8664715119660216219]": { + "$type": "EditorEntitySortComponent", + "Id": 8664715119660216219 + }, + "Component_[8952093761729701957]": { + "$type": "EditorVisibilityComponent", + "Id": 8952093761729701957, + "VisibilityFlag": false + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Graphics/hermanubis_high/tags.txt b/AutomatedTesting/Levels/Graphics/hermanubis_high/tags.txt new file mode 100644 index 0000000000..0d6c1880e7 --- /dev/null +++ b/AutomatedTesting/Levels/Graphics/hermanubis_high/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_Curvature.tif b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_Curvature.tif similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_Curvature.tif rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_Curvature.tif diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_High.fbx b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_High.fbx new file mode 100644 index 0000000000..0625c89874 --- /dev/null +++ b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_High.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d72cec207a7677ba027eac72f41285907237e04a45ebacf64341de86fc6f022d +size 159115308 diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_Normal.png b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_Normal.png similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_Normal.png rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_Normal.png diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_Stone_BaseColor.png b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_Stone_BaseColor.png similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_Stone_BaseColor.png rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_Stone_BaseColor.png diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_ao.tif b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_ao.tif similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_ao.tif rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_ao.tif diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/lucy_brass.material b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_brass.material similarity index 59% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/lucy_brass.material rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_brass.material index 6e490cb0b1..4ad325b086 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/lucy_brass.material +++ b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_brass.material @@ -1,39 +1,33 @@ { "description": "", - "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "Materials/Presets/PBR/metal_brass.material", - "propertyLayoutVersion": 3, + "materialType": "Materials/Types/StandardPBR.materialtype", + "materialTypeVersion": 4, "properties": { - "occlusion": { - "diffuseTextureMap": "Objects/Lucy/Lucy_ao.tif", - "diffuseTextureMapUv": "Unwrapped" - }, "baseColor": { - "color": [ - 0.6745098233222961, - 0.48627451062202456, - 0.19607843458652497, - 1.0 - ], "factor": 1.0, "textureBlendMode": "Lerp", - "textureMap": "Objects/Lucy/Lucy_bronze_BaseColor.png", + "textureMap": "Hermanubis_bronze_BaseColor.png", "textureMapUv": "Unwrapped" }, "general": { "applySpecularAA": true }, "metallic": { - "textureMap": "Objects/Lucy/Lucy_bronze_Metallic.png", + "textureMap": "Hermanubis_bronze_Metallic.png", "textureMapUv": "Unwrapped" }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_Normal.png", + "textureMap": "Hermanubis_Normal.png", "textureMapUv": "Unwrapped" }, + "occlusion": { + "diffuseTextureMap": "Hermanubis_ao.tif", + "diffuseTextureMapUv": "Unwrapped" + }, "roughness": { - "textureMap": "Objects/Lucy/Lucy_bronze_Roughness.png", + "textureMap": "Hermanubis_bronze_Roughness.png", "textureMapUv": "Unwrapped", "upperBound": 0.6767677068710327 } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_brass_cavity.tif b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_brass_cavity.tif similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_brass_cavity.tif rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_brass_cavity.tif diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_bronze_BaseColor.png b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_bronze_BaseColor.png similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_bronze_BaseColor.png rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_bronze_BaseColor.png diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_bronze_Metallic.png b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_bronze_Metallic.png similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_bronze_Metallic.png rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_bronze_Metallic.png diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_bronze_Roughness.png b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_bronze_Roughness.png similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_bronze_Roughness.png rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_bronze_Roughness.png diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_convexity.tif b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_convexity.tif similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_convexity.tif rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_convexity.tif diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_low.fbx b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_low.fbx new file mode 100644 index 0000000000..79960433dd --- /dev/null +++ b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_low.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c9d1030b9467b58d640fbedf1bc58ab9a5f7d68811b2452dd8d60114287b731 +size 12410812 diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/lucy_stone.material b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_stone.material similarity index 77% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/lucy_stone.material rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_stone.material index a0e54d9d0e..1ba59a50c5 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/lucy_stone.material +++ b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_stone.material @@ -1,13 +1,9 @@ { "description": "", - "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "Materials/Presets/PBR/metal_brass.material", - "propertyLayoutVersion": 3, + "materialType": "Materials/Types/StandardPBR.materialtype", + "materialTypeVersion": 4, "properties": { - "occlusion": { - "diffuseTextureMap": "Objects/Lucy/Lucy_ao.tif", - "diffuseTextureMapUv": "Unwrapped" - }, "baseColor": { "color": [ 1.0, @@ -17,7 +13,7 @@ ], "factor": 1.0, "textureBlendMode": "Lerp", - "textureMap": "Objects/Lucy/Lucy_Stone_BaseColor.png", + "textureMap": "Hermanubis_Stone_BaseColor.png", "textureMapUv": "Unwrapped" }, "clearCoat": { @@ -39,13 +35,17 @@ }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_Normal.png", + "textureMap": "Hermanubis_Normal.png", "textureMapUv": "Unwrapped" }, + "occlusion": { + "diffuseTextureMap": "Hermanubis_ao.tif", + "diffuseTextureMapUv": "Unwrapped" + }, "roughness": { "factor": 1.0, - "lowerBound": 0.15000000596046449, - "textureMap": "Objects/Lucy/Lucy_bronze_Roughness.png", + "lowerBound": 0.15000000596046448, + "textureMap": "Hermanubis_bronze_Roughness.png", "textureMapUv": "Unwrapped", "upperBound": 0.7300000190734863 } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_thickness.tif b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_thickness.tif similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_thickness.tif rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_thickness.tif diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_High.fbx b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_High.fbx deleted file mode 100644 index b87971bf6d..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_High.fbx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:00e19e317613be5420fd78bac1159e66d1c4deeb1f32cd4fc8c20b1ea3a5ead1 -size 153114272 diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_low.fbx b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_low.fbx deleted file mode 100644 index 46f5d1cfbd..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_low.fbx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6a4a65d139a6088dd4ac34f3ba3f6a7a98b8fe9545150ee7d9879fbc2a55d8d4 -size 9022128 From 05da6aaa67423cb0afd9957f92488288f7816b5c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 09:26:08 -0800 Subject: [PATCH 266/399] Removes unnecessary loop (#6684) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- cmake/AzAutoGen.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmake/AzAutoGen.py b/cmake/AzAutoGen.py index 19b9711325..782419a6f2 100755 --- a/cmake/AzAutoGen.py +++ b/cmake/AzAutoGen.py @@ -287,8 +287,7 @@ def ProcessExpansionRule(sourceFiles, templateFiles, templateCache, outputDir, p else: # Process all matches in one batch # Due to the lack of wildcards in the output file, we've determined we'll glob all matching input files into the template conversion - for filename in fnmatch.filter(sourceFiles, inputFiles): - dataInputFiles = [os.path.abspath(file) for file in fnmatch.filter(sourceFiles, inputFiles)] + dataInputFiles = [os.path.abspath(file) for file in fnmatch.filter(sourceFiles, inputFiles)] outputFileAbsolute = outputFile.replace("$path", ComputeOutputPath(dataInputFiles, projectDir, outputDir)) outputFileAbsolute = SanitizePath(outputFileAbsolute) ProcessTemplateConversion(dataInputSet, dataInputFiles, templateFile, outputFileAbsolute, templateCache, dryrun, verbose) From 1d0cd46cb7b727384b84bc201a98461df84689ea Mon Sep 17 00:00:00 2001 From: Shirang Jia Date: Wed, 5 Jan 2022 09:54:52 -0800 Subject: [PATCH 267/399] Escape % for windows batch in palSh (#6688) Signed-off-by: Shirang Jia --- scripts/build/Jenkins/Jenkinsfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/build/Jenkins/Jenkinsfile b/scripts/build/Jenkins/Jenkinsfile index ec40840fa6..570c553444 100644 --- a/scripts/build/Jenkins/Jenkinsfile +++ b/scripts/build/Jenkins/Jenkinsfile @@ -42,10 +42,11 @@ def palSh(cmd, lbl = '', winSlashReplacement = true) { if (env.IS_UNIX) { sh label: lbl, script: cmd - } else if (winSlashReplacement) { - bat label: lbl, - script: cmd.replace('/','\\') } else { + if (winSlashReplacement) { + cmd = cmd.replace('/','\\') + } + cmd = cmd.replace('%', '%%') bat label: lbl, script: cmd } From 783a04b88092045fe0a78c07e9b16a24188c4cbc Mon Sep 17 00:00:00 2001 From: sphrose <82213493+sphrose@users.noreply.github.com> Date: Wed, 5 Jan 2022 18:00:07 +0000 Subject: [PATCH 268/399] 3495 Preferences panel update: fix richtext elision and allow html links Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com> --- Code/Editor/EditorPreferencesPageAWS.cpp | 2 +- .../Components/Widgets/ElidingLabel.cpp | 60 ++++++++++++++++++- .../UI/PropertyEditor/PropertyRowWidget.cpp | 1 + 3 files changed, 61 insertions(+), 2 deletions(-) diff --git a/Code/Editor/EditorPreferencesPageAWS.cpp b/Code/Editor/EditorPreferencesPageAWS.cpp index 68a9d6889f..9279dce7bc 100644 --- a/Code/Editor/EditorPreferencesPageAWS.cpp +++ b/Code/Editor/EditorPreferencesPageAWS.cpp @@ -28,7 +28,7 @@ void CEditorPreferencesPage_AWS::Reflect(AZ::SerializeContext& serialize) if (editContext) { editContext->Class("Options", "") - ->DataElement(AZ::Edit::UIHandlers::CheckBox, &UsageOptions::m_awsAttributionEnabled, "Allow O3DE to send information about your use of AWS Core Gem to AWS", + ->DataElement(AZ::Edit::UIHandlers::CheckBox, &UsageOptions::m_awsAttributionEnabled, "Allow O3DE to send information about your use of AWS Core Gem to AWS", ""); editContext->Class("AWS Preferences", "AWS Preferences") diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ElidingLabel.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ElidingLabel.cpp index 8ef69c4b56..8daa183b80 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ElidingLabel.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ElidingLabel.cpp @@ -12,6 +12,8 @@ #include #include #include +#include +#include namespace AzQtComponents { @@ -35,6 +37,7 @@ namespace AzQtComponents m_text = text; m_metricsLabel->setText(m_text); + m_elidedText.clear(); elide(); updateGeometry(); @@ -65,7 +68,62 @@ namespace AzQtComponents void ElidingLabel::elide() { ensurePolished(); - m_elidedText = fontMetrics().elidedText(m_text, m_elideMode, TextRect().width()); + + if (Qt::mightBeRichText(m_text)) + { + // If RichText tags are elided using fontMetrics.elidedText(), they will break. + // A TextDocument is used to produce elided text that takes this into account. + const QString ellipsis("..."); + const int maxLineWidth = TextRect().width(); + + QTextDocument doc; + doc.setHtml(m_text); + doc.setDefaultFont(font()); + doc.setDocumentMargin(0.0); + + // Turn off wrapping so the document uses a single line. + QTextOption option = doc.defaultTextOption(); + option.setWrapMode(QTextOption::WrapMode::NoWrap); + doc.setDefaultTextOption(option); + doc.adjustSize(); + + if (doc.size().width() <= maxLineWidth) + { + m_elidedText = m_text; + } + else + { + QTextCursor textCursor(&doc); + textCursor.movePosition(QTextCursor::End); + + int ellipsisWidth = 0; + + // At the moment only ElideRight and ElideNone are ever used. This will need expanding if other elision modes are used. + if (m_elideMode == Qt::ElideRight) + { + ellipsisWidth = fontMetrics().horizontalAdvance(ellipsis); + } + + // Move the cursor back until the text fits or the start of the text is reached. + while (doc.size().width() + ellipsisWidth > maxLineWidth && !textCursor.atStart()) + { + textCursor.deletePreviousChar(); + doc.adjustSize(); + } + + if (m_elideMode == Qt::ElideRight) + { + textCursor.insertText(ellipsis); + } + + m_elidedText = doc.toHtml(); + } + } + else + { + m_elidedText = fontMetrics().elidedText(m_text, m_elideMode, TextRect().width()); + } + QLabel::setText(m_elidedText); if (m_elidedText != m_text) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp index bb2d2851ca..e895456151 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp @@ -421,6 +421,7 @@ namespace AzToolsFramework { QString label{ text }; m_nameLabel->setText(label); + m_nameLabel->setOpenExternalLinks(true); m_nameLabel->setVisible(!label.isEmpty()); // setting the stretches to 0 in case of an empty label really hides the label (i.e. even the reserved space) m_mainLayout->setStretch(0, label.isEmpty() ? 0 : LabelColumnStretch); From 8ed3da5b7f9916474e3e1de2188d23093bf68549 Mon Sep 17 00:00:00 2001 From: mrieggeramzn Date: Wed, 5 Jan 2022 10:24:53 -0800 Subject: [PATCH 269/399] Adding header file Signed-off-by: mrieggeramzn --- .../AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h index 504e3fd0dc..ed428eeac5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h @@ -14,6 +14,7 @@ #include #include #include +#include namespace AzToolsFramework { From 89067fe667d481f43628f9fd0431aa3d94e92bbf Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 10:40:03 -0800 Subject: [PATCH 270/399] Memory/benchmarks (#5896) * initial version ported from an old implementation Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * simplification of code Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Fixes a recursive loop Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Removing commented code of different options for getting memory usage of a process Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * PR comment (NULL->nullptr) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Adds mulit-threaded tests Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Improving runtime and making the whole duration manageable Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Fixes Linux build Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Fixes for mac Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Fixes for HeapSchema to get a default block if none is passed Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Adds recording functionality (disabled) and a benchmark that can run recordings Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Removes Heap allocator from being possible to use as a SystemAllocator since it doesnt allow dynamic allocating (only works with pre-allocated blocks) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * WIP trying to use SystemAllocator instead of raw reads Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Makes the recorded benchmark more stable Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * More stability changes, improvement on type usage within the benchmark, cleanup of unstable stats Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Adds benchmark files for Android Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Fixes Linux nounity build Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * PR comments Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Death test relies on an exception from ocurring, that exception is an access violation, which could not happen (i.e. the memory could be valid for the process) The test didnt have to be a death test. Also handled the situation better in the code to be able to continue in that scenario (useful for release configurations)" Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 163 ++++- .../AzCore/AzCore/Memory/HeapSchema.cpp | 12 +- .../AzCore/AzCore/Memory/HeapSchema.h | 14 +- .../AzCore/AzCore/Memory/SystemAllocator.cpp | 16 - Code/Framework/AzCore/CMakeLists.txt | 5 + .../Memory/AllocatorBenchmarkRecordings.bin | 3 + .../Tests/Memory/AllocatorBenchmarks.cpp | 591 ++++++++++++++++++ .../AzCore/Tests/Memory/HphaSchema.cpp | 88 --- .../Memory/AllocatorBenchmarks_Android.cpp | 31 + .../Android/platform_android_files.cmake | 1 + .../Memory/AllocatorBenchmarks_Linux.cpp | 31 + .../Platform/Linux/platform_linux_files.cmake | 1 + .../Tests/Memory/AllocatorBenchmarks_Mac.cpp | 31 + .../Platform/Mac/platform_mac_files.cmake | 1 + .../Memory/AllocatorBenchmarks_Windows.cpp | 40 ++ .../Windows/platform_windows_files.cmake | 1 + .../AzCore/Tests/azcoretests_files.cmake | 1 + 17 files changed, 904 insertions(+), 126 deletions(-) create mode 100644 Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin create mode 100644 Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp create mode 100644 Code/Framework/AzCore/Tests/Platform/Android/Tests/Memory/AllocatorBenchmarks_Android.cpp create mode 100644 Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp create mode 100644 Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp create mode 100644 Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index 5c510f67c1..c2bf9fe45c 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -6,8 +6,155 @@ * */ -#include #include +#include + +#define RECORDING_ENABLED 0 + +#if RECORDING_ENABLED + +#include +#include +#include +#include + +namespace +{ + class DebugAllocator + { + public: + using pointer_type = void*; + using size_type = AZStd::size_t; + using difference_type = AZStd::ptrdiff_t; + using allow_memory_leaks = AZStd::false_type; ///< Regular allocators should not leak. + + AZ_FORCE_INLINE pointer_type allocate(size_t byteSize, size_t alignment, int = 0) + { + return AZ_OS_MALLOC(byteSize, alignment); + } + AZ_FORCE_INLINE size_type resize(pointer_type, size_type) + { + return 0; + } + AZ_FORCE_INLINE void deallocate(pointer_type ptr, size_type, size_type) + { + AZ_OS_FREE(ptr); + } + }; + + #pragma pack(push, 1) + struct alignas(1) AllocatorOperation + { + enum OperationType : size_t + { + ALLOCATE, + DEALLOCATE + }; + OperationType m_type: 1; + size_t m_size : 28; // Can represent up to 256Mb requests + size_t m_alignment : 7; // Can represent up to 128 alignment + size_t m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids + }; + #pragma pack(pop) + static_assert(sizeof(AllocatorOperation) == 8); + + static AZStd::mutex s_operationsMutex = {}; + + static constexpr size_t s_maxNumberOfAllocationsToRecord = 16384; + static size_t s_numberOfAllocationsRecorded = 0; + static constexpr size_t s_allocationOperationCount = 5 * 1024; + static AZStd::array s_operations = {}; + static uint64_t s_operationCounter = 0; + + static unsigned int s_nextRecordId = 1; + using AllocatorOperationByAddress = AZStd::unordered_map, DebugAllocator>; + static AllocatorOperationByAddress s_allocatorOperationByAddress; + using AvailableRecordIds = AZStd::vector; + AvailableRecordIds s_availableRecordIds; + + void RecordAllocatorOperation(AllocatorOperation::OperationType type, void* ptr, size_t size = 0, size_t alignment = 0) + { + AZStd::scoped_lock lock(s_operationsMutex); + if (s_operationCounter == s_allocationOperationCount) + { + AZ::IO::SystemFile file; + int mode = AZ::IO::SystemFile::OpenMode::SF_OPEN_APPEND | AZ::IO::SystemFile::OpenMode::SF_OPEN_WRITE_ONLY; + if (!file.Exists("memoryrecordings.bin")) + { + mode |= AZ::IO::SystemFile::OpenMode::SF_OPEN_CREATE; + } + file.Open("memoryrecordings.bin", mode); + if (file.IsOpen()) + { + file.Write(&s_operations, sizeof(AllocatorOperation) * s_allocationOperationCount); + file.Close(); + } + s_operationCounter = 0; + } + AllocatorOperation& operation = s_operations[s_operationCounter++]; + operation.m_type = type; + if (type == AllocatorOperation::OperationType::ALLOCATE) + { + if (s_numberOfAllocationsRecorded > s_maxNumberOfAllocationsToRecord) + { + // reached limit of allocations, dont record anymore + --s_operationCounter; + return; + } + ++s_numberOfAllocationsRecorded; + operation.m_size = size; + operation.m_alignment = alignment; + unsigned int recordId = 0; + if (!s_availableRecordIds.empty()) + { + recordId = s_availableRecordIds.back(); + s_availableRecordIds.pop_back(); + } + else + { + recordId = s_nextRecordId; + ++s_nextRecordId; + } + operation.m_recordId = recordId; + auto it = s_allocatorOperationByAddress.emplace(ptr, operation); + if (!it.second) + { + // double alloc or resize, leave the current record and return the id + operation = it.first->second; + s_availableRecordIds.emplace_back(recordId); + } + } + else + { + if (ptr == nullptr) + { + // common scenario, just record the operation + operation.m_size = 0; + operation.m_alignment = 0; + operation.m_recordId = 0; // recordId = 0 will flag this case + } + else + { + auto it = s_allocatorOperationByAddress.find(ptr); + if (it != s_allocatorOperationByAddress.end()) + { + operation.m_size = it->second.m_size; + operation.m_alignment = it->second.m_alignment; + operation.m_recordId = it->second.m_recordId; + s_availableRecordIds.push_back(it->second.m_recordId); + s_allocatorOperationByAddress.erase(it); + } + else + { + // just dont record this operation + --s_operationCounter; + } + } + } + + } +} +#endif namespace AZ { @@ -150,6 +297,10 @@ namespace AZ records->RegisterAllocation(ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1); } } + +#if RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, byteSize, alignment); +#endif } void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t alignment, Debug::AllocationInfo* info) @@ -162,6 +313,9 @@ namespace AZ records->UnregisterAllocation(ptr, byteSize, alignment, info); } } +#if RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr, byteSize, alignment); +#endif } void AllocatorBase::ProfileReallocationBegin([[maybe_unused]] void* ptr, [[maybe_unused]] size_t newSize) @@ -176,6 +330,10 @@ namespace AZ ProfileDeallocation(ptr, 0, 0, &info); ProfileAllocation(newPtr, newSize, newAlignment, info.m_name, info.m_fileName, info.m_lineNum, 0); } +#if RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr); + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, newPtr, newSize, newAlignment); +#endif } void AllocatorBase::ProfileReallocation(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) @@ -193,6 +351,9 @@ namespace AZ records->ResizeAllocation(ptr, newSize); } } +#if RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, newSize); +#endif } bool AllocatorBase::OnOutOfMemory(size_t byteSize, size_t alignment, int flags, const char* name, const char* fileName, int lineNum) diff --git a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp index aceafa1b28..1f0fc59a97 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp @@ -115,6 +115,7 @@ namespace AZ m_ownMemoryBlock[i] = false; } + AZ_Assert(m_desc.m_numMemoryBlocks > 0, "At least one memory block is required"); for (int i = 0; i < m_desc.m_numMemoryBlocks; ++i) { if (m_desc.m_memoryBlocks[i] == nullptr) // Allocate memory block if requested! @@ -131,17 +132,6 @@ namespace AZ m_capacity += m_desc.m_memoryBlocksByteSize[i]; } - - if (m_desc.m_numMemoryBlocks == 0) - { - // Create default memory space if we can to serve for default allocations - m_memSpaces[0] = AZDLMalloc::create_mspace(0, m_desc.m_isMultithreadAlloc); - if (m_memSpaces[0]) - { - AZDLMalloc::mspace_az_set_expandable(m_memSpaces[0], true); - m_capacity = Platform::GetHeapCapacity(); - } - } } HeapSchema::~HeapSchema() diff --git a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h index f72ae31057..3a7716a127 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h @@ -32,17 +32,11 @@ namespace AZ */ struct Descriptor { - Descriptor() - : m_numMemoryBlocks(0) - , m_isMultithreadAlloc(true) - {} - - static const int m_memoryBlockAlignment = 64 * 1024; static const int m_maxNumBlocks = 5; - int m_numMemoryBlocks; ///< Number of memory blocks to use. - void* m_memoryBlocks[m_maxNumBlocks]; ///< Pointers to provided memory blocks or NULL if you want the system to allocate them for you with the System Allocator. - size_t m_memoryBlocksByteSize[m_maxNumBlocks]; ///< Sizes of different memory blocks, if m_memoryBlock is 0 the block will be allocated for you with the System Allocator. - bool m_isMultithreadAlloc; ///< Set to true to enable multi threading safe allocation. + int m_numMemoryBlocks = 1; ///< Number of memory blocks to use. + void* m_memoryBlocks[m_maxNumBlocks] = {}; ///< Pointers to provided memory blocks or NULL if you want the system to allocate them for you with the System Allocator. + size_t m_memoryBlocksByteSize[m_maxNumBlocks] = {4 * 1024}; ///< Sizes of different memory blocks, if m_memoryBlock is 0 the block will be allocated for you with the System Allocator. + bool m_isMultithreadAlloc = true; ///< Set to true to enable multi threading safe allocation. }; HeapSchema(const Descriptor& desc); diff --git a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp index 15cf5de8bc..41099f7a38 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp @@ -18,7 +18,6 @@ #define AZCORE_SYSTEM_ALLOCATOR_HPHA 1 #define AZCORE_SYSTEM_ALLOCATOR_MALLOC 2 -#define AZCORE_SYSTEM_ALLOCATOR_HEAP 3 #if !defined(AZCORE_SYSTEM_ALLOCATOR) // define the default @@ -29,8 +28,6 @@ #include #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC #include -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - #include #else #error "Invalid allocator selected for SystemAllocator" #endif @@ -44,8 +41,6 @@ namespace AZ static AZStd::aligned_storage::value>::type g_systemSchema; #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC static AZStd::aligned_storage::value>::type g_systemSchema; -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - static AZStd::aligned_storage::value>::type g_systemSchema; #endif ////////////////////////////////////////////////////////////////////////// @@ -118,11 +113,6 @@ namespace AZ heapDesc.m_systemChunkSize = desc.m_heap.m_systemChunkSize; #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC MallocSchema::Descriptor heapDesc; -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - HeapSchema::Descriptor heapDesc; - memcpy(heapDesc.m_memoryBlocks, desc.m_heap.m_memoryBlocks, sizeof(heapDesc.m_memoryBlocks)); - memcpy(heapDesc.m_memoryBlocksByteSize, desc.m_heap.m_memoryBlocksByteSize, sizeof(heapDesc.m_memoryBlocksByteSize)); - heapDesc.m_numMemoryBlocks = desc.m_heap.m_numMemoryBlocks; #endif if (&AllocatorInstance::Get() == this) // if we are the system allocator { @@ -132,8 +122,6 @@ namespace AZ m_allocator = new (&g_systemSchema) HphaSchema(heapDesc); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC m_allocator = new (&g_systemSchema) MallocSchema(heapDesc); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - m_allocator = new (&g_systemSchema) HeapSchema(heapDesc); #endif g_isSystemSchemaUsed = true; isReady = true; @@ -149,8 +137,6 @@ namespace AZ m_allocator = azcreate(HphaSchema, (heapDesc), SystemAllocator); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC m_allocator = azcreate(MallocSchema, (heapDesc), SystemAllocator); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - m_allocator = azcreate(HeapSchema, (heapDesc), SystemAllocator); #endif if (m_allocator == nullptr) { @@ -186,8 +172,6 @@ namespace AZ static_cast(m_allocator)->~HphaSchema(); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC static_cast(m_allocator)->~MallocSchema(); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - static_cast(m_allocator)->~HeapSchema(); #endif g_isSystemSchemaUsed = false; } diff --git a/Code/Framework/AzCore/CMakeLists.txt b/Code/Framework/AzCore/CMakeLists.txt index 96ed838ccc..838142f0df 100644 --- a/Code/Framework/AzCore/CMakeLists.txt +++ b/Code/Framework/AzCore/CMakeLists.txt @@ -146,6 +146,11 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) PROPERTY COMPILE_DEFINITIONS VALUES AZCORETEST_DLL_NAME=\"$\" ) + ly_add_target_files( + TARGETS AzCore.Tests + FILES ${CMAKE_CURRENT_SOURCE_DIR}/Tests/Memory/AllocatorBenchmarkRecordings.bin + OUTPUT_SUBDIRECTORY Tests/AzCore/Memory + ) endif() diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin new file mode 100644 index 0000000000..ec5de82e83 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:281ba03e79ecba90b313a0b17bdba87c57d76b504b6e38d579b5eabd995902cc +size 245760 diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp new file mode 100644 index 0000000000..bc477e41dc --- /dev/null +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -0,0 +1,591 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#if defined(HAVE_BENCHMARK) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes(); + size_t GetMemorySize(void* memory); + } + + ///

+ /// Test allocator wrapper that redirects the calls to the passed TAllocator by using AZ::AllocatorInstance. + /// It also creates/destroys the TAllocator type (to reflect what happens at runtime) + /// + /// Allocator type to wrap + template + class TestAllocatorWrapper + { + public: + static void SetUp() + { + AZ::AllocatorInstance::Create(); + } + + static void TearDown() + { + AZ::AllocatorInstance::Destroy(); + } + + static void* Allocate(size_t byteSize, size_t alignment) + { + return AZ::AllocatorInstance::Get().Allocate(byteSize, alignment); + } + + static void DeAllocate(void* ptr, size_t byteSize = 0) + { + AZ::AllocatorInstance::Get().DeAllocate(ptr, byteSize); + } + + static void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) + { + return AZ::AllocatorInstance::Get().ReAllocate(ptr, newSize, newAlignment); + } + + static size_t Resize(void* ptr, size_t newSize) + { + return AZ::AllocatorInstance::Get().Resize(ptr, newSize); + } + + static void GarbageCollect() + { + AZ::AllocatorInstance::Get().GarbageCollect(); + } + + static size_t NumAllocatedBytes() + { + return AZ::AllocatorInstance::Get().NumAllocatedBytes() + + AZ::AllocatorInstance::Get().GetUnAllocatedMemory(); + } + + static size_t GetSize(void* ptr) + { + return AZ::AllocatorInstance::Get().AllocationSize(ptr); + } + }; + + /// + /// Basic allocator used as a baseline. This allocator is the most basic allocation possible with the OS (AZ_OS_MALLOC). + /// MallocSchema cannot be used here because it has extra logic that we don't want to use as a baseline. + /// + class RawMallocAllocator {}; + + template<> + class TestAllocatorWrapper + { + public: + TestAllocatorWrapper() + { + s_numAllocatedBytes = 0; + } + + static void SetUp() + { + s_numAllocatedBytes = 0; + } + + static void TearDown() + { + } + + // IAllocatorAllocate + static void* Allocate(size_t byteSize, size_t) + { + s_numAllocatedBytes += byteSize; + // Don't pass an alignment since we wont be able to get the memory size without also passing the alignment + return AZ_OS_MALLOC(byteSize, 1); + } + + static void DeAllocate(void* ptr, size_t = 0) + { + s_numAllocatedBytes -= Platform::GetMemorySize(ptr); + AZ_OS_FREE(ptr); + } + + static void* ReAllocate(void* ptr, size_t newSize, size_t) + { + s_numAllocatedBytes -= Platform::GetMemorySize(ptr); + AZ_OS_FREE(ptr); + + s_numAllocatedBytes += newSize; + return AZ_OS_MALLOC(newSize, 1); + } + + static size_t Resize(void* ptr, size_t newSize) + { + AZ_UNUSED(ptr); + AZ_UNUSED(newSize); + + return 0; + } + + static void GarbageCollect() {} + + static size_t NumAllocatedBytes() + { + return s_numAllocatedBytes; + } + + static size_t GetSize(void* ptr) + { + return Platform::GetMemorySize(ptr); + } + + private: + static size_t s_numAllocatedBytes; + }; + + size_t TestAllocatorWrapper::s_numAllocatedBytes = 0; + + // Some allocator are not fully declared, those we simply setup from the schema + class MallocSchemaAllocator : public AZ::SimpleSchemaAllocator + { + public: + AZ_TYPE_INFO(MallocSchemaAllocator, "{3E68224F-E676-402C-8276-CE4B49C05E89}"); + + MallocSchemaAllocator() + : AZ::SimpleSchemaAllocator("MallocSchemaAllocator", "") + {} + }; + + // We use both this HphaSchemaAllocator and the SystemAllocator configured with Hpha because the SystemAllocator + // has extra things + class HphaSchemaAllocator : public AZ::SimpleSchemaAllocator + { + public: + AZ_TYPE_INFO(HphaSchemaAllocator, "{6563AB4B-A68E-4499-8C98-D61D640D1F7F}"); + + HphaSchemaAllocator() + : AZ::SimpleSchemaAllocator("TestHphaSchemaAllocator", "") + {} + }; + + // For the SystemAllocator we inherit so we have a different stack. The SystemAllocator is used globally so we dont want + // to get that data affecting the benchmark + class TestSystemAllocator : public AZ::SystemAllocator + { + public: + AZ_TYPE_INFO(TestSystemAllocator, "{360D4DAA-D65D-4D5C-A6FA-1A4C5261C35C}"); + + TestSystemAllocator() + : AZ::SystemAllocator() + { + } + }; + + // Allocated bytes reported by the allocator + static const char* s_counterAllocatorMemory = "Allocator_Memory"; + + // Allocated bytes as counted by the benchmark + static const char* s_counterBenchmarkMemory = "Benchmark_Memory"; + + enum AllocationSize + { + SMALL, + BIG, + MIXED, + COUNT + }; + + static const size_t s_kiloByte = 1024; + static const size_t s_megaByte = s_kiloByte * s_kiloByte; + using AllocationSizeArray = AZStd::array; + static const AZStd::array s_allocationSizes = { + /* SMALL */ AllocationSizeArray{ 2, 16, 20, 59, 100, 128, 160, 250, 300, 512 }, + /* BIG */ AllocationSizeArray{ 513, s_kiloByte, 2 * s_kiloByte, 4 * s_kiloByte, 10 * s_kiloByte, 64 * s_kiloByte, 128 * s_kiloByte, 200 * s_kiloByte, s_megaByte, 2 * s_megaByte }, + /* MIXED */ AllocationSizeArray{ 2, s_kiloByte, 59, 4 * s_kiloByte, 128, 200 * s_kiloByte, 250, s_megaByte, 512, 2 * s_megaByte } + }; + + template + class AllocatorBenchmarkFixture + : public ::benchmark::Fixture + { + protected: + using TestAllocatorType = TestAllocatorWrapper; + + virtual void internalSetUp(const ::benchmark::State& state) + { + if (state.thread_index == 0) // Only setup in the first thread + { + TestAllocatorType::SetUp(); + + m_allocations.resize(state.threads); + for (auto& perThreadAllocations : m_allocations) + { + perThreadAllocations.resize(state.range(0), nullptr); + } + } + } + + virtual void internalTearDown(const ::benchmark::State& state) + { + if (state.thread_index == 0) // Only setup in the first thread + { + m_allocations.clear(); + m_allocations.shrink_to_fit(); + + TestAllocatorType::TearDown(); + } + } + + AZStd::vector& GetPerThreadAllocations(size_t threadIndex) + { + return m_allocations[threadIndex]; + } + + public: + void SetUp(const ::benchmark::State& state) override + { + internalSetUp(state); + } + void SetUp(::benchmark::State& state) override + { + internalSetUp(state); + } + + void TearDown(const ::benchmark::State& state) override + { + internalTearDown(state); + } + void TearDown(::benchmark::State& state) override + { + internalTearDown(state); + } + + private: + AZStd::vector> m_allocations; + }; + + template + class AllocationBenchmarkFixture + : public AllocatorBenchmarkFixture + { + using base = AllocatorBenchmarkFixture; + using TestAllocatorType = typename base::TestAllocatorType; + + public: + void Benchmark(benchmark::State& state) + { + for (auto _ : state) + { + state.PauseTiming(); + + AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); + const size_t numberOfAllocations = perThreadAllocations.size(); + size_t totalAllocationSize = 0; + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + totalAllocationSize += allocationSize; + + state.ResumeTiming(); + perThreadAllocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); + state.PauseTiming(); + } + + state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); + + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + TestAllocatorType::DeAllocate(perThreadAllocations[allocationIndex], allocationSize); + perThreadAllocations[allocationIndex] = nullptr; + } + TestAllocatorType::GarbageCollect(); + + state.SetItemsProcessed(numberOfAllocations); + } + } + }; + + template + class DeAllocationBenchmarkFixture + : public AllocatorBenchmarkFixture + { + using base = AllocatorBenchmarkFixture; + using TestAllocatorType = typename base::TestAllocatorType; + + public: + void Benchmark(benchmark::State& state) + { + for (auto _ : state) + { + state.PauseTiming(); + AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); + + const size_t numberOfAllocations = perThreadAllocations.size(); + size_t totalAllocationSize = 0; + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + totalAllocationSize += allocationSize; + perThreadAllocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); + } + + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + state.ResumeTiming(); + TestAllocatorType::DeAllocate(perThreadAllocations[allocationIndex], allocationSize); + state.PauseTiming(); + perThreadAllocations[allocationIndex] = nullptr; + } + + state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); + + state.SetItemsProcessed(numberOfAllocations); + + TestAllocatorType::GarbageCollect(); + } + } + }; + + template + class RecordedAllocationBenchmarkFixture : public ::benchmark::Fixture + { + using TestAllocatorType = TestAllocatorWrapper; + + virtual void internalSetUp() + { + TestAllocatorType::SetUp(); + } + + void internalTearDown() + { + TestAllocatorType::TearDown(); + } + + #pragma pack(push, 1) + struct alignas(1) AllocatorOperation + { + enum OperationType : size_t + { + ALLOCATE, + DEALLOCATE + }; + OperationType m_type : 1; + size_t m_size : 28; // Can represent up to 256Mb requests + size_t m_alignment : 7; // Can represent up to 128 alignment + size_t m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids + }; + #pragma pack(pop) + static_assert(sizeof(AllocatorOperation) == 8); + + public: + void SetUp(const ::benchmark::State&) override + { + internalSetUp(); + } + void SetUp(::benchmark::State&) override + { + internalSetUp(); + } + + void TearDown(const ::benchmark::State&) override + { + internalTearDown(); + } + void TearDown(::benchmark::State&) override + { + internalTearDown(); + } + + void Benchmark(benchmark::State& state) + { + for (auto _ : state) + { + state.PauseTiming(); + + AZStd::unordered_map pointerRemapping; + constexpr size_t allocationOperationCount = 5 * 1024; + AZStd::array m_operations = {}; + [[maybe_unused]] const size_t operationSize = sizeof(AllocatorOperation); + + size_t totalAllocationSize = 0; + size_t itemsProcessed = 0; + + for (size_t i = 0; i < 100; ++i) // play the recording multiple times to get a good stable sample, this way we can keep a smaller recording + { + AZ::IO::SystemFile file; + AZ::IO::FixedMaxPathString filePath = AZ::Utils::GetExecutableDirectory(); + filePath += "/Tests/AzCore/Memory/AllocatorBenchmarkRecordings.bin"; + if (!file.Open(filePath.c_str(), AZ::IO::SystemFile::OpenMode::SF_OPEN_READ_ONLY)) + { + return; + } + size_t elementsRead = + file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations) / sizeof(AllocatorOperation); + itemsProcessed += elementsRead; + + while (elementsRead > 0) + { + for (size_t operationIndex = 0; operationIndex < elementsRead; ++operationIndex) + { + const AllocatorOperation& operation = m_operations[operationIndex]; + if (operation.m_type == AllocatorOperation::ALLOCATE) + { + const auto it = pointerRemapping.emplace(operation.m_recordId, nullptr); + if (it.second) // otherwise already allocated + { + state.ResumeTiming(); + void* ptr = TestAllocatorType::Allocate(operation.m_size, operation.m_alignment); + state.PauseTiming(); + totalAllocationSize += operation.m_size; + it.first->second = ptr; + } + else + { + // Doing a resize, dont account for this memory change, this operation is rare and we dont have + // the size of the previous allocation + state.ResumeTiming(); + TestAllocatorType::Resize(it.first->second, operation.m_size); + state.PauseTiming(); + } + } + else // AllocatorOperation::DEALLOCATE: + { + if (operation.m_recordId) + { + const auto ptrIt = pointerRemapping.find(operation.m_recordId); + if (ptrIt != pointerRemapping.end()) + { + totalAllocationSize -= operation.m_size; + state.ResumeTiming(); + TestAllocatorType::DeAllocate( + ptrIt->second, + /*operation.m_size*/ 0); // size is not correct after a resize, a 0 size deals with it + state.PauseTiming(); + pointerRemapping.erase(ptrIt); + } + } + else // deallocate(nullptr) are recorded + { + // Just to account of the call of deallocate(nullptr); + state.ResumeTiming(); + TestAllocatorType::DeAllocate(nullptr, /*operation.m_size*/ 0); + state.PauseTiming(); + } + } + } + + elementsRead = + file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations) / sizeof(AllocatorOperation); + itemsProcessed += elementsRead; + } + file.Close(); + + // Deallocate the remainder (since we stopped the recording middle-game)(there are leaks as well) + for (const auto& pointerMapping : pointerRemapping) + { + state.ResumeTiming(); + TestAllocatorType::DeAllocate(pointerMapping.second); + state.PauseTiming(); + } + itemsProcessed += pointerRemapping.size(); + pointerRemapping.clear(); + } + + state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); + + state.SetItemsProcessed(itemsProcessed); + + TestAllocatorType::GarbageCollect(); + } + } + }; + + // For non-threaded ranges, run 100, 400, 1600 amounts + static void RunRanges(benchmark::internal::Benchmark* b) + { + for (int i = 0; i < 6; i += 2) + { + b->Arg((1 << i) * 100); + } + } + static void RecordedRunRanges(benchmark::internal::Benchmark* b) + { + b->Iterations(1); + } + + // For threaded ranges, run just 200, multi-threaded will already multiply by thread + static void ThreadedRunRanges(benchmark::internal::Benchmark* b) + { + b->Arg(100); + } + + // Test under and over-subscription of threads vs the amount of CPUs available + static const unsigned int MaxThreadRange = 2 * AZStd::thread::hardware_concurrency(); + +#define BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME, ...) \ + BENCHMARK_TEMPLATE_DEFINE_F(FIXTURE, TESTNAME, __VA_ARGS__)(benchmark::State& state) { Benchmark(state); } \ + BENCHMARK_REGISTER_F(FIXTURE, TESTNAME) + + // We test small/big/mixed allocations in single-threaded environments. For multi-threaded environments, we test mixed since + // the multi threaded fixture will run multiple passes (1, 2, 4, ... until 2*hardware_concurrency) +#define BM_REGISTER_SIZE_FIXTURES(FIXTURE, TESTNAME, ALLOCATORTYPE) \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_SMALL, ALLOCATORTYPE, SMALL)->Apply(RunRanges); \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_BIG, ALLOCATORTYPE, BIG)->Apply(RunRanges); \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED, ALLOCATORTYPE, MIXED)->Apply(RunRanges); \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED_THREADED, ALLOCATORTYPE, MIXED)->ThreadRange(2, MaxThreadRange)->Apply(ThreadedRunRanges); + +#define BM_REGISTER_ALLOCATOR(TESTNAME, ALLOCATORTYPE) \ + namespace BM_##TESTNAME \ + { \ + BM_REGISTER_SIZE_FIXTURES(AllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE); \ + BM_REGISTER_SIZE_FIXTURES(DeAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE); \ + BM_REGISTER_TEMPLATE(RecordedAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE)->Apply(RecordedRunRanges); \ + } + + /// Warm up benchmark used to prepare the OS for allocations. Most OS keep allocations for a process somehow + /// reserved. So the first allocations run always get a bigger impact in a process. This warm up allocator runs + /// all the benchmarks and is just used for the the next allocators to report more consistent results. + BM_REGISTER_ALLOCATOR(WarmUpAllocator, RawMallocAllocator); + + BM_REGISTER_ALLOCATOR(RawMallocAllocator, RawMallocAllocator); + BM_REGISTER_ALLOCATOR(MallocSchemaAllocator, MallocSchemaAllocator); + BM_REGISTER_ALLOCATOR(HphaSchemaAllocator, HphaSchemaAllocator); + BM_REGISTER_ALLOCATOR(SystemAllocator, TestSystemAllocator); + + //BM_REGISTER_ALLOCATOR(BestFitExternalMapAllocator, BestFitExternalMapAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator + //BM_REGISTER_ALLOCATOR(HeapSchemaAllocator, TestHeapSchemaAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator + //BM_REGISTER_SCHEMA(PoolSchema); // Requires special alignment requests while allocating + +#undef BM_REGISTER_ALLOCATOR +#undef BM_REGISTER_SIZE_FIXTURES +#undef BM_REGISTER_TEMPLATE + +} // Benchmark + +#endif // HAVE_BENCHMARK diff --git a/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp b/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp index 85dd79931d..08b84416e6 100644 --- a/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp +++ b/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp @@ -10,10 +10,6 @@ #include #include -#if defined(HAVE_BENCHMARK) -#include -#endif // HAVE_BENCHMARK - class HphaSchema_TestAllocator : public AZ::SimpleSchemaAllocator { @@ -112,87 +108,3 @@ namespace UnitTest HphaSchemaTestFixture, ::testing::ValuesIn(s_mixedInstancesParameters)); } - - -#if defined(HAVE_BENCHMARK) -namespace Benchmark -{ - class HphaSchemaBenchmarkFixture - : public ::benchmark::Fixture - { - void internalSetUp() - { - AZ::AllocatorInstance::Create(); - } - - void internalTearDown() - { - AZ::AllocatorInstance::Destroy(); - } - - public: - void SetUp(const benchmark::State&) override - { - internalSetUp(); - } - void SetUp(benchmark::State&) override - { - internalSetUp(); - } - void TearDown(const benchmark::State&) override - { - internalTearDown(); - } - void TearDown(benchmark::State&) override - { - internalTearDown(); - } - - static void BM_Allocations(benchmark::State& state, const AllocationSizeArray& allocationArray) - { - AZStd::vector allocations; - while (state.KeepRunning()) - { - state.PauseTiming(); - const size_t allocationIndex = allocations.size(); - const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; - - state.ResumeTiming(); - void* allocation = AZ::AllocatorInstance::Get().Allocate(allocationSize, 0); - - state.PauseTiming(); - allocations.emplace_back(allocation); - - state.ResumeTiming(); - } - - const size_t numberOfAllocations = allocations.size(); - state.SetItemsProcessed(numberOfAllocations); - - for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) - { - AZ::AllocatorInstance::Get().DeAllocate(allocations[allocationIndex], allocationArray[allocationIndex % allocationArray.size()]); - } - AZ::AllocatorInstance::Get().GarbageCollect(); - } - }; - - // Small allocations, these are allocations that are going to end up in buckets in the HphaSchema - BENCHMARK_F(HphaSchemaBenchmarkFixture, SmallAllocations)(benchmark::State& state) - { - BM_Allocations(state, s_smallAllocationSizes); - } - - BENCHMARK_F(HphaSchemaBenchmarkFixture, BigAllocations)(benchmark::State& state) - { - BM_Allocations(state, s_bigAllocationSizes); - } - - BENCHMARK_F(HphaSchemaBenchmarkFixture, MixedAllocations)(benchmark::State& state) - { - BM_Allocations(state, s_mixedAllocationSizes); - } - - -} // Benchmark -#endif // HAVE_BENCHMARK diff --git a/Code/Framework/AzCore/Tests/Platform/Android/Tests/Memory/AllocatorBenchmarks_Android.cpp b/Code/Framework/AzCore/Tests/Platform/Android/Tests/Memory/AllocatorBenchmarks_Android.cpp new file mode 100644 index 0000000000..636d5519d8 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Platform/Android/Tests/Memory/AllocatorBenchmarks_Android.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +#include +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes() + { + struct rusage rusage; + getrusage(RUSAGE_SELF, &rusage); + return rusage.ru_maxrss * 1024L; + } + + size_t GetMemorySize(void* memory) + { + return memory ? malloc_usable_size(memory) : 0; + } + } +} diff --git a/Code/Framework/AzCore/Tests/Platform/Android/platform_android_files.cmake b/Code/Framework/AzCore/Tests/Platform/Android/platform_android_files.cmake index ed54a84dbf..3ad1bd3185 100644 --- a/Code/Framework/AzCore/Tests/Platform/Android/platform_android_files.cmake +++ b/Code/Framework/AzCore/Tests/Platform/Android/platform_android_files.cmake @@ -8,4 +8,5 @@ set(FILES Tests/UtilsTests_Android.cpp + Tests/Memory/AllocatorBenchmarks_Android.cpp ) diff --git a/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp new file mode 100644 index 0000000000..636d5519d8 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +#include +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes() + { + struct rusage rusage; + getrusage(RUSAGE_SELF, &rusage); + return rusage.ru_maxrss * 1024L; + } + + size_t GetMemorySize(void* memory) + { + return memory ? malloc_usable_size(memory) : 0; + } + } +} diff --git a/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake b/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake index 844b621e05..953dbb7791 100644 --- a/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake +++ b/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake @@ -9,4 +9,5 @@ set(FILES Tests/UtilsTests_Linux.cpp ../Common/UnixLike/Tests/UtilsTests_UnixLike.cpp + Tests/Memory/AllocatorBenchmarks_Linux.cpp ) diff --git a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp new file mode 100644 index 0000000000..932252985a --- /dev/null +++ b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +#include +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes() + { + struct rusage rusage; + getrusage(RUSAGE_SELF, &rusage); + return rusage.ru_maxrss; + } + + size_t GetMemorySize(void* memory) + { + return memory ? malloc_size(memory) : 0; + } + } +} diff --git a/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake b/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake index 93d2daf2b8..14e39d47f4 100644 --- a/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake +++ b/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake @@ -9,4 +9,5 @@ set(FILES ../Common/Apple/Tests/UtilsTests_Apple.cpp ../Common/UnixLike/Tests/UtilsTests_UnixLike.cpp + Tests/Memory/AllocatorBenchmarks_Mac.cpp ) diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp new file mode 100644 index 0000000000..e9571a7e5b --- /dev/null +++ b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp @@ -0,0 +1,40 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +#include +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes() + { + EmptyWorkingSet(GetCurrentProcess()); + + size_t memoryUsage = 0; + MEMORY_BASIC_INFORMATION mbi = { 0 }; + unsigned char* pEndRegion = nullptr; + while (sizeof(mbi) == VirtualQuery(pEndRegion, &mbi, sizeof(mbi))) { + pEndRegion += mbi.RegionSize; + if ((mbi.AllocationProtect & PAGE_READWRITE) && (mbi.State & MEM_COMMIT)) { + memoryUsage += mbi.RegionSize; + } + } + return memoryUsage; + } + + size_t GetMemorySize(void* memory) + { + return memory ? _aligned_msize(memory, 1, 0) : 0; + } + } +} diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake b/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake index 0a96dad34e..97b12b28e6 100644 --- a/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake +++ b/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake @@ -9,6 +9,7 @@ set(FILES ../Common/WinAPI/Tests/UtilsTests_WinAPI.cpp Tests/IO/Streamer/StorageDriveTests_Windows.cpp + Tests/Memory/AllocatorBenchmarks_Windows.cpp Tests/Memory/OverrunDetectionAllocator_Windows.cpp Tests/Serialization_Windows.cpp ) diff --git a/Code/Framework/AzCore/Tests/azcoretests_files.cmake b/Code/Framework/AzCore/Tests/azcoretests_files.cmake index 98f268b61a..3777071168 100644 --- a/Code/Framework/AzCore/Tests/azcoretests_files.cmake +++ b/Code/Framework/AzCore/Tests/azcoretests_files.cmake @@ -170,6 +170,7 @@ set(FILES Math/Vector3Tests.cpp Math/Vector4PerformanceTests.cpp Math/Vector4Tests.cpp + Memory/AllocatorBenchmarks.cpp Memory/AllocatorManager.cpp Memory/HphaSchema.cpp Memory/HphaSchemaErrorDetection.cpp From 31e51f8c3abd1614550f73cf43c8ab267611d498 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Wed, 5 Jan 2022 10:47:23 -0800 Subject: [PATCH 271/399] Minor updates to the Spawnable Entity Aliases in response to PR feedback. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Tests/Spawnable/SpawnableEntitiesManagerTests.cpp | 8 +++++--- .../Entity/PrefabEditorEntityOwnershipService.cpp | 3 +-- .../Prefab/Spawnable/PrefabProcessorContext.cpp | 3 +++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp b/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp index 1a483a7851..50365ff2ff 100644 --- a/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp +++ b/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp @@ -101,6 +101,8 @@ namespace UnitTest class SpawnableEntitiesManagerTest : public AllocatorsFixture { public: + constexpr static AZ::u64 EntityIdStartId = 40; + void SetUp() override { AllocatorsFixture::SetUp(); @@ -156,7 +158,7 @@ namespace UnitTest { auto entry = AZStd::make_unique(); entry->AddComponent(aznew SourceSpawnableComponent()); - entry->SetId(AZ::EntityId(40 + i)); + entry->SetId(AZ::EntityId(EntityIdStartId + i)); entities.push_back(AZStd::move(entry)); } } @@ -175,13 +177,13 @@ namespace UnitTest auto entry = AZStd::make_unique(); if (i != 0) { - entry->AddComponent(aznew TargetSpawnableComponent(AZ::EntityId(40 + i - 1))); + entry->AddComponent(aznew TargetSpawnableComponent(AZ::EntityId(EntityIdStartId + i - 1))); } else { entry->AddComponent(aznew TargetSpawnableComponent()); } - entry->SetId(AZ::EntityId(40 + i)); + entry->SetId(AZ::EntityId(EntityIdStartId + i)); entities.push_back(AZStd::move(entry)); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp index 3d962ade67..418d176daa 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp @@ -415,8 +415,7 @@ namespace AzToolsFramework { // Construct the runtime entities and products bool readyToCreateRootSpawnable = m_playInEditorData.m_assetsCache.IsActivated(); - if (!readyToCreateRootSpawnable && - !m_playInEditorData.m_assetsCache.Activate(Prefab::PrefabConversionUtils::PlayInEditor)) + if (!readyToCreateRootSpawnable && !m_playInEditorData.m_assetsCache.Activate(Prefab::PrefabConversionUtils::PlayInEditor)) { AZ_Error("Prefab", false, "Failed to create a prefab processing stack from key '%.*s'.", AZ_STRING_ARG(Prefab::PrefabConversionUtils::PlayInEditor)); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp index 2e8da9f9a1..fd8ce43836 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp @@ -38,6 +38,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils if (!m_prefabNames.contains(name)) { m_prefabNames.emplace(AZStd::move(name)); + // If currently iterating add to pending queue to avoid invalidating the container that's being iterated over. PrefabContainer& container = m_isIterating ? m_pendingPrefabAdditions : m_prefabs; container.push_back(AZStd::move(document)); return true; @@ -47,6 +48,8 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) { + // Enable iterating state so the prefab container doesn't get invalided. Enabling this flag will cause new prefabs + // to be stored in a temporary buffer that can be moved into the regular prefab container after iterating. m_isIterating = true; for (PrefabDocument& document : m_prefabs) { From 2296cf228c42158c0c01a6a6ea5d45f9ebe2d257 Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Wed, 5 Jan 2022 13:00:14 -0600 Subject: [PATCH 272/399] Removing custom teardown for closing O3DE applications, and adding to list of LY_PROCESSES to close with test Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../Gem/PythonTests/automatedtesting_shared/base.py | 2 +- .../editor/EditorScripts/Menus_FileMenuOptions.py | 5 ----- .../PythonTests/editor/TestSuite_Main_Optimized.py | 6 +++--- .../Gem/PythonTests/editor/TestSuite_Periodic.py | 11 ++--------- .../ly_test_tools/o3de/editor_test_utils.py | 2 +- 5 files changed, 7 insertions(+), 19 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py index 0441f8a1dc..4db959b23e 100755 --- a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py +++ b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py @@ -182,7 +182,7 @@ class TestAutomationBase: @staticmethod def _kill_ly_processes(include_asset_processor=True): LY_PROCESSES = [ - 'Editor', 'Profiler', 'RemoteConsole', 'AutomatedTesting.ServerLauncher' + 'Editor', 'Profiler', 'RemoteConsole', 'AutomatedTesting.ServerLauncher', 'o3de' ] AP_PROCESSES = [ 'AssetProcessor', 'AssetProcessorBatch', 'AssetBuilder', 'CrySCompileServer', diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py index c319535c05..cade2125e2 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py @@ -26,8 +26,6 @@ def Menus_FileMenuOptions_Work(): :return: None """ - import azlmbr.legacy.general as general - import editor_python_test_tools.hydra_editor_utils as hydra import editor_python_test_tools.pyside_utils as pyside_utils from editor_python_test_tools.utils import Report @@ -66,9 +64,6 @@ def Menus_FileMenuOptions_Work(): ) Report.result(menu_action_triggered, action_triggered) - # Wait a few seconds for Project Settings dialogs to load so teardown can properly close them - general.idle_wait(2.0) - if __name__ == "__main__": diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py index 7364cd8bc9..058c309652 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py @@ -24,11 +24,11 @@ class TestAutomationNoAutoTestMode(EditorTestSuite): class test_AssetPicker_UI_UX(EditorSharedTest): from .EditorScripts import AssetPicker_UI_UX as test_module - class test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(EditorSingleTest): + class test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(EditorSharedTest): from .EditorScripts import BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD as test_module class test_BasicEditorWorkflows_LevelEntityComponentCRUD(EditorSingleTest): - # Custom teardown to remove slice asset created during test + # Custom teardown to remove level created during test def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")], True, True) @@ -39,7 +39,7 @@ class TestAutomationNoAutoTestMode(EditorTestSuite): # Disable null renderer use_null_renderer = False - # Custom teardown to remove slice asset created during test + # Custom teardown to remove level created during test def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")], True, True) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py index f8a054d517..282276250f 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py @@ -26,13 +26,6 @@ def remove_test_level(request, workspace, project): request.addfinalizer(teardown) -@pytest.fixture -def kill_external_tools(request): - def teardown(): - process_utils.kill_processes_named("o3de.exe") - request.addfinalizer(teardown) - - @pytest.mark.SUITE_periodic @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @pytest.mark.parametrize("project", ["AutomatedTesting"]) @@ -40,7 +33,7 @@ class TestAutomation(TestAutomationBase): def test_AssetBrowser_SearchFiltering(self, request, workspace, editor, launcher_platform): from .EditorScripts import AssetBrowser_SearchFiltering as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) + self._run_test(request, workspace, editor, test_module, batch_mode=False, use_null_renderer=False) def test_AssetBrowser_TreeNavigation(self, request, workspace, editor, launcher_platform): from .EditorScripts import AssetBrowser_TreeNavigation as test_module @@ -58,7 +51,7 @@ class TestAutomation(TestAutomationBase): from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False) - def test_Menus_FileMenuOptions_Work(self, request, workspace, editor, launcher_platform, kill_external_tools): + def test_Menus_FileMenuOptions_Work(self, request, workspace, editor, launcher_platform): from .EditorScripts import Menus_FileMenuOptions as test_module self._run_test(request, workspace, editor, test_module, batch_mode=False) diff --git a/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py b/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py index 9f1e01342c..dd0bede4b8 100644 --- a/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py @@ -24,7 +24,7 @@ def kill_all_ly_processes(include_asset_processor: bool = True) -> None: :return: None """ LY_PROCESSES = [ - 'Editor', 'Profiler', 'RemoteConsole', + 'Editor', 'Profiler', 'RemoteConsole', 'o3de' ] AP_PROCESSES = [ 'AssetProcessor', 'AssetProcessorBatch', 'AssetBuilder' From acc6248ec98ef8cd24ea057f679d90ca6be812e5 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Wed, 5 Jan 2022 11:31:09 -0800 Subject: [PATCH 273/399] Move deep comparison / copy to utils Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp | 148 +++++++++++++++++ Code/Framework/AzCore/AzCore/DOM/DomUtils.h | 3 + Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 155 +++--------------- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 13 +- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 3 +- .../AzCore/Tests/DOM/DomValueTests.cpp | 6 +- 6 files changed, 186 insertions(+), 142 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp index 73c4bd2d76..c604373296 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp @@ -33,4 +33,152 @@ namespace AZ::Dom::Utils } return AZ::Success(AZStd::move(value)); } + + bool DeepCompareIsEqual(const Value& lhs, const Value& rhs) + { + const Value::ValueType& lhsValue = lhs.GetInternalValue(); + const Value::ValueType& rhsValue = rhs.GetInternalValue(); + + if (lhs.IsString() && rhs.IsString()) + { + // If we both hold the same ref counted string we don't need to do a full comparison + if (AZStd::holds_alternative(lhsValue) && lhsValue == rhsValue) + { + return true; + } + return lhs.GetString() == rhs.GetString(); + } + + return AZStd::visit( + [&](auto&& ourValue) -> bool + { + using Alternative = AZStd::decay_t; + + if constexpr (AZStd::is_same_v) + { + if (!rhs.IsObject()) + { + return false; + } + auto&& theirValue = AZStd::get>(rhsValue); + if (ourValue == theirValue) + { + return true; + } + + const Object::ContainerType& ourValues = ourValue->GetValues(); + const Object::ContainerType& theirValues = theirValue->GetValues(); + + if (ourValues.size() != theirValues.size()) + { + return false; + } + + for (size_t i = 0; i < ourValues.size(); ++i) + { + const Object::EntryType& lhsChild = ourValues[i]; + const Object::EntryType& rhsChild = theirValues[i]; + if (lhsChild.first != rhsChild.first || !DeepCompareIsEqual(lhsChild.second, rhsChild.second)) + { + return false; + } + } + + return true; + } + else if constexpr (AZStd::is_same_v) + { + if (!rhs.IsArray()) + { + return false; + } + auto&& theirValue = AZStd::get>(rhsValue); + if (ourValue == theirValue) + { + return true; + } + + const Array::ContainerType& ourValues = ourValue->GetValues(); + const Array::ContainerType& theirValues = theirValue->GetValues(); + + if (ourValues.size() != theirValues.size()) + { + return false; + } + + for (size_t i = 0; i < ourValues.size(); ++i) + { + const Value& lhsChild = ourValues[i]; + const Value& rhsChild = theirValues[i]; + if (!DeepCompareIsEqual(lhsChild, rhsChild)) + { + return false; + } + } + + return true; + } + else if constexpr (AZStd::is_same_v) + { + if (!rhs.IsNode()) + { + return false; + } + auto&& theirValue = AZStd::get>(rhsValue); + if (ourValue == theirValue) + { + return true; + } + + const Node& ourNode = *ourValue; + const Node& theirNode = *theirValue; + + const Object::ContainerType& ourProperties = ourNode.GetProperties(); + const Object::ContainerType& theirProperties = theirNode.GetProperties(); + + if (ourProperties.size() != theirProperties.size()) + { + return false; + } + + for (size_t i = 0; i < ourProperties.size(); ++i) + { + const Object::EntryType& lhsChild = ourProperties[i]; + const Object::EntryType& rhsChild = theirProperties[i]; + if (lhsChild.first != rhsChild.first || !DeepCompareIsEqual(lhsChild.second, rhsChild.second)) + { + return false; + } + } + + const Array::ContainerType& ourChildren = ourNode.GetChildren(); + const Array::ContainerType& theirChildren = theirNode.GetChildren(); + + for (size_t i = 0; i < ourChildren.size(); ++i) + { + const Value& lhsChild = ourChildren[i]; + const Value& rhsChild = theirChildren[i]; + if (!DeepCompareIsEqual(lhsChild, rhsChild)) + { + return false; + } + } + + return true; + } + else + { + return lhs == rhs; + } + }, + lhsValue); + } + + Value DeepCopy(const Value& value, bool copyStrings) + { + Value copiedValue; + AZStd::unique_ptr writer = copiedValue.GetWriteHandler(); + value.Accept(*writer, copyStrings); + return copiedValue; + } } // namespace AZ::Dom::Utils diff --git a/Code/Framework/AzCore/AzCore/DOM/DomUtils.h b/Code/Framework/AzCore/AzCore/DOM/DomUtils.h index ebe4273b48..5403b93714 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomUtils.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomUtils.h @@ -17,4 +17,7 @@ namespace AZ::Dom::Utils Visitor::Result ReadFromStringInPlace(Backend& backend, AZStd::string& string, Visitor& visitor); AZ::Outcome WriteToValue(const Backend::WriteCallback& writeCallback); + + bool DeepCompareIsEqual(const Value& lhs, const Value& rhs); + Value DeepCopy(const Value& value, bool copyStrings = true); } // namespace AZ::Dom::Utils diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 8c002b7091..af6d86d699 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -67,6 +67,16 @@ namespace AZ::Dom return Internal::ExtractTypeArgs::GetTypeIndex(); } + const Array::ContainerType& Array::GetValues() const + { + return m_values; + } + + const Object::ContainerType& Object::GetValues() const + { + return m_values; + } + Node::Node(AZ::Name name) : m_name(AZStd::move(name)) { @@ -130,8 +140,8 @@ namespace AZ::Dom } } - Value::Value(const AZStd::any& value) - : m_value(AZStd::allocate_shared(StdValueAllocator(), value)) + Value::Value(AZStd::any opaqueValue) + : m_value(AZStd::allocate_shared(StdValueAllocator(), AZStd::move(opaqueValue))) { } @@ -660,7 +670,9 @@ namespace AZ::Dom Value& Value::AddMember(KeyType name, const Value& value) { Object::ContainerType& object = GetObjectInternal(); - object.reserve((object.size() / Object::ReserveIncrement + 1) * Object::ReserveIncrement); + // Reserve in ReserveIncremenet chunks instead of the default vector doubling strategy + // Profiling has found that this is an aggregate performance gain for typical workflows + object.reserve(AZ_SIZE_ALIGN_UP(object.size() + 1, Object::ReserveIncrement)); if (auto memberIt = FindMutableMember(name); memberIt != object.end()) { memberIt->second = value; @@ -833,7 +845,9 @@ namespace AZ::Dom Value& Value::ArrayPushBack(Value value) { Array::ContainerType& array = GetArrayInternal(); - array.reserve((array.size() / Array::ReserveIncrement + 1) * Array::ReserveIncrement); + // Reserve in ReserveIncremenet chunks instead of the default vector doubling strategy + // Profiling has found that this is an aggregate performance gain for typical workflows + array.reserve(AZ_SIZE_ALIGN_UP(array.size() + 1, Array::ReserveIncrement)); array.push_back(AZStd::move(value)); return *this; } @@ -1231,137 +1245,8 @@ namespace AZ::Dom return AZStd::make_unique(*this); } - bool Value::DeepCompareIsEqual(const Value& other) const - { - if (IsString() && other.IsString()) - { - // If we both hold the same ref counted string we don't need to do a full comparison - if (AZStd::holds_alternative(m_value) && m_value == other.m_value) - { - return true; - } - return GetString() == other.GetString(); - } - - if (m_value.index() != other.m_value.index()) - { - return false; - } - - return AZStd::visit( - [&](auto&& ourValue) -> bool - { - using Alternative = AZStd::decay_t; - auto&& theirValue = AZStd::get>(other.m_value); - - if constexpr (AZStd::is_same_v) - { - return true; - } - else if constexpr (AZStd::is_same_v) - { - if (ourValue == theirValue) - { - return true; - } - - if (ourValue->m_values.size() != theirValue->m_values.size()) - { - return false; - } - - for (size_t i = 0; i < ourValue->m_values.size(); ++i) - { - const Object::EntryType& lhs = ourValue->m_values[i]; - const Object::EntryType& rhs = theirValue->m_values[i]; - if (lhs.first != rhs.first || !lhs.second.DeepCompareIsEqual(rhs.second)) - { - return false; - } - } - - return true; - } - else if constexpr (AZStd::is_same_v) - { - if (ourValue == theirValue) - { - return true; - } - - if (ourValue->m_values.size() != theirValue->m_values.size()) - { - return false; - } - - for (size_t i = 0; i < ourValue->m_values.size(); ++i) - { - const Value& lhs = ourValue->m_values[i]; - const Value& rhs = theirValue->m_values[i]; - if (!lhs.DeepCompareIsEqual(rhs)) - { - return false; - } - } - - return true; - } - else if constexpr (AZStd::is_same_v) - { - if (ourValue == theirValue) - { - return true; - } - - const Node& ourNode = *ourValue; - const Node& theirNode = *theirValue; - - const Object::ContainerType& ourProperties = ourNode.GetProperties(); - const Object::ContainerType& theirProperties = theirNode.GetProperties(); - - if (ourProperties.size() != theirProperties.size()) - { - return false; - } - - for (size_t i = 0; i < ourProperties.size(); ++i) - { - const Object::EntryType& lhs = ourProperties[i]; - const Object::EntryType& rhs = theirProperties[i]; - if (lhs.first != rhs.first || !lhs.second.DeepCompareIsEqual(rhs.second)) - { - return false; - } - } - - const Array::ContainerType& ourChildren = ourNode.GetChildren(); - const Array::ContainerType& theirChildren = theirNode.GetChildren(); - - for (size_t i = 0; i < ourChildren.size(); ++i) - { - const Value& lhs = ourChildren[i]; - const Value& rhs = theirChildren[i]; - if (!lhs.DeepCompareIsEqual(rhs)) - { - return false; - } - } - - return true; - } - else - { - return ourValue == theirValue; - } - }, - m_value); - } - - Value Value::DeepCopy(bool copyStrings) const + const Value::ValueType& Value::GetInternalValue() const { - Value newValue; - AZStd::unique_ptr writer = newValue.GetWriteHandler(); - Accept(*writer, copyStrings); - return newValue; + return m_value; } } // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index d67947dd0a..a6990fcbce 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -67,6 +67,9 @@ namespace AZ::Dom using Iterator = ContainerType::iterator; using ConstIterator = ContainerType::const_iterator; static constexpr const size_t ReserveIncrement = 4; + static_assert((ReserveIncrement & (ReserveIncrement - 1)) == 0, "ReserveIncremenet must be a power of 2"); + + const ContainerType& GetValues() const; private: ContainerType m_values; @@ -86,6 +89,9 @@ namespace AZ::Dom using Iterator = ContainerType::iterator; using ConstIterator = ContainerType::const_iterator; static constexpr const size_t ReserveIncrement = 8; + static_assert((ReserveIncrement & (ReserveIncrement - 1)) == 0, "ReserveIncremenet must be a power of 2"); + + const ContainerType& GetValues() const; private: ContainerType m_values; @@ -374,8 +380,9 @@ namespace AZ::Dom Visitor::Result Accept(Visitor& visitor, bool copyStrings) const; AZStd::unique_ptr GetWriteHandler(); - bool DeepCompareIsEqual(const Value& other) const; - Value DeepCopy(bool copyStrings = true) const; + //! Gets the internal value of this Value. Note that this value's types may not correspond one-to-one with the Type enumeration, + //! as internally the same type might have different storage mechanisms. Where possible, prefer using the typed API. + const ValueType& GetInternalValue() const; private: const Node& GetNodeInternal() const; @@ -385,7 +392,7 @@ namespace AZ::Dom const Array::ContainerType& GetArrayInternal() const; Array::ContainerType& GetArrayInternal(); - explicit Value(const AZStd::any& opaqueValue); + explicit Value(AZStd::any opaqueValue); static_assert( sizeof(ValueType) == sizeof(ShortStringType) + sizeof(size_t), "ValueType should have no members larger than ShortStringType"); diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index 74eb78be00..b20091b232 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -171,7 +172,7 @@ namespace AZ::Dom::Benchmark for (auto _ : state) { - Value copy = original.DeepCopy(); + Value copy = Utils::DeepCopy(original); TakeAndDiscardWithoutTimingDtor(AZStd::move(copy), state); } diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp index 3cbd532b13..a98eb307a2 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -41,10 +41,10 @@ namespace AZ::Dom::Tests { Value shallowCopy = m_value; EXPECT_EQ(m_value, shallowCopy); - EXPECT_TRUE(m_value.DeepCompareIsEqual(shallowCopy)); + EXPECT_TRUE(Utils::DeepCompareIsEqual(m_value, shallowCopy)); - Value deepCopy = m_value.DeepCopy(); - EXPECT_TRUE(m_value.DeepCompareIsEqual(deepCopy)); + Value deepCopy = Utils::DeepCopy(m_value); + EXPECT_TRUE(Utils::DeepCompareIsEqual(m_value, deepCopy)); } Value m_value; From 233349ffe3117bb7da54af3404660c7c1126224c Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 5 Jan 2022 13:35:09 -0600 Subject: [PATCH 274/399] Removed unused Editor code from EditMode/Geometry/Include/LightmapCompiler Signed-off-by: Chris Galvan --- Code/Editor/EditMode/DeepSelection.cpp | 138 ---- Code/Editor/EditMode/DeepSelection.h | 87 --- Code/Editor/Geometry/TriMesh.cpp | 587 ------------------ Code/Editor/Geometry/TriMesh.h | 238 ------- Code/Editor/Include/HitContext.h | 4 - .../Include/IAnimationCompressionManager.h | 20 - Code/Editor/Include/IAssetItem.h | 433 ------------- Code/Editor/Include/IAssetItemDatabase.h | 259 -------- Code/Editor/Include/IAssetViewer.h | 46 -- Code/Editor/Include/IFileUtil.h | 3 - .../SimpleTriangleRasterizer.cpp | 506 --------------- .../SimpleTriangleRasterizer.h | 181 ------ Code/Editor/Objects/ObjectManager.cpp | 1 - Code/Editor/Util/FileUtil.cpp | 102 --- Code/Editor/Util/FileUtil.h | 6 - Code/Editor/Util/FileUtil_impl.cpp | 5 - Code/Editor/Util/FileUtil_impl.h | 3 - Code/Editor/editor_lib_files.cmake | 9 - 18 files changed, 2628 deletions(-) delete mode 100644 Code/Editor/EditMode/DeepSelection.cpp delete mode 100644 Code/Editor/EditMode/DeepSelection.h delete mode 100644 Code/Editor/Geometry/TriMesh.cpp delete mode 100644 Code/Editor/Geometry/TriMesh.h delete mode 100644 Code/Editor/Include/IAnimationCompressionManager.h delete mode 100644 Code/Editor/Include/IAssetItem.h delete mode 100644 Code/Editor/Include/IAssetItemDatabase.h delete mode 100644 Code/Editor/Include/IAssetViewer.h delete mode 100644 Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.cpp delete mode 100644 Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.h diff --git a/Code/Editor/EditMode/DeepSelection.cpp b/Code/Editor/EditMode/DeepSelection.cpp deleted file mode 100644 index 3e232a230c..0000000000 --- a/Code/Editor/EditMode/DeepSelection.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "DeepSelection.h" - -// Editor -#include "Objects/BaseObject.h" - - -//! Functor for sorting selected objects on deep selection mode. -struct NearDistance -{ - NearDistance(){} - bool operator()(const CDeepSelection::RayHitObject& lhs, const CDeepSelection::RayHitObject& rhs) const - { - return lhs.distance < rhs.distance; - } -}; - -//----------------------------------------------------------------------------- -CDeepSelection::CDeepSelection() - : m_Mode(DSM_NONE) - , m_previousMode(DSM_NONE) - , m_CandidateObjectCount(0) - , m_CurrentSelectedPos(-1) -{ - m_LastPickPoint = QPoint(-1, -1); -} - -//----------------------------------------------------------------------------- -CDeepSelection::~CDeepSelection() -{ -} - -//----------------------------------------------------------------------------- -void CDeepSelection::Reset(bool bResetLastPick) -{ - for (int i = 0; i < m_CandidateObjectCount; ++i) - { - m_RayHitObjects[i].object->ClearFlags(OBJFLAG_NO_HITTEST); - } - - m_CandidateObjectCount = 0; - m_CurrentSelectedPos = -1; - - m_RayHitObjects.clear(); - - if (bResetLastPick) - { - m_LastPickPoint = QPoint(-1, -1); - } -} - -//----------------------------------------------------------------------------- -void CDeepSelection::AddObject(float distance, CBaseObject* pObj) -{ - m_RayHitObjects.push_back(RayHitObject(distance, pObj)); -} - -//----------------------------------------------------------------------------- -bool CDeepSelection::OnCycling (const QPoint& pt) -{ - QPoint diff = m_LastPickPoint - pt; - LONG epsilon = 2; - m_LastPickPoint = pt; - - if (abs(diff.x()) < epsilon && abs(diff.y()) < epsilon) - { - return true; - } - else - { - return false; - } -} - -//----------------------------------------------------------------------------- -void CDeepSelection::ExcludeHitTest(int except) -{ - int nExcept = except % m_CandidateObjectCount; - - for (int i = 0; i < m_CandidateObjectCount; ++i) - { - m_RayHitObjects[i].object->SetFlags(OBJFLAG_NO_HITTEST); - } - - m_RayHitObjects[nExcept].object->ClearFlags(OBJFLAG_NO_HITTEST); -} - -//----------------------------------------------------------------------------- -int CDeepSelection::CollectCandidate(float fMinDistance, float fRange) -{ - m_CandidateObjectCount = 0; - - if (!m_RayHitObjects.empty()) - { - std::sort(m_RayHitObjects.begin(), m_RayHitObjects.end(), NearDistance()); - - for (std::vector::iterator itr = m_RayHitObjects.begin(); - itr != m_RayHitObjects.end(); ++itr) - { - if (itr->distance - fMinDistance < fRange) - { - ++m_CandidateObjectCount; - } - else - { - break; - } - } - } - - return m_CandidateObjectCount; -} - -//----------------------------------------------------------------------------- -CBaseObject* CDeepSelection::GetCandidateObject(int index) -{ - m_CurrentSelectedPos = index % m_CandidateObjectCount; - - return m_RayHitObjects[m_CurrentSelectedPos].object; -} - -//----------------------------------------------------------------------------- -//! -void CDeepSelection::SetMode(EDeepSelectionMode mode) -{ - m_previousMode = m_Mode; - m_Mode = mode; -} diff --git a/Code/Editor/EditMode/DeepSelection.h b/Code/Editor/EditMode/DeepSelection.h deleted file mode 100644 index b6f652abc5..0000000000 --- a/Code/Editor/EditMode/DeepSelection.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : Deep Selection Header - - -#ifndef CRYINCLUDE_EDITOR_EDITMODE_DEEPSELECTION_H -#define CRYINCLUDE_EDITOR_EDITMODE_DEEPSELECTION_H -#pragma once - -class CBaseObject; - -//! Deep Selection -//! Additional output information of HitContext on using "deep selection mode". -//! At the deep selection mode, it supports second selection pass for easy -//! selection on crowded area with two different method. -//! One is to show pop menu of candidate objects list. Another is the cyclic -//! selection on pick clicking. -class CDeepSelection - : public _i_reference_target_t -{ -public: - //! Deep Selection Mode Definition - enum EDeepSelectionMode - { - DSM_NONE = 0, // Not using deep selection. - DSM_POP = 1, // Deep selection mode with pop context menu. - DSM_CYCLE = 2 // Deep selection mode with cyclic selection on each clinking same point. - }; - - //! Subclass for container of the selected object with hit distance. - struct RayHitObject - { - RayHitObject(float dist, CBaseObject* pObj) - : distance(dist) - , object(pObj) - { - } - - float distance; - CBaseObject* object; - }; - - //! Constructor - CDeepSelection(); - virtual ~CDeepSelection(); - - void Reset(bool bResetLastPick = false); - void AddObject(float distance, CBaseObject* pObj); - //! Check if clicking point is same position with last position, - //! to decide whether to continue cycling mode. - bool OnCycling (const QPoint& pt); - //! All objects in list are excluded for hitting test except one, current selection. - void ExcludeHitTest(int except); - void SetMode(EDeepSelectionMode mode); - inline EDeepSelectionMode GetMode() const { return m_Mode; } - inline EDeepSelectionMode GetPreviousMode() const { return m_previousMode; } - //! Collect object in the deep selection range. The distance from the minimum - //! distance is less than deep selection range. - int CollectCandidate(float fMinDistance, float fRange); - //! Return the candidate object in index position, then it is to be current - //! selection position. - CBaseObject* GetCandidateObject(int index); - //! Return the current selection position that is update in "GetCandidateObject" - //! function call. - inline int GetCurrentSelectPos() const { return m_CurrentSelectedPos; } - //! Return the number of objects in the deep selection range. - inline int GetCandidateObjectCount() const { return m_CandidateObjectCount; } - -private: - //! Current mode - EDeepSelectionMode m_Mode; - EDeepSelectionMode m_previousMode; - //! Last picking point to check whether cyclic selection continue. - QPoint m_LastPickPoint; - //! List of the selected objects with ray hitting - std::vector m_RayHitObjects; - int m_CandidateObjectCount; - int m_CurrentSelectedPos; -}; -#endif // CRYINCLUDE_EDITOR_EDITMODE_DEEPSELECTION_H diff --git a/Code/Editor/Geometry/TriMesh.cpp b/Code/Editor/Geometry/TriMesh.cpp deleted file mode 100644 index efc201095d..0000000000 --- a/Code/Editor/Geometry/TriMesh.cpp +++ /dev/null @@ -1,587 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "TriMesh.h" - -// Editor -#include "Util/fastlib.h" -#include "Objects/SubObjSelection.h" - - -////////////////////////////////////////////////////////////////////////// -CTriMesh::CTriMesh() -{ - pFaces = nullptr; - pVertices = nullptr; - pWSVertices = nullptr; - pUV = nullptr; - pColors = nullptr; - pEdges = nullptr; - pWeights = nullptr; - - nFacesCount = 0; - nVertCount = 0; - nUVCount = 0; - nEdgeCount = 0; - - selectionType = SO_ELEM_NONE; - - memset(m_streamSize, 0, sizeof(m_streamSize)); - memset(m_streamSel, 0, sizeof(m_streamSel)); - streamSelMask = 0; - - m_streamSel[VERTICES] = &vertSel; - m_streamSel[EDGES] = &edgeSel; - m_streamSel[FACES] = &faceSel; -} - -////////////////////////////////////////////////////////////////////////// -CTriMesh::~CTriMesh() -{ - free(pFaces); - free(pEdges); - free(pVertices); - free(pUV); - free(pColors); - free(pWSVertices); - free(pWeights); -} - -// Set stream size. -void CTriMesh::ReallocStream(int stream, int nNewCount) -{ - assert(stream >= 0 && stream < LAST_STREAM); - if (stream < 0 || stream >= LAST_STREAM) - { - return; - } - if (m_streamSize[stream] == nNewCount) - { - return; // Stream already have required size. - } - void* pStream = nullptr; - int nElementSize = 0; - GetStreamInfo(stream, pStream, nElementSize); - pStream = ReAllocElements(pStream, nNewCount, nElementSize); - m_streamSize[stream] = nNewCount; - - switch (stream) - { - case VERTICES: - pVertices = (CTriVertex*)pStream; - nVertCount = nNewCount; - vertSel.resize(nNewCount); - break; - case FACES: - pFaces = (CTriFace*)pStream; - nFacesCount = nNewCount; - faceSel.resize(nNewCount); - break; - case EDGES: - pEdges = (CTriEdge*)pStream; - nEdgeCount = nNewCount; - edgeSel.resize(nNewCount); - break; - case TEXCOORDS: - pUV = (SMeshTexCoord*)pStream; - nUVCount = nNewCount; - break; - case COLORS: - pColors = (SMeshColor*)pStream; - break; - case WEIGHTS: - pWeights = (float*)pStream; - break; - case LINES: - pLines = (CTriLine*)pStream; - break; - case WS_POSITIONS: - pWSVertices = (Vec3*)pStream; - break; - default: - assert(0); // unknown stream. - } - m_streamSize[stream] = nNewCount; -} - -// Set stream size. -void CTriMesh::GetStreamInfo(int stream, void*& pStream, int& nElementSize) const -{ - assert(stream >= 0 && stream < LAST_STREAM); - switch (stream) - { - case VERTICES: - pStream = pVertices; - nElementSize = sizeof(CTriVertex); - break; - case FACES: - pStream = pFaces; - nElementSize = sizeof(CTriFace); - break; - case EDGES: - pStream = pEdges; - nElementSize = sizeof(CTriEdge); - break; - case TEXCOORDS: - pStream = pUV; - nElementSize = sizeof(SMeshTexCoord); - break; - case COLORS: - pStream = pColors; - nElementSize = sizeof(SMeshColor); - break; - case WEIGHTS: - pStream = pWeights; - nElementSize = sizeof(float); - break; - case LINES: - pStream = pLines; - nElementSize = sizeof(CTriLine); - break; - case WS_POSITIONS: - pStream = pWSVertices; - nElementSize = sizeof(Vec3); - break; - default: - assert(0); // unknown stream. - } -} - -////////////////////////////////////////////////////////////////////////// -void* CTriMesh::ReAllocElements(void* old_ptr, int new_elem_num, int size_of_element) -{ - return realloc(old_ptr, new_elem_num * size_of_element); -} - -///////////////////////////////////////////////////////////////////////////////////// -inline int FindVertexInHash(const Vec3& vPosToFind, const CTriVertex* pVectors, std::vector& hash, float fEpsilon) -{ - for (uint32 i = 0; i < hash.size(); i++) - { - const Vec3& v0 = pVectors[hash[i]].pos; - const Vec3& v1 = vPosToFind; - if (fabsf(v0.y - v1.y) < fEpsilon && fabsf(v0.x - v1.x) < fEpsilon && fabsf(v0.z - v1.z) < fEpsilon) - { - return hash[i]; - } - } - return -1; -} - -///////////////////////////////////////////////////////////////////////////////////// -inline int FindTexCoordInHash(const SMeshTexCoord& coordToFind, const SMeshTexCoord* pCoords, std::vector& hash, float fEpsilon) -{ - for (uint32 i = 0; i < hash.size(); i++) - { - const SMeshTexCoord& t0 = pCoords[hash[i]]; - const SMeshTexCoord& t1 = coordToFind; - - if (t0.IsEquivalent(t1, fEpsilon)) - { - return hash[i]; - } - } - return -1; -} - - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::SharePositions() -{ - float fEpsilon = 0.0001f; - float fHashScale = 256.0f / MAX(bbox.GetSize().GetLength(), fEpsilon); - std::vector arrHashTable[256]; - - CTriVertex* pNewVerts = new CTriVertex[GetVertexCount()]; - SMeshColor* pNewColors = nullptr; - if (pColors) - { - pNewColors = new SMeshColor[GetVertexCount()]; - } - - int nLastIndex = 0; - for (int f = 0; f < GetFacesCount(); f++) - { - CTriFace& face = pFaces[f]; - for (int i = 0; i < 3; i++) - { - const Vec3& v = pVertices[face.v[i]].pos; - uint8 nHash = static_cast(RoundFloatToInt((v.x + v.y + v.z) * fHashScale)); - - int find = FindVertexInHash(v, pNewVerts, arrHashTable[nHash], fEpsilon); - if (find < 0) - { - pNewVerts[nLastIndex] = pVertices[face.v[i]]; - if (pColors) - { - pNewColors[nLastIndex] = pColors[face.v[i]]; - } - face.v[i] = nLastIndex; - // Reserve some space already. - arrHashTable[nHash].reserve(100); - arrHashTable[nHash].push_back(nLastIndex); - nLastIndex++; - } - else - { - face.v[i] = find; - } - } - } - - SetVertexCount(nLastIndex); - memcpy(pVertices, pNewVerts, nLastIndex * sizeof(CTriVertex)); - delete []pNewVerts; - - if (pColors) - { - SetColorsCount(nLastIndex); - memcpy(pColors, pNewColors, nLastIndex * sizeof(SMeshColor)); - delete []pNewColors; - } -} - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::ShareUV() -{ - float fEpsilon = 0.0001f; - float fHashScale = 256.0f; - std::vector arrHashTable[256]; - - SMeshTexCoord* pNewUV = new SMeshTexCoord[GetUVCount()]; - - int nLastIndex = 0; - for (int f = 0; f < GetFacesCount(); f++) - { - CTriFace& face = pFaces[f]; - for (int i = 0; i < 3; i++) - { - const Vec2 uv = pUV[face.uv[i]].GetUV(); - uint8 nHash = static_cast(RoundFloatToInt((uv.x + uv.y) * fHashScale)); - - int find = FindTexCoordInHash(pUV[face.uv[i]], pNewUV, arrHashTable[nHash], fEpsilon); - if (find < 0) - { - pNewUV[nLastIndex] = pUV[face.uv[i]]; - face.uv[i] = nLastIndex; - arrHashTable[nHash].reserve(100); - arrHashTable[nHash].push_back(nLastIndex); - nLastIndex++; - } - else - { - face.uv[i] = find; - } - } - } - - SetUVCount(nLastIndex); - memcpy(pUV, pNewUV, nLastIndex * sizeof(SMeshTexCoord)); - delete []pNewUV; -} - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::CalcFaceNormals() -{ - for (int i = 0; i < nFacesCount; i++) - { - CTriFace& face = pFaces[i]; - Vec3 p1 = pVertices[face.v[0]].pos; - Vec3 p2 = pVertices[face.v[1]].pos; - Vec3 p3 = pVertices[face.v[2]].pos; - face.normal = (p2 - p1).Cross(p3 - p1); - face.normal.Normalize(); - } -} - -#define TEX_EPS 0.001f -#define VER_EPS 0.001f - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::CopyStream(CTriMesh& fromMesh, int stream) -{ - void* pTrgStream = nullptr; - void* pSrcStream = nullptr; - int nElemSize = 0; - fromMesh.GetStreamInfo(stream, pSrcStream, nElemSize); - if (pSrcStream) - { - ReallocStream(stream, fromMesh.GetStreamSize(stream)); - GetStreamInfo(stream, pTrgStream, nElemSize); - memcpy(pTrgStream, pSrcStream, nElemSize * fromMesh.GetStreamSize(stream)); - } -} - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::Copy(CTriMesh& fromMesh, int nCopyFlags) -{ - streamSelMask = fromMesh.streamSelMask; - - if (nCopyFlags & COPY_VERTICES) - { - CopyStream(fromMesh, VERTICES); - } - if (nCopyFlags & COPY_FACES) - { - CopyStream(fromMesh, FACES); - } - if (nCopyFlags & COPY_EDGES) - { - CopyStream(fromMesh, EDGES); - } - if (nCopyFlags & COPY_TEXCOORDS) - { - CopyStream(fromMesh, TEXCOORDS); - } - if (nCopyFlags & COPY_COLORS) - { - CopyStream(fromMesh, COLORS); - } - if (nCopyFlags & COPY_WEIGHTS) - { - CopyStream(fromMesh, WEIGHTS); - } - if (nCopyFlags & COPY_LINES) - { - CopyStream(fromMesh, LINES); - } - - if (nCopyFlags & COPY_VERT_SEL) - { - vertSel = fromMesh.vertSel; - } - if (nCopyFlags & COPY_EDGE_SEL) - { - edgeSel = fromMesh.edgeSel; - } - if (nCopyFlags & COPY_FACE_SEL) - { - faceSel = fromMesh.faceSel; - } -} - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::UpdateEdges() -{ - SetEdgeCount(GetFacesCount() * 3); - - std::map edgemap; - - int nEdges = 0; - for (int i = 0; i < GetFacesCount(); i++) - { - CTriFace& face = pFaces[i]; - for (int j = 0; j < 3; j++) - { - int v0 = j; - int v1 = (j != 2) ? j + 1 : 0; - CTriEdge edge; - edge.flags = 0; - - // First vertex index must always be smaller. - if (face.v[v0] < face.v[v1]) - { - edge.v[0] = face.v[v0]; - edge.v[1] = face.v[v1]; - } - else - { - edge.v[0] = face.v[v1]; - edge.v[1] = face.v[v0]; - } - edge.face[0] = i; - edge.face[1] = -1; - int nedge = stl::find_in_map(edgemap, edge, -1); - if (nedge >= 0) - { - // Assign this face as a second member of the edge. - if (pEdges[nedge].face[1] < 0) - { - pEdges[nedge].face[1] = i; - } - - face.edge[j] = nedge; - } - else - { - edgemap[edge] = nEdges; - pEdges[nEdges] = edge; - face.edge[j] = nEdges; - nEdges++; - } - } - } - - SetEdgeCount(nEdges); -} - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::SoftSelection(const SSubObjSelOptions& options) -{ - int i; - int nVerts = GetVertexCount(); - CTriVertex* pVerts = pVertices; - - for (i = 0; i < nVerts; i++) - { - if (pWeights[i] == 1.0f) - { - const Vec3& vp = pVerts[i].pos; - for (int j = 0; j < nVerts; j++) - { - if (pWeights[j] != 1.0f) - { - if (vp.IsEquivalent(pVerts[j].pos, options.fSoftSelFalloff)) - { - float fDist = vp.GetDistance(pVerts[j].pos); - if (fDist < options.fSoftSelFalloff) - { - float fWeight = 1.0f - (fDist / options.fSoftSelFalloff); - if (fWeight > pWeights[j]) - { - pWeights[j] = fWeight; - } - } - } - } - } - } - } -} - -////////////////////////////////////////////////////////////////////////// -bool CTriMesh::UpdateSelection() -{ - bool bAnySelected = false; - if (selectionType == SO_ELEM_VERTEX) - { - for (int i = 0; i < GetVertexCount(); i++) - { - if (vertSel[i]) - { - bAnySelected = true; - pWeights[i] = 1.0f; - } - else - { - pWeights[i] = 0; - } - } - } - if (selectionType == SO_ELEM_EDGE) - { - // Clear weights. - for (int i = 0; i < GetVertexCount(); i++) - { - pWeights[i] = 0; - } - - for (int i = 0; i < GetEdgeCount(); i++) - { - if (edgeSel[i]) - { - bAnySelected = true; - CTriEdge& edge = pEdges[i]; - for (int j = 0; j < 2; j++) - { - pWeights[edge.v[j]] = 1.0f; - } - } - } - } - else if (selectionType == SO_ELEM_FACE) - { - // Clear weights. - for (int i = 0; i < GetVertexCount(); i++) - { - pWeights[i] = 0; - } - - for (int i = 0; i < GetFacesCount(); i++) - { - if (faceSel[i]) - { - bAnySelected = true; - CTriFace& face = pFaces[i]; - for (int j = 0; j < 3; j++) - { - pWeights[face.v[j]] = 1.0f; - } - } - } - } - return bAnySelected; -} - - -////////////////////////////////////////////////////////////////////////// -bool CTriMesh::ClearSelection() -{ - bool bWasSelected = false; - // Remove all selections. - int i; - for (i = 0; i < GetVertexCount(); i++) - { - pWeights[i] = 0; - } - streamSelMask = 0; - for (int ii = 0; ii < LAST_STREAM; ii++) - { - if (m_streamSel[ii] && !m_streamSel[ii]->is_zero()) - { - bWasSelected = true; - m_streamSel[ii]->clear(); - } - } - return bWasSelected; -} - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::GetEdgesByVertex(MeshElementsArray& inVertices, MeshElementsArray& outEdges) -{ - // Brute force algorithm using binary search. - // for every edge check if edge vertex is inside inVertices array. - std::sort(inVertices.begin(), inVertices.end()); - for (int i = 0; i < GetEdgeCount(); i++) - { - if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pEdges[i].v[0])) != inVertices.end()) - { - outEdges.push_back(i); - } - else if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pEdges[i].v[1])) != inVertices.end()) - { - outEdges.push_back(i); - } - } -} - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::GetFacesByVertex(MeshElementsArray& inVertices, MeshElementsArray& outFaces) -{ - // Brute force algorithm using binary search. - // for every face check if face vertex is inside inVertices array. - std::sort(inVertices.begin(), inVertices.end()); - for (int i = 0; i < GetFacesCount(); i++) - { - if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pFaces[i].v[0])) != inVertices.end()) - { - outFaces.push_back(i); - } - else if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pFaces[i].v[1])) != inVertices.end()) - { - outFaces.push_back(i); - } - else if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pFaces[i].v[2])) != inVertices.end()) - { - outFaces.push_back(i); - } - } -} diff --git a/Code/Editor/Geometry/TriMesh.h b/Code/Editor/Geometry/TriMesh.h deleted file mode 100644 index a6c58b8f9d..0000000000 --- a/Code/Editor/Geometry/TriMesh.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_GEOMETRY_TRIMESH_H -#define CRYINCLUDE_EDITOR_GEOMETRY_TRIMESH_H -#pragma once - -#include -#include "Util/bitarray.h" - -struct SSubObjSelOptions; - -typedef std::vector MeshElementsArray; - -////////////////////////////////////////////////////////////////////////// -// Vertex used in the TriMesh. -////////////////////////////////////////////////////////////////////////// -struct CTriVertex -{ - Vec3 pos; - //float weight; // Selection weight in 0-1 range. -}; - -////////////////////////////////////////////////////////////////////////// -// Triangle face used by the Triangle mesh. -////////////////////////////////////////////////////////////////////////// -struct CTriFace -{ - uint32 v[3]; // Indices to vertices array. - uint32 uv[3]; // Indices to texture coordinates array. - Vec3 n[3]; // Vertex normals at face vertices. - Vec3 normal; // Face normal. - uint32 edge[3]; // Indices to the face edges. - unsigned char MatID; // Index of face sub material. - unsigned char flags; // see ETriMeshFlags -}; - -////////////////////////////////////////////////////////////////////////// -// Mesh edge. -////////////////////////////////////////////////////////////////////////// -struct CTriEdge -{ - uint32 v[2]; // Indices to edge vertices. - int face[2]; // Indices to edge faces (-1 if no face). - uint32 flags; // see ETriMeshFlags - - CTriEdge() {} - bool operator==(const CTriEdge& edge) const - { - if ((v[0] == edge.v[0] && v[1] == edge.v[1]) || - (v[0] == edge.v[1] && v[1] == edge.v[0])) - { - return true; - } - return false; - } - bool operator!=(const CTriEdge& edge) const { return !(*this == edge); } - bool operator<(const CTriEdge& edge) const { return (*(uint64*)v < *(uint64*)edge.v); } - bool operator>(const CTriEdge& edge) const { return (*(uint64*)v > *(uint64*)edge.v); } -}; - -////////////////////////////////////////////////////////////////////////// -// Mesh line. -////////////////////////////////////////////////////////////////////////// -struct CTriLine -{ - uint32 v[2]; // Indices to edge vertices. - - CTriLine() {} - bool operator==(const CTriLine& edge) const - { - if ((v[0] == edge.v[0] && v[1] == edge.v[1]) || - (v[0] == edge.v[1] && v[1] == edge.v[0])) - { - return true; - } - return false; - } - bool operator!=(const CTriLine& edge) const { return !(*this == edge); } - bool operator<(const CTriLine& edge) const { return (*(uint64*)v < *(uint64*)edge.v); } - bool operator>(const CTriLine& edge) const { return (*(uint64*)v > *(uint64*)edge.v); } -}; - -////////////////////////////////////////////////////////////////////////// -struct CTriMeshPoly -{ - std::vector v; // Indices to vertices array. - std::vector uv; // Indices to texture coordinates array. - std::vector n; // Vertex normals at face vertices. - Vec3 normal; // Polygon normal. - uint32 edge[3]; // Indices to the face edges. - unsigned char MatID; // Index of face sub material. - unsigned char flags; // optional flags. -}; - -////////////////////////////////////////////////////////////////////////// -// CTriMesh is used in the Editor as a general purpose editable triangle mesh. -////////////////////////////////////////////////////////////////////////// -class CTriMesh -{ -public: - enum EStream - { - VERTICES, - FACES, - EDGES, - TEXCOORDS, - COLORS, - WEIGHTS, - LINES, - WS_POSITIONS, - LAST_STREAM, - }; - enum ECopyFlags - { - COPY_VERTICES = BIT(1), - COPY_FACES = BIT(2), - COPY_EDGES = BIT(3), - COPY_TEXCOORDS = BIT(4), - COPY_COLORS = BIT(5), - COPY_VERT_SEL = BIT(6), - COPY_EDGE_SEL = BIT(7), - COPY_FACE_SEL = BIT(8), - COPY_WEIGHTS = BIT(9), - COPY_LINES = BIT(10), - COPY_ALL = 0xFFFF, - }; - // geometry data - CTriFace* pFaces; - CTriEdge* pEdges; - CTriVertex* pVertices; - SMeshTexCoord* pUV; - SMeshColor* pColors; // If allocated same size as pVerts array. - Vec3* pWSVertices; // World space vertices. - float* pWeights; - CTriLine* pLines; - - int nFacesCount; - int nVertCount; - int nUVCount; - int nEdgeCount; - int nLinesCount; - - AABB bbox; - - ////////////////////////////////////////////////////////////////////////// - // Selections. - ////////////////////////////////////////////////////////////////////////// - CBitArray vertSel; - CBitArray edgeSel; - CBitArray faceSel; - // Every bit of the selection mask correspond to a stream, if bit is set this stream have some elements selected - int streamSelMask; - - // Selection element type. - // see ESubObjElementType - int selectionType; - - ////////////////////////////////////////////////////////////////////////// - // Vertices of the front facing triangles. - CBitArray frontFacingVerts; - - ////////////////////////////////////////////////////////////////////////// - // Functions. - ////////////////////////////////////////////////////////////////////////// - CTriMesh(); - ~CTriMesh(); - - int GetFacesCount() const { return nFacesCount; } - int GetVertexCount() const { return nVertCount; } - int GetUVCount() const { return nUVCount; } - int GetEdgeCount() const { return nEdgeCount; } - int GetLinesCount() const { return nLinesCount; } - - ////////////////////////////////////////////////////////////////////////// - void SetFacesCount(int nNewCount) { ReallocStream(FACES, nNewCount); } - void SetVertexCount(int nNewCount) - { - ReallocStream(VERTICES, nNewCount); - if (pColors) - { - ReallocStream(COLORS, nNewCount); - } - ReallocStream(WEIGHTS, nNewCount); - } - void SetColorsCount(int nNewCount) { ReallocStream(COLORS, nNewCount); } - void SetUVCount(int nNewCount) { ReallocStream(TEXCOORDS, nNewCount); } - void SetEdgeCount(int nNewCount) { ReallocStream(EDGES, nNewCount); } - void SetLinesCount(int nNewCount) { ReallocStream(LINES, nNewCount); } - - void ReallocStream(int stream, int nNewCount); - void GetStreamInfo(int stream, void*& pStream, int& nElementSize) const; - int GetStreamSize(int stream) const { return m_streamSize[stream]; }; - - // Calculate per face normal. - void CalcFaceNormals(); - - ////////////////////////////////////////////////////////////////////////// - // Welding functions. - ////////////////////////////////////////////////////////////////////////// - void SharePositions(); - void ShareUV(); - ////////////////////////////////////////////////////////////////////////// - // Recreate edges of the mesh. - void UpdateEdges(); - - void Copy(CTriMesh& fromMesh, int nCopyFlags = COPY_ALL); - - ////////////////////////////////////////////////////////////////////////// - // Sub-object selection specific methods. - ////////////////////////////////////////////////////////////////////////// - // Return true if something is selected. - bool UpdateSelection(); - // Clear all selections, return true if something was selected. - bool ClearSelection(); - void SoftSelection(const SSubObjSelOptions& options); - CBitArray* GetStreamSelection(int nStream) { return m_streamSel[nStream]; }; - // Returns true if specified stream have any selected elements. - bool StreamHaveSelection(int nStream) { return streamSelMask & (1 << nStream); } - void GetEdgesByVertex(MeshElementsArray& inVertices, MeshElementsArray& outEdges); - void GetFacesByVertex(MeshElementsArray& inVertices, MeshElementsArray& outFaces); - -private: - void* ReAllocElements(void* old_ptr, int new_elem_num, int size_of_element); - void CopyStream(CTriMesh& fromMesh, int stream); - - // For internal use. - int m_streamSize[LAST_STREAM]; - CBitArray* m_streamSel[LAST_STREAM]; -}; - -#endif // CRYINCLUDE_EDITOR_GEOMETRY_TRIMESH_H diff --git a/Code/Editor/Include/HitContext.h b/Code/Editor/Include/HitContext.h index ceff0adb22..b49117bb60 100644 --- a/Code/Editor/Include/HitContext.h +++ b/Code/Editor/Include/HitContext.h @@ -17,7 +17,6 @@ class CGizmo; class CBaseObject; struct IDisplayViewport; -class CDeepSelection; struct AABB; #include @@ -105,8 +104,6 @@ struct HitContext CBaseObject* object; //! gizmo object that have been hit. CGizmo* gizmo; - //! for deep selection mode - CDeepSelection* pDeepSelection; //! For linking tool const char* name; //! true if this hit was from the object icon @@ -131,7 +128,6 @@ struct HitContext bIgnoreAxis = false; bOnlyGizmo = false; bUseSelectionHelpers = false; - pDeepSelection = 0; name = nullptr; iconHit = false; } diff --git a/Code/Editor/Include/IAnimationCompressionManager.h b/Code/Editor/Include/IAnimationCompressionManager.h deleted file mode 100644 index 64cebf620a..0000000000 --- a/Code/Editor/Include/IAnimationCompressionManager.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IANIMATIONCOMPRESSIONMANAGER_H -#define CRYINCLUDE_EDITOR_INCLUDE_IANIMATIONCOMPRESSIONMANAGER_H -#pragma once - -struct IAnimationCompressionManager -{ - virtual bool IsEnabled() const = 0; - virtual void UpdateLocalAnimations() = 0; -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_IANIMATIONCOMPRESSIONMANAGER_H diff --git a/Code/Editor/Include/IAssetItem.h b/Code/Editor/Include/IAssetItem.h deleted file mode 100644 index ff80331af5..0000000000 --- a/Code/Editor/Include/IAssetItem.h +++ /dev/null @@ -1,433 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : Standard interface for asset display in the asset browser, -// this header should be used to create plugins. -// The method Release of this interface should NOT be called. -// Instead, the FreeData from the database (from IAssetItemDatabase) should -// be used as it will safely release all the items from the database. -// It is still possible to call the release method, but this is not the -// recomended method, specially for usage outside of the plugins because there -// is no guarantee that a the asset will be properly removed from the database -// manager. - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IASSETITEM_H -#define CRYINCLUDE_EDITOR_INCLUDE_IASSETITEM_H -#pragma once - -struct IAssetItemDatabase; - -namespace AssetViewer -{ - // Used in GetAssetFieldValue for each asset type to check if field name is the right one - inline bool IsFieldName(const char* pIncomingFieldName, const char* pFieldName) - { - return !strncmp(pIncomingFieldName, pFieldName, strlen(pIncomingFieldName)); - } -} - -// Description: -// This interface allows the programmer to extend asset display types visible in the asset browser. -struct IAssetItem - : public IUnknown -{ - DEFINE_UUID(0x04F20346, 0x2EC3, 0x43f2, 0xBD, 0xA1, 0x2C, 0x0B, 0x97, 0x76, 0xF3, 0x84); - - // The supported asset flags - enum EAssetFlags - { - // asset is visible in the database for filtering and sorting (not asset view control related) - eFlag_Visible = BIT(0), - // the asset is loaded - eFlag_Loaded = BIT(1), - // the asset is loaded - eFlag_Cached = BIT(2), - // the asset is selected in a selection set - eFlag_Selected = BIT(3), - // this asset is invalid, no thumb is shown/available - eFlag_Invalid = BIT(4), - // this asset has some errors/warnings, in the asset browser it will show some blinking/red elements - // and the user can check out the errors. Error text will be fetched using GetAssetFieldValue( "errors", &someStringVar ) - eFlag_HasErrors = BIT(5), - // this flag is set when the asset is rendering its contents using GDI, and not the engine's rendering capabilities - // (this flags is used as hint for the preview tool, which will use a double-buffer canvas if this flag is set, - // and send a memory HDC to the OnBeginPreview method, for drawing of the asset) - eFlag_UseGdiRendering = BIT(6), - // set if this asset is draggable into the render viewports, and can be created there - eFlag_CanBeDraggedInViewports = BIT(7), - // set if this asset can be moved after creation, otherwise the asset instance will just be created where user clicked - eFlag_CanBeMovedAfterDroppedIntoViewport = BIT(8), - // the asset thumbnail image is loaded - eFlag_ThumbnailLoaded = BIT(9), - // the asset thumbnail image is loaded - eFlag_UsedInLevel = BIT(10) - }; - - // Asset field name and field values map - typedef std::map < QString/*fieldName*/, QString/*value*/ > TAssetFieldValuesMap; - // Dependency category names and corresponding files map, example: "Textures"=>{ "foam.dds","water.dds","normal.dds" } - typedef std::map < QString/*dependencyCategory*/, std::set/*dependency filenames*/ > TAssetDependenciesMap; - - virtual ~IAssetItem() { - } - - // Description: - // Get the hash number/key used for database thumbnail and info records management - virtual uint32 GetHash() const = 0; - // Description: - // Set the hash number/key used for database thumbnail and info records management - virtual void SetHash(uint32 hash) = 0; - // Description: - // Get the owner database for this asset - // Return Value: - // The owner database for this asset - // See Also: - // SetOwnerDatabase() - virtual IAssetItemDatabase* GetOwnerDatabase() const = 0; - // Description: - // Set the owner database for this asset - // Arguments: - // piOwnerDisplayDatabase - the owner database - // See Also: - // GetOwnerDatabase() - virtual void SetOwnerDatabase(IAssetItemDatabase* pOwnerDisplayDatabase) = 0; - // Description: - // Get the asset's dependency files / objects - // Return Value: - // The vector with filenames which this asset is dependent upon, ex.: ["Textures"].(vector of textures) - virtual const TAssetDependenciesMap& GetDependencies() const = 0; - // Description: - // Set the file size of this asset in bytes - // Arguments: - // aSize - size of the file in bytes - // See Also: - // GetFileSize() - virtual void SetFileSize(quint64 aSize) = 0; - // Description: - // Get the file size of this asset in bytes - // Return Value: - // The file size of this asset in bytes - // See Also: - // SetFileSize() - virtual quint64 GetFileSize() const = 0; - // Description: - // Set asset filename (extension included and no path) - // Arguments: - // pName - the asset filename (extension included and no path) - // See Also: - // GetFilename() - virtual void SetFilename(const char* pName) = 0; - // Description: - // Get asset filename (extension included and no path) - // Return Value: - // The asset filename (extension included and no path) - // See Also: - // SetFilename() - virtual QString GetFilename() const = 0; - // Description: - // Set the asset's relative path - // Arguments: - // pName - file's relative path - // See Also: - // GetRelativePath() - virtual void SetRelativePath(const char* pName) = 0; - // Description: - // Get the asset's relative path - // Return Value: - // The asset's relative path - // See Also: - // SetRelativePath() - virtual QString GetRelativePath() const = 0; - // Description: - // Set the file extension ( dot(s) must be included ) - // Arguments: - // pExt - the file's extension - // See Also: - // GetFileExtension() - virtual void SetFileExtension(const char* pExt) = 0; - // Description: - // Get the file extension ( dot(s) included ) - // Return Value: - // The file extension ( dot(s) included ) - // See Also: - // SetFileExtension() - virtual QString GetFileExtension() const = 0; - // Description: - // Get the asset flags, with values from IAssetItem::EAssetFlags - // Return Value: - // The asset flags, with values from IAssetItem::EAssetFlags - // See Also: - // SetFlags(), SetFlag(), IsFlagSet() - virtual UINT GetFlags() const = 0; - // Description: - // Set the asset flags - // Arguments: - // aFlags - flags, OR-ed values from IAssetItem::EAssetFlags - // See Also: - // GetFlags(), SetFlag(), IsFlagSet() - virtual void SetFlags(UINT aFlags) = 0; - // Description: - // Set/clear a single flag bit for the asset - // Arguments: - // aFlag - the flag to set/clear, with values from IAssetItem::EAssetFlags - // See Also: - // GetFlags(), SetFlags(), IsFlagSet() - virtual void SetFlag(EAssetFlags aFlag, bool bSet = true) = 0; - // Description: - // Check if a specified flag is set - // Arguments: - // aFlag - the flag to check, with values from IAssetItem::EAssetFlags - // Return Value: - // True if the flag is set - // See Also: - // GetFlags(), SetFlags(), SetFlag() - virtual bool IsFlagSet(EAssetFlags aFlag) const = 0; - // Description: - // Set this asset's index; used in sorting, selections, and to know where an asset is in the current list - // Arguments: - // aIndex - the asset's index - // See Also: - // GetIndex() - virtual void SetIndex(UINT aIndex) = 0; - // Description: - // Get the asset's index in the current list - // Return Value: - // The asset's index in the current list - // See Also: - // SetIndex() - virtual UINT GetIndex() const = 0; - // Description: - // Get the asset's field raw data value into a user location, you must check the field's type ( from asset item's owner database ) - // before using this function and send the correct pointer to destination according to the type ( int8, float32, string, etc. ) - // Arguments: - // pFieldName - the asset field name to query the value for - // pDest - the destination variable address, must be the same type as the field type - // Return Value: - // True if the asset field name is found and the value is returned correctly - // See Also: - // SetAssetFieldValue() - virtual QVariant GetAssetFieldValue(const char* pFieldName) const = 0; - // Description: - // Set the asset's field raw data value from a user location, you must check the field's type ( from asset item's owner database ) - // before using this function and send the correct pointer to source according to the type ( int8, float32, string, etc. ) - // Arguments: - // pFieldName - the asset field name to set the value for - // pSrc - the source variable address, must be the same type as the field type - // Return Value: - // True if the asset field name is found and the value is set correctly - // See Also: - // GetAssetFieldValue() - virtual bool SetAssetFieldValue(const char* pFieldName, void* pSrc) = 0; - // Description: - // Get the drawing rectangle for the asset's thumb ( absolute viewer canvas location ) - // Arguments: - // rstDrawingRectangle - destination location to set with the asset's thumbnail rectangle location - // See Also: - // SetDrawingRectangle() - virtual void GetDrawingRectangle(QRect& rstDrawingRectangle) const = 0; - // Description: - // Set the drawing rectangle for the asset's thumb ( absolute viewer canvas location ) - // Arguments: - // crstDrawingRectangle - source to set the asset's thumbnail rectangle - // See Also: - // GetDrawingRectangle() - virtual void SetDrawingRectangle(const QRect& crstDrawingRectangle) = 0; - // Description: - // Checks if the given 2D point is inside the asset's thumb rectangle - // Arguments: - // nX - mouse pointer position on X axis, relative to the asset viewer control - // nY - mouse pointer position on Y axis, relative to the asset viewer control - // Return Value: - // True if the given 2D point is inside the asset's thumb rectangle - // See Also: - // HitTest(CRect) - virtual bool HitTest(int nX, int nY) const = 0; - // Description: - // Checks if the given rectangle intersects the asset thumb's rectangle - // Arguments: - // nX - mouse pointer position on X axis, relative to the asset viewer control - // nY - mouse pointer position on Y axis, relative to the asset viewer control - // Return Value: - // True if the given rectangle intersects the asset thumb's rectangle - // See Also: - // HitTest(int nX,int nY) - virtual bool HitTest(const QRect& roTestRect) const = 0; - // Description: - // When user drags this asset item into a viewport, this method is called when the dragging operation ends - // and the mouse button is released, for the asset to return an instance of the asset object to be placed in the level - // Arguments: - // aX - instance's X position component in world coordinates - // aY - instance's Y position component in world coordinates - // aZ - instance's Z position component in world coordinates - // Return Value: - // The newly created asset instance (Example: BrushObject*) - // See Also: - // MoveInstanceInViewport() - virtual void* CreateInstanceInViewport(float aX, float aY, float aZ) = 0; - // Description: - // When the mouse button is released after level object creation, the user now can move the mouse - // and move the asset instance in the 3D world - // Arguments: - // pDraggedObject - the actual entity or brush object (CBaseObject* usually) to be moved around with the mouse - // returned by the CreateInstanceInViewport() - // aNewX - the new X world coordinates of the asset instance - // aNewY - the new Y world coordinates of the asset instance - // aNewZ - the new Z world coordinates of the asset instance - // Return Value: - // True if asset instance was moved properly - // See Also: - // CreateInstanceInViewport() - virtual bool MoveInstanceInViewport(const void* pDraggedObject, float aNewX, float aNewY, float aNewZ) = 0; - // Description: - // This will be called when the user presses ESCAPE key when dragging the asset in the viewport, you must delete the given object - // because the creation was aborted - // Arguments: - // pDraggedObject - the asset instance to be deleted ( you must cast to the needed type, and delete it properly ) - // See Also: - // CreateInstanceInViewport() - virtual void AbortCreateInstanceInViewport(const void* pDraggedObject) = 0; - // Description: - // This method is used to cache/load asset's data, so it can be previewed/rendered - // Return Value: - // True if the asset was successfully cached - // See Also: - // UnCache() - virtual bool Cache() = 0; - // Description: - // This method is used to force cache/load asset's data, so it can be previewed/rendered - // Return Value: - // True if the asset was successfully forced cached - // See Also: - // UnCache(), Cache() - virtual bool ForceCache() = 0; - // Description: - // This method is used to load the thumbnail image of the asset - // Return Value: - // True if thumb loaded ok - // See Also: - // UnloadThumbnail() - virtual bool LoadThumbnail() = 0; - // Description: - // This method is used to unload the thumbnail image of the asset - // See Also: - // LoadThumbnail() - virtual void UnloadThumbnail() = 0; - // Description: - // This is called when the asset starts to be previewed in full detail, so here you can load the whole asset, in fine detail - // ( textures are fully loaded, models etc. ). It is called once, when the Preview dialog is shown - // Arguments: - // hPreviewWnd - the window handle of the quick preview dialog - // hMemDC - the memory DC used to render assets that can render themselves in the DC, otherwise they will render in the dialog's HWND - // See Also: - // OnEndPreview(), GetCustomPreviewPanelHeader() - virtual void OnBeginPreview(QWidget* hPreviewWnd) = 0; - // Description: - // Called when the Preview dialog is closed, you may release the detail asset data here - // See Also: - // OnBeginPreview(), GetCustomPreviewPanelHeader() - virtual void OnEndPreview() = 0; - // Description: - // If the asset has a special preview panel with utility controls, to be placed at the top of the Preview window, it can return an child dialog window - // otherwise it can return nullptr, if no panel is available - // Arguments: - // pParentWnd - a valid CDialog*, or nullptr - // Return Value: - // A valid child dialog window handle, if this asset wants to have a custom panel in the top side of the Asset Preview window, - // otherwise it can return nullptr, if no panel is available - // See Also: - // OnBeginPreview(), OnEndPreview() - virtual QWidget* GetCustomPreviewPanelHeader(QWidget* pParentWnd) = 0; - virtual QWidget* GetCustomPreviewPanelFooter(QWidget* pParentWnd) = 0; - // Description: - // Used when dragging/rotate/zoom a model, or other asset that can support preview - // Arguments: - // hRenderWindow - the rendering window handle - // rstViewport - the viewport rectangle - // aMouseX - the render window relative mouse pointer X coordinate - // aMouseY - the render window relative mouse pointer Y coordinate - // aMouseDeltaX - the X coordinate delta between two mouse movements - // aMouseDeltaY - the Y coordinate delta between two mouse movements - // aMouseWheelDelta - the mouse wheel scroll delta/step - // aKeyFlags - the key flags, see WM_LBUTTONUP - // See Also: - // OnPreviewRenderKeyEvent() - virtual void PreviewRender( - QWidget* hRenderWindow, - const QRect& rstViewport, - int aMouseX = 0, int aMouseY = 0, - int aMouseDeltaX = 0, int aMouseDeltaY = 0, - int aMouseWheelDelta = 0, UINT aKeyFlags = 0) = 0; - // Description: - // This is called when the user manipulates the assets in interactive render and a key is pressed ( with down or up state ) - // Arguments: - // bKeyDown - true if this is a WM_KEYDOWN event, else it is a WM_KEYUP event - // aChar - the char/key code pressed/released - // aKeyFlags - the key flags, compatible with WM_KEYDOWN/UP events - // See Also: - // InteractiveRender() - virtual void OnPreviewRenderKeyEvent(bool bKeyDown, UINT aChar, UINT aKeyFlags) = 0; - // Description: - // Called when user clicked once on the thumb image - // Arguments: - // point - mouse coordinates relative to the thumbnail rectangle - // aKeyFlags - the key flags, see WM_LBUTTONDOWN - // See Also: - // OnThumbDblClick() - virtual void OnThumbClick(const QPoint& point, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers) = 0; - // Description: - // Called when user double clicked on the thumb image - // Arguments: - // point - mouse coordinates relative to the thumbnail rectangle - // aKeyFlags - the key flags, see WM_LBUTTONDOWN - // See Also: - // OnThumbClick() - //! called when user clicked twice on the thumb image - virtual void OnThumbDblClick(const QPoint& point, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers) = 0; - // Description: - // Draw the cached thumb bitmap only, if any, no other kind of rendering - // Arguments: - // hDC - the destination DC, where to draw the thumb - // rRect - the destination rectangle - // Return Value: - // True if drawing of the thumbnail was done OK - // See Also: - // Render() - virtual bool DrawThumbImage(QPainter* painter, const QRect& rRect) = 0; - // Description: - // Writes asset info to a XML node. - // This is needed to save cached info as a persistent XML file for the next run of the editor. - // Arguments: - // node - An XML node to contain the info - // See Also: - // FromXML() - virtual void ToXML(XmlNodeRef& node) const = 0; - // Description: - // Gets asset info from a XML node. - // This is needed to get the asset info from previous runs of the editor without re-caching it. - // Arguments: - // node - An XML node that contains info for this asset - // See Also: - // ToXML() - virtual void FromXML(const XmlNodeRef& node) = 0; - - // From IUnknown - virtual HRESULT STDMETHODCALLTYPE QueryInterface([[maybe_unused]] const IID& riid, [[maybe_unused]] void** ppvObject) - { - return E_NOINTERFACE; - }; - virtual ULONG STDMETHODCALLTYPE AddRef() - { - return 0; - }; - virtual ULONG STDMETHODCALLTYPE Release() - { - return 0; - }; -}; -#endif // CRYINCLUDE_EDITOR_INCLUDE_IASSETITEM_H diff --git a/Code/Editor/Include/IAssetItemDatabase.h b/Code/Editor/Include/IAssetItemDatabase.h deleted file mode 100644 index 39fd60e8c6..0000000000 --- a/Code/Editor/Include/IAssetItemDatabase.h +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : Standard interface for asset database creators used to -// create an asset plugin for the asset browser -// The category of the plugin must be Asset Item DB - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IASSETITEMDATABASE_H -#define CRYINCLUDE_EDITOR_INCLUDE_IASSETITEMDATABASE_H -#pragma once -struct IAssetItem; -struct IAssetViewer; - -class QString; -class QStringList; - -// Description: -// This struct keeps the info, filter and sorting settings for an asset field -struct SAssetField -{ - // the condition for the current filter on the field - enum EAssetFilterCondition - { - eCondition_Any = 0, - // string conditions - // this also supports '*' and '?' as wildcards inside text - eCondition_Contains, - // this filter will search the target for at least one of the words specified - // ( ex: filter: "water car moon" , field value : "the_great_moon.dds", this will pass the test - // it also supports '*' and '?' as wildcards inside words text - eCondition_ContainsOneOfTheWords, - eCondition_StartsWith, - eCondition_EndsWith, - // string & numerical conditions - eCondition_Equal, - eCondition_Greater, - eCondition_Less, - eCondition_GreaterOrEqual, - eCondition_LessOrEqual, - eCondition_Not, - eCondition_InsideRange - }; - - // the asset field type - enum EAssetFieldType - { - eType_None = 0, - eType_Bool, - eType_Int8, - eType_Int16, - eType_Int32, - eType_Int64, - eType_Float, - eType_Double, - eType_String - }; - - // used when a field can have different specific values - typedef QStringList TFieldEnumValues; - - SAssetField( - const char* pFieldName = "", - const char* pDisplayName = "Unnamed field", - EAssetFieldType aFieldType = eType_None, - UINT aColumnWidth = 50, - bool bVisibleInUI = true, - bool bReadOnly = true) - { - m_fieldName = pFieldName; - m_displayName = pDisplayName; - m_fieldType = aFieldType; - m_filterCondition = eCondition_Equal; - m_bUseEnumValues = false; - m_bReadOnly = bReadOnly; - m_listColumnWidth = aColumnWidth; - m_bFieldVisibleInUI = bVisibleInUI; - m_bPostFilter = false; - - SetupEnumValues(); - } - - void SetupEnumValues() - { - m_bUseEnumValues = true; - - if (m_fieldType == eType_Bool) - { - m_enumValues.clear(); - m_enumValues.push_back("Yes"); - m_enumValues.push_back("No"); - } - } - - // the field's display name, used in UI - QString m_displayName, - // the field internal name, used in C++ code - m_fieldName, - // the current filter value, if its empty "" then no filter is applied - m_filterValue, - // the field's max value, valid when the field's filter condition is eAssertFilterCondition_InsideRange - m_maxFilterValue, - // the name of the database holding this field, used in Asset Browser preset editor, if its "" then the field - // is common to all current databases - m_parentDatabaseName; - // is this field visible in the UI ? - bool m_bFieldVisibleInUI, - // if true, then you cannot modify this field of an asset item, only use it - m_bReadOnly, - // this field filter is applied after the other filters - m_bPostFilter; - // the field data type - EAssetFieldType m_fieldType; - // the filter's condition - EAssetFilterCondition m_filterCondition; - // use the enum list values to choose a value for the field ? - bool m_bUseEnumValues; - // this map is used when asset field has m_bUseEnumValues on true, - // choose a value for the field from this list in the UI - TFieldEnumValues m_enumValues; - // recommended list column width - unsigned int m_listColumnWidth; -}; - -struct SFieldFiltersPreset -{ - QString presetName2; - QStringList checkedDatabaseNames; - bool bUsedInLevel; - std::vector fields; -}; - -// Description: -// This interface allows the programmer to extend asset display types -// visible in the asset browser. -struct IAssetItemDatabase - : public IUnknown -{ - DEFINE_UUID(0xFB09B039, 0x1D9D, 0x4057, 0xA5, 0xF0, 0xAA, 0x3C, 0x7B, 0x97, 0xAE, 0xA8) - - typedef std::vector TAssetFields; - typedef std::map < QString/*field name*/, SAssetField > TAssetFieldFiltersMap; - typedef std::map < QString/*asset filename*/, IAssetItem* > TFilenameAssetMap; - typedef AZStd::function MetaDataChangeListener; - - // Description: - // Refresh the database by scanning the folders/paks for files, does not load the files, only filename and filesize are fetched - virtual void Refresh() = 0; - // Description: - // Fills the asset meta data from the loaded xml meta data DB. - // Arguments: - // db - the database XML node from where to cache the info - virtual void PrecacheFieldsInfoFromFileDB(const XmlNodeRef& db) = 0; - // Description: - // Return all assets loaded/scanned by this database - // Return Value: - // The assets map reference (filename-asset) - virtual TFilenameAssetMap& GetAssets() = 0; - // Description: - // Get an asset item by its filename - // Return Value: - // A single asset from the database given the filename - virtual IAssetItem* GetAsset(const char* pAssetFilename) = 0; - // Description: - // Return the asset fields this database's items support - // Return Value: - // The asset fields vector reference - virtual TAssetFields& GetAssetFields() = 0; - // Description: - // Return an asset field object pointer by the field internal name - // Arguments: - // pFieldName - the internal field's name (ex: "filename", "relativepath") - // Return Value: - // The asset field object pointer - virtual SAssetField* GetAssetFieldByName(const char* pFieldName) = 0; - // Description: - // Get the database name - // Return Value: - // Returns the database name, ex: "Textures" - virtual const char* GetDatabaseName() const = 0; - // Description: - // Get the database supported file name extension(s) - // Return Value: - // Returns the supported extensions, separated by comma, ex: "tga,bmp,dds" - virtual const char* GetSupportedExtensions() const = 0; - // Description: - // Free the database internal data structures - virtual void FreeData() = 0; - // Description: - // Apply filters to this database which will set/unset the IAssetItem::eAssetFlag_Visible of each asset, based - // on the given field filters - // Arguments: - // rFieldFilters - a reference to the field filters map (fieldname-field) - // See Also: - // ClearFilters() - virtual void ApplyFilters(const TAssetFieldFiltersMap& rFieldFilters) = 0; - // Description: - // Clear the current filters, by setting the IAssetItem::eAssetFlag_Visible of each asset to true - // See Also: - // ApplyFilters() - virtual void ClearFilters() = 0; - virtual QWidget* CreateDbFilterDialog(QWidget* pParent, IAssetViewer* pViewerCtrl) = 0; - virtual void UpdateDbFilterDialogUI(QWidget* pDlg) = 0; - virtual void OnAssetBrowserOpen() = 0; - virtual void OnAssetBrowserClose() = 0; - // Description: - // Gets the filename for saving new cached asset info. - // Return Value: - // A file name to save new transactions to the persistent asset info DB - // See Also: - // CAssetInfoFileDB, IAssetItem::ToXML(), IAssetItem::FromXML() - virtual const char* GetTransactionFilename() const = 0; - // Description: - // Adds a callback to be called when the meta data of this asset changed. - // Arguments: - // callBack - A functor to be added - // Return Value: - // True if successful, false otherwise. - // See Also: - // RemoveMetaDataChangeListener() - virtual bool AddMetaDataChangeListener(MetaDataChangeListener callBack) = 0; - // Description: - // Removes a callback from the list of meta data change listeners. - // Arguments: - // callBack - A functor to be removed - // Return Value: - // True if successful, false otherwise. - // See Also: - // AddMetaDataCHangeListener() - virtual bool RemoveMetaDataChangeListener(MetaDataChangeListener callBack) = 0; - // Description: - // The method that should be called when the meta data of an asset item changes to notify all listeners - // Arguments: - // pAssetItem - An asset item whose meta data have changed - // See Also: - // AddMetaDataCHangeListener(), RemoveMetaDataChangeListener() - virtual void OnMetaDataChange(const IAssetItem* pAssetItem) = 0; - - //! from IUnknown - virtual HRESULT STDMETHODCALLTYPE QueryInterface([[maybe_unused]] REFIID riid, [[maybe_unused]] void** ppvObject) - { - return E_NOINTERFACE; - }; - virtual ULONG STDMETHODCALLTYPE AddRef() - { - return 0; - }; - virtual ULONG STDMETHODCALLTYPE Release() - { - return 0; - }; -}; -#endif // CRYINCLUDE_EDITOR_INCLUDE_IASSETITEMDATABASE_H diff --git a/Code/Editor/Include/IAssetViewer.h b/Code/Editor/Include/IAssetViewer.h deleted file mode 100644 index 488ee8e508..0000000000 --- a/Code/Editor/Include/IAssetViewer.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : This file declares a control which objective is to display -// multiple assets allowing selection and preview of such things -// It also handles scrolling and changes in the thumbnail display size - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IASSETVIEWER_H -#define CRYINCLUDE_EDITOR_INCLUDE_IASSETVIEWER_H -#pragma once -#include "IObservable.h" -#include "IAssetItemDatabase.h" - -struct IAssetItem; -struct IAssetItemDatabase; - -// Description: -// Observer for the asset viewer events -struct IAssetViewerObserver -{ - virtual void OnChangeStatusBarInfo(UINT nSelectedItems, UINT nVisibleItems, UINT nTotalItems) {}; - virtual void OnSelectionChanged() {}; - virtual void OnChangedPreviewedAsset(IAssetItem* pAsset) {}; - virtual void OnAssetDblClick(IAssetItem* pAsset) {}; - virtual void OnAssetFilterChanged() {}; -}; - -// Description: -// The asset viewer interface for the asset database plugins to use -struct IAssetViewer -{ - DEFINE_OBSERVABLE_PURE_METHODS(IAssetViewerObserver); - - virtual HWND GetRenderWindow() = 0; - virtual void ApplyFilters(const IAssetItemDatabase::TAssetFieldFiltersMap& rFieldFilters) = 0; - virtual const IAssetItemDatabase::TAssetFieldFiltersMap& GetCurrentFilters() = 0; - virtual void ClearFilters() = 0; -}; -#endif // CRYINCLUDE_EDITOR_INCLUDE_IASSETVIEWER_H diff --git a/Code/Editor/Include/IFileUtil.h b/Code/Editor/Include/IFileUtil.h index 036a0bc5ee..ea2fe1f1a3 100644 --- a/Code/Editor/Include/IFileUtil.h +++ b/Code/Editor/Include/IFileUtil.h @@ -116,9 +116,6 @@ struct IFileUtil virtual bool ExtractFile(QString& file, bool bMsgBoxAskForExtraction = true, const char* pDestinationFilename = nullptr) = 0; virtual void EditTextureFile(const char* txtureFile, bool bUseGameFolder) = 0; - //! dcc filename calculation and extraction sub-routines - virtual bool CalculateDccFilename(const QString& assetFilename, QString& dccFilename) = 0; - //! Reformat filter string for (MFC) CFileDialog style file filtering virtual void FormatFilterString(QString& filter) = 0; diff --git a/Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.cpp b/Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.cpp deleted file mode 100644 index 736465cac1..0000000000 --- a/Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.cpp +++ /dev/null @@ -1,506 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "SimpleTriangleRasterizer.h" - -#include - -#if !defined FLT_MAX -#define FLT_MAX 3.402823466e+38F -#endif - -void CSimpleTriangleRasterizer::lambertHorizlineConservative(float fx1, float fx2, int yy, IRasterizeSink* inpSink) -{ - int x1 = (int)floorf(fx1 + 0.25f), x2 = (int)floorf(fx2 + .75f); - - if (x1 < m_iMinX) - { - x1 = m_iMinX; - } - if (x2 > m_iMaxX + 1) - { - x2 = m_iMaxX + 1; - } - if (x1 > m_iMaxX + 1) - { - x1 = m_iMaxX + 1; - } - if (x2 < m_iMinX) - { - x2 = m_iMinX; - } - - - inpSink->Line(fx1, fx2, x1, x2, yy); -} - -void CSimpleTriangleRasterizer::lambertHorizlineSubpixelCorrect(float fx1, float fx2, int yy, IRasterizeSink* inpSink) -{ - int x1 = (int)floorf(fx1 + 0.5f), x2 = (int)floorf(fx2 + 0.5f); - // int x1=(int)floorf(fx1*1023.f/1024.f+1.f),x2=(int)floorf(fx2*1023.f/1024.f+1.f); - - if (x1 < m_iMinX) - { - x1 = m_iMinX; - } - if (x2 > m_iMaxX) - { - x2 = m_iMaxX; - } - if (x1 > m_iMaxX) - { - x1 = m_iMaxX; - } - if (x2 < m_iMinX) - { - x2 = m_iMinX; - } - - inpSink->Line(fx1, fx2, x1, x2, yy); -} - -// optimizable -void CSimpleTriangleRasterizer::CopyAndSortY(const float infX[3], const float infY[3], float outfX[3], float outfY[3]) -{ - outfX[0] = infX[0]; - outfY[0] = infY[0]; - outfX[1] = infX[1]; - outfY[1] = infY[1]; - outfX[2] = infX[2]; - outfY[2] = infY[2]; - - // Sort the coordinates, so that (x[1], y[1]) becomes the highest coord - float tmp; - - if (outfY[0] > outfY[1]) - { - if (outfY[1] > outfY[2]) - { - tmp = outfY[0]; - outfY[0] = outfY[1]; - outfY[1] = tmp; - tmp = outfX[0]; - outfX[0] = outfX[1]; - outfX[1] = tmp; - tmp = outfY[1]; - outfY[1] = outfY[2]; - outfY[2] = tmp; - tmp = outfX[1]; - outfX[1] = outfX[2]; - outfX[2] = tmp; - - if (outfY[0] > outfY[1]) - { - tmp = outfY[0]; - outfY[0] = outfY[1]; - outfY[1] = tmp; - tmp = outfX[0]; - outfX[0] = outfX[1]; - outfX[1] = tmp; - } - } - else - { - tmp = outfY[0]; - outfY[0] = outfY[1]; - outfY[1] = tmp; - tmp = outfX[0]; - outfX[0] = outfX[1]; - outfX[1] = tmp; - - if (outfY[1] > outfY[2]) - { - tmp = outfY[1]; - outfY[1] = outfY[2]; - outfY[2] = tmp; - tmp = outfX[1]; - outfX[1] = outfX[2]; - outfX[2] = tmp; - } - } - } - else - { - if (outfY[1] > outfY[2]) - { - tmp = outfY[1]; - outfY[1] = outfY[2]; - outfY[2] = tmp; - tmp = outfX[1]; - outfX[1] = outfX[2]; - outfX[2] = tmp; - - if (outfY[0] > outfY[1]) - { - tmp = outfY[0]; - outfY[0] = outfY[1]; - outfY[1] = tmp; - tmp = outfX[0]; - outfX[0] = outfX[1]; - outfX[1] = tmp; - } - } - } -} - -void CSimpleTriangleRasterizer::CallbackFillRectConservative(float _x[3], float _y[3], IRasterizeSink* inpSink) -{ - inpSink->Triangle(m_iMinY); - - float fMinX = (std::min)(_x[0], (std::min)(_x[1], _x[2])); - float fMaxX = (std::max)(_x[0], (std::max)(_x[1], _x[2])); - float fMinY = (std::min)(_y[0], (std::min)(_y[1], _y[2])); - float fMaxY = (std::max)(_y[0], (std::max)(_y[1], _y[2])); - - int iMinX = (std::max)(m_iMinX, (int)floorf(fMinX)); - int iMaxX = (std::min)(m_iMaxX + 1, (int)ceilf(fMaxX)); - int iMinY = (std::max)(m_iMinY, (int)floorf(fMinY)); - int iMaxY = (std::min)(m_iMaxY + 1, (int)ceilf(fMaxY)); - - for (int y = iMinY; y < iMaxY; y++) - { - inpSink->Line(fMinX, fMaxX, iMinX, iMaxX, y); - } -} - - - - -void CSimpleTriangleRasterizer::CallbackFillConservative(float _x[3], float _y[3], IRasterizeSink* inpSink) -{ - float x[3], y[3]; - - CopyAndSortY(_x, _y, x, y); - - // Calculate interpolation steps - float fX1toX2step = 0.0f; - float fX1toX3step = 0.0f; - float fX2toX3step = 0.0f; - if (fabsf(y[1] - y[0]) > FLT_EPSILON) - { - fX1toX2step = (x[1] - x[0]) / (float)(y[1] - y[0]); - } - if (fabsf(y[2] - y[0]) > FLT_EPSILON) - { - fX1toX3step = (x[2] - x[0]) / (float)(y[2] - y[0]); - } - if (fabsf(y[2] - y[1]) > FLT_EPSILON) - { - fX2toX3step = (x[2] - x[1]) / (float)(y[2] - y[1]); - } - - float fX1toX2 = x[0], fX1toX3 = x[0], fX2toX3 = x[1]; - bool bFirstLine = true; - bool bTriangleCallDone = false; - - // Go through the scanlines of the triangle - int yy = (int)floorf(y[0]); // was floor - - for (; yy <= (int)floorf(y[2]); yy++) - // for(yy=m_iMinY; yy<=m_iMaxY; yy++) // juhu - { - float fSubPixelYStart = 0.0f, fSubPixelYEnd = 1.0f; - float start, end; - - // first line - if (bFirstLine) - { - fSubPixelYStart = y[0] - floorf(y[0]); - start = x[0]; - end = x[0]; - bFirstLine = false; - } - else - { - // top part without middle corner line - if (yy <= (int)floorf(y[1])) - { - start = (std::min)(fX1toX2, fX1toX3); - end = (std::max)(fX1toX2, fX1toX3); - } - else - { - start = (std::min)(fX2toX3, fX1toX3); - end = (std::max)(fX2toX3, fX1toX3); - } - } - - // middle corner line - if (yy == (int)floorf(y[1])) - { - fSubPixelYEnd = y[1] - floorf(y[1]); - - fX1toX3 += fX1toX3step * (fSubPixelYEnd - fSubPixelYStart); - start = (std::min)(start, fX1toX3); - end = (std::max)(end, fX1toX3); - start = (std::min)(start, x[1]); - end = (std::max)(end, x[1]); - - fSubPixelYStart = fSubPixelYEnd; - fSubPixelYEnd = 1.0f; - } - - // last line - if (yy == (int)floorf(y[2])) - { - start = (std::min)(start, x[2]); - end = (std::max)(end, x[2]); - } - else - { - // top part without middle corner line - if (yy < (int)floorf(y[1])) - { - fX1toX2 += fX1toX2step * (fSubPixelYEnd - fSubPixelYStart); - start = (std::min)(start, fX1toX2); - end = (std::max)(end, fX1toX2); - } - else - { - fX2toX3 += fX2toX3step * (fSubPixelYEnd - fSubPixelYStart); - start = (std::min)(start, fX2toX3); - end = (std::max)(end, fX2toX3); - } - - fX1toX3 += fX1toX3step * (fSubPixelYEnd - fSubPixelYStart); - start = (std::min)(start, fX1toX3); - end = (std::max)(end, fX1toX3); - } - - if (yy >= m_iMinY && yy <= m_iMaxY) - { - if (!bTriangleCallDone) - { - inpSink->Triangle(yy); - bTriangleCallDone = true; - } - - lambertHorizlineConservative(start, end, yy, inpSink); - } - } -} - - - -void CSimpleTriangleRasterizer::CallbackFillSubpixelCorrect(float _x[3], float _y[3], IRasterizeSink* inpSink) -{ - float x[3], y[3]; - - CopyAndSortY(_x, _y, x, y); - - if (fabs(y[0] - floorf(y[0])) < FLT_EPSILON) - { - y[0] -= FLT_EPSILON; - } - - // Calculate interpolation steps - float fX1toX2step = 0.0f; - float fX1toX3step = 0.0f; - float fX2toX3step = 0.0f; - if (fabsf(y[1] - y[0]) > FLT_EPSILON) - { - fX1toX2step = (x[1] - x[0]) / (y[1] - y[0]); - } - if (fabsf(y[2] - y[0]) > FLT_EPSILON) - { - fX1toX3step = (x[2] - x[0]) / (y[2] - y[0]); - } - if (fabsf(y[2] - y[1]) > FLT_EPSILON) - { - fX2toX3step = (x[2] - x[1]) / (y[2] - y[1]); - } - - float fX1toX2 = x[0], fX1toX3 = x[0], fX2toX3 = x[1]; - bool bFirstLine = true; - bool bTriangleCallDone = false; - - y[0] -= 0.5f; - y[1] -= 0.5f; - y[2] -= 0.5f; - // y[0]=y[0]*1023.f/1024.f+1.f; - // y[1]=y[1]*1023.f/1024.f+1.f; - // y[2]=y[2]*1023.f/1024.f+1.f; - - for (int yy = (int)floorf(y[0]); yy <= (int)floorf(y[2]); yy++) - { - float fSubPixelYStart = 0.0f, fSubPixelYEnd = 1.0f; - float start, end; - - // first line - if (bFirstLine) - { - fSubPixelYStart = y[0] - floorf(y[0]); - start = x[0]; - end = x[0]; - bFirstLine = false; - } - else - { - // top part without middle corner line - if (yy <= (int)floorf(y[1])) - { - start = (std::min)(fX1toX2, fX1toX3); - end = (std::max)(fX1toX2, fX1toX3); - } - else - { - start = (std::min)(fX2toX3, fX1toX3); - end = (std::max)(fX2toX3, fX1toX3); - } - } - - // middle corner line - if (yy == (int)floorf(y[1])) - { - fSubPixelYEnd = y[1] - floorf(y[1]); - - fX1toX3 += fX1toX3step * (fSubPixelYEnd - fSubPixelYStart); - - fSubPixelYStart = fSubPixelYEnd; - fSubPixelYEnd = 1.0f; - } - - // last line - if (yy != (int)floorf(y[2])) - { - // top part without middle corner line - if (yy < (int)floorf(y[1])) - { - fX1toX2 += fX1toX2step * (fSubPixelYEnd - fSubPixelYStart); - } - else - { - fX2toX3 += fX2toX3step * (fSubPixelYEnd - fSubPixelYStart); - } - - fX1toX3 += fX1toX3step * (fSubPixelYEnd - fSubPixelYStart); - } - - if (start != end) - { - if (yy >= m_iMinY && yy <= m_iMaxY) - { - if (!bTriangleCallDone) - { - inpSink->Triangle(yy); - bTriangleCallDone = true; - } - - lambertHorizlineSubpixelCorrect(start, end, yy, inpSink); - } - } - } -} - - - - -// shrink triangle by n pixel, optimizable -void CSimpleTriangleRasterizer::ShrinkTriangle(float inoutfX[3], float inoutfY[3], float infAmount) -{ - float fX[3] = { inoutfX[0], inoutfX[1], inoutfX[2] }; - float fY[3] = { inoutfY[0], inoutfY[1], inoutfY[2] }; - - /* - // move edge to opposing vertex - float dx,dy,fLength; - - for(int a=0;a<3;a++) - { - int b=a+1;if(b>=3)b=0; - int c=b+1;if(c>=3)c=0; - - dx=fX[a]-(fX[b]+fX[c])*0.5f; - dy=fY[a]-(fY[b]+fY[c])*0.5f; - fLength=(float)sqrt(dx*dx+dy*dy); - if(fLength>1.0f) - { - dx/=fLength;dy/=fLength; - inoutfX[b]+=dx;inoutfY[b]+=dy; - inoutfX[c]+=dx;inoutfY[c]+=dy; - } - } - */ - - /* - // move vertex to opposing edge - float dx,dy,fLength; - - for(int a=0;a<3;a++) - { - int b=a+1;if(b>=3)b=0; - int c=b+1;if(c>=3)c=0; - - dx=fX[a]-(fX[b]+fX[c])*0.5f; - dy=fY[a]-(fY[b]+fY[c])*0.5f; - fLength=(float)sqrt(dx*dx+dy*dy); - if(fLength>1.0f) - { - dx/=fLength;dy/=fLength; - inoutfX[a]-=dx;inoutfY[a]-=dy; - } - } - */ - - // move vertex to get edges shifted perpendicular for 1 unit - for (int a = 0; a < 3; a++) - { - float dx1, dy1, dx2, dy2, fLength; - - int b = a + 1; - if (b >= 3) - { - b = 0; - } - int c = b + 1; - if (c >= 3) - { - c = 0; - } - - dx1 = fX[b] - fX[a]; - dy1 = fY[b] - fY[a]; - fLength = (float)sqrt(dx1 * dx1 + dy1 * dy1); - if (infAmount > 0) - { - if (fLength < infAmount) - { - continue; - } - } - if (fLength == 0.0f) - { - continue; - } - dx1 /= fLength; - dy1 /= fLength; - - dx2 = fX[c] - fX[a]; - dy2 = fY[c] - fY[a]; - fLength = (float)sqrt(dx2 * dx2 + dy2 * dy2); - if (infAmount > 0) - { - if (fLength < infAmount) - { - continue; - } - } - if (fLength == 0.0f) - { - continue; - } - dx2 /= fLength; - dy2 /= fLength; - - inoutfX[a] += (dx1 + dx2) * infAmount; - inoutfY[a] += (dy1 + dy2) * infAmount; - } -} diff --git a/Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.h b/Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.h deleted file mode 100644 index bcfdd7b6da..0000000000 --- a/Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_LIGHTMAPCOMPILER_SIMPLETRIANGLERASTERIZER_H -#define CRYINCLUDE_EDITOR_LIGHTMAPCOMPILER_SIMPLETRIANGLERASTERIZER_H -#pragma once - -class CSimpleTriangleRasterizer -{ -public: - - class IRasterizeSink - { - public: - - //! is called once per triangel for the first possible visible line - //! /param iniStartY - virtual void Triangle([[maybe_unused]] const int iniStartY) - { - } - - //! callback function - //! /param infXLeft included - not clipped against left and reight border - //! /param infXRight excluded - not clipped against left and reight border - //! /param iniXLeft included - //! /param iniXRight excluded - //! /param iniY - virtual void Line(const float infXLeft, const float infXRight, - const int iniXLeft, const int iniXRight, const int iniY) = 0; - }; - - typedef unsigned long DWORD; - - // ----------------------------------------------------- - - //! implementation sink sample - class CDWORDFlatFill - : public IRasterizeSink - { - public: - - //! constructor - CDWORDFlatFill(DWORD* inpBuffer, const DWORD indwPitchInPixels, DWORD indwValue) - { - m_dwValue = indwValue; - m_pBuffer = inpBuffer; - m_dwPitchInPixels = indwPitchInPixels; - } - - virtual void Triangle(const int iniY) - { - m_pBufferLine = &m_pBuffer[iniY * m_dwPitchInPixels]; - } - - virtual void Line([[maybe_unused]] const float infXLeft, [[maybe_unused]] const float infXRight, - const int iniLeft, const int iniRight, [[maybe_unused]] const int iniY) - { - DWORD* mem = &m_pBufferLine[iniLeft]; - - for (int x = iniLeft; x < iniRight; x++) - { - *mem++ = m_dwValue; - } - - m_pBufferLine += m_dwPitchInPixels; - } - - private: - DWORD m_dwValue; //!< fill value - DWORD* m_pBufferLine; //!< to get rid of the multiplication per line - - DWORD m_dwPitchInPixels; //!< in DWORDS, not in Bytes - DWORD* m_pBuffer; //!< pointer to the buffer - }; - - // ----------------------------------------------------- - - //! constructor - //! /param iniWidth excluded - //! /param iniHeight excluded - CSimpleTriangleRasterizer(const int iniWidth, const int iniHeight) - { - m_iMinX = 0; - m_iMinY = 0; - m_iMaxX = iniWidth - 1; - m_iMaxY = iniHeight - 1; - } - /* - //! constructor - //! /param iniMinX included - //! /param iniMinY included - //! /param iniMaxX included - //! /param iniMaxY included - CSimpleTriangleRasterizer( const int iniMinX, const int iniMinY, const int iniMaxX, const int iniMaxY ) - { - m_iMinX=iniMinX; - m_iMinY=iniMinY; - m_iMaxX=iniMaxX; - m_iMaxY=iniMaxY; - } - */ - //! simple triangle filler with clipping (optimizable), not subpixel correct - //! /param pBuffer pointer o the color buffer - //! /param indwWidth width of the color buffer - //! /param indwHeight height of the color buffer - //! /param x array of the x coordiantes of the three vertices - //! /param y array of the x coordiantes of the three vertices - //! /param indwValue value of the triangle - void DWORDFlatFill(DWORD* inpBuffer, const DWORD indwPitchInPixels, float x[3], float y[3], DWORD indwValue, bool inbConservative) - { - CDWORDFlatFill pix(inpBuffer, indwPitchInPixels, indwValue); - - if (inbConservative) - { - CallbackFillConservative(x, y, &pix); - } - else - { - CallbackFillSubpixelCorrect(x, y, &pix); - } - } - - // Rectangle around triangle - more stable - use for debugging purpose - void CallbackFillRectConservative(float x[3], float y[3], IRasterizeSink * inpSink); - - - //! subpixel correct triangle filler (conservative or not conservative) - //! \param pBuffer pointe to the DWORD - //! \param indwWidth width of the buffer pBuffer pointes to - //! \param indwHeight height of the buffer pBuffer pointes to - //! \param x array of the x coordiantes of the three vertices - //! \param y array of the x coordiantes of the three vertices - //! \param inpSink pointer to the sink interface (is called per triangle and per triangle line) - void CallbackFillConservative(float x[3], float y[3], IRasterizeSink * inpSink); - - //! subpixel correct triangle filler (conservative or not conservative) - //! \param pBuffer pointe to the DWORD - //! \param indwWidth width of the buffer pBuffer pointes to - //! \param indwHeight height of the buffer pBuffer pointes to - //! \param x array of the x coordiantes of the three vertices - //! \param y array of the x coordiantes of the three vertices - //! \param inpSink pointer to the sink interface (is called per triangle and per triangle line) - void CallbackFillSubpixelCorrect(float x[3], float y[3], IRasterizeSink * inpSink); - - //! - //! /param inoutfX - //! /param inoutfY - //! /param infAmount could be positive or negative - static void ShrinkTriangle(float inoutfX[3], float inoutfY[3], float infAmount); - -private: - - // Clipping Rect; - - int m_iMinX; //!< minimum x value included - int m_iMinY; //!< minimum y value included - int m_iMaxX; //!< maximum x value included - int m_iMaxY; //!< maximum x value included - - void lambertHorizlineConservative(float fx1, float fx2, int y, IRasterizeSink* inpSink); - void lambertHorizlineSubpixelCorrect(float fx1, float fx2, int y, IRasterizeSink* inpSink); - void CopyAndSortY(const float infX[3], const float infY[3], float outfX[3], float outfY[3]); -}; - - -// extension ideas: -// * callback with coverage mask (possible non ordered sampling) -// * z-buffer behaviour -// * gouraud shading -// * texture mapping with nearest/bicubic/bilinear filter -// * further primitives: thick line, ellipse -// * build a template version -// * - -#endif // CRYINCLUDE_EDITOR_LIGHTMAPCOMPILER_SIMPLETRIANGLERASTERIZER_H diff --git a/Code/Editor/Objects/ObjectManager.cpp b/Code/Editor/Objects/ObjectManager.cpp index 1dea6ece7f..06233d4dd2 100644 --- a/Code/Editor/Objects/ObjectManager.cpp +++ b/Code/Editor/Objects/ObjectManager.cpp @@ -26,7 +26,6 @@ #include "Util/Image.h" #include "ObjectManagerLegacyUndo.h" #include "Include/HitContext.h" -#include "EditMode/DeepSelection.h" #include "Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h" #include diff --git a/Code/Editor/Util/FileUtil.cpp b/Code/Editor/Util/FileUtil.cpp index 182a122ea8..ce2d399dcc 100644 --- a/Code/Editor/Util/FileUtil.cpp +++ b/Code/Editor/Util/FileUtil.cpp @@ -42,8 +42,6 @@ #include "CheckOutDialog.h" #include "ISourceControl.h" #include "Dialogs/Generic/UserOptions.h" -#include "IAssetItem.h" -#include "IAssetItemDatabase.h" #include "Include/IObjectManager.h" #include "UsedResources.h" #include "Objects/BaseObject.h" @@ -223,106 +221,6 @@ void CFileUtil::EditTextureFile(const char* textureFile, [[maybe_unused]] bool b } } - -////////////////////////////////////////////////////////////////////////// -bool CFileUtil::CalculateDccFilename(const QString& assetFilename, QString& dccFilename) -{ - if (ExtractDccFilenameFromAssetDatabase(assetFilename, dccFilename)) - { - return true; - } - - if (ExtractDccFilenameUsingNamingConventions(assetFilename, dccFilename)) - { - return true; - } - - GetIEditor()->GetEnv()->pLog->LogError("Failed to find psd file for texture: '%s'", assetFilename.toUtf8().data()); - return false; -} - -////////////////////////////////////////////////////////////////////////// -bool CFileUtil::ExtractDccFilenameFromAssetDatabase(const QString& assetFilename, QString& dccFilename) -{ - IAssetItemDatabase* pCurrentDatabaseInterface = nullptr; - std::vector assetDatabasePlugins; - IEditorClassFactory* pClassFactory = GetIEditor()->GetClassFactory(); - pClassFactory->GetClassesByCategory("Asset Item DB", assetDatabasePlugins); - - for (size_t i = 0; i < assetDatabasePlugins.size(); ++i) - { - if (assetDatabasePlugins[i]->QueryInterface(__az_uuidof(IAssetItemDatabase), (void**)&pCurrentDatabaseInterface) == S_OK) - { - if (!pCurrentDatabaseInterface) - { - continue; - } - - QString assetDatabaseDccFilename; - IAssetItem* pAssetItem = pCurrentDatabaseInterface->GetAsset(assetFilename.toUtf8().data()); - if (pAssetItem) - { - if ((pAssetItem->GetFlags() & IAssetItem::eFlag_Cached)) - { - QVariant v = pAssetItem->GetAssetFieldValue("dccfilename"); - assetDatabaseDccFilename = v.toString(); - if (!v.isNull()) - { - dccFilename = assetDatabaseDccFilename; - dccFilename = Path::GetRelativePath(dccFilename, false); - - uint32 attr = CFileUtil::GetAttributes(dccFilename.toUtf8().data()); - - if (CFileUtil::FileExists(dccFilename)) - { - return true; - } - else if (GetIEditor()->IsSourceControlAvailable() && (attr & SCC_FILE_ATTRIBUTE_MANAGED)) - { - return CFileUtil::GetLatestFromSourceControl(dccFilename.toUtf8().data()); - } - } - } - } - } - } - return false; -} - -////////////////////////////////////////////////////////////////////////// -bool CFileUtil::ExtractDccFilenameUsingNamingConventions(const QString& assetFilename, QString& dccFilename) -{ - //else to try find it by naming conventions - QString tempStr = assetFilename; - int foundSplit = -1; - if ((foundSplit = tempStr.lastIndexOf('.')) > 0) - { - QString first = tempStr.mid(0, foundSplit); - tempStr = first + ".psd"; - } - if (CFileUtil::FileExists(tempStr)) - { - dccFilename = tempStr; - return true; - } - - //else try to find it by replacing post fix _ with .psd - tempStr = assetFilename; - foundSplit = -1; - if ((foundSplit = tempStr.lastIndexOf('_')) > 0) - { - QString first = tempStr.mid(0, foundSplit); - tempStr = first + ".psd"; - } - if (CFileUtil::FileExists(tempStr)) - { - dccFilename = tempStr; - return true; - } - - return false; -} - ////////////////////////////////////////////////////////////////////////// void CFileUtil::FormatFilterString(QString& filter) { diff --git a/Code/Editor/Util/FileUtil.h b/Code/Editor/Util/FileUtil.h index fc0fc942fe..a4ff5009a2 100644 --- a/Code/Editor/Util/FileUtil.h +++ b/Code/Editor/Util/FileUtil.h @@ -29,9 +29,6 @@ public: static void EditTextFile(const char* txtFile, int line = 0, IFileUtil::ETextFileType fileType = IFileUtil::FILE_TYPE_SCRIPT); static void EditTextureFile(const char* txtureFile, bool bUseGameFolder); - //! dcc filename calculation and extraction sub-routines - static bool CalculateDccFilename(const QString& assetFilename, QString& dccFilename); - //! Reformat filter string for (MFC) CFileDialog style file filtering static void FormatFilterString(QString& filter); @@ -155,9 +152,6 @@ private: // Keep this variant of this method private! pIsSelected is captured in a lambda, and so requires menu use exec() and never use show() static void PopulateQMenu(QWidget* caller, QMenu* menu, AZStd::string_view fullGamePath, bool* pIsSelected); - - static bool ExtractDccFilenameFromAssetDatabase(const QString& assetFilename, QString& dccFilename); - static bool ExtractDccFilenameUsingNamingConventions(const QString& assetFilename, QString& dccFilename); }; class CAutoRestorePrimaryCDRoot diff --git a/Code/Editor/Util/FileUtil_impl.cpp b/Code/Editor/Util/FileUtil_impl.cpp index 28090d28d5..31e3532f33 100644 --- a/Code/Editor/Util/FileUtil_impl.cpp +++ b/Code/Editor/Util/FileUtil_impl.cpp @@ -30,11 +30,6 @@ void CFileUtil_impl::EditTextureFile(const char* txtureFile, bool bUseGameFolder CFileUtil::EditTextureFile(txtureFile, bUseGameFolder); } -bool CFileUtil_impl::CalculateDccFilename(const QString& assetFilename, QString& dccFilename) -{ - return CFileUtil::CalculateDccFilename(assetFilename, dccFilename); -} - void CFileUtil_impl::FormatFilterString(QString& filter) { CFileUtil::FormatFilterString(filter); diff --git a/Code/Editor/Util/FileUtil_impl.h b/Code/Editor/Util/FileUtil_impl.h index aa8d0bf3b5..3c8e138dab 100644 --- a/Code/Editor/Util/FileUtil_impl.h +++ b/Code/Editor/Util/FileUtil_impl.h @@ -39,9 +39,6 @@ public: bool ExtractFile(QString& file, bool bMsgBoxAskForExtraction = true, const char* pDestinationFilename = nullptr) override; void EditTextureFile(const char* txtureFile, bool bUseGameFolder) override; - //! dcc filename calculation and extraction sub-routines - bool CalculateDccFilename(const QString& assetFilename, QString& dccFilename) override; - //! Reformat filter string for (MFC) CFileDialog style file filtering void FormatFilterString(QString& filter) override; diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index a018333925..c81a326aff 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -269,9 +269,6 @@ set(FILES LevelTreeModel.h Include/Command.h Include/HitContext.h - Include/IAnimationCompressionManager.h - Include/IAssetItem.h - Include/IAssetItemDatabase.h Include/ICommandManager.h Include/IConsoleConnectivity.h Include/IDataBaseItem.h @@ -457,18 +454,14 @@ set(FILES GameResourcesExporter.cpp GameExporter.h GameResourcesExporter.h - Geometry/TriMesh.cpp - Geometry/TriMesh.h AboutDialog.h AboutDialog.ui DocMultiArchive.h - EditMode/DeepSelection.h FBXExporterDialog.h FileTypeUtils.h GridUtils.h IObservable.h IPostRenderer.h - LightmapCompiler/SimpleTriangleRasterizer.h ToolBox.h TrackViewNewSequenceDialog.h UndoConfigSpec.h @@ -559,11 +552,9 @@ set(FILES AboutDialog.cpp ErrorReportTableModel.h ErrorReportTableModel.cpp - EditMode/DeepSelection.cpp FBXExporterDialog.cpp FBXExporterDialog.ui FileTypeUtils.cpp - LightmapCompiler/SimpleTriangleRasterizer.cpp ToolBox.cpp TrackViewNewSequenceDialog.cpp TrackViewNewSequenceDialog.ui From f71efa8b9bde2b48e04f8e88e57db45cceca4d27 Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Wed, 5 Jan 2022 14:16:35 -0600 Subject: [PATCH 275/399] Updating KillAllLyProcesses tests to expect o3de.exe process Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- Tools/LyTestTools/tests/unit/test_editor_test_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tools/LyTestTools/tests/unit/test_editor_test_utils.py b/Tools/LyTestTools/tests/unit/test_editor_test_utils.py index cd361d9e8a..849fa5c391 100644 --- a/Tools/LyTestTools/tests/unit/test_editor_test_utils.py +++ b/Tools/LyTestTools/tests/unit/test_editor_test_utils.py @@ -17,14 +17,15 @@ class TestEditorTestUtils(unittest.TestCase): @mock.patch('ly_test_tools.environment.process_utils.kill_processes_named') def test_KillAllLyProcesses_IncludeAP_CallsCorrectly(self, mock_kill_processes_named): - process_list = ['Editor', 'Profiler', 'RemoteConsole', 'AssetProcessor', 'AssetProcessorBatch', 'AssetBuilder'] + process_list = ['Editor', 'Profiler', 'RemoteConsole', 'o3de', 'AssetProcessor', 'AssetProcessorBatch', + 'AssetBuilder'] editor_test_utils.kill_all_ly_processes(include_asset_processor=True) mock_kill_processes_named.assert_called_once_with(process_list, ignore_extensions=True) @mock.patch('ly_test_tools.environment.process_utils.kill_processes_named') def test_KillAllLyProcesses_NotIncludeAP_CallsCorrectly(self, mock_kill_processes_named): - process_list = ['Editor', 'Profiler', 'RemoteConsole'] + process_list = ['Editor', 'Profiler', 'RemoteConsole', 'o3de'] ap_process_list = ['AssetProcessor', 'AssetProcessorBatch', 'AssetBuilder'] editor_test_utils.kill_all_ly_processes(include_asset_processor=False) From 9c85cd19a77fde4da716ad7a97ccd4f92ed0f5dc Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Wed, 5 Jan 2022 14:17:01 -0600 Subject: [PATCH 276/399] Skipping Docking test due to unknown Jenkins failure Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../Gem/PythonTests/editor/TestSuite_Main_Optimized.py | 1 + 1 file changed, 1 insertion(+) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py index 058c309652..7e07d125fd 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py @@ -66,6 +66,7 @@ class TestAutomationAutoTestMode(EditorTestSuite): class test_ComponentCRUD_Add_Delete_Components(EditorSharedTest): from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module + @pytest.mark.skip("Passes locally, fails on Jenkins") class test_Docking_BasicDockedTools(EditorSharedTest): from .EditorScripts import Docking_BasicDockedTools as test_module From 55fb63da48bae2efeb76478480b09e0e1b8d70e3 Mon Sep 17 00:00:00 2001 From: Roman <69218254+amzn-rhhong@users.noreply.github.com> Date: Wed, 5 Jan 2022 12:54:41 -0800 Subject: [PATCH 277/399] Debug render aabb now include node, mesh and static aabb. (#6685) Signed-off-by: rhhong --- .../Code/Source/AtomActorDebugDraw.cpp | 46 +++++++++++++++++-- .../Code/Source/AtomActorDebugDraw.h | 8 +++- .../Source/RenderPlugin/RenderOptions.cpp | 2 + .../Rendering/RenderActorSettings.h | 9 +++- 4 files changed, 59 insertions(+), 6 deletions(-) diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.cpp index 421e5828b1..21f9f69f7c 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.cpp @@ -63,7 +63,10 @@ namespace AZ::Render // Render aabb if (renderFlags[EMotionFX::ActorRenderFlag::RENDER_AABB]) { - RenderAABB(instance, renderActorSettings.m_staticAABBColor); + RenderAABB(instance, + renderActorSettings.m_enabledNodeBasedAabb, renderActorSettings.m_nodeAABBColor, + renderActorSettings.m_enabledMeshBasedAabb, renderActorSettings.m_meshAABBColor, + renderActorSettings.m_enabledStaticBasedAabb, renderActorSettings.m_staticAABBColor); } // Render simple line skeleton @@ -201,11 +204,46 @@ namespace AZ::Render return AzFramework::DebugDisplayRequestBus::FindFirstHandler(debugDisplayBus); } - void AtomActorDebugDraw::RenderAABB(EMotionFX::ActorInstance* instance, const AZ::Color& aabbColor) + void AtomActorDebugDraw::RenderAABB(EMotionFX::ActorInstance* instance, + bool enableNodeAabb, + const AZ::Color& nodeAabbColor, + bool enableMeshAabb, + const AZ::Color& meshAabbColor, + bool enableStaticAabb, + const AZ::Color& staticAabbColor) { RPI::AuxGeomDrawPtr auxGeom = m_auxGeomFeatureProcessor->GetDrawQueue(); - const AZ::Aabb& aabb = instance->GetAabb(); - auxGeom->DrawAabb(aabb, aabbColor, RPI::AuxGeomDraw::DrawStyle::Line); + + if (enableNodeAabb) + { + AZ::Aabb aabb; + instance->CalcNodeBasedAabb(&aabb); + if (aabb.IsValid()) + { + auxGeom->DrawAabb(aabb, nodeAabbColor, RPI::AuxGeomDraw::DrawStyle::Line); + } + } + + if (enableMeshAabb) + { + AZ::Aabb aabb; + const size_t lodLevel = instance->GetLODLevel(); + instance->CalcMeshBasedAabb(lodLevel, &aabb); + if (aabb.IsValid()) + { + auxGeom->DrawAabb(aabb, meshAabbColor, RPI::AuxGeomDraw::DrawStyle::Line); + } + } + + if (enableStaticAabb) + { + AZ::Aabb aabb; + instance->CalcStaticBasedAabb(&aabb); + if (aabb.IsValid()) + { + auxGeom->DrawAabb(aabb, staticAabbColor, RPI::AuxGeomDraw::DrawStyle::Line); + } + } } void AtomActorDebugDraw::RenderLineSkeleton(EMotionFX::ActorInstance* instance, const AZ::Color& skeletonColor) diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.h b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.h index 3c0258cfef..8e985fdbc6 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.h +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.h @@ -49,7 +49,13 @@ namespace AZ::Render void PrepareForMesh(EMotionFX::Mesh* mesh, const AZ::Transform& worldTM); AzFramework::DebugDisplayRequests* GetDebugDisplay(AzFramework::ViewportId viewportId); - void RenderAABB(EMotionFX::ActorInstance* instance, const AZ::Color& aabbColor); + void RenderAABB(EMotionFX::ActorInstance* instance, + bool enableNodeAabb, + const AZ::Color& nodeAabbColor, + bool enableMeshAabb, + const AZ::Color& meshAabbColor, + bool enableStaticAabb, + const AZ::Color& staticAabbColor); void RenderLineSkeleton(EMotionFX::ActorInstance* instance, const AZ::Color& skeletonColor); void RenderSkeleton(EMotionFX::ActorInstance* instance, const AZ::Color& skeletonColor); void RenderEMFXDebugDraw(EMotionFX::ActorInstance* instance); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderOptions.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderOptions.cpp index 241412c6c8..cc344db488 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderOptions.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderOptions.cpp @@ -1071,6 +1071,8 @@ namespace EMStudio settings.m_mirroredBitangentsColor = m_mirroredBitangentsColor; settings.m_bitangentsColor = m_bitangentsColor; settings.m_wireframeColor = m_wireframeColor; + settings.m_nodeAABBColor = m_nodeAABBColor; + settings.m_meshAABBColor = m_meshAABBColor; settings.m_staticAABBColor = m_staticAABBColor; settings.m_skeletonColor = m_skeletonColor; settings.m_lineSkeletonColor = m_lineSkeletonColor; diff --git a/Gems/EMotionFX/Code/Source/Integration/Rendering/RenderActorSettings.h b/Gems/EMotionFX/Code/Source/Integration/Rendering/RenderActorSettings.h index 0260d1aae5..8663b768c8 100644 --- a/Gems/EMotionFX/Code/Source/Integration/Rendering/RenderActorSettings.h +++ b/Gems/EMotionFX/Code/Source/Integration/Rendering/RenderActorSettings.h @@ -28,6 +28,10 @@ namespace AZ::Render float m_wireframeScale = 1.0f; float m_nodeOrientationScale = 1.0f; + bool m_enabledNodeBasedAabb = true; + bool m_enabledMeshBasedAabb = true; + bool m_enabledStaticBasedAabb = true; + AZ::Color m_hitDetectionColliderColor{0.44f, 0.44f, 0.44f, 1.0f}; AZ::Color m_selectedHitDetectionColliderColor{ 0.3f, 0.56f, 0.88f, 1.0f }; AZ::Color m_ragdollColliderColor{ 0.44f, 0.44f, 0.44f, 1.0f }; @@ -44,9 +48,12 @@ namespace AZ::Render AZ::Color m_mirroredBitangentsColor{ 1.0f, 1.0f, 0.0f, 1.0f }; AZ::Color m_bitangentsColor{ 1.0f, 1.0f, 1.0f, 1.0f }; AZ::Color m_wireframeColor{ 0.0f, 0.0f, 0.0f, 1.0f }; - AZ::Color m_staticAABBColor{ 0.0f, 0.7f, 0.7f, 1.0f }; AZ::Color m_lineSkeletonColor{ 0.33333f, 1.0f, 0.0f, 1.0f }; AZ::Color m_skeletonColor{ 0.19f, 0.58f, 0.19f, 1.0f }; AZ::Color m_jointNameColor{ 1.0f, 1.0f, 1.0f, 1.0f }; + + AZ::Color m_nodeAABBColor{ 1.0f, 0.0f, 0.0f, 1.0f }; + AZ::Color m_meshAABBColor{ 0.0f, 0.0f, 0.7f, 1.0f }; + AZ::Color m_staticAABBColor{ 0.0f, 0.7f, 0.7f, 1.0f }; }; } // namespace AZ::Render From d347a9d2c034dea3878ce357060b7e040bee6885 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Wed, 5 Jan 2022 12:56:22 -0800 Subject: [PATCH 278/399] Fix Linux build (a static_assert unfortunately fires for Clang) Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index af6d86d699..824b38e47b 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -352,7 +352,7 @@ namespace AZ::Dom } else { - static_assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); + AZ_Assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); } }, m_value); From 6c3d5c434ebf166f3632f8a4e8257d0f8d09f440 Mon Sep 17 00:00:00 2001 From: Allen Jackson <23512001+jackalbe@users.noreply.github.com> Date: Wed, 5 Jan 2022 16:08:58 -0600 Subject: [PATCH 279/399] {lyn8865} Adding DataTypes::ScriptProcessorFallbackLogic (#6396) * {lyn8865} Adding DataTypes::ScriptProcessorFallbackLogic - Give the user an option how to handle fallback logic for script rules Signed-off-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> * the new code found an error in a Python script... it seems to work! Signed-off-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> * fixing up the regression test Signed-off-by: Jackson <23512001+jackalbe@users.noreply.github.com> * dump version number Signed-off-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> --- .../python_builder.py | 2 +- .../TestAssets/test_chunks_builder.py | 2 +- .../DataTypes/Rules/IScriptProcessorRule.h | 8 ++ .../Behaviors/ScriptProcessorRuleBehavior.cpp | 26 ++++++- .../Behaviors/ScriptProcessorRuleBehavior.h | 2 +- .../SceneData/Rules/ScriptProcessorRule.cpp | 17 ++++- .../SceneData/Rules/ScriptProcessorRule.h | 3 + .../SceneManifest/SceneManifestRuleTests.cpp | 75 +++++++++++++++++++ 8 files changed, 126 insertions(+), 9 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/fbx_tests/assets/TwoSceneFiles_OneWithPythonOneWithout_PythonOnlyRunsOnFirstScene/python_builder.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/fbx_tests/assets/TwoSceneFiles_OneWithPythonOneWithout_PythonOnlyRunsOnFirstScene/python_builder.py index 7ad5894a86..a9759e3d33 100644 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/fbx_tests/assets/TwoSceneFiles_OneWithPythonOneWithout_PythonOnlyRunsOnFirstScene/python_builder.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/fbx_tests/assets/TwoSceneFiles_OneWithPythonOneWithout_PythonOnlyRunsOnFirstScene/python_builder.py @@ -23,7 +23,7 @@ def output_test_data(scene): # Just write something to the file, but the filename is the main information # used for the test. f.write(f"scene.sourceFilename: {scene.sourceFilename}\n") - return True + return '' mySceneJobHandler = None diff --git a/AutomatedTesting/TestAssets/test_chunks_builder.py b/AutomatedTesting/TestAssets/test_chunks_builder.py index 2fd1ad9db9..b18902a34c 100755 --- a/AutomatedTesting/TestAssets/test_chunks_builder.py +++ b/AutomatedTesting/TestAssets/test_chunks_builder.py @@ -28,7 +28,7 @@ def update_manifest(scene): meshGroup = sceneManifest.add_mesh_group(chunkName) meshGroup['id'] = '{' + str(uuid.uuid5(uuid.NAMESPACE_DNS, scene.sourceFilename + chunkName)) + '}' sceneManifest.mesh_group_add_comment(meshGroup, 'auto generated by test_chunks_builder') - sceneManifest.mesh_group_set_origin(meshGroup, None, 0, 0, 0, 1.0) + sceneManifest.mesh_group_add_advanced_coordinate_system(meshGroup) for meshIndex in range(len(chunkNameList)): if (activeMeshIndex == meshIndex): sceneManifest.mesh_group_select_node(meshGroup, chunkNameList[meshIndex]) diff --git a/Code/Tools/SceneAPI/SceneCore/DataTypes/Rules/IScriptProcessorRule.h b/Code/Tools/SceneAPI/SceneCore/DataTypes/Rules/IScriptProcessorRule.h index 36be5f61d3..2b2abae561 100644 --- a/Code/Tools/SceneAPI/SceneCore/DataTypes/Rules/IScriptProcessorRule.h +++ b/Code/Tools/SceneAPI/SceneCore/DataTypes/Rules/IScriptProcessorRule.h @@ -17,6 +17,12 @@ namespace AZ { namespace DataTypes { + enum class ScriptProcessorFallbackLogic + { + FailBuild, // this will log error & fail the build + ContinueBuild // this will log the errors but continue the build logic + }; + class IScriptProcessorRule : public IRule { @@ -26,6 +32,8 @@ namespace AZ virtual ~IScriptProcessorRule() override = default; virtual const AZStd::string& GetScriptFilename() const = 0; + + virtual ScriptProcessorFallbackLogic GetScriptProcessorFallbackLogic() const = 0; }; } // DataTypes } // SceneAPI diff --git a/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp b/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp index 8d413b6038..6046bfa620 100644 --- a/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp +++ b/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp @@ -173,10 +173,13 @@ namespace AZ::SceneAPI::Behaviors UnloadPython(); } - bool ScriptProcessorRuleBehavior::LoadPython(const AZ::SceneAPI::Containers::Scene& scene, AZStd::string& scriptPath) + bool ScriptProcessorRuleBehavior::LoadPython(const AZ::SceneAPI::Containers::Scene& scene, AZStd::string& scriptPath, Events::ProcessingResult& fallbackResult) { + using namespace AZ::SceneAPI; + + fallbackResult = Events::ProcessingResult::Failure; int scriptDiscoveryAttempts = 0; - const AZ::SceneAPI::Containers::SceneManifest& manifest = scene.GetManifest(); + const Containers::SceneManifest& manifest = scene.GetManifest(); auto view = Containers::MakeDerivedFilterView(manifest.GetValueStorage()); for (const auto& scriptItem : view) { @@ -188,6 +191,8 @@ namespace AZ::SceneAPI::Behaviors } ++scriptDiscoveryAttempts; + fallbackResult = (scriptItem.GetScriptProcessorFallbackLogic() == DataTypes::ScriptProcessorFallbackLogic::ContinueBuild) ? + Events::ProcessingResult::Ignored : Events::ProcessingResult::Failure; // check for file exist via absolute path if (!IO::FileIOBase::GetInstance()->Exists(scriptFilename.c_str())) @@ -301,7 +306,8 @@ namespace AZ::SceneAPI::Behaviors } }; - if (LoadPython(context.GetScene(), scriptPath)) + [[maybe_unused]] Events::ProcessingResult fallbackResult; + if (LoadPython(context.GetScene(), scriptPath, fallbackResult)) { EditorPythonConsoleNotificationHandler logger; m_editorPythonEventsInterface->ExecuteWithLock(executeCallback); @@ -333,8 +339,9 @@ namespace AZ::SceneAPI::Behaviors return Events::ProcessingResult::Ignored; } + Events::ProcessingResult fallbackResult; AZStd::string scriptPath; - if (LoadPython(scene, scriptPath)) + if (LoadPython(scene, scriptPath, fallbackResult)) { AZStd::string manifestUpdate; auto executeCallback = [&scene, &manifestUpdate, &scriptPath]() @@ -349,6 +356,12 @@ namespace AZ::SceneAPI::Behaviors EditorPythonConsoleNotificationHandler logger; m_editorPythonEventsInterface->ExecuteWithLock(executeCallback); + // if the returned scene manifest is empty then ignore the script update + if (manifestUpdate.empty()) + { + return Events::ProcessingResult::Ignored; + } + EntityUtilityBus::Broadcast(&EntityUtilityBus::Events::ResetEntityContext); AZ::Interface::Get()->RemoveAllTemplates(); @@ -364,6 +377,11 @@ namespace AZ::SceneAPI::Behaviors } return Events::ProcessingResult::Success; } + else + { + // if the manifest was not updated by the script, then return back the fallback result + return fallbackResult; + } } return Events::ProcessingResult::Ignored; } diff --git a/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.h b/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.h index a9ddf88df9..8903a8f257 100644 --- a/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.h +++ b/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.h @@ -54,7 +54,7 @@ namespace AZ::SceneAPI::Behaviors SCENE_DATA_API void GetManifestDependencyPaths(AZStd::vector& paths) override; protected: - bool LoadPython(const AZ::SceneAPI::Containers::Scene& scene, AZStd::string& scriptPath); + bool LoadPython(const AZ::SceneAPI::Containers::Scene& scene, AZStd::string& scriptPath, Events::ProcessingResult& fallbackResult); void UnloadPython(); bool DoPrepareForExport(Events::PreExportEventContext& context); diff --git a/Code/Tools/SceneAPI/SceneData/Rules/ScriptProcessorRule.cpp b/Code/Tools/SceneAPI/SceneData/Rules/ScriptProcessorRule.cpp index 5893764eb1..15c8c1b7f3 100644 --- a/Code/Tools/SceneAPI/SceneData/Rules/ScriptProcessorRule.cpp +++ b/Code/Tools/SceneAPI/SceneData/Rules/ScriptProcessorRule.cpp @@ -14,6 +14,9 @@ namespace AZ { + // Enum types must have a TypeId tied to it in order for the reflection to succeed. + AZ_TYPE_INFO_SPECIALIZE(SceneAPI::DataTypes::ScriptProcessorFallbackLogic, "{3DCABF3D-E8EF-43E7-B3C7-373E05825F60}"); + namespace SceneAPI { namespace SceneData @@ -23,13 +26,23 @@ namespace AZ return m_scriptFilename; } + DataTypes::ScriptProcessorFallbackLogic ScriptProcessorRule::GetScriptProcessorFallbackLogic() const + { + return m_fallbackLogic; + } + void ScriptProcessorRule::Reflect(AZ::ReflectContext* context) { AZ::SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { - serializeContext->Class()->Version(1) - ->Field("scriptFilename", &ScriptProcessorRule::m_scriptFilename); + serializeContext->Class()->Version(2) + ->Field("scriptFilename", &ScriptProcessorRule::m_scriptFilename) + ->Field("fallbackLogic", &ScriptProcessorRule::m_fallbackLogic); + + serializeContext->Enum() + ->Value("FailBuild", DataTypes::ScriptProcessorFallbackLogic::FailBuild) + ->Value("ContinueBuild", DataTypes::ScriptProcessorFallbackLogic::ContinueBuild); AZ::EditContext* editContext = serializeContext->GetEditContext(); if (editContext) diff --git a/Code/Tools/SceneAPI/SceneData/Rules/ScriptProcessorRule.h b/Code/Tools/SceneAPI/SceneData/Rules/ScriptProcessorRule.h index ad5e1de063..80cb670f9f 100644 --- a/Code/Tools/SceneAPI/SceneData/Rules/ScriptProcessorRule.h +++ b/Code/Tools/SceneAPI/SceneData/Rules/ScriptProcessorRule.h @@ -35,10 +35,13 @@ namespace AZ m_scriptFilename = AZStd::move(scriptFilename); } + DataTypes::ScriptProcessorFallbackLogic GetScriptProcessorFallbackLogic() const override; + static void Reflect(ReflectContext* context); protected: AZStd::string m_scriptFilename; + DataTypes::ScriptProcessorFallbackLogic m_fallbackLogic = DataTypes::ScriptProcessorFallbackLogic::FailBuild; }; } // SceneData } // SceneAPI diff --git a/Code/Tools/SceneAPI/SceneData/Tests/SceneManifest/SceneManifestRuleTests.cpp b/Code/Tools/SceneAPI/SceneData/Tests/SceneManifest/SceneManifestRuleTests.cpp index e0d5cca484..2bbbc1054a 100644 --- a/Code/Tools/SceneAPI/SceneData/Tests/SceneManifest/SceneManifestRuleTests.cpp +++ b/Code/Tools/SceneAPI/SceneData/Tests/SceneManifest/SceneManifestRuleTests.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -271,5 +272,79 @@ namespace AZ auto update = scriptProcessorRuleBehavior.UpdateManifest(scene, AssetImportRequest::Update, AssetImportRequest::Generic); EXPECT_EQ(update, ProcessingResult::Ignored); } + + TEST_F(SceneManifest_JSON, ScriptProcessorRule_DefaultFallbackLogic_Works) + { + using namespace AZ::SceneAPI; + + constexpr const char* defaultJson = { R"JSON( + { + "values": [ + { + "$type": "ScriptProcessorRule", + "scriptFilename": "foo.py" + } + ] + })JSON" }; + + auto scene = Containers::Scene("mock"); + auto result = scene.GetManifest().LoadFromString(defaultJson, m_serializeContext.get(), m_jsonRegistrationContext.get()); + EXPECT_TRUE(result.IsSuccess()); + EXPECT_FALSE(scene.GetManifest().IsEmpty()); + ASSERT_EQ(scene.GetManifest().GetEntryCount(), 1); + + auto view = Containers::MakeDerivedFilterView(scene.GetManifest().GetValueStorage()); + EXPECT_EQ(view.begin()->GetScriptProcessorFallbackLogic(), DataTypes::ScriptProcessorFallbackLogic::FailBuild); + } + + TEST_F(SceneManifest_JSON, ScriptProcessorRule_ExplicitFallbackLogic_Works) + { + using namespace AZ::SceneAPI; + + constexpr const char* fallbackLogicJson = { R"JSON( + { + "values": [ + { + "$type": "ScriptProcessorRule", + "scriptFilename": "foo.py", + "fallbackLogic": "FailBuild" + } + ] + })JSON" }; + + auto scene = Containers::Scene("mock"); + auto result = scene.GetManifest().LoadFromString(fallbackLogicJson, m_serializeContext.get(), m_jsonRegistrationContext.get()); + EXPECT_TRUE(result.IsSuccess()); + EXPECT_FALSE(scene.GetManifest().IsEmpty()); + ASSERT_EQ(scene.GetManifest().GetEntryCount(), 1); + + auto view = Containers::MakeDerivedFilterView(scene.GetManifest().GetValueStorage()); + EXPECT_EQ(view.begin()->GetScriptProcessorFallbackLogic(), DataTypes::ScriptProcessorFallbackLogic::FailBuild); + } + + TEST_F(SceneManifest_JSON, ScriptProcessorRule_ContinueBuildFallbackLogic_Works) + { + using namespace AZ::SceneAPI; + + constexpr const char* fallbackLogicJson = { R"JSON( + { + "values": [ + { + "$type": "ScriptProcessorRule", + "scriptFilename": "foo.py", + "fallbackLogic": "ContinueBuild" + } + ] + })JSON" }; + + auto scene = Containers::Scene("mock"); + auto result = scene.GetManifest().LoadFromString(fallbackLogicJson, m_serializeContext.get(), m_jsonRegistrationContext.get()); + EXPECT_TRUE(result.IsSuccess()); + EXPECT_FALSE(scene.GetManifest().IsEmpty()); + ASSERT_EQ(scene.GetManifest().GetEntryCount(), 1); + + auto view = Containers::MakeDerivedFilterView(scene.GetManifest().GetValueStorage()); + EXPECT_EQ(view.begin()->GetScriptProcessorFallbackLogic(), DataTypes::ScriptProcessorFallbackLogic::ContinueBuild); + } } } From 6ae8c6343194e58712eb620958ee9021555bdcab Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Wed, 5 Jan 2022 16:27:21 -0600 Subject: [PATCH 280/399] Re-enabling Periodic suite for testing on Jenkins Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../Gem/PythonTests/editor/CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt index 1fc71da972..a43b3647f9 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt @@ -50,4 +50,17 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ Editor ) + ly_add_pytest( + NAME AutomatedTesting::EditorTests_Periodic + TEST_SUITE periodic + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Periodic.py + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT + Editor + ) + endif() From 7d9f9f99e657af79cbe6000ccadfa79272c4410f Mon Sep 17 00:00:00 2001 From: mrieggeramzn Date: Wed, 5 Jan 2022 14:50:03 -0800 Subject: [PATCH 281/399] fix unit test Signed-off-by: mrieggeramzn --- .../Tests/PropertyIntCtrlCommonTests.h | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h b/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h index 712eeb99b7..d4f0c8d705 100644 --- a/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h +++ b/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h @@ -12,6 +12,7 @@ #include #include "IntegerPrimtitiveTestConfig.h" #include +#include #include namespace UnitTest @@ -83,18 +84,6 @@ namespace UnitTest widget->setMaximum(widget->maximum() - 1); } - static std::string GetToolTipStringAtLimits() - { - if constexpr (std::is_signed::value) - { - return "[-INF, INF]"; - } - else - { - return "[0, INF]"; - } - } - void PropertyCtrlHandlersCreated() { using ::testing::Ne; @@ -125,15 +114,19 @@ namespace UnitTest auto& widget = m_widget; auto& handler = m_handler; QString tooltip; - std::string expected; + std::stringstream expected; // Retrieve the tooltip string for this widget auto success = handler->ModifyTooltip(widget, tooltip); - expected = GetToolTipStringAtLimits(); + + const QString minString = QLocale().toString(widget->minimum()); + const QString maxString = QLocale().toString(widget->maximum()); + + expected << "[" << minString.toStdString() << ", " << maxString.toStdString() << "]"; // Expect the operation to be successful and a valid limit tooltip string generated EXPECT_TRUE(success); - EXPECT_STREQ(tooltip.toStdString().c_str(), expected.c_str()); + EXPECT_STREQ(tooltip.toStdString().c_str(), expected.str().c_str()); } void HandlerMinMaxLessLimit_ModifyHandler_ExpectSuccessAndValidLessLimitToolTipString() @@ -149,7 +142,11 @@ namespace UnitTest // Retrieve the tooltip string for this widget auto success = handler->ModifyTooltip(widget, tooltip); - expected << "[" << widget->minimum() << ", " << widget->maximum() << "]"; + + const QString minString = QLocale().toString(widget->minimum()); + const QString maxString = QLocale().toString(widget->maximum()); + + expected << "[" << minString.toStdString() << ", " << maxString.toStdString() << "]"; // Expect the operation to be successful and a valid less than limit tooltip string generated EXPECT_TRUE(success); From 01c5fb78178eeefd74172ba0556461dcc5c6b0b2 Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Wed, 5 Jan 2022 15:27:52 -0800 Subject: [PATCH 282/399] Add clamp mode to Draw2d (#6630) Signed-off-by: abrmich --- Gems/LyShine/Code/Include/LyShine/Draw2d.h | 11 ++++++++++- Gems/LyShine/Code/Source/Draw2d.cpp | 22 +++++++++++++++++----- Gems/LyShine/Code/Source/LyShine.cpp | 10 ++++++++-- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/Gems/LyShine/Code/Include/LyShine/Draw2d.h b/Gems/LyShine/Code/Include/LyShine/Draw2d.h index 881479bd23..f92c6ce2e1 100644 --- a/Gems/LyShine/Code/Include/LyShine/Draw2d.h +++ b/Gems/LyShine/Code/Include/LyShine/Draw2d.h @@ -50,6 +50,7 @@ public: // types { AZ::Vector3 color = AZ::Vector3(1.0f, 1.0f, 1.0f); Rounding pixelRounding = Rounding::Nearest; + bool m_clamp = false; RenderState m_renderState; }; @@ -145,6 +146,7 @@ public: // member functions virtual void DrawQuad(AZ::Data::Instance image, VertexPosColUV* verts, Rounding pixelRounding = Rounding::Nearest, + bool clamp = false, const RenderState& renderState = RenderState{}); //! Draw a line @@ -257,6 +259,8 @@ protected: // types and constants { AZ::RHI::ShaderInputImageIndex m_imageInputIndex; AZ::RHI::ShaderInputConstantIndex m_viewProjInputIndex; + AZ::RPI::ShaderVariantId m_shaderOptionsClamp; + AZ::RPI::ShaderVariantId m_shaderOptionsWrap; }; class DeferredPrimitive @@ -281,6 +285,7 @@ protected: // types and constants AZ::Vector2 m_texCoords[4]; uint32 m_packedColors[4]; AZ::Data::Instance m_image; + bool m_clamp; RenderState m_renderState; }; @@ -455,11 +460,12 @@ public: // member functions //! See IDraw2d:DrawQuad for parameter descriptions void DrawQuad(AZ::Data::Instance image, CDraw2d::VertexPosColUV* verts, IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, + bool clamp = false, const CDraw2d::RenderState& renderState = CDraw2d::RenderState{}) { if (m_draw2d) { - m_draw2d->DrawQuad(image, verts, pixelRounding, renderState); + m_draw2d->DrawQuad(image, verts, pixelRounding, clamp, renderState); } } @@ -545,6 +551,9 @@ public: // member functions //! Set the base state (that blend mode etc is combined with) used for images, default is GS_NODEPTHTEST. void SetImageDepthState(const AZ::RHI::DepthState& depthState) { m_imageOptions.m_renderState.m_depthState = depthState; } + //! Set image clamp mode + void SetImageClamp(bool clamp) { m_imageOptions.m_clamp = clamp; } + //! Set the text font. void SetTextFont(AZStd::string_view fontName) { m_textOptions.fontName = fontName; } diff --git a/Gems/LyShine/Code/Source/Draw2d.cpp b/Gems/LyShine/Code/Source/Draw2d.cpp index 6b6356aa4f..917c1bb168 100644 --- a/Gems/LyShine/Code/Source/Draw2d.cpp +++ b/Gems/LyShine/Code/Source/Draw2d.cpp @@ -103,10 +103,7 @@ void CDraw2d::OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene) LyShinePassRequestBus::EventResult(uiCanvasPass, sceneId, &LyShinePassRequestBus::Events::GetUiCanvasPass); m_dynamicDraw = AZ::RPI::DynamicDrawInterface::Get()->CreateDynamicDrawContext(); - AZ::RPI::ShaderOptionList shaderOptions; - shaderOptions.push_back(AZ::RPI::ShaderOption(AZ::Name("o_useColorChannels"), AZ::Name("true"))); - shaderOptions.push_back(AZ::RPI::ShaderOption(AZ::Name("o_clamp"), AZ::Name("false"))); - m_dynamicDraw->InitShaderWithVariant(shader, &shaderOptions); + m_dynamicDraw->InitShader(shader); m_dynamicDraw->InitVertexFormat( { {"POSITION", AZ::RHI::Format::R32G32B32_FLOAT}, {"COLOR", AZ::RHI::Format::B8G8R8A8_UNORM}, @@ -136,6 +133,16 @@ void CDraw2d::OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene) m_shaderData.m_viewProjInputIndex = layout->FindShaderInputConstantIndex(AZ::Name(worldToProjIndexName)); AZ_Error("Draw2d", m_shaderData.m_viewProjInputIndex.IsValid(), "Failed to find shader input constant %s.", worldToProjIndexName); + + // Cache shader variants that will be used + AZ::RPI::ShaderOptionList shaderOptionsClamp; + shaderOptionsClamp.push_back(AZ::RPI::ShaderOption(AZ::Name("o_clamp"), AZ::Name("true"))); + shaderOptionsClamp.push_back(AZ::RPI::ShaderOption(AZ::Name("o_useColorChannels"), AZ::Name("true"))); + m_shaderData.m_shaderOptionsClamp = m_dynamicDraw->UseShaderVariant(shaderOptionsClamp); + AZ::RPI::ShaderOptionList shaderOptionsWrap; + shaderOptionsWrap.push_back(AZ::RPI::ShaderOption(AZ::Name("o_clamp"), AZ::Name("false"))); + shaderOptionsWrap.push_back(AZ::RPI::ShaderOption(AZ::Name("o_useColorChannels"), AZ::Name("true"))); + m_shaderData.m_shaderOptionsWrap = m_dynamicDraw->UseShaderVariant(shaderOptionsWrap); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -181,6 +188,8 @@ void CDraw2d::DrawImage(AZ::Data::Instance image, AZ::Vector2 po quad.m_image = image; + quad.m_clamp = actualImageOptions->m_clamp; + // add the blendMode flags to the base state quad.m_renderState = actualImageOptions->m_renderState; @@ -206,7 +215,7 @@ void CDraw2d::DrawImageAligned(AZ::Data::Instance image, AZ::Vec //////////////////////////////////////////////////////////////////////////////////////////////////// void CDraw2d::DrawQuad(AZ::Data::Instance image, VertexPosColUV* verts, Rounding pixelRounding, - const CDraw2d::RenderState& renderState) + bool clamp, const CDraw2d::RenderState& renderState) { // define quad DeferredQuad quad; @@ -217,6 +226,7 @@ void CDraw2d::DrawQuad(AZ::Data::Instance image, VertexPosColUV* quad.m_packedColors[i] = PackARGB8888(verts[i].color); } quad.m_image = image; + quad.m_clamp = clamp; // add the blendMode flags to the base state quad.m_renderState = renderState; @@ -766,6 +776,8 @@ void CDraw2d::DeferredQuad::Draw(AZ::RHI::Ptr dynam vertices[i].st = Vec2(m_texCoords[j].GetX(), m_texCoords[j].GetY()); } + dynamicDraw->SetShaderVariant(m_clamp ? shaderData.m_shaderOptionsClamp : shaderData.m_shaderOptionsWrap); + // Set up per draw SRG AZ::Data::Instance drawSrg = dynamicDraw->NewDrawSrg(); diff --git a/Gems/LyShine/Code/Source/LyShine.cpp b/Gems/LyShine/Code/Source/LyShine.cpp index d19bc3f92d..683d72f4ab 100644 --- a/Gems/LyShine/Code/Source/LyShine.cpp +++ b/Gems/LyShine/Code/Source/LyShine.cpp @@ -668,7 +668,7 @@ void CLyShine::LoadUiCursor() { if (!m_cursorImagePathToLoad.empty()) { - m_uiCursorTexture = CDraw2d::LoadTexture(m_cursorImagePathToLoad); // LYSHINE_ATOM_TODO - add clamp option to draw2d and set cursor to clamp + m_uiCursorTexture = CDraw2d::LoadTexture(m_cursorImagePathToLoad); m_cursorImagePathToLoad.clear(); } } @@ -691,7 +691,13 @@ void CLyShine::RenderUiCursor() AZ::RHI::Size cursorSize = m_uiCursorTexture->GetDescriptor().m_size; const AZ::Vector2 dimensions(aznumeric_cast(cursorSize.m_width), aznumeric_cast(cursorSize.m_height)); - m_draw2d->DrawImage(m_uiCursorTexture, position, dimensions); + CDraw2d::ImageOptions imageOptions; + imageOptions.m_clamp = true; + const float opacity = 1.0f; + const float rotation = 0.0f; + const AZ::Vector2* pivotPoint = nullptr; + const AZ::Vector2* minMaxTexCoords = nullptr; + m_draw2d->DrawImage(m_uiCursorTexture, position, dimensions, opacity, rotation, pivotPoint, minMaxTexCoords, &imageOptions); } #ifndef _RELEASE From ee6709a85c0b32ab8737cb13af0b0fc696c594d7 Mon Sep 17 00:00:00 2001 From: Sean Masterson Date: Wed, 5 Jan 2022 15:47:11 -0800 Subject: [PATCH 283/399] Move and convert ShadowTest level and include object files Signed-off-by: Sean Masterson --- .../Graphics/ShadowTest/ShadowTest.prefab | 566 ++++++++++++++++++ .../Levels/Graphics/ShadowTest/tags.txt | 12 + .../Objects/ShaderBall_simple.fbx | 3 + AutomatedTesting/Objects/bunny.fbx | 3 + AutomatedTesting/Objects/cone.fbx | 3 + AutomatedTesting/Objects/cube.fbx | 3 + AutomatedTesting/Objects/cylinder.fbx | 3 + AutomatedTesting/Objects/plane.fbx | 3 + AutomatedTesting/Objects/suzanne.fbx | 3 + 9 files changed, 599 insertions(+) create mode 100644 AutomatedTesting/Levels/Graphics/ShadowTest/ShadowTest.prefab create mode 100644 AutomatedTesting/Levels/Graphics/ShadowTest/tags.txt create mode 100644 AutomatedTesting/Objects/ShaderBall_simple.fbx create mode 100644 AutomatedTesting/Objects/bunny.fbx create mode 100644 AutomatedTesting/Objects/cone.fbx create mode 100644 AutomatedTesting/Objects/cube.fbx create mode 100644 AutomatedTesting/Objects/cylinder.fbx create mode 100644 AutomatedTesting/Objects/plane.fbx create mode 100644 AutomatedTesting/Objects/suzanne.fbx diff --git a/AutomatedTesting/Levels/Graphics/ShadowTest/ShadowTest.prefab b/AutomatedTesting/Levels/Graphics/ShadowTest/ShadowTest.prefab new file mode 100644 index 0000000000..86d16328e9 --- /dev/null +++ b/AutomatedTesting/Levels/Graphics/ShadowTest/ShadowTest.prefab @@ -0,0 +1,566 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "ShadowTest", + "Components": { + "Component_[10182366347512475253]": { + "$type": "EditorPrefabComponent", + "Id": 10182366347512475253 + }, + "Component_[12917798267488243668]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12917798267488243668 + }, + "Component_[3261249813163778338]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3261249813163778338 + }, + "Component_[3837204912784440039]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 3837204912784440039 + }, + "Component_[4272963378099646759]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 4272963378099646759, + "Parent Entity": "" + }, + "Component_[4848458548047175816]": { + "$type": "EditorVisibilityComponent", + "Id": 4848458548047175816 + }, + "Component_[5787060997243919943]": { + "$type": "EditorInspectorComponent", + "Id": 5787060997243919943 + }, + "Component_[7804170251266531779]": { + "$type": "EditorLockComponent", + "Id": 7804170251266531779 + }, + "Component_[7874177159288365422]": { + "$type": "EditorEntitySortComponent", + "Id": 7874177159288365422 + }, + "Component_[8018146290632383969]": { + "$type": "EditorEntityIconComponent", + "Id": 8018146290632383969 + }, + "Component_[8452360690590857075]": { + "$type": "SelectionComponent", + "Id": 8452360690590857075 + } + } + }, + "Entities": { + "Entity_[232650527119]": { + "Id": "Entity_[232650527119]", + "Name": "DirectionalLight", + "Components": { + "Component_[10660156197505313227]": { + "$type": "EditorLockComponent", + "Id": 10660156197505313227 + }, + "Component_[14184823757717157844]": { + "$type": "EditorInspectorComponent", + "Id": 14184823757717157844, + "ComponentOrderEntryArray": [ + { + "ComponentId": 9854879901259791898 + }, + { + "ComponentId": 3968519938187714949, + "SortIndex": 1 + } + ] + }, + "Component_[1495573908681275492]": { + "$type": "EditorEntitySortComponent", + "Id": 1495573908681275492 + }, + "Component_[15580233403487968826]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15580233403487968826 + }, + "Component_[3968519938187714949]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 3968519938187714949, + "Controller": { + "Configuration": { + "Intensity": 0.0, + "CameraEntityId": "", + "ShadowmapSize": "Size2048" + } + } + }, + "Component_[4961040003466069196]": { + "$type": "EditorEntityIconComponent", + "Id": 4961040003466069196 + }, + "Component_[7824884165323036147]": { + "$type": "EditorVisibilityComponent", + "Id": 7824884165323036147 + }, + "Component_[8741866916946672319]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8741866916946672319 + }, + "Component_[9288966876314965560]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9288966876314965560 + }, + "Component_[9313163355156975968]": { + "$type": "SelectionComponent", + "Id": 9313163355156975968 + }, + "Component_[9854879901259791898]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 9854879901259791898, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 2.0 + ], + "Rotate": [ + -32.05662536621094, + -26.103206634521484, + 47.54806137084961 + ] + } + } + } + }, + "Entity_[260824893221]": { + "Id": "Entity_[260824893221]", + "Name": "SpotLight", + "Components": { + "Component_[16098295228434057928]": { + "$type": "EditorDiskShapeComponent", + "Id": 16098295228434057928, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "DiskShape": { + "Configuration": { + "Radius": 0.0 + } + } + }, + "Component_[16175995808158769171]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16175995808158769171, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 0.6417449712753296, + 1.3211734294891357, + 3.022759199142456 + ], + "Rotate": [ + 243.31329345703125, + 0.0, + 0.0 + ] + } + }, + "Component_[17136787899581093377]": { + "$type": "EditorEntitySortComponent", + "Id": 17136787899581093377 + }, + "Component_[17938027566627202610]": { + "$type": "EditorPendingCompositionComponent", + "Id": 17938027566627202610 + }, + "Component_[190081405128299223]": { + "$type": "SelectionComponent", + "Id": 190081405128299223 + }, + "Component_[2181418147135573579]": { + "$type": "EditorEntityIconComponent", + "Id": 2181418147135573579 + }, + "Component_[2564149706319215342]": { + "$type": "EditorOnlyEntityComponent", + "Id": 2564149706319215342 + }, + "Component_[3716169383940064541]": { + "$type": "EditorInspectorComponent", + "Id": 3716169383940064541, + "ComponentOrderEntryArray": [ + { + "ComponentId": 16175995808158769171 + }, + { + "ComponentId": 16665800442781289114, + "SortIndex": 1 + } + ] + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 2, + "AttenuationRadius": 31.62277603149414, + "EnableShutters": true, + "InnerShutterAngleDegrees": 22.5, + "OuterShutterAngleDegrees": 27.5, + "Enable Shadow": true, + "Shadowmap Max Size": "Size2048", + "Filtering Sample Count": 32 + } + } + }, + "Component_[6706371214647538019]": { + "$type": "EditorVisibilityComponent", + "Id": 6706371214647538019 + }, + "Component_[7493944209625718550]": { + "$type": "EditorLockComponent", + "Id": 7493944209625718550 + }, + "Component_[7614113482082939165]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 7614113482082939165 + } + } + }, + "Entity_[269117486973]": { + "Id": "Entity_[269117486973]", + "Name": "Floor", + "Components": { + "Component_[10562678944594915756]": { + "$type": "EditorEntitySortComponent", + "Id": 10562678944594915756 + }, + "Component_[1175452962278157526]": { + "$type": "EditorEntityIconComponent", + "Id": 1175452962278157526 + }, + "Component_[13598353801231166887]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13598353801231166887 + }, + "Component_[13735087293504923475]": { + "$type": "SelectionComponent", + "Id": 13735087293504923475 + }, + "Component_[13888244442459268363]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13888244442459268363, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E65E9ED3-3E38-5ABA-9E22-95E34DA4C3AE}", + "subId": 280178048 + }, + "assetHint": "objects/plane.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1525720357937234014]": { + "$type": "EditorMaterialComponent", + "Id": 1525720357937234014, + "materialSlotsByLodEnabled": true + }, + "Component_[16568998871680422442]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16568998871680422442 + }, + "Component_[2147751093058990131]": { + "$type": "EditorInspectorComponent", + "Id": 2147751093058990131, + "ComponentOrderEntryArray": [ + { + "ComponentId": 3266761149114817871 + }, + { + "ComponentId": 13888244442459268363, + "SortIndex": 1 + }, + { + "ComponentId": 1525720357937234014, + "SortIndex": 2 + } + ] + }, + "Component_[3266761149114817871]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3266761149114817871, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Scale": [ + 100.0, + 100.0, + 100.0 + ], + "UniformScale": 100.0 + } + }, + "Component_[4625895382416898670]": { + "$type": "EditorVisibilityComponent", + "Id": 4625895382416898670 + }, + "Component_[4856699190357614535]": { + "$type": "EditorLockComponent", + "Id": 4856699190357614535 + }, + "Component_[6466465153982575739]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6466465153982575739 + } + } + }, + "Entity_[282757803856]": { + "Id": "Entity_[282757803856]", + "Name": "Cube", + "Components": { + "Component_[11189870094752260272]": { + "$type": "EditorEntitySortComponent", + "Id": 11189870094752260272 + }, + "Component_[11909086967677513257]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 11909086967677513257, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{593006BE-FE73-5A4B-A0A6-06C02EFFE458}", + "subId": 285127096 + }, + "loadBehavior": "PreLoad", + "assetHint": "objects/cube.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1443341568598731610]": { + "$type": "EditorVisibilityComponent", + "Id": 1443341568598731610 + }, + "Component_[18339772707807258951]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18339772707807258951, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 0.6083869934082031, + 3.137901782989502, + 0.5876787900924683 + ] + } + }, + "Component_[2447207272572065708]": { + "$type": "EditorEntityIconComponent", + "Id": 2447207272572065708 + }, + "Component_[3281906807632213471]": { + "$type": "SelectionComponent", + "Id": 3281906807632213471 + }, + "Component_[3412442673858204671]": { + "$type": "EditorPendingCompositionComponent", + "Id": 3412442673858204671 + }, + "Component_[5382641380294287889]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5382641380294287889 + }, + "Component_[7221534636342494619]": { + "$type": "EditorInspectorComponent", + "Id": 7221534636342494619, + "ComponentOrderEntryArray": [ + { + "ComponentId": 18339772707807258951 + }, + { + "ComponentId": 11909086967677513257, + "SortIndex": 1 + } + ] + }, + "Component_[7701217952253676487]": { + "$type": "EditorLockComponent", + "Id": 7701217952253676487 + }, + "Component_[7758436981023123121]": { + "$type": "EditorOnlyEntityComponent", + "Id": 7758436981023123121 + } + } + }, + "Entity_[372196702077]": { + "Id": "Entity_[372196702077]", + "Name": "Bunny", + "Components": { + "Component_[11345914745205508221]": { + "$type": "EditorEntityIconComponent", + "Id": 11345914745205508221 + }, + "Component_[11507863983962969790]": { + "$type": "EditorMaterialComponent", + "Id": 11507863983962969790, + "materialSlotsByLodEnabled": true + }, + "Component_[1342998773562921470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1342998773562921470 + }, + "Component_[14975835087235718844]": { + "$type": "EditorInspectorComponent", + "Id": 14975835087235718844, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5012565883129470759 + }, + { + "ComponentId": 7975043234993822905, + "SortIndex": 1 + }, + { + "ComponentId": 11507863983962969790, + "SortIndex": 2 + } + ] + }, + "Component_[16460806723667032929]": { + "$type": "EditorOnlyEntityComponent", + "Id": 16460806723667032929 + }, + "Component_[18225690044585951363]": { + "$type": "EditorLockComponent", + "Id": 18225690044585951363 + }, + "Component_[18314752491697618927]": { + "$type": "EditorEntitySortComponent", + "Id": 18314752491697618927 + }, + "Component_[2431610550789583502]": { + "$type": "EditorVisibilityComponent", + "Id": 2431610550789583502 + }, + "Component_[5012565883129470759]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5012565883129470759, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 0.20401419699192047 + ] + } + }, + "Component_[7975043234993822905]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 7975043234993822905, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0C6BBB76-4EC2-583A-B8C6-1A4C4FD1FE9D}", + "subId": 283109893 + }, + "assetHint": "objects/bunny.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[8510666363380501112]": { + "$type": "SelectionComponent", + "Id": 8510666363380501112 + }, + "Component_[9639060480533776634]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 9639060480533776634 + } + } + }, + "Entity_[670308843764]": { + "Id": "Entity_[670308843764]", + "Name": "Camera1", + "Components": { + "Component_[12951260100632682169]": { + "$type": "GenericComponentWrapper", + "Id": 12951260100632682169, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[14180723329646459524]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14180723329646459524 + }, + "Component_[14996469885773917977]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 14996469885773917977, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 4.563776969909668, + 0.7667046785354614, + 3.000542640686035 + ], + "Rotate": [ + -9.740042686462402, + -20.20942497253418, + 63.57760238647461 + ] + } + }, + "Component_[17638492356673689530]": { + "$type": "EditorInspectorComponent", + "Id": 17638492356673689530 + }, + "Component_[2421853983468750254]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 2421853983468750254, + "Controller": { + "Configuration": { + "Field of View": 90.00020599365234, + "EditorEntityId": 666013876468 + } + } + }, + "Component_[2572028619185965684]": { + "$type": "EditorEntityIconComponent", + "Id": 2572028619185965684 + }, + "Component_[2782900516907042776]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 2782900516907042776 + }, + "Component_[2849166119438883669]": { + "$type": "EditorVisibilityComponent", + "Id": 2849166119438883669 + }, + "Component_[4618311795498613781]": { + "$type": "EditorOnlyEntityComponent", + "Id": 4618311795498613781 + }, + "Component_[5402004894214413002]": { + "$type": "EditorEntitySortComponent", + "Id": 5402004894214413002 + }, + "Component_[6111028576371006514]": { + "$type": "SelectionComponent", + "Id": 6111028576371006514 + }, + "Component_[8203141294643544464]": { + "$type": "EditorLockComponent", + "Id": 8203141294643544464 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Graphics/ShadowTest/tags.txt b/AutomatedTesting/Levels/Graphics/ShadowTest/tags.txt new file mode 100644 index 0000000000..0d6c1880e7 --- /dev/null +++ b/AutomatedTesting/Levels/Graphics/ShadowTest/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 diff --git a/AutomatedTesting/Objects/ShaderBall_simple.fbx b/AutomatedTesting/Objects/ShaderBall_simple.fbx new file mode 100644 index 0000000000..50b7b8f44d --- /dev/null +++ b/AutomatedTesting/Objects/ShaderBall_simple.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5f7a86a693878c10f91783955cc72535bf7d7c495163087a4c1982f228d27f0 +size 2145248 diff --git a/AutomatedTesting/Objects/bunny.fbx b/AutomatedTesting/Objects/bunny.fbx new file mode 100644 index 0000000000..f0a16349f7 --- /dev/null +++ b/AutomatedTesting/Objects/bunny.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef71257b240a7e704731806f8cd4b966af5d3c60f22881f9c6a6320180ee71a4 +size 2496384 diff --git a/AutomatedTesting/Objects/cone.fbx b/AutomatedTesting/Objects/cone.fbx new file mode 100644 index 0000000000..081b8b119d --- /dev/null +++ b/AutomatedTesting/Objects/cone.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:531b6473b314259504ab595e4983838b5866035ef4d70cedaf4cc9c7d9e65c3a +size 24512 diff --git a/AutomatedTesting/Objects/cube.fbx b/AutomatedTesting/Objects/cube.fbx new file mode 100644 index 0000000000..616c7b4ff3 --- /dev/null +++ b/AutomatedTesting/Objects/cube.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e32877eab35459499c73ff093df898f93bf3e7379de25eef6875d693be9bec81 +size 18015 diff --git a/AutomatedTesting/Objects/cylinder.fbx b/AutomatedTesting/Objects/cylinder.fbx new file mode 100644 index 0000000000..18ab200b4c --- /dev/null +++ b/AutomatedTesting/Objects/cylinder.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2949a50eec079a7d43a1d92e056c580ef625ee39e00e91cc25318319e37dcd3b +size 115689 diff --git a/AutomatedTesting/Objects/plane.fbx b/AutomatedTesting/Objects/plane.fbx new file mode 100644 index 0000000000..b274bfa282 --- /dev/null +++ b/AutomatedTesting/Objects/plane.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a1f8d75dcd85e8b4aa57f6c0c81af0300ff96915ba3c2b591095c215d5e1d8c +size 12072 diff --git a/AutomatedTesting/Objects/suzanne.fbx b/AutomatedTesting/Objects/suzanne.fbx new file mode 100644 index 0000000000..171a6d21e9 --- /dev/null +++ b/AutomatedTesting/Objects/suzanne.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3bcfac5de831c269dac58e7d73d1dc61eb8d9f6d8a241f5c029537b6bcdf166 +size 1088304 From 0bcb514c27299df1f09c8cdfe8e6e94247ff2f89 Mon Sep 17 00:00:00 2001 From: mrieggeramzn Date: Wed, 5 Jan 2022 15:56:53 -0800 Subject: [PATCH 284/399] removing qlocale.h compile issue Signed-off-by: mrieggeramzn --- .../AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h b/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h index d4f0c8d705..1bd6f72a19 100644 --- a/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h +++ b/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h @@ -12,7 +12,6 @@ #include #include "IntegerPrimtitiveTestConfig.h" #include -#include #include namespace UnitTest From 09fd52ef73e199137bb1a38abcba7cd1242604a6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 16:07:52 -0800 Subject: [PATCH 285/399] AzCore Math tests produce errors that need to be disabled in debug (#6678) * Tests produce errors that need to be disabled in debug Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * PR suggestion Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/Math/Plane.inl | 8 +++----- Code/Framework/AzCore/Tests/Math/MathTest.h | 19 +++++++++++++++++++ .../AzCore/Tests/Math/PlaneTests.cpp | 11 ++++++++++- Code/Framework/AzCore/Tests/ScriptMath.cpp | 8 ++++++++ .../AzCore/Tests/azcoretests_files.cmake | 1 + 5 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 Code/Framework/AzCore/Tests/Math/MathTest.h diff --git a/Code/Framework/AzCore/AzCore/Math/Plane.inl b/Code/Framework/AzCore/AzCore/Math/Plane.inl index 795ee8b4bc..22c449dc6f 100644 --- a/Code/Framework/AzCore/AzCore/Math/Plane.inl +++ b/Code/Framework/AzCore/AzCore/Math/Plane.inl @@ -26,7 +26,6 @@ namespace AZ AZ_MATH_INLINE Plane Plane::CreateFromNormalAndDistance(const Vector3& normal, float dist) { - AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); Plane result; result.Set(normal, dist); return result; @@ -35,7 +34,6 @@ namespace AZ AZ_MATH_INLINE Plane Plane::CreateFromCoefficients(const float a, const float b, const float c, const float d) { - AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is notormalized"); Plane result; result.Set(a, b, c, d); return result; @@ -68,21 +66,21 @@ namespace AZ AZ_MATH_INLINE void Plane::Set(const Vector3& normal, float d) { - AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is notormalized"); + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); m_plane.Set(normal, d); } AZ_MATH_INLINE void Plane::Set(float a, float b, float c, float d) { - AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is notormalized"); + AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is not normalized"); m_plane.Set(a, b, c, d); } AZ_MATH_INLINE void Plane::SetNormal(const Vector3& normal) { - AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is notormalized"); + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); m_plane.SetX(normal.GetX()); m_plane.SetY(normal.GetY()); m_plane.SetZ(normal.GetZ()); diff --git a/Code/Framework/AzCore/Tests/Math/MathTest.h b/Code/Framework/AzCore/Tests/Math/MathTest.h new file mode 100644 index 0000000000..783c08a553 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Math/MathTest.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +#if AZ_DEBUG_BUILD + #define AZ_MATH_TEST_START_TRACE_SUPPRESSION AZ_TEST_START_TRACE_SUPPRESSION + #define AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(x) AZ_TEST_STOP_TRACE_SUPPRESSION(x) +#else + #define AZ_MATH_TEST_START_TRACE_SUPPRESSION + #define AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(x) +#endif diff --git a/Code/Framework/AzCore/Tests/Math/PlaneTests.cpp b/Code/Framework/AzCore/Tests/Math/PlaneTests.cpp index 016a7ec6e2..398c1320ed 100644 --- a/Code/Framework/AzCore/Tests/Math/PlaneTests.cpp +++ b/Code/Framework/AzCore/Tests/Math/PlaneTests.cpp @@ -12,6 +12,7 @@ #include #include #include +#include using namespace AZ; @@ -47,7 +48,9 @@ namespace UnitTest TEST(MATH_Plane, TestSet) { Plane pl; + AZ_MATH_TEST_START_TRACE_SUPPRESSION; pl.Set(12.0f, 13.0f, 14.0f, 15.0f); + AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(1); AZ_TEST_ASSERT_FLOAT_CLOSE(pl.GetDistance(), 15.0f); AZ_TEST_ASSERT_FLOAT_CLOSE(pl.GetNormal().GetX(), 12.0f); AZ_TEST_ASSERT_FLOAT_CLOSE(pl.GetNormal().GetY(), 13.0f); @@ -57,7 +60,9 @@ namespace UnitTest TEST(MATH_Plane, TestSetVector3) { Plane pl; + AZ_MATH_TEST_START_TRACE_SUPPRESSION; pl.Set(Vector3(22.0f, 23.0f, 24.0f), 25.0f); + AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(1); AZ_TEST_ASSERT_FLOAT_CLOSE(pl.GetDistance(), 25.0f); AZ_TEST_ASSERT_FLOAT_CLOSE(pl.GetNormal().GetX(), 22.0f); AZ_TEST_ASSERT_FLOAT_CLOSE(pl.GetNormal().GetY(), 23.0f); @@ -177,17 +182,21 @@ namespace UnitTest pl.Set(1.0f, 0.0f, 0.0f, 0.0f); AZ_TEST_ASSERT(pl.IsFinite()); const float infinity = std::numeric_limits::infinity(); + AZ_MATH_TEST_START_TRACE_SUPPRESSION; pl.Set(infinity, infinity, infinity, infinity); + AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(1); AZ_TEST_ASSERT(!pl.IsFinite()); } TEST(MATH_Plane, CreateFromVectorCoefficients_IsEquivalentToCreateFromCoefficients) { + AZ_MATH_TEST_START_TRACE_SUPPRESSION; Plane planeFromCoefficients = Plane::CreateFromCoefficients(1.0, 2.0, 3.0, 4.0); - + AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(1); Vector4 coefficients(1.0, 2.0, 3.0, 4.0); Plane planeFromVectorCoefficients = Plane::CreateFromVectorCoefficients(coefficients); + EXPECT_EQ(planeFromVectorCoefficients, planeFromCoefficients); } } diff --git a/Code/Framework/AzCore/Tests/ScriptMath.cpp b/Code/Framework/AzCore/Tests/ScriptMath.cpp index 35541c5eec..927ea4a3cd 100644 --- a/Code/Framework/AzCore/Tests/ScriptMath.cpp +++ b/Code/Framework/AzCore/Tests/ScriptMath.cpp @@ -15,6 +15,8 @@ #include #include +#include + using namespace AZ; namespace UnitTest @@ -1409,13 +1411,17 @@ namespace UnitTest script->Execute("AZTestAssertFloatClose(pl:GetNormal().y,-1)"); script->Execute("AZTestAssertFloatClose(pl:GetNormal().z,0)"); + AZ_MATH_TEST_START_TRACE_SUPPRESSION; script->Execute("pl:Set(12, 13, 14, 15)"); + AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(1); script->Execute("AZTestAssertFloatClose(pl:GetDistance(), 15)"); script->Execute("AZTestAssertFloatClose(pl:GetNormal().x, 12)"); script->Execute("AZTestAssertFloatClose(pl:GetNormal().y, 13)"); script->Execute("AZTestAssertFloatClose(pl:GetNormal().z, 14)"); + AZ_MATH_TEST_START_TRACE_SUPPRESSION; script->Execute("pl:Set(Vector3(22, 23, 24), 25)"); + AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(1); script->Execute("AZTestAssertFloatClose(pl:GetDistance(), 25)"); script->Execute("AZTestAssertFloatClose(pl:GetNormal().x, 22)"); script->Execute("AZTestAssertFloatClose(pl:GetNormal().y, 23)"); @@ -1493,7 +1499,9 @@ namespace UnitTest script->Execute("pl:Set(1, 0, 0, 0)"); script->Execute("AZTestAssert(pl:IsFinite())"); + AZ_MATH_TEST_START_TRACE_SUPPRESSION; script->Execute("pl:Set(math.huge, math.huge, math.huge, math.huge)"); + AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(1); script->Execute("AZTestAssert( not pl:IsFinite())"); } diff --git a/Code/Framework/AzCore/Tests/azcoretests_files.cmake b/Code/Framework/AzCore/Tests/azcoretests_files.cmake index 3777071168..834e3431b6 100644 --- a/Code/Framework/AzCore/Tests/azcoretests_files.cmake +++ b/Code/Framework/AzCore/Tests/azcoretests_files.cmake @@ -148,6 +148,7 @@ set(FILES Math/Matrix4x4PerformanceTests.cpp Math/Matrix4x4Tests.cpp Math/MatrixUtilsTests.cpp + Math/MathTest.h Math/MathTestData.h Math/ObbPerformanceTests.cpp Math/ObbTests.cpp From d378544bbc813d87db5b0a897e6024a914d72aae Mon Sep 17 00:00:00 2001 From: evanchia Date: Wed, 5 Jan 2022 17:06:44 -0800 Subject: [PATCH 286/399] Fixing crash log name bugs in test tools Signed-off-by: evanchia --- .../_internal/pytest_plugin/test_tools_fixtures.py | 2 +- .../ly_test_tools/o3de/editor_test_utils.py | 11 ++++++++++- .../LyTestTools/tests/unit/test_editor_test_utils.py | 12 +++++++++--- Tools/LyTestTools/tests/unit/test_fixtures.py | 11 +++++------ 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/Tools/LyTestTools/ly_test_tools/_internal/pytest_plugin/test_tools_fixtures.py b/Tools/LyTestTools/ly_test_tools/_internal/pytest_plugin/test_tools_fixtures.py index af29064766..1c17d6d519 100755 --- a/Tools/LyTestTools/ly_test_tools/_internal/pytest_plugin/test_tools_fixtures.py +++ b/Tools/LyTestTools/ly_test_tools/_internal/pytest_plugin/test_tools_fixtures.py @@ -413,7 +413,7 @@ def crash_log_watchdog(request, workspace): def _crash_log_watchdog(request, workspace, raise_on_crash): """Separate implementation to call directly during unit tests""" - error_log = os.path.join(workspace.paths.project_log(), 'error.log') + error_log = workspace.paths.crash_log() crash_log_watchdog = ly_test_tools.environment.watchdog.CrashLogWatchdog( error_log, raise_on_condition=raise_on_crash) diff --git a/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py b/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py index 9f1e01342c..54ac67f56e 100644 --- a/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py @@ -10,6 +10,7 @@ from __future__ import annotations import os import time import logging +import re import ly_test_tools.environment.process_utils as process_utils import ly_test_tools.environment.waiter as waiter @@ -71,7 +72,15 @@ def retrieve_crash_output(run_id: int, workspace: AbstractWorkspaceManager, time :return str: The contents of the editor crash file (error.log) """ crash_info = "-- No crash log available --" - crash_log = os.path.join(retrieve_log_path(run_id, workspace), 'error.log') + error_log_regex = "" + log_path = retrieve_log_path(run_id, workspace) + # Gather all of the files in the log directory + dir_files = [f for f in os.listdir(log_path) if os.path.isfile(os.path.join(log_path, f))] + for file_name in dir_files: + # Search for all .log files with either "crash" or "error" because they could be renamed + if ("error" in file_name.lower() or "crash" in file_name.lower()) and (file_name.endswith(".log")): + crash_log = os.path.join(log_path, file_name) + break try: waiter.wait_for(lambda: os.path.exists(crash_log), timeout=timeout) except AssertionError: diff --git a/Tools/LyTestTools/tests/unit/test_editor_test_utils.py b/Tools/LyTestTools/tests/unit/test_editor_test_utils.py index cd361d9e8a..f7678c44c0 100644 --- a/Tools/LyTestTools/tests/unit/test_editor_test_utils.py +++ b/Tools/LyTestTools/tests/unit/test_editor_test_utils.py @@ -59,22 +59,28 @@ class TestEditorTestUtils(unittest.TestCase): assert expected == editor_test_utils.retrieve_log_path(0, mock_workspace) + @mock.patch('os.listdir') @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') + @mock.patch('os.path.isfile', mock.MagicMock()) @mock.patch('ly_test_tools.environment.waiter.wait_for', mock.MagicMock()) - def test_RetrieveCrashOutput_CrashLogExists_ReturnsLogInfo(self, mock_retrieve_log_path): - mock_retrieve_log_path.return_value = 'mock_log_path' + def test_RetrieveCrashOutput_CrashLogExists_ReturnsLogInfo(self, mock_retrieve_log_path, mock_listdir): + mock_retrieve_log_path.return_value = 'mock_path' mock_workspace = mock.MagicMock() mock_log = 'mock crash info' + mock_listdir.return_value = ['mock_error_log.log'] with mock.patch('builtins.open', mock.mock_open(read_data=mock_log)) as mock_file: assert mock_log == editor_test_utils.retrieve_crash_output(0, mock_workspace, 0) + @mock.patch('os.listdir') @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') + @mock.patch('os.path.isfile', mock.MagicMock()) @mock.patch('ly_test_tools.environment.waiter.wait_for', mock.MagicMock()) - def test_RetrieveCrashOutput_CrashLogNotExists_ReturnsError(self, mock_retrieve_log_path): + def test_RetrieveCrashOutput_CrashLogNotExists_ReturnsError(self, mock_retrieve_log_path, mock_listdir): mock_retrieve_log_path.return_value = 'mock_log_path' mock_workspace = mock.MagicMock() error_message = "No crash log available" + mock_listdir.return_value = ['mock_file.log'] assert error_message in editor_test_utils.retrieve_crash_output(0, mock_workspace, 0) diff --git a/Tools/LyTestTools/tests/unit/test_fixtures.py b/Tools/LyTestTools/tests/unit/test_fixtures.py index 32dc204bd2..eb36cf6998 100755 --- a/Tools/LyTestTools/tests/unit/test_fixtures.py +++ b/Tools/LyTestTools/tests/unit/test_fixtures.py @@ -323,20 +323,19 @@ class TestFixtures(object): @mock.patch('ly_test_tools.environment.watchdog.CrashLogWatchdog') def test_CrashLogWatchdog_Instantiates_CreatesWatchdog(self, under_test): mock_workspace = mock.MagicMock() - mock_path = 'C:/foo' - mock_workspace.paths.project_log.return_value = mock_path + mock_workspace.paths.crash_log.return_value = mock.MagicMock() mock_request = mock.MagicMock() mock_request.addfinalizer = mock.MagicMock() mock_raise_on_crash = mock.MagicMock() mock_watchdog = test_tools_fixtures._crash_log_watchdog(mock_request, mock_workspace, mock_raise_on_crash) - under_test.assert_called_once_with(os.path.join(mock_path, 'error.log'), raise_on_condition=mock_raise_on_crash) + under_test.assert_called_once_with(mock_workspace.paths.crash_log.return_value, raise_on_condition=mock_raise_on_crash) @mock.patch('ly_test_tools.environment.watchdog.CrashLogWatchdog.start') def test_CrashLogWatchdog_Instantiates_StartsThread(self, under_test): mock_workspace = mock.MagicMock() mock_path = 'C:/foo' - mock_workspace.paths.project_log.return_value = mock_path + mock_workspace.paths.crash_log.return_value = mock_path mock_request = mock.MagicMock() mock_request.addfinalizer = mock.MagicMock() mock_raise_on_crash = mock.MagicMock() @@ -348,7 +347,7 @@ class TestFixtures(object): def test_CrashLogWatchdog_Instantiates_AddsTeardown(self): mock_workspace = mock.MagicMock() mock_path = 'C:/foo' - mock_workspace.paths.project_log.return_value = mock_path + mock_workspace.paths.crash_log.return_value = mock_path mock_request = mock.MagicMock() mock_request.addfinalizer = mock.MagicMock() mock_raise_on_crash = mock.MagicMock() @@ -361,7 +360,7 @@ class TestFixtures(object): def test_CrashLogWatchdog_Teardown_CallsStop(self, mock_stop): mock_workspace = mock.MagicMock() mock_path = 'C:/foo' - mock_workspace.paths.project_log.return_value = mock_path + mock_workspace.paths.crash_log.return_value = mock_path mock_request = mock.MagicMock() mock_request.addfinalizer = mock.MagicMock() mock_raise_condition = mock.MagicMock() From 52ab5a1c0fb5f0744df0c879844ca3512b48109d Mon Sep 17 00:00:00 2001 From: evanchia Date: Wed, 5 Jan 2022 17:10:18 -0800 Subject: [PATCH 287/399] removing unused import Signed-off-by: evanchia --- Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py b/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py index 54ac67f56e..69c6eda2ee 100644 --- a/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py @@ -10,7 +10,6 @@ from __future__ import annotations import os import time import logging -import re import ly_test_tools.environment.process_utils as process_utils import ly_test_tools.environment.waiter as waiter From e2a960e44296fe4a1a844abf1f90df2260cc91cd Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Wed, 5 Jan 2022 17:21:15 -0800 Subject: [PATCH 288/399] Fixed a sync issue when a PrefaDOM was taken from a PrefabDocument. When a PrefabDOM was taken from a PrefabDocument the Instance would continue to have the data from the original Prefab, which means they'd no longer be in sync as the Prefab would be empty. This was fixed by resetting the Instance so they're both clear. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Prefab/Spawnable/PrefabDocument.cpp | 10 ++++++++-- .../Prefab/Spawnable/PrefabProcessorContext.cpp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp index c0eb5257b0..04fdea30d2 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp @@ -16,7 +16,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils : m_name(AZStd::move(name)) , m_instance(AZStd::make_unique()) { - m_instance->SetTemplateSourcePath(AZ::IO::Path("InMemory") / name); + m_instance->SetTemplateSourcePath(AZ::IO::Path("InMemory") / m_name); } bool PrefabDocument::SetPrefabDom(const PrefabDom& prefab) @@ -64,8 +64,14 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils { if (m_isDirty) { - m_isDirty = !PrefabDomUtils::StoreInstanceInPrefabDom(*m_instance, m_dom); + [[maybe_unused]] bool storedSuccessfully = PrefabDomUtils::StoreInstanceInPrefabDom(*m_instance, m_dom); + AZ_Assert(storedSuccessfully, "Failed to store Instance '%s' to PrefabDom.", m_name.c_str()); + m_isDirty = false; } + // After the PrefabDom is moved an empty PrefabDom is left behind. This should be reflected in the Instance, + // so reset it so it's empty as well. + m_instance->Reset(); + m_instance->SetTemplateSourcePath(AZ::IO::Path("InMemory") / m_name); return AZStd::move(m_dom); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp index fd8ce43836..12625712b7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp @@ -245,7 +245,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils AZ::Data::Asset(target->m_spawnable.GetId(), azrtti_typeid()), alias.m_tag, sourceIndex, targetIndex, alias.m_aliasType, alias.m_loadBehavior == EntityAliasSpawnableLoadBehavior::QueueLoad); - + // Register the dependency between the two spawnables. RegisterProductAssetDependency(source->m_spawnable.GetId(), target->m_spawnable.GetId(), loadBehavior); From 5f9a4a5eed421480094884b2b78ac309d2d77fde Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Wed, 5 Jan 2022 17:21:55 -0800 Subject: [PATCH 289/399] docstring clarification and addressing review comments Signed-off-by: Scott Murray --- .../editor_entity_utils.py | 95 +++++++++++-------- 1 file changed, 56 insertions(+), 39 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index 4dd7ec1446..d354c4ece6 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -22,7 +22,7 @@ import azlmbr.legacy.general as general from editor_python_test_tools.utils import Report -class Entity_Type(Enum): +class EditorEntityType(Enum): GAME = azlmbr.entity.EntityType().Game LEVEL = azlmbr.entity.EntityType().Level @@ -39,7 +39,7 @@ class EditorComponent: def __init__(self, type_id: uuid): self.type_id = type_id self.id = None - self.property_tree = None + self.property_tree_editor = None def get_component_name(self) -> str: """ @@ -52,7 +52,7 @@ class EditorComponent: def get_property_tree(self, force_get: bool = False): """ - Used to get the property tree object of component that has following functions associated with it: + Used to get and cache the property tree editor of component that has following functions associated with it: 1. prop_tree.is_container(path) 2. prop_tree.get_container_count(path) 3. prop_tree.reset_container(path) @@ -60,32 +60,36 @@ class EditorComponent: 5. prop_tree.remove_container_item(path, key) 6. prop_tree.update_container_item(path, key, value) 7. prop_tree.get_container_item(path, key) - :param force_get: Force a fresh property tree to be returned rather than using an existing self.property_tree - :return: Property tree object of a component + :param force_get: Force a fresh property tree editor rather than the cached self.property_tree_editor + :return: Property tree editor of the component """ - if (not force_get) and (self.property_tree is not None): - return self.property_tree + if (not force_get) and (self.property_tree_editor is not None): + return self.property_tree_editor build_prop_tree_outcome = editor.EditorComponentAPIBus( bus.Broadcast, "BuildComponentPropertyTreeEditor", self.id ) assert ( build_prop_tree_outcome.IsSuccess() - ), f"Failure: Could not build property tree of component: '{self.get_component_name()}'" + ), f"Failure: Could not build property tree editor of component: '{self.get_component_name()}'" prop_tree = build_prop_tree_outcome.GetValue() Report.info(prop_tree.build_paths_list()) - self.property_tree = prop_tree - return self.property_tree + self.property_tree_editor = prop_tree + return self.property_tree_editor def is_property_container(self, component_property_path: str) -> bool: """ - Used to determine if a component property is a container. Containers are similar to a dictionary with int keys. + Used to determine if a component property is a container. + Containers are a collection of same typed values that can expand/shrink to contain more or less. + There are two types of containers; indexed and associative. + Indexed containers use integer key and are something like a linked list + Associative containers utilize keys of the same type which could be any supported type. :param component_property_path: String of component property. (e.g. 'Settings|Visible') :return: Boolean True if the property is a container False if it is not. """ - if self.property_tree is None: + if self.property_tree_editor is None: self.get_property_tree() - result = self.property_tree.is_container(component_property_path) + result = self.property_tree_editor.is_container(component_property_path) if not result: Report.info(f"{self.get_component_name()}: '{component_property_path}' is not a container") return result @@ -99,7 +103,7 @@ class EditorComponent: assert ( self.is_property_container(component_property_path) ), f"Failure: '{component_property_path}' is not a property container" - container_count_outcome = self.property_tree.get_container_count(component_property_path) + container_count_outcome = self.property_tree_editor.get_container_count(component_property_path) assert ( container_count_outcome.IsSuccess() ), f"Failure: get_container_count did not return success for '{component_property_path}'" @@ -107,21 +111,22 @@ class EditorComponent: def reset_container(self, component_property_path: str): """ - Used to rest a container to empty + Used to reset a container to empty :param component_property_path: String of component property. (e.g. 'Settings|Visible') :return: None """ assert ( self.is_property_container(component_property_path) ), f"Failure: '{component_property_path}' is not a property container" - reset_outcome = self.property_tree.reset_container(component_property_path) + reset_outcome = self.property_tree_editor.reset_container(component_property_path) assert ( reset_outcome.IsSuccess() ), f"Failure: could not reset_container on '{component_property_path}'" def append_container_item(self, component_property_path: str, value: any): """ - Used to append a container item without providing an index key. + Used to append a value to an indexed container item without providing an index key. + Append will fail on an associative container :param component_property_path: String of component property. (e.g. 'Settings|Visible') :param value: Value to be set :return: None @@ -129,38 +134,44 @@ class EditorComponent: assert ( self.is_property_container(component_property_path) ), f"Failure: '{component_property_path}' is not a property container" - append_outcome = self.property_tree.append_container_item(component_property_path, value) + append_outcome = self.property_tree_editor.append_container_item(component_property_path, value) assert ( append_outcome.IsSuccess() ), f"Failure: could not append_container_item to '{component_property_path}'" def add_container_item(self, component_property_path: str, key: any, value: any): """ - Used to add a container item at a specified key. In practice key should be an integer index. + Used to add a container item at a specified key. + There are two types of containers; indexed and associative. + Indexed containers use integer key. + Associative containers utilize keys of the same type which could be any supported type. :param component_property_path: String of component property. (e.g. 'Settings|Visible') - :param key: Zero index integer key, although this could be any unique unused key value + :param key: Zero index integer key or any supported type for associative container :param value: Value to be set :return: None """ assert ( self.is_property_container(component_property_path) ), f"Failure: '{component_property_path}' is not a property container" - add_outcome = self.property_tree.add_container_item(component_property_path, key, value) + add_outcome = self.property_tree_editor.add_container_item(component_property_path, key, value) assert ( add_outcome.IsSuccess() ), f"Failure: could not add_container_item '{key}' to '{component_property_path}'" def get_container_item(self, component_property_path: str, key: any) -> any: """ - Used to retrieve a container item value at the specified key. In practice key should be an integer index. + Used to retrieve a container item value at the specified key. + There are two types of containers; indexed and associative. + Indexed containers use integer key. + Associative containers utilize keys of the same type which could be any supported type. :param component_property_path: String of component property. (e.g. 'Settings|Visible') - :param key: Zero index integer key + :param key: Zero index integer key or any supported type for associative container :return: Value stored at the key specified """ assert ( self.is_property_container(component_property_path) ), f"Failure: '{component_property_path}' is not a property container" - get_outcome = self.property_tree.get_container_item(component_property_path, key) + get_outcome = self.property_tree_editor.get_container_item(component_property_path, key) assert ( get_outcome.IsSuccess() ), f"Failure: could not get a value for {self.get_component_name()}: '{component_property_path}' [{key}]" @@ -168,31 +179,37 @@ class EditorComponent: def remove_container_item(self, component_property_path: str, key: any): """ - Used to remove a container item value at the specified key. In practice key should be an integer index. + Used to remove a container item value at the specified key. + There are two types of containers; indexed and associative. + Indexed containers use integer key. + Associative containers utilize keys of the same type which could be any supported type. :param component_property_path: String of component property. (e.g. 'Settings|Visible') - :param key: Zero index integer key + :param key: Zero index integer key or any supported type for associative container :return: None """ assert ( self.is_property_container(component_property_path) ), f"Failure: '{component_property_path}' is not a property container" - remove_outcome = self.property_tree.remove_container_item(component_property_path, key) + remove_outcome = self.property_tree_editor.remove_container_item(component_property_path, key) assert ( remove_outcome.IsSuccess() ), f"Failure: could not remove_container_item '{key}' from '{component_property_path}'" def update_container_item(self, component_property_path: str, key: any, value: any): """ - Used to update a container item at a specified key. In practice key should be an integer index. + Used to update a container item at a specified key. + There are two types of containers; indexed and associative. + Indexed containers use integer key. + Associative containers utilize keys of the same type which could be any supported type. :param component_property_path: String of component property. (e.g. 'Settings|Visible') - :param key: Zero index integer key + :param key: Zero index integer key or any supported type for associative container :param value: Value to be set :return: None """ assert ( self.is_property_container(component_property_path) ), f"Failure: '{component_property_path}' is not a property container" - update_outcome = self.property_tree.update_container_item(component_property_path, key, value) + update_outcome = self.property_tree_editor.update_container_item(component_property_path, key, value) assert ( update_outcome.IsSuccess() ), f"Failure: could not update '{key}' in '{component_property_path}'" @@ -252,7 +269,7 @@ class EditorComponent: editor.EditorComponentAPIBus(bus.Broadcast, "DisableComponents", [self.id]) @staticmethod - def get_type_ids(component_names: list, entity_type: Entity_Type = Entity_Type.GAME) -> list: + def get_type_ids(component_names: list, entity_type: EditorEntityType = EditorEntityType.GAME) -> list: """ Used to get type ids of given components list :param component_names: List of components to get type ids @@ -426,7 +443,7 @@ class EditorEntity: :return: List of newly added components to the entity """ components = [] - type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.GAME) + type_ids = EditorComponent.get_type_ids(component_names, EditorEntityType.GAME) for type_id in type_ids: new_comp = EditorComponent(type_id) add_component_outcome = editor.EditorComponentAPIBus( @@ -454,7 +471,7 @@ class EditorEntity: :param component_names: List of component names to remove :return: None """ - type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.GAME) + type_ids = EditorComponent.get_type_ids(component_names, EditorEntityType.GAME) for type_id in type_ids: remove_outcome = editor.EditorComponentAPIBus(bus.Broadcast, "RemoveComponents", self.id, [type_id]) assert ( @@ -468,7 +485,7 @@ class EditorEntity: :return: List of Entity Component objects of given component name """ component_list = [] - type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.GAME) + type_ids = EditorComponent.get_type_ids(component_names, EditorEntityType.GAME) for type_id in type_ids: component = EditorComponent(type_id) get_component_of_type_outcome = editor.EditorComponentAPIBus( @@ -488,7 +505,7 @@ class EditorEntity: :param component_name: Name of component to check for :return: True, if entity has specified component. Else, False """ - type_ids = EditorComponent.get_type_ids([component_name], Entity_Type.GAME) + type_ids = EditorComponent.get_type_ids([component_name], EditorEntityType.GAME) return editor.EditorComponentAPIBus(bus.Broadcast, "HasComponentOfType", self.id, type_ids[0]) def get_start_status(self) -> int: @@ -690,7 +707,7 @@ class EditorLevelEntity: :return: List of newly added components to the level """ components = [] - type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.LEVEL) + type_ids = EditorComponent.get_type_ids(component_names, EditorEntityType.LEVEL) for type_id in type_ids: new_comp = EditorComponent(type_id) add_component_outcome = editor.EditorLevelComponentAPIBus( @@ -711,7 +728,7 @@ class EditorLevelEntity: :return: List of Level Component objects of given component name """ component_list = [] - type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.LEVEL) + type_ids = EditorComponent.get_type_ids(component_names, EditorEntityType.LEVEL) for type_id in type_ids: component = EditorComponent(type_id) get_component_of_type_outcome = editor.EditorLevelComponentAPIBus( @@ -732,7 +749,7 @@ class EditorLevelEntity: :param component_name: Name of component to check for :return: True, if level has specified component. Else, False """ - type_ids = EditorComponent.get_type_ids([component_name], Entity_Type.LEVEL) + type_ids = EditorComponent.get_type_ids([component_name], EditorEntityType.LEVEL) return editor.EditorLevelComponentAPIBus(bus.Broadcast, "HasComponentOfType", type_ids[0]) @staticmethod @@ -742,5 +759,5 @@ class EditorLevelEntity: :param component_name: Name of component to check for :return: integer count of occurences of level component attached to level or zero if none are present """ - type_ids = EditorComponent.get_type_ids([component_name], Entity_Type.LEVEL) + type_ids = EditorComponent.get_type_ids([component_name], EditorEntityType.LEVEL) return editor.EditorLevelComponentAPIBus(bus.Broadcast, "CountComponentsOfType", type_ids[0]) From da0a10bb4cde930c7266bbb24d2cd6f5f7dedfbf Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:04:55 -0800 Subject: [PATCH 290/399] fix for edit SC action in entity context menu (#6686) * on demand reflect az events when they are the return value of ebuses Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> * fix crash and functionality for edit sc editor context menu action Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp | 6 ++++-- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 9bbdddfedb..1b5e97ba36 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -265,11 +265,13 @@ namespace ScriptCanvasEditor action = entityMenu->addAction(QString("%1").arg(QString(displayName.c_str()))); - QObject::connect(action, &QAction::triggered, [assetId] + QObject::connect(action, &QAction::triggered, [assetInfo] { AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); + SourceHandle sourceHandle(nullptr, assetInfo.m_assetId.m_guid, ""); + CompleteDescriptionInPlace(sourceHandle); GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset - , SourceHandle(nullptr, assetId.m_guid, "") + , sourceHandle , Tracker::ScriptCanvasFileState::UNMODIFIED, -1); }); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 6222d902da..1176df61dc 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1139,7 +1139,7 @@ namespace ScriptCanvasEditor auto loadedGraphOutcome = LoadFromFile(fileAssetId.Path().c_str()); if (!loadedGraphOutcome.IsSuccess()) { - return AZ::Failure(AZStd::string("Failed to load graph at %s", fileAssetId.Path().c_str())); + return AZ::Failure(AZStd::string::format("Failed to load graph at %s", fileAssetId.Path().c_str())); } auto loadedGraph = loadedGraphOutcome.TakeValue(); From 23293a13c14b90402c9aee42dedfbf53cb3b0934 Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Wed, 5 Jan 2022 21:51:42 -0700 Subject: [PATCH 291/399] Improved DiffuseProbeGrid blending around the edges of the volume Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- .../DiffuseComposite.azsl | 2 +- .../diffuseprobegridrender.azshader | Bin 240003 -> 219075 bytes ...fuseprobegridrender_dx12_0.azshadervariant | Bin 32631 -> 30575 bytes ...fuseprobegridrender_null_0.azshadervariant | Bin 589 -> 589 bytes ...seprobegridrender_vulkan_0.azshadervariant | Bin 24581 -> 24081 bytes .../DiffuseProbeGrid.cpp | 22 ++++++++++++++---- .../DiffuseProbeGrid.h | 5 +++- 7 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite.azsl index 9aa169beea..e3237e59a2 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite.azsl @@ -150,7 +150,7 @@ PSOutput MainPS(VSOutput IN, in uint sampleIndex : SV_SampleIndex) float4 encodedNormal = PassSrg::m_normal.Load(screenCoords, sampleIndex); float3 normal = DecodeNormalSignedOctahedron(encodedNormal.rgb); float4 albedo = PassSrg::m_albedo.Load(screenCoords, sampleIndex); - float probeIrradianceBlendWeight = PassSrg::m_downsampledProbeIrradiance.Load(probeIrradianceCoords, sampleIndex).a; + float probeIrradianceBlendWeight = saturate(PassSrg::m_downsampledProbeIrradiance.Load(probeIrradianceCoords, sampleIndex).a); float3 diffuse = float3(0.0f, 0.0f, 0.0f); if (probeIrradianceBlendWeight > 0.0f) diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrender.azshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrender.azshader index 781d7e26e514ab7a100ea668bd864c3b9ef1f0b9..1f045706254b0b0c859f4bc976030ea3b50a5844 100644 GIT binary patch delta 2922 zcmeHJeN0 z()sn48w~~n8#CU?+%=7hYP^p;v!My6&l07YtnF4mGf9@KJ z#vF?V54cDrwjZR~xOg?(rJWbMIMIb3iKesJkj%nr3Jd-qvqpa|dTMDGD%qr0ND>y; zP#MP>VJQZe5t+3gx3ad7jLHP0G5^JlY}G_Q2JWR+v{izYxyEJ9IkshzF3lP1y`cYF zzY}Qpi#4|IWemE(j-wewMq4`R6ASFPNl2_@Kw^`lGE*!@YzRRr^L#5azatBO$`!WC zO=N$>`TlKUgPvTn_m$A~7Q(O{z6L`6L@*M#@I!NE)-`oN6^~73KO34bY zd`!*(Dl3UeJzINVQR4A%VQ{s8b@%6>cL)|Jd<{_eFLE|%QqNpDP5zj;kBTjZzL)d8 zVRyBGUq$M-{7X6ybdV^WQ54~mkjbiVDAH~^zj+vZmj9zBqo~PEnEN1DuqB`N=%XJ2 z9PIFk23;E73C~AH?8~w|TyG&ccz6aj%}=qalRM@GEa`=1`016He(R|{^E%(!r}c5m zItO1KP=y?jFTXr@(m}mVq9ZZWG1HXYDI1@UQY$O%k;b=IhS@=#z z55~C*`eT@ROd9Tp3&E&>!lsy|R@t!Z+1Qb2Zrj&V9aC(_hDE!fS;Vk?Db)U5V>~w4 zxwAFYUm9P~f!O&?JDgS40lscc?gs-n6&guu7gy(QlxXv PTeDy6z2!fY_0it}yUs(O delta 6935 zcmeHLdrXs86z}=I7D^Q;C`gMHG>TImtuixBoY24)MCGNRa}KFe1t;R8^${JbqMM?V z$AO*9*F+7Qq5-Y)8Rr8tgR&tnXW}v+MJKwAOo@LjPT1{hiopf5#bsIl;ePktbIy0p zE%$eR-|y=x&-^Q1)uY6c4|Z)mqc%r~(*Zl;LuK+fefGjELym4K4w=#c99q6p07unX zzy^$(x(VfDBv^N4q+6`spvzv&tQLU?)0ve>sLtnx0Gg7-)Vh)L6V$t5vy2{9K!jJO z&3Ky5pkJP?TTJU8g9@wN62OF74+XCfiRk=RPD^{Aa4K`b)}wCtp;Cggd_&~&oVi)f zj3(#k7UJGpSyZIwJn$Xg5mem(;sHHEPtJ5&m8p3N9E>gLoAtH4WmGA`!Nwh6zKeKq@vvAJ9eLz*y>mUbn_C1JT*L1$Yb66N830|z)A z;&h7_BxSGGFHT*FoktZg3t^6qny!OHYW+vj>gLU}uH&+Im6)MXVRKDdug(NDTsl@q ziz%-ayv*Z;aS+(^T%SovzZ{oMQqvwOsLhK`?)2#SKI(LbbfM@b#B#6{&+~(%zx*`e z#{IQnG1TG#V{pfXOzDA&?Gfz-+MRebCF0Y5{8;q98RPc;8bfN62|@J53XFSq1l#yU4lk_{j=%NZ>Lg30?X7@uvE5!c62 zMh7S)~X?OD4 zHTSA4CLziTDrG`Z3ZE(#G&A`5ys$4Aj4l@7VgW7|@G>kw@O%hTDMjbPKF4(NxgC8aNaZ>EQBRMvsIFttOf+sGj;GzmHs^Fpu|1wpuf>*PwFSxZb)J`Bg zJc_?4tZSIjAQC3N&42FEgFy_N$n}vyY_NS_pT83JLLC7Dsc9n@KukqA3o5hDt={9m zswI%7hVjkYsi7`0fr$y2SCPrIg|^U-+28VZ4bC~|i;dxfXs?(HEQwIUU}`DlBC%+r z7}eovZ0Zvar8bXnd~hZRvky*Xi`qIUW5dt{&`{MiCd?EZV#_RSI2B%m)$DQTSPeFv z@~4DLVBgVT^x>Iyp90%{i8anQP|SvwMA&9`FL`~Q-I;6kq!FvTbTD#Bwy0!xot1*mQ^;vu)D=dN30f+ILwB^hnn^vJt3?v_K6F*@K2kHo8JsXsqlINgu0cgGVcb18QN=TvK~ z+XCC}3Kcd99M`uG9T!afZ#7RBOxY061yg-fj$aH@R^4kZYa^X)p#7Wjmz_v3;i@kR zSQ@CTV%UjSsDat#xju+s5Xf}AIGT1FR{diVSZi;6px8-no$!A_Ev+6Ud$jJ>LHFkg HEb@NE2SB|uTfG_i1uL>-z*K9#S5M;gr zu0p{HEroAm z=%^d;LkwR?VNppqsZvBC=n>PsP>>DsF`h7TlA=#DTzgA${zpIEelBf`o{tQTU7AQw zI9m&ynQ(5^Ge5V>p3HdLbh?c1n9b00PxW^2slN6?O9I8^aWq0`nh&Pgn{6hEr$M&XJ#vkzckFpC*u}*jmR# zl6waS^)|Lmd`l42<-TYj{9%uM=NfdJ`n`;V7D05le6^EHL3;8Yd>TJ9u|O>?4S$HA zp6rTGR^ZpNIlnonyt7MIJKXgq2p@e($MKZ9Ar?aQ+w_*h{zNO-!(C$)r13n5{EV$t zokRXrM1DDjw@E8m7O1_H`5l+gp|Mot6JZlpjO%1cKNY>kpL{Y(0 zO?V^DfveOT6q`(y8c(3~+c>6er6xUM(;klLdq}O(ifV-#>tQb#?=SLkg23xME*LT1 zD+u?!m%J|(qeq0;r96nTyB@y0dZiaVJvk>ck%~X$mw6x|Gl7ra>X(_s#vdwBOD5nG z(=rdwVf4nxiWqf{VlZn3ak6{1o^7y%Im$=bNli1!`pcv|CZ z@`4NI9$GJQ!L)tBICE*3v91L{4b8V^!5H>RYH%7pwJS3z4S!(4<*0;9OmNc@Zdaq( z>tV^7<+c}P-9qiQFw4iUuYR9fnKgEP_lfgM)htBj))r^_k@O>Ki?L?H+8X+BDM@#| zXTS6yAv0A3hLE{Sk$FUvnaJh{F2x!Tn;TCGOh-lfJt(uOQqu|GF_GSOf&QCTg<=%7N&2wMA|4uPh$MrZ)msL>RyuU97MK*vYhj zZm7-8$yT>s---2h(x=nuZ3JjZfP&x)ohW6)hslA2Riz?b;@6NG{4X-YmrnFhQ1HZ6 z3I&GfsTji$*D4rl#LWtx8gZ*aq}EgB8sH?dPv_w*p{1PDhLEHe;zi&@R?bj)0ZP$9 zg3NbAQw(^6)=q~L&X8UKirz|sOrjuy8;0F&2yMCx^(W#)16#F^!7SPX&-5P2r1}I~{ zOm(k;SjHI*=T9@zf4w#yYJIzW!d0OKO?Rk;g7=($&_4qd8i-SmB!1Oijst zQyTi^FrE6eP9TzUJ-a|p1L@rZoR*4a;0~Qvtt18kV-dS6Q4kTGl0?hy@MJgvrRjsO zzS}yP>YI68={JUHP-75)))pGUG(>CHF@@(NjPWnw#uMR^Is7{YXAW}|$oR9)y!JE@ zX-30&cFhT;{tpax6dIarEE>gG4rtAgz({U19xY9;E8JO;J5UP5|J53U0;6C5V4I1t zs@V%It|n*()I^$@=U0@JB5G2U_Yo^?dT?&EF!&5@XCY#zFN2I8f}XXtNr;VDRP}iN zV-#+Gt@!}Pu^|0F!l~1L6LPi9bJe|UUbbUVdT#_${`sy9XdR2-dm@H9L=Vzl6T2%Z zS&*2#E-u19E+R6GmMvR{jNcX5*FsW)qRK#=iBY>^ccp^Ac!}|QBg2!Uh4FELg5<>LG+K_#H|wa%(3}3*^yB>w ztN4t^yS?w~H`obpNzWV(vZIx4IGiLsW7n{cSO#xs zFQ)4qtVQ{E%7*dTTwv9-kWY#|Z0WAc<+SuwAi4!oh@QX+yCo&+R2k|?>!-0I6Zo^= zz=WRvb#i%4P0ZaZAOEeg1(RI$?>?b~Hv_!qugeVta^5V+x!1g40?n3YFdv!+`hdJO zKwgaG8Y0iOseaopiL~tU&lzh$gp5Uf8c+V@ZkKd@-&d(W>*EZ3zSn2D!AGNQ!~YnTjS!4$qtZ_ej4P7=sqEJSSay zLuim&NI#GE=TbJ0TUisX@O5;tQwCX{$B`5|pHHu~A59E*of)0!nV9Th(YukRO2jDFmN{Olcf6^}I$ygu zI+in7&XW0PQhGYl-k2ONJ^bgvc!G58|;$G_I(vzwm}-c!43wIT!ln3 zPHG6Uc--e<$U-!~GDXG-!eSzQqId63Ns3(W4}xqr;}9ej--8Q4YM)g#($&3`MCPN3!MlT_EUN!qJ`Sj@-RyGngX8L* zRgR-b;KRChF!2t2Xx?$aW1iA0$QTQ+yWFb3?&RYB)#@Adz|+piHpnLa-x^#+rytzdIBic3-l zww{0Pv-reVL5x?l08C*AhTla>7wJ(K;9hP!}&9`Rp7pcgXO94zXjx+``@Zr?XMV^dwT0%Wb* zZ8*yjT6R2`-+REicsyS{U0zd|F3;as+MVAgEN!XF1#4q4SR0Q?|Dy@q;*40j{u0y0 zvf0JOy`i?w>0+bXO<-_jLD8UPTO~6Fz=EPs*^9Nx`gLdLtBBpKZN4sG^nUm|+Q7^K zs?l!}9P|++3w#l)fuVcpgWUR*e;I7qTZtc(7Je9d?^NK`71_wf9jNPX!c76QeqLSw z{JIu-IBnD6AXc>!>-vc|ax}hCXiO%MXGG-R8Cq|7TB`)Q9{Y9oDfJV__3IsJ zH#oE>0@L62oBqKud%MwWX_$pwq6I_8(#gs4#u>YbO%5+Nt^Divl~s_FrMFWR&*>81 zsVc#VmE?Ra+@rb7qvf&3n67ZmV`omKOtUpZ$uRq4gmV6e41tZ=%R+jiBp`+`l<6B3 zTvU8-2&w^n&;p>2=)&P33=LsFQf1NL^w}r(wN?EWIb~YlLsTXSFn)uQxGn zHmiGyHS7mRC#NQX>m2$EHh8=Xvn+Ewm-=ee`XAV z_ArlL>6P(o*fwhyu+d;Gr5ELlHxH-Rfh}*KdbWE+nnThaK}2L?V0=VmOpv6UWccOD z(2>y{C8NP3qj~(VV9`!JSE|{|E8d`!b6Zo-`LNa*_-@aHUq)Erz7 zK{)W~3V!^+PXqXw1wU`W&9}A<9nRmQmcChrm=A*fQvav<#=!ND=KB+-V~SCmRq(jF zA(r(9C2TW2{r%$?X>4LTn@$0i79$^i4u@6bC~8|yl2J6eD7x%~B#Xx|4U+vcm&d|=Fip@8q)j$hdI6gb^qT+T zqk({=a5_SI))-mIgbW04+I6|fnW#RiIskKZog54ZbVakKrjAzuz?UOSCeHg7iFV(w zyhyjui^+0E^UzvHPf!TFJ*OaB9MCo!?Xx^%8Tf=EiYy5|W9kZb|0!`BrBz zfO~BJgGwM>1j(NnI)DLt{qC(W)JLmTU#vz8Ymo6`(GxeLZ@gDOOz3`2$=GAn5pCsz z1)7@k#al&Tkq{PQ+7amUBe+LI0W&4r`GDtmR~c38Dgu3s z7rg)Fx;Emw^eMINsNYTgLAouQ+<0<#vvtYv!%4qliibzZ?S z5%2BWR%_(C`#I-l?dN6z7%eIsgJV5ho%!P?gG!Sr@sh!D<9;y$a{K;RgdwA}CqoFY z_Rq6uz`r3>@5_%Y+LfX4w4XfJN`Au7n49|t2>&&55eUCb9^@i8)QJueAl(9g6-jnM z=|3_z85Nrbo15H4nM^6Qcofe?ix2%ex-j-K>1vs`M;^vAPr4fL<7)poKXhxpc##QBbhO)Ku9~%Zz=Sg>(y4SKdzJ>! zOa!Kis5b%+2M{d*qu2C)O4oYAAivBZKOZBHw|?Zr42>xYd18+I8Zi5Q)5X9z(=PyF z(|QC5Ey99&315YU8TNje2ZI-p>4f-282kdp^!WBHRf$05mNP_0CWAN*Y5l>|n&Ewv z2}I2;7WHia${P^{k_J+d5El-DAXsS^R%+TNHeT=q^iAL*j6W2@XpdGEK-g#s%vN`z zg38BCj@GYpA7tn`as@XAFEQt z4Ul-+7-ci6LdeH@E)Koq=@N;r=O3)MS>-t-le9&vBI$sM%{OnDX7_9q+Gat zuO-A>o?~PqZnH_(7J1o7&(J$b(5l^#pA&`+8$uTWf{w(An9fjRA&P#N1f}eT_BdkL zCk&y0UWgKg6Oo;v2tcRXNRT$T#h542!UYt49!39^1bG5V?T%p&7(!>jtz?|25ClnnHTem`IQy5^~C`_ZK&md0j z$njIlYbaf3fztXE*o`d*mivuwyBoGNDyGmH5zyt%?wVkTE0T8Kk3_voHo)* z9j6s~EJDaiE+w>dsWqXd71my#gj?yzNmDxqpICno=jh1EQY(Pf{kChgak&(UO98!C z!flB2TZh8!4U_OSm~gXyzs9(=H34PHr6en@8}b4OC~(m6u`c?W93bXBI2Tedx@||% zj)$Y?c7Q*z<`i(CN1Fzw4T+sO1Yf{t8oiuNQ^sNv*pHc;%T|41$=dUnl^Blj=MIEF zx8&&RV!voT{tx_|pytBUa*Ev*5uLPe(+Aot^DIiP#6$sJCiH%cPZ^ur^Uf(;!vi_j zJs*&HndE`peraZg-gN5--|BV0!pp?9{Qfr`)59H#N0WodX8z0G-pQUR7Pb2bvx(DZcdZ!>D_zSXm5<^61GxUaQx4oyPM%B(C(k(3hU|YQ6S?J0VrjDzlUFSM*N_MU$=LD!D zEE!?kkkG0L@b#6~orKQr7n#U8-=fcSNZejAtFa=xZ)UkXn;a|6z3m5+RmS;BY8e0n zNsfbWI3}(U_rK|H8}7~NK~8_b1li0|V1kP4E1R9`tXysaqQbnn`Z5zaJa4kpv>g%y zlJlsn?zFp2y5@1aVX@l{LUtEHKHMeeQg(KZFS926GNuc*-s@Rdk9rOxEuwu4AJ=br z1hC7gwuz||qX1iU^~?cDrO;LGF&(Wo&a-Z7#O3k1bF(+CyMynv%phw z(#M0NgaUY?WjE~m`E+Zk@dCbY&QI@-K3e$k*T#x#`F(DmuC1zQzBm7GAO*bz9D|Px zz67I3c&+dQhn^k-mZSy-fgFLl}x%X9E6DsTSRn*cEDe7pp+-n{H zI&K3xRt}a2nB<{7KRM{@=0=w5^?KVIF7B5aotZa3;P*K&nIpCsZM`Dh#7BtAJbqVu zeRk6Kdlf)_3C>;sGK5wL{|{770c0a$tI>Ag6Z5Q}8=sRJ7Xd7ur zi>t!z7DH|9H84MqRiMrRQ-lFi2tU-Q_NNFU79;Iegmc_rK1STSsHF5vzT){zpWJqq zB#)b_xhs#8P(~5gp6d(+t{q+o$lR7f;K$Hmw$;>N`JIdzZ{1bVx~{pfyAt+%0rSlB zgEr=GJ-8%9cx6fG$dX;^28nJ4DTQ>u*X%2^`|PW0xDKS{T!-qKY%s4to^9NKjtEVJI;fMnnPeeWc8Nwf{&`-oEKL$s=5=^;=G z0bq}I_%Li)bswPO!5NS#^X`AsDSXsf`RG#TL{HCXIl_TJ8oSM`2l*!d>y3QD448Wq>rH6~FV7q+*N#Tb)V6Yy&9i*m=Exto+ z|8VEsUr>Yp2yQ6@*!*B#= zXCM+o#c<91sUB*9$DsoY`us07?46^*dF+UzU2eOwCZ zOaYzoC)k<%C6Ls?Q~a}?pr=xq0dH~&9CzEEtuV4il#Jl#E^a&gm^ zrNM$&J8!4>&wc4ds%({L(0}^e=ew(E)-9zkqicGb3U-$ns&-@s_=q3 z4G^@(Li!$1-6o`pJBvf_hZKQQilDd?cp__*rg8zeu)lb>)^w}TT!lNWmz-Vpr>_B0 z)Itj9mtKIyv8%CVB>!4|^T5U@%6u@S=4iiCFvUqK*sd2k99;AOxUjSsw`96?9F5Ro z7LvyhS~_!Sf4X~DS1W>L-R@oUPk(~gD`YWKou1S4;bOpA;` z3P|xqC6&@_eMCfI&`#RM`^Gy99t0b1G5o^t0oc!tAvwe)@LxlmPCNoyNw)E)u5z!& zIK(0woxsPsDPsvLTE36i4lw&iU=B7Or9aBnnYbQNQPuO0ChoTl%LdyfSyW;76f**> zn=}=M2ier4w6PZ1ceu+#z#^x@x!E?cryKyrt|n+b>#ONSGRjMkQQS&!DbuayIAr8! zt(F=1p4A6v-8UT+2Qy!F`T{#{zHC_Ro{%+9r@N8WqdC8?PsOJZJPl0plUnp=AWmSp zm5C56{01Nzeq(+OqG5$fpVHd8RS2kF&TOuCYjk0OZNwZxs#A?dKt4A_%oGw-RGd3n zOe+Z)4mSK?uMw;{l&R_K zuQa&VU_2VaJ#I93e51Q&B594TEQzjR3Tl+`G4Y9;FI9h2**0;vXNnItR{v)DUS9*w z0F+mvqt=8eo_;8}4R+;1)wUeez)YCFujU&-$E*oY`TFxwb7o?qt!uDtw6ljr>3+|| z%}30~5`w1BrnPc2hN>V0jH&T}ZT0%c8)&mS=5=OMJ)`+bE!Y@1HEa5uS*sZmW78`+ zHiH+wjFRNYI=~A((#}e$Fh-j5=MPwMPo}2NFRMCn2s;7#UH8+Dkkp2t4fn4ocO?&P;N@_rkwKY~yH z(R%v*oYsFBxw-;vJ!P)(3vClaT_;;z=MaO`W`iSchIz*g3tyxc3hN4sU#OiQNI(BV zt;C;pjdS5;wAt(9W^YH#{(5oYZ*_BR3!o5{P7`TL_j@gCG-sD;w)4GgnH*kb!!V_q zBEMA2bg8_e-bU?j#|lW30&hN-(#ZzzJ%v-WXtGNqwbbX2y;fqq9hn_D=HAXeQ9aZ9 zmLtjCzFS^R62?myxH$%gDg|#%Ws5zy6m$~!gX0ksoMBX7N|Try8ztCeCKHC~{rzOe z!uo$-B*GqcAYQXkps^%rn9f|=C~!Q~m41Yf5wR!B+&iOnk2l4ahBMW%r`YY;!dXzKIkm3nf$>9-Y5edy2pk6~+GI~}Maj{+ z+yR8!7nNChZOeH5-79@xU)fdC^E!pthe)`ZQ7<057C0%?$*X^8?kl zR+0_B+)zj>2{j$sfvA_K$i4|0Wh2{H@Y+nE`UFA63pN67;7kx1cQlOdtio8QnamUG zFYx~))_idNBeC9sN8WdCSRXcpM#*4Ce|juqXBTem|Hh)T*vXT zq3XP_R@D+hLPf&Kb(@box%td?Tj_6$;8!UnV5{xl4@y5y-s5U z9ds0%Lee{IcP-J*OCr zL56Cbm>h5_0i{5JB4Qf^xloZ(3zk|h)vLGt)(KVczWe*$d;WxkoU_;3d+oK?UT6Jx zetn7g<4;Vr5JPf$uD|v5&FoOcN{rCdk?kGo>2)B6Y;(|bq2*_?3mX>%;Kwisg0LMG z)ff|Okab-L#sR|_;~+>lf6N!9)n6qSEkZQ`eeB$2C+t8hQ$cp{(w$XxaG5$ki2A*SnTQ8@}p_lfvKh5 zG<=t?AwT~hp~zz7)v*T{&RqyDt+Tlc|bQ~Yl>f-%K^!x zT+cG-%Je@MP@voy!3xlsD_W`;b}@8iP_dI&InJZMn5@!j%A_G zw|2q?rfCL^lJde4vOKMle=1xAuNwSf#npudzL5Ahl`BqC-jgiR2oa6!M6T zMky#Gx%kla%hy!vlPyfN@R9ss>)4~#l2=rk*8<3fYvdy|MW@Ae2z-sqZ zr!D-8-W##)cut26C7;X1b7JP}JS)l*z#QTmMLQHV?hcAW1Wo%oMEh61_N6@9PpP!m zLqzMXn>eT;|2#%FWEx9fusYXTv^cWU5f)-1FYZp2VkHAz{Y8sDDk{`5$Z@wkZ1%vI6XU-@I`s^n6WULh7^!L-%*1 z7W1yiqrD2GJ>zTtJV|>=r;Rs~e@>*0@wMwxX~TTluZh}+Q?Ub*S;N?qT~Uy|Q{>A= zNC?P6^rQVz&se~crxa!F63bKEh$*GuAF`LcS-!Mr=)`%s^~d>ATyb}DE~nEbx!V71 zq&@$j6m$*F)^$;zi|Qhwy0EE%MK+3VR|h+`;S08D>#WJT*FSr*&T2THsq)T=@Whw# z5yh{I92p4Z*GAggMB1-Iv>CTRx(XD(EwWN9qZkno!r|1kM#Y9OAB?r)T$n3~M9tF4 z4(GUoCmWh+EUnH;Vi5Q5CGHza-=CPZ&o?VMF)N8h1?E;!_nL)HnyF+F+2ohyljR@^MU;DM#ylHwt4jWO%*mH); zOalXpVwsB1oDCG;ko7dJkdw*yQtl&Dg=yF##+b~!1AG#{T@kLAfMXJ zAuX?$`Pz3BvCd%J>txzS7?;p2P0xq%+V8?&dKn!5z%}2iVnIdp_`_cu~4jd30)g9cp7nTu;M1WC0rmU8PR zz9QDRV5x}y8kxf*3FG5PaS`d_ftE~xw$lLX(bV#jyc-+? z;mKgv8%p04T%CrLOG?)gzM>SFqzV|5Ti-cFP&`Wd#a4G^*D#FxN`j>(kxB#e@EDql z#3=|t!vAVw#iio`)EDvgx%LyC6Kx%FS8@{4Ph=2x6QPT7PwtI&H?1 zJ}e^xdVNCUk`~%))5Ib3Neu0kBkgxb!JG8MMXWcNWuW7oiaziSLD~43R4d&)@~yIB z;@IVmoa5F3Fp_cNZUT%X?8&|ECRN9kp4KtQO8lha>oEGp@`;PI>D%5DtI*q^o9JzM z?LA%HXg9OP@u-z9Osse*vTMt|(t+CPJDc1Dkeovzpf+OWRJd|q!E~$g#-uVv2Uhxq zn4L{JQqYQL>;EZ9L&$$t3%G%iUU?Qwyw`Fbbz9zL(ihjSF1p2Cbj!lE*2=Zk>5i7L z#{wO{DcDy>*@aM>z)xDS(G*kxc_AHVv`>do%*w|4#xc5vwEZP%e6oe3fFaL=72xRy ztx&h8Njap-MhX*;^Wota)e5*Nk+@-^t1j8YNx;>}FJe_R`GLQB6tPOv{J?J9K6*wQ zEDeQL^JkF}O;r;YyN>(Ycf@y%2V9A7PAzMy#`v{oaP>NnbnZ~k)LcVe2=8^v6bHPm z8=sEjl5oQKE#Z>nD6buHJCcNw2x-cWBxa6x0BR3z>7%LVQ=A_RTcY)O!avYPD*Pj~ z5ifpAd{l}g4jQQMzaPM*P@7T%`%evQd}@4pW8c6)ZzyA9AHh zS9o}pA8>Lmu`LHrJdoCahX!AMXu!ViK%UWT9V&{jRhq#e7yeH2!lImiuC`f7k!N%z!3VhAtz8$(VE{&yE%OR(#ysnL_YhP#7LjtEck zf_WRj$Rdq$A~zf7AHQX5RBX)F6u)>$Oq5?jWYk{0jBssO`Co}IUnFtnUkm9Sa*cKoL@R## z{LAAB{x8QbPJC;BdHjk^&Psc&9k~4a=yh{2Mq-`6?d_6$k9XVN)vmC;y`5aHSkb&9 zsm@kWV%wi;Rp&X5o3aGo?!DC0{<3PM>)w-lLnDK|?JZ+Hg9E3V#zuM|+ANuveZ-1Bx^sOIXhR9*I?L%*ZNdjpzV;yL38mYh6@!{9`o+s_2XFh&* zx@X|U^q*h@YncC?%2rg(7t)VwbHjoV~r8`$mZbKs6A_vVz$I@Nr{b%@=1z~42g|Q*{YY3rVoyC zTRZ`d()iuSxt4CXzpQoqGWErR&fMcR6V%*| zHDygdxUIQ!eRaz&7aUbJ6W9*wZTwL9&U^U(NVvZn-mq161yWo5+_1en_h+|sL*T`vvGu-{Em;NJ7yQ3@QLh8AlukD zClX}eoH1FhT-o`!rtlMc1%tgf>1U~o`%;YKM}u9xd5h~bV=u^k$jlt8C~hGp-EAnk zFnG7?+&xo|r!@X(Ik{(Qw54EorqK0u@J~X>LBb^IC#tF6JHfh-oAJrk!43}Tfo&Ws z|CCak872NGVtKI8=w!?H`oa(?=agZ~NpE$;;jJANhM++`k`SQ)jJby|G$MuU4pZIz2_ z)eYxjEnyN5jj4_2CoWR8U&dcqdF7G~^|PNRL?ER?E0YXTM36lVwYQ5}zZ!y&Uo8kgx*X|JEBDKkPr-Pq5s{%%Q@*ck|kz!eQmz&c|(q>*Y0%3$^ZEQx-OK%F*Bl zTjx!6evzs$Uui5o!R*im4}>w8i(@c^oz<8iTzyc<^?fBbi9Uj*)%=5-_t%YCO!Q^HP$nv>S-SV6Z|5sK;yz}VHZ0Vh;lCHSa)_@O1Ls^ z9h-jQ4o#>n=2q|5U1Q5EpWflp6bJNdJ@Qvrf{kj@|J|Bt>1p;@V)lc~tgo20cm#IZ zNLfos*pv0AVUB9d&}@oj@rTezcuG1odR^(8Nc2F{BG1I69pO={CHq$INRgl+1v05U z+=b}fkEWtSz7HN1`Vp0N^C(V^;MXd%`>6$uM? zK1R^Z;0)p)qhJzfHbkVL2|~EKnO{asi||_uDI)US&6pHRTMB zJZTz(2h0Vqs{c~*Ns#Cnz}_CZKL1P@WBrDr{?OuwXdd|#Uv?gLcMDGyNhUDuRy&4(%C@^l3bktFot>4%mAP^$8UPF$ zPXy49ZiIcsI-`=#pk}B$1Tk$;rOH%69s=F5hwd0Og_5Y5S{o(?R=ylx`Rn_YZ*o?> zJ+taxmsY*Iv+8}vs(%lx`g8KLzcT2WXYtm0cyqvPl%rl(onKUT|p zSsf~tw?{qOD5w3=n^JAjuzs-2AiT^Vk!^HPVAL^es=}C!NX%cAnQv?2?EaDSecFPN zrUlXIyrgno$Fs#M+>){KrLUWpiblLc@zUkt-ooe%p{Pt4tQ798@CjD>wBkh@9;{0e z#iQqgmCa;vIcTrXbGOw*w0;eRpW;al*^S8^>Zfxt9O&+Hh>=^o3GX1X|a z`R4NQ+g$|J`=O9A(nP={munrvctsZoxAqFXn8q=$g-op56K-{oDF$LJpGRsjjki8{ zK4&ERoTW*0+zv@fGUOOWp%o3C4?AHNHdwN8eiPx|d6rw3cx zRaJODW2ePN4Ydt7+#70Y8*G$ok5Ipp+iPF3YweuKwMTQM_=Ka4UXrz0AQK(|?2p79 zwa>W{=g$?QvLLpOyiz~wk5=JRdO>m2_+`zmT+p82U+q)ZJ%1TS5i+-k(@L5q3r^Ti z$wD=J{(&smV1X>mQ!M5rV=+Hc5lIb5Y>gxpt{mZ>iknt51y5W zXCKeQb9V)0t}~Fy@B(Tx7yXa(rQ>x58S2{bX9P{QC@%87(>OV4rDXu$*>4k>lWDP5J;g#v{mE2@7X|Mj1^lP7PzgDp(G|& z`?uD+9eQ`@`4mrsQ)w5WMvTZ-AP50o-QdR;e(K<70)F1Y#eXiSyYKJ~hV$AMH6nui zoBXK}2jKG$Mtn_H9xDq<^?fi2uR5usWW2z5F-E^K z!NgwLWbXMY#B;-uHirbJ0T_o~`fy3}^HnM@-@_!AX3x^pb<%=$r3NHu$xjV))jG9I zqRoD5)oYP1GsdJv@>*ucS36Xehi({2!Lu=N_qMyla3c+h?<1ll zE^VAn`<<(uz^6P<)qWkQ4O}9LPcCC=zoOILDvnc3c;X@A{!-#Z9?A{A=4-!2w4X!W zUKI0xZ_0tDzSefXDyp(|Ie#rD9m~!6VtG*vdo?k(O4sqYrVc$ zX%=1kLb%cZoX)YD$aOPZZ7zdpg+-R9?wP|fvA}##VAd`{5kjlPup2l!lQss$xS&3V-l1j6Z@=)Zn zP}AHGx#^TQW8|;BEIf#4+4a$sgD62L{QG;dRH$}GA=`9FV*UcK;|INvNQ7SxL>&2^lsU znN46)Y3~s#^h7SfTNE9k{da03(;inFZct$Urqp~u0v0qKfSJWm)jU(HaaszXoKmwM zjQQxW(cc({USu-^f}%emLI0035zVOI<+53;!ORiU8jjV|VK??*^inG*ALFGuIPKyr z$|pNWS6dVJld@98S-~W=3;Cijc{RKzf&XCs)yu3uI#RDOtgOm99T<4iN8Rw$@(VwgarE_9s@M6~zwm$CWq6bw?3r}l zmu2P6W#DtXP4EiL=A(7<7UMDVP_O%e_7;%D25<)7;87Vk}VLhiJ3u2J$MN%BU(-=wWLb`!Vl{zE( zXECgwsYn1^11|NwF>AY&dl{*W<3{tn68OGs^TM!Y}A zlq#u6FR5I8XJXS$}_KWOjvwVe+h)b`S(b!(q3B&^gSEE;B<6&% zQaJG!=!S-;(X%nQdM)oBLaw90S6*1RlW&H>YMfH!2~1p1=rZxmhCKWY;1G!t9Gg-X zNNL~-Lggn*Wrm}|mSFUevdr;CsXmXi-a$kU!*DpH%ae*>K{CO~QLtBDq}brOkKp1c z$d(r?`aCyK(gH;EG}j_lhi5?DQm^G0LSlHDnBuB9;@wRV%;S(S<|29udtP1SauP;t`R{*FnTe{`rY-?L;pxF6g|R@bcTscA|tddJdGrG(QtAe$iOW!dJlK%Z4)c zXYPqSx6+*^Up+Lrs>7_`$!w@$-ouzbLn+hdp(C1DhjD;VJH zH2{rWap8eGl4H?F@Kw>#$x$iHoQ$QX*PX{@1wgrF1Ea5h6O{9f2k~rcwA?zU^H8tA zCN4BgN$bFv4Ln=&qu0{W@}-jzX_J(tjsoeV{BsqH@veqF^qE%L!#PaC>O|aM@JPSV z$B5%Y{O3vaGc3Qt@kJvW7z;dwt8t!pg%Wz4U4N*iu;J{(GU&2yY)={O3=~Fb0oJ{; zx?z@_ZhT^&wax+V2~AJ8)CYKs>EZBnaYbt;e>prh9F1dyDYZf~q<;NI8;gz2f=&Y& z*?A&b`$gk$&y*an%H8cQbDypP3LQY)FnxlZaVjo$)wg`||_36biGDl-Q!GFf~+eKkCu z@_NPvW^O>(Oi!nr$HjOJ6L-@&;Z7Vqd=lfBRS(j;xMsN9w>{imE~zHyrAJ)%qsF)59k-OfJ2f21MVKS16!SmBaKC-i+kHL z1uF*{SE}j{J?;x?lQ(o0-)*}V&o~_ih+wbhh+jmnthsVxgW{1k>OyE`5=ugULpQ&V)a@6~o8AhOT|?E> znX3Od@VC;B?6WDwQ+sXneR`1_+_|m z!^XZdYd-uLyyo=Ar_+Dp*{P@xICS2HkxFN%&BZRQl`jLJ?u!;9#yaDV+jjt$Pov+5 zIc_^8-15mxEDz=xwoDgA1*Axb`;#jkIY6M8)$6eyRr~Rgo>ui40q8YaW|zkDt7!hR zFFy8K`a{?Trs+oG-i@c3W@}*OJni0imiZLVE=6l|PMxjbr`@xV)e5wBUXpg8Ji;G< z^4|;&e+{kCRXG;J8i=0ZCW$*@6H?R^$!o{11lV=(Q6}F*AY{dS^p}OwEJNYc?jH;Z zM&92T@>~n6LU;mF9E|6@sLlz3#EfeHw!NB2c$1=w#JQJ5uFL*MPR1v%pr_UNMe%=$mrSsES6T9(DdnbEMwvS+L4 zy!?smO=y6BG=R!>oxxf)+?x&V*FPa!)f9+VF(zj(fGMOii^3qpNZ2xqYmxS%(<*x8 z4AVL=zr!?P#lTHY4CPSxy1 z(h6)Ig-B!VBhsEGReq~F=r|a`?YkE$? z7)Ihu>LKP9%xGM1yeZUVV_;E{ieMR3k_j15U*n-?tL=X}XFvYR{?%%SH?N;5^ zJJ~clIaoR`Ot*FRc;+ne;zcWX+noh@uVruoA~bYkaTsH5QCR3kW5D3(Heb>LTeZT& zlr5E&5MakI`(a8WWR!^L8B$dr4Z0hU z+g4cE;D;h3i0`*zBOx`Kzhz6JByx)+#mNQg;|V5rVMk6MChpL4O zopsFR0PL)nuV1abQ_HI5y4~VR0o~uQxWRS2?o*SgoVQT?ju+PosHJ!kQz6@IhpT^S(nm1;^>4Q`dIZ{zrZJ|K7MPH z-KCY|B0BzB5zBO5jo_vnt}?FG$@1juL(Te&Sqy7OflB(POrjq~s`OUdEp6#j(CH z3)^Pjx+6Rs#jK*JgqW1AC@I-vQVSFRbVj4JKP0pybVD(7(;748CKJ<*8;Zd{Fkg%Y z!#*@+h3+cTpm^P=A*TiCN_2FvYsl_`dZq9EFBctgXM`>}f}We0K1iVk3TADUC*Ww^ ztJsmqW=F#9M;>46Eq%6TsUE&_4lFIV?!Af?9xKo(`}q-Lmvo4J;y}3?QNSm^JVNui zY1{z(qhfIE@0s&^=W-ZkuK2p^?OHfn4}6_cx0?sFt1gY7`cD`)Cg;|4)~t zu*m13@@uQOi!W3!K35M%xNg)yKYNx1gu>oLRBQP;;L3uW0P6*DApHF*FGJXG)%`~! z^WS+JySHe$ncF3`lI$Kh7dOz-espq3Iye9!1$2=X)~_bg9M!t47NIBPK#$XWmxkI! z^{xO(g{wUwA(DBihb8j0hcu@P^2Ot12*tFC++4^R&jcpx?i$KVM=iG^UqP{4K}lxX z+9oj%Sb`Bf$lJG5V6-;9lm2FI_3DmfG)Y^&?`UdiKi>^w?jBUNLQlvG??F$Tr$_DL zYT4lG>Rwk}n$2!GW!+9ePPDvqk*gpav4@R9%XkN zgOfh`LZfJu`N2U1QVT5h)<9=32-v7Gr1#tNM@9h6qxSf~#W0ItwVG^;I}fqi5LHmT z*0{evRDJg6#Kt1VMq>!t)>&G@G_L^KV6>q) zeBTV;){H=3dFU9xg3JWpto@`M4r#p6a4~u+Ks7jWUbOyDki6||;X@@PPLA7ha&jP| z!x2v70Q!@%1vlZc;BIH7n#1#T-M8jYbEmJH1keYR3#4xvQD8T>txbNSQr?hT2&;^@ zjXI4(KVU^>_WfLwWnwkt6@oFZ%Y28<@6=ct9vc^%5G6@kBZ*Ipi%Mc6ocY5!|d`(2?=;Yh>RlRa)eqclWFm;R(D438AXR0y|w`|L{b0YrD87kbC#^AIKhSHO?;qWd#5hd=X< zO`D|csA03_ngmE<69U)hWjHowX*Mwinll@VSUEB{mfKQl&LaiXNgTV!3Ic5k*Tx3U zjVKH~(pB*IhqY*kM~~#eGrWX4CQ0KGe&-4pQrx~G7JdxgrSFCP|H^Cs>H_~7m;3p4 zox0V6t#dboJ4O9-xdCTSFgPy*2PcH_Kf~vVvCZMC9-F7D=U?tA^>3N~yeE@?ibuUx zzoHQ@F{_4W{uRul%bezJUX9ygVZi}-oeAt&KfB&K1u?>V_q&F?E(9Td{L9prnXW zCkgRW>J$f`f1pmGb=B+Bankyy2{-yDb~oSMoURmexeWMHkeJ*3oO<=!&Fb&VeEPMV z@$6H$t92O~c~)Owsz?p*!*`~(eSOGOEP#R{ag`KJcu+x!pgsV;H0zUjIR%rn#Y)#h{h?OGFgzcb?wk zcoCjVh!mwOO)=IYOdV!(8V0ksE@R6LJf^;Gab$q5RIb(b4OXx;dMNLp9cv^aiw1vs zEv>`DI3?C!m=opZ#3p{0?BGFD{ez|?oLS~?Z+8a1*~y}&Fb*>g9%ks5nvyIDnn;?s zbcFd;8S~b^O&r7X5EhBxf3M8sRvGiE)+d+m7ISA`#&5i-LCW6~LppTk*j)#hmHz?j CJlqHX diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrender_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrender_null_0.azshadervariant index 77bb34183936f274b4c8c2928fa299896c948bb7..7a90c7f3527ed732e34b54009bc1b661365655d5 100644 GIT binary patch delta 16 XcmX@ha+YO-D-%bZZdTV91_lNIGC~D4 delta 16 XcmX@ha+YO-D-%cUobJ8)3=9kaGxP;A diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrender_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrender_vulkan_0.azshadervariant index 117f993f2808b36d1ebb8e9992312f0123a4bb29..4cbb76954dbaef688dfb2961b893a2156f11785a 100644 GIT binary patch delta 2089 zcmZ9NU1(HC6vt=o-Fx?LjGNeQ-0W`lBQ7?rA)hLW8VyqX0MW#xmO^pa>KZKBG$c}J z1y_(35&UT9LFhxJ2(9fyD_rP9wIzrks7R|IwhygTs1Jhag9TeG^#7l|cRS|5nVIuD zbMDNX`M4j<$&W6}i(91kD6#n7ons$gQ9I?9?9w-Fs~8nR3L)ZRGfK)5VUhSh%WA}N zL`*p9(|pl??A~)^(!bWc&-M?rUa(azk&|gPl&EA2A|l!mX+a~(?(d9RhF0{YW?Yp|{bLj2O@oT3YdQaq7{-)c%=yso*)G3QHWiqPf z-8{;cXgA7uf#teFK82L)Je5k*<^84dp}|!`Fwvem7wycrXbExXz3EEt;Qro&)$&9I zw!@XGuM5e_B3L8k+1as~iBh#R_0CMSJPD+GG^5s$v*qgaWM!t#J+T;#FlNWWsY-cf ztkHpAj)!sKi2gr?v(6hH@G>Yjb}Ob#yAzrW>?YLo^8nFLn|=yyPSy0&reCV-FXdIN z>v)Z+pcLzs*oI}0@rz_!P{=q7vQ~rH0ZSN+N09w^BpJ&CLm{IWtfmL6e=ySM=op>C zi3~4boTM4Yer8-a*`r1r+4FI=dT!0Ya7A-QAldVQxL9CjT)1kcE?gnm!Z@-<9LCoM zQ!{J?vctkavPK}xIilj#TBij&~_@$NCFGl$$WyDvjK3}x4xNaIEPwZEiaAHLWd zKoPI^F@-lLrrsJTzA^+tVe-@PGm-4Qkq|Po1=2uD6}~qcZU+%+!;z}b5|&|H={1^5=JyX(%w_5S(?1Dy0FCC!BO_RJ59*uHUFws)c{!@S+ncHF4*2ImAI6U2 z#&8G6;G>@svhjf76gSvw0b|z@jK@9L1B3DGPyZ-%BMuAiB7Oe~Dc0gC9xr|A9qD=d I#1ruU0N-NYxBvhE delta 2557 zcmb7_U1(fI6vyZ8?%nPt*`)18vwQa=O_nxFXtwpcv1wx^X(COtag#I;4ckq#i7T6J z*aRCXax3DKP?32k)USs^Di&hpf)CniUVN$)LGZx`D~ca4MZqc}QvCmC?~Ow!r~@;1 z&+nZ7%-lI=?!I=_czNBpGH8VIBQN!i%}n2sM~%UOwj+LDW{VJp5TaQe!pOEw_!Qyu zgH|CLL`dXwlZAn)@xp9r>13_ExO}QsC|74oE9L6E^S-eVu!ABZ0uaa0C(EVN`PzJ8 z0pZKVa%H5rT&k6emEqaph2nha$x;G;Zq8~Uj zyITgv^)sK6>3E`>r_9rS0P24^ZMi>Q@CQXu-blB_kvg&b{9>tRskpFMQD=%*Zx$i> zR{T*j1h0@^TZsq~P%E$Sz{Bv3`Z7jH?y|Zt9<{nuTtL3nw%9|X5j^uB6xd{+IwX?EG% zDbH0aoKthKSyc4>-=d=CzZ4bYko>g1u&P+Ms&JTL5td)3GDcYbnQF&qrMoc>s_~N` z$<1J!(IDSVXN*RblqO7?D=sa0H(+u38O*aqMC2XhI)wE6<3CcamWs7}J$uef`+3uD zfV&f&HFX&EMY{t%>Drv0e%@L7Y17X}o3*L?Y18k;b9voQn|^maxw7-c=`d_IUJ5o| z9x~2B#x*@g9obfm`CW#x-iYHxXIxCa-qLR42ad#31yq*FOmxo7%y_HyZ(^HujMH`A zj?QX2GEHZz1qgMax9xRJNTvyuj!f5iuf`pFnBdhD|`Ww>Vne=Nyvdu!Wy0ESb zy1KKPj%>4zOxMxR_10}o$fG9wTw_c&**6+vA(H)~u|}8O))AgR1nsHpNpsZyx6Z@fHW8(NX)Q4vp z-H&eJoR~oV=^Vh5jdmI%^K~COKN4Q&>S>X}2Y;=nu+z&Zy_}J=9K;i^p=z3YXq3CM znQ%V{Tccddo;SIJKKaz1AMp<_#N)1twLm59emt3THqU0h*=TdGOf?&Az9ZAj=Gja! zn`bkceM@2B-6p>vi8d@I~bBk6nc8!oKhJ za?>B7bAdigM*Au{7og1pyoSyVD!;SV`$fn0bGSA4de4ehd9)^xrTm#d$ZHJ}T)O!^BL%IBfdaJT~Dn+>s47=`x1qFfUVg3FindShaderInputConstantIndex(Name("m_modelToWorld")); - AZ::Matrix3x4 modelToWorld = AZ::Matrix3x4::CreateFromTransform(m_transform) * AZ::Matrix3x4::CreateScale(m_extents); + AZ::Matrix3x4 modelToWorld = AZ::Matrix3x4::CreateFromTransform(m_transform) * AZ::Matrix3x4::CreateScale(m_renderExtents); m_renderObjectSrg->SetConstant(constantIndex, modelToWorld); constantIndex = srgLayout->FindShaderInputConstantIndex(Name("m_modelToWorldInverse")); - AZ::Matrix3x4 modelToWorldInverse = AZ::Matrix3x4::CreateFromTransform(m_transform).GetInverseFull(); + AZ::Matrix3x4 modelToWorldInverse = modelToWorld.GetInverseFull(); m_renderObjectSrg->SetConstant(constantIndex, modelToWorldInverse); constantIndex = srgLayout->FindShaderInputConstantIndex(Name("m_obbHalfLengths")); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h index 6c3017fe33..a828fe4b96 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h @@ -183,11 +183,14 @@ namespace AZ // extents of the probe grid AZ::Vector3 m_extents = AZ::Vector3(0.0f, 0.0f, 0.0f); + // expanded extents for rendering the volume + AZ::Vector3 m_renderExtents = AZ::Vector3(0.0f, 0.0f, 0.0f); + // probe grid OBB (world space), built from transform and extents AZ::Obb m_obbWs; // per-axis spacing of probes in the grid - AZ::Vector3 m_probeSpacing; + AZ::Vector3 m_probeSpacing = AZ::Vector3(0.0f, 0.0f, 0.0f); // per-axis number of probes in the grid uint32_t m_probeCountX = 0; From 66985e3569c13ab7b640ef31667e25b18bccd668 Mon Sep 17 00:00:00 2001 From: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> Date: Thu, 6 Jan 2022 09:26:16 +0000 Subject: [PATCH 292/399] Updates to ViewportTitleDlg to better expose grid snapping visualization (#6700) * updates to ViewportTitleDlg to better expose grid snapping visualization Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * small typo fix Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * add escape handling for widget to be more consistent with other QMenu behavior Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * remove unneeded [[maybe_unused]] Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> --- Code/Editor/ViewportTitleDlg.cpp | 119 +++++++++++++++++++++---------- Code/Editor/ViewportTitleDlg.h | 11 +-- 2 files changed, 89 insertions(+), 41 deletions(-) diff --git a/Code/Editor/ViewportTitleDlg.cpp b/Code/Editor/ViewportTitleDlg.cpp index 888089fd72..90aa044d25 100644 --- a/Code/Editor/ViewportTitleDlg.cpp +++ b/Code/Editor/ViewportTitleDlg.cpp @@ -14,6 +14,7 @@ #include "ViewportTitleDlg.h" // Qt +#include #include #include @@ -43,6 +44,7 @@ #include #include #include +#include #include @@ -51,6 +53,8 @@ AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING #endif //! defined(Q_MOC_RUN) +static constexpr int MiniumOverflowMenuWidth = 200; + // CViewportTitleDlg dialog namespace @@ -257,21 +261,56 @@ void CViewportTitleDlg::SetupHelpersButton() void CViewportTitleDlg::SetupOverflowMenu() { - // Setup the overflow menu - QMenu* overFlowMenu = new QMenu(this); + // simple override of QMenu that does not respond to keyboard events + // note: this prevents the menu from being prematurely closed + class IgnoreKeyboardMenu : public QMenu + { + public: + IgnoreKeyboardMenu(QWidget *parent = nullptr) : QMenu(parent) + { + } - m_audioMuteAction = new QAction("Mute Audio", overFlowMenu); - connect(m_audioMuteAction, &QAction::triggered, this, &CViewportTitleDlg::OnBnClickedMuteAudio); - overFlowMenu->addAction(m_audioMuteAction); + private: + void keyPressEvent(QKeyEvent* event) override + { + // regular escape key handling + if (event->key() == Qt::Key_Escape) + { + QMenu::keyPressEvent(event); + } + } + }; - overFlowMenu->addSeparator(); + // setup the overflow menu + auto* overflowMenu = new IgnoreKeyboardMenu(this); + overflowMenu->setMinimumWidth(MiniumOverflowMenuWidth); - m_enableGridSnappingAction = new QAction("Enable Grid Snapping", overFlowMenu); - connect(m_enableGridSnappingAction, &QAction::triggered, this, &CViewportTitleDlg::OnGridSnappingToggled); - m_enableGridSnappingAction->setCheckable(true); - overFlowMenu->addAction(m_enableGridSnappingAction); + m_audioMuteAction = new QAction("Mute Audio", overflowMenu); + connect(m_audioMuteAction, &QAction::triggered, this, &CViewportTitleDlg::OnBnClickedMuteAudio); + overflowMenu->addAction(m_audioMuteAction); + + overflowMenu->addSeparator(); + + m_enableGridSnappingCheckBox = new QCheckBox("Enable Grid Snapping", overflowMenu); + AzQtComponents::CheckBox::applyToggleSwitchStyle(m_enableGridSnappingCheckBox); + auto gridSnappingWidgetAction = new QWidgetAction(overflowMenu); + gridSnappingWidgetAction->setDefaultWidget(m_enableGridSnappingCheckBox); + connect(m_enableGridSnappingCheckBox, &QCheckBox::stateChanged, this, &CViewportTitleDlg::OnGridSnappingToggled); + overflowMenu->addAction(gridSnappingWidgetAction); + + m_enableGridVisualizationCheckBox = new QCheckBox("Show Grid", overflowMenu); + AzQtComponents::CheckBox::applyToggleSwitchStyle(m_enableGridVisualizationCheckBox); + auto gridVisualizationWidgetAction = new QWidgetAction(overflowMenu); + gridVisualizationWidgetAction->setDefaultWidget(m_enableGridVisualizationCheckBox); + connect( + m_enableGridVisualizationCheckBox, &QCheckBox::stateChanged, + [](const int state) + { + SandboxEditor::SetShowingGrid(state == Qt::Checked); + }); + overflowMenu->addAction(gridVisualizationWidgetAction); - m_gridSizeActionWidget = new QWidgetAction(overFlowMenu); + m_gridSizeActionWidget = new QWidgetAction(overflowMenu); m_gridSpinBox = new AzQtComponents::DoubleSpinBox(); m_gridSpinBox->setValue(SandboxEditor::GridSnappingSize()); m_gridSpinBox->setMinimum(1e-2f); @@ -281,31 +320,33 @@ void CViewportTitleDlg::SetupOverflowMenu() m_gridSpinBox, QOverload::of(&AzQtComponents::DoubleSpinBox::valueChanged), this, &CViewportTitleDlg::OnGridSpinBoxChanged); m_gridSizeActionWidget->setDefaultWidget(m_gridSpinBox); - overFlowMenu->addAction(m_gridSizeActionWidget); + overflowMenu->addAction(m_gridSizeActionWidget); - overFlowMenu->addSeparator(); + overflowMenu->addSeparator(); - m_enableAngleSnappingAction = new QAction("Enable Angle Snapping", overFlowMenu); - connect(m_enableAngleSnappingAction, &QAction::triggered, this, &CViewportTitleDlg::OnAngleSnappingToggled); - m_enableAngleSnappingAction->setCheckable(true); - overFlowMenu->addAction(m_enableAngleSnappingAction); + m_enableAngleSnappingCheckBox = new QCheckBox("Enable Angle Snapping", overflowMenu); + AzQtComponents::CheckBox::applyToggleSwitchStyle(m_enableAngleSnappingCheckBox); + auto angleSnappingWidgetAction = new QWidgetAction(overflowMenu); + angleSnappingWidgetAction->setDefaultWidget(m_enableAngleSnappingCheckBox); + connect(m_enableAngleSnappingCheckBox, &QCheckBox::stateChanged, this, &CViewportTitleDlg::OnAngleSnappingToggled); + overflowMenu->addAction(angleSnappingWidgetAction); - m_angleSizeActionWidget = new QWidgetAction(overFlowMenu); + m_angleSizeActionWidget = new QWidgetAction(overflowMenu); m_angleSpinBox = new AzQtComponents::DoubleSpinBox(); m_angleSpinBox->setValue(SandboxEditor::AngleSnappingSize()); m_angleSpinBox->setMinimum(1e-2f); - m_angleSpinBox->setToolTip(tr("Angle Snapping")); + m_angleSpinBox->setToolTip(tr("Angle size")); QObject::connect( m_angleSpinBox, QOverload::of(&AzQtComponents::DoubleSpinBox::valueChanged), this, &CViewportTitleDlg::OnAngleSpinBoxChanged); m_angleSizeActionWidget->setDefaultWidget(m_angleSpinBox); - overFlowMenu->addAction(m_angleSizeActionWidget); + overflowMenu->addAction(m_angleSizeActionWidget); - m_ui->m_overflowBtn->setMenu(overFlowMenu); + m_ui->m_overflowBtn->setMenu(overflowMenu); m_ui->m_overflowBtn->setPopupMode(QToolButton::InstantPopup); - connect(overFlowMenu, &QMenu::aboutToShow, this, &CViewportTitleDlg::UpdateOverFlowMenuState); + connect(overflowMenu, &QMenu::aboutToShow, this, &CViewportTitleDlg::UpdateOverFlowMenuState); UpdateMuteActionText(); } @@ -982,43 +1023,49 @@ void CViewportTitleDlg::CheckForCameraSpeedUpdate() } } -void CViewportTitleDlg::OnGridSnappingToggled() +void CViewportTitleDlg::OnGridSnappingToggled(const int state) { - m_gridSizeActionWidget->setEnabled(m_enableGridSnappingAction->isChecked()); + m_gridSizeActionWidget->setEnabled(state == Qt::Checked); + m_enableGridVisualizationCheckBox->setEnabled(state == Qt::Checked); MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapToGrid)->trigger(); } -void CViewportTitleDlg::OnAngleSnappingToggled() +void CViewportTitleDlg::OnAngleSnappingToggled(const int state) { - m_angleSizeActionWidget->setEnabled(m_enableAngleSnappingAction->isChecked()); + m_angleSizeActionWidget->setEnabled(state == Qt::Checked); MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapAngle)->trigger(); } -void CViewportTitleDlg::OnGridSpinBoxChanged(double value) +void CViewportTitleDlg::OnGridSpinBoxChanged(const double value) { - SandboxEditor::SetGridSnappingSize(static_cast(value)); + SandboxEditor::SetGridSnappingSize(aznumeric_cast(value)); } -void CViewportTitleDlg::OnAngleSpinBoxChanged(double value) +void CViewportTitleDlg::OnAngleSpinBoxChanged(const double value) { - SandboxEditor::SetAngleSnappingSize(static_cast(value)); + SandboxEditor::SetAngleSnappingSize(aznumeric_cast(value)); } void CViewportTitleDlg::UpdateOverFlowMenuState() { - bool gridSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapToGrid)->isChecked(); + const bool gridSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapToGrid)->isChecked(); { - QSignalBlocker signalBlocker(m_enableGridSnappingAction); - m_enableGridSnappingAction->setChecked(gridSnappingActive); + QSignalBlocker signalBlocker(m_enableGridSnappingCheckBox); + m_enableGridSnappingCheckBox->setChecked(gridSnappingActive); } m_gridSizeActionWidget->setEnabled(gridSnappingActive); - bool angleSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapAngle)->isChecked(); + const bool angleSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapAngle)->isChecked(); { - QSignalBlocker signalBlocker(m_enableAngleSnappingAction); - m_enableAngleSnappingAction->setChecked(angleSnappingActive); + QSignalBlocker signalBlocker(m_enableAngleSnappingCheckBox); + m_enableAngleSnappingCheckBox->setChecked(angleSnappingActive); } m_angleSizeActionWidget->setEnabled(angleSnappingActive); + + { + QSignalBlocker signalBlocker(m_enableGridVisualizationCheckBox); + m_enableGridVisualizationCheckBox->setChecked(SandboxEditor::ShowingGrid()); + } } namespace diff --git a/Code/Editor/ViewportTitleDlg.h b/Code/Editor/ViewportTitleDlg.h index ba3dba858a..b8da7f20ea 100644 --- a/Code/Editor/ViewportTitleDlg.h +++ b/Code/Editor/ViewportTitleDlg.h @@ -140,8 +140,8 @@ protected: void CheckForCameraSpeedUpdate(); - void OnGridSnappingToggled(); - void OnAngleSnappingToggled(); + void OnGridSnappingToggled(int state); + void OnAngleSnappingToggled(int state); void OnGridSpinBoxChanged(double value); void OnAngleSpinBoxChanged(double value); @@ -160,8 +160,9 @@ protected: QAction* m_fullInformationAction = nullptr; QAction* m_compactInformationAction = nullptr; QAction* m_audioMuteAction = nullptr; - QAction* m_enableGridSnappingAction = nullptr; - QAction* m_enableAngleSnappingAction = nullptr; + QCheckBox* m_enableGridSnappingCheckBox = nullptr; + QCheckBox* m_enableGridVisualizationCheckBox = nullptr; + QCheckBox* m_enableAngleSnappingCheckBox = nullptr; QComboBox* m_cameraSpeed = nullptr; AzQtComponents::DoubleSpinBox* m_gridSpinBox = nullptr; AzQtComponents::DoubleSpinBox* m_angleSpinBox = nullptr; @@ -175,7 +176,7 @@ protected: namespace AzToolsFramework { - //! A component to reflect scriptable commands for the Editor + //! A component to reflect scriptable commands for the Editor. class ViewportTitleDlgPythonFuncsHandler : public AZ::Component { From 14661af13f51028a5e92ed32ff59c01df2f1ebcd Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Thu, 6 Jan 2022 09:19:42 -0600 Subject: [PATCH 293/399] Terrain/mbalfour/misc bugfixes (#6712) * Bumped up terrain world limit to allow up to (and including) 4096 x 4096. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Changed loop calculations to handle floating-point math better. By looping on floating-point values, query resolutions of unstable values like "0.200000007" would sometimes cause the loop to go one more time than it should. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Components/TerrainWorldComponent.cpp | 4 +-- .../TerrainWorldDebuggerComponent.cpp | 28 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Gems/Terrain/Code/Source/Components/TerrainWorldComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainWorldComponent.cpp index 8d6bf8e4b0..8b612b86ce 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainWorldComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainWorldComponent.cpp @@ -139,8 +139,8 @@ namespace Terrain AZ::Outcome TerrainWorldConfig::DetermineMessage(float numSamples) { - const float maximumSamplesAllowed = 8.0f * 1024.0f * 1024.0f; - if (numSamples < maximumSamplesAllowed) + const float maximumSamplesAllowed = 16.0f * 1024.0f * 1024.0f; + if (numSamples <= maximumSamplesAllowed) { return AZ::Success(); } diff --git a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp index 8daccd7d61..f3e0d59537 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp @@ -339,17 +339,17 @@ namespace Terrain AZ::Aabb region = sector.m_aabb; region.SetMax(region.GetMax() + AZ::Vector3(gridResolution.GetX(), gridResolution.GetY(), 0.0f)); + // We need 4 vertices for each grid point in our sector to hold the _| shape. + const size_t numSamplesX = aznumeric_cast(ceil(region.GetExtents().GetX() / gridResolution.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(region.GetExtents().GetY() / gridResolution.GetY())); + sector.m_lineVertices.clear(); + sector.m_lineVertices.reserve(numSamplesX * numSamplesY * 4); + // This keeps track of the height from the previous point for the _ line. float previousHeight = 0.0f; // This keeps track of the heights from the previous row for the | line. - AZStd::vector rowHeights(aznumeric_cast(ceil(region.GetExtents().GetX() / gridResolution.GetX()))); - - // We need 4 vertices for each grid point in our sector to hold the _| shape. - const uint32_t numSamplesX = static_cast((region.GetMax().GetX() - region.GetMin().GetX()) / gridResolution.GetX()); - const uint32_t numSamplesY = static_cast((region.GetMax().GetY() - region.GetMin().GetY()) / gridResolution.GetY()); - sector.m_lineVertices.clear(); - sector.m_lineVertices.reserve(numSamplesX * numSamplesY * 4); + AZStd::vector rowHeights(numSamplesX); // For each terrain height value in the region, create the _| grid lines for that point and cache off the height value // for use with subsequent grid line calculations. @@ -376,21 +376,21 @@ namespace Terrain }; // This set of nested loops will get replaced with a call to ProcessHeightsFromRegion once the API exists. - uint32_t yIndex = 0; - for (float y = region.GetMin().GetY(); y < region.GetMax().GetY(); y += gridResolution.GetY()) + for (size_t yIndex = 0; yIndex < numSamplesY; yIndex++) { - uint32_t xIndex = 0; - for (float x = region.GetMin().GetX(); x < region.GetMax().GetX(); x += gridResolution.GetX()) + float y = region.GetMin().GetY() + (gridResolution.GetY() * yIndex); + for (size_t xIndex = 0; xIndex < numSamplesX; xIndex++) { + float x = region.GetMin().GetX() + (gridResolution.GetX() * xIndex); + float height = worldMinZ; bool terrainExists = false; AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( height, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, x, y, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, &terrainExists); - ProcessHeightValue(xIndex, yIndex, AZ::Vector3(x, y, height), terrainExists); - xIndex++; + ProcessHeightValue( + aznumeric_cast(xIndex), aznumeric_cast(yIndex), AZ::Vector3(x, y, height), terrainExists); } - yIndex++; } } From 60b8292abffb39f0969c9c324e8a3c173b09d72e Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Thu, 6 Jan 2022 10:12:15 -0600 Subject: [PATCH 294/399] Adding Docking and EditMenu tests to Periodic suite for Jenkins testing Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../Gem/PythonTests/editor/TestSuite_Periodic.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py index 282276250f..6e7bc413d3 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py @@ -47,10 +47,18 @@ class TestAutomation(TestAutomationBase): from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module self._run_test(request, workspace, editor, test_module, batch_mode=False) + def test_Docking_BasicDockedTools(self, request, workspace, editor, launcher_platform): + from .EditorScripts import Docking_BasicDockedTools as test_module + self._run_test(request, workspace, editor, test_module, batch_mode=False) + def test_InputBindings_Add_Remove_Input_Events(self, request, workspace, editor, launcher_platform): from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False) + def test_Menus_EditMenuOptions_Work(self, request, workspace, editor, launcher_platform): + from .EditorScripts import Menus_EditMenuOptions as test_module + self._run_test(request, workspace, editor, test_module, batch_mode=False) + def test_Menus_FileMenuOptions_Work(self, request, workspace, editor, launcher_platform): from .EditorScripts import Menus_FileMenuOptions as test_module self._run_test(request, workspace, editor, test_module, batch_mode=False) From fee88cf5c6499812af04c125fb12b3d93330d1b7 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 6 Jan 2022 10:12:54 -0600 Subject: [PATCH 295/399] Removed legacy editor DatabaseLibrary code. Signed-off-by: Chris Galvan --- Code/Editor/BaseLibrary.cpp | 232 ----- Code/Editor/BaseLibrary.h | 129 --- Code/Editor/BaseLibraryItem.cpp | 261 ------ Code/Editor/BaseLibraryItem.h | 114 --- Code/Editor/BaseLibraryManager.cpp | 822 ------------------ Code/Editor/BaseLibraryManager.h | 226 ----- Code/Editor/ErrorRecorder.cpp | 1 - Code/Editor/ErrorRecorder.h | 2 + Code/Editor/ErrorReport.cpp | 29 - Code/Editor/ErrorReport.h | 10 +- Code/Editor/ErrorReportDialog.cpp | 4 - Code/Editor/ErrorReportTableModel.cpp | 6 +- Code/Editor/IEditor.h | 9 - Code/Editor/IEditorImpl.cpp | 17 - Code/Editor/IEditorImpl.h | 3 - Code/Editor/Include/IBaseLibraryManager.h | 143 --- Code/Editor/Include/IDataBaseItem.h | 92 -- Code/Editor/Include/IDataBaseLibrary.h | 118 --- Code/Editor/Include/IDataBaseManager.h | 134 --- Code/Editor/Include/IEditorMaterial.h | 20 - Code/Editor/Include/IEditorMaterialManager.h | 21 - Code/Editor/Include/IErrorReport.h | 4 - Code/Editor/Lib/Tests/IEditorMock.h | 3 - .../TrackView/TrackViewSequenceManager.cpp | 14 - .../TrackView/TrackViewSequenceManager.h | 4 - Code/Editor/Viewport.h | 3 - Code/Editor/editor_core_files.cmake | 7 - Code/Editor/editor_lib_files.cmake | 6 - 28 files changed, 4 insertions(+), 2430 deletions(-) delete mode 100644 Code/Editor/BaseLibrary.cpp delete mode 100644 Code/Editor/BaseLibrary.h delete mode 100644 Code/Editor/BaseLibraryItem.cpp delete mode 100644 Code/Editor/BaseLibraryItem.h delete mode 100644 Code/Editor/BaseLibraryManager.cpp delete mode 100644 Code/Editor/BaseLibraryManager.h delete mode 100644 Code/Editor/Include/IBaseLibraryManager.h delete mode 100644 Code/Editor/Include/IDataBaseItem.h delete mode 100644 Code/Editor/Include/IDataBaseLibrary.h delete mode 100644 Code/Editor/Include/IDataBaseManager.h delete mode 100644 Code/Editor/Include/IEditorMaterial.h delete mode 100644 Code/Editor/Include/IEditorMaterialManager.h diff --git a/Code/Editor/BaseLibrary.cpp b/Code/Editor/BaseLibrary.cpp deleted file mode 100644 index 15742bd254..0000000000 --- a/Code/Editor/BaseLibrary.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "BaseLibrary.h" -#include "BaseLibraryItem.h" -#include "Include/IBaseLibraryManager.h" -#include -#include - -////////////////////////////////////////////////////////////////////////// -// CBaseLibrary implementation. -////////////////////////////////////////////////////////////////////////// -CBaseLibrary::CBaseLibrary(IBaseLibraryManager* pManager) - : m_pManager(pManager) - , m_bModified(false) - , m_bLevelLib(false) - , m_bNewLibrary(true) -{ -} - -////////////////////////////////////////////////////////////////////////// -CBaseLibrary::~CBaseLibrary() -{ - m_items.clear(); -} - -////////////////////////////////////////////////////////////////////////// -IBaseLibraryManager* CBaseLibrary::GetManager() -{ - return m_pManager; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibrary::RemoveAllItems() -{ - AddRef(); - for (int i = 0; i < m_items.size(); i++) - { - // Unregister item in case it was registered. It is ok if it wasn't. This is still safe to call. - m_pManager->UnregisterItem(m_items[i]); - // Clear library item. - m_items[i]->m_library = nullptr; - } - m_items.clear(); - Release(); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibrary::SetName(const QString& name) -{ - //the fullname of the items in the library will be changed due to library's name change - //so we need unregistered them and register them after their name changed. - for (int i = 0; i < m_items.size(); i++) - { - m_pManager->UnregisterItem(m_items[i]); - } - - m_name = name; - - for (int i = 0; i < m_items.size(); i++) - { - m_pManager->RegisterItem(m_items[i]); - } - - SetModified(); -} - -////////////////////////////////////////////////////////////////////////// -const QString& CBaseLibrary::GetName() const -{ - return m_name; -} - -////////////////////////////////////////////////////////////////////////// -bool CBaseLibrary::Save() -{ - return true; -} - -////////////////////////////////////////////////////////////////////////// -bool CBaseLibrary::Load(const QString& filename) -{ - m_filename = filename; - SetModified(false); - m_bNewLibrary = false; - return true; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibrary::SetModified(bool bModified) -{ - if (bModified != m_bModified) - { - m_bModified = bModified; - emit Modified(bModified); - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibrary::AddItem(IDataBaseItem* item, bool bRegister) -{ - - CBaseLibraryItem* pLibItem = (CBaseLibraryItem*)item; - // Check if item is already assigned to this library. - if (pLibItem->m_library != this) - { - pLibItem->m_library = this; - m_items.push_back(pLibItem); - SetModified(); - if (bRegister) - { - m_pManager->RegisterItem(pLibItem); - } - } -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibrary::GetItem(int index) -{ - assert(index >= 0 && index < m_items.size()); - return m_items[index]; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibrary::RemoveItem(IDataBaseItem* item) -{ - - for (int i = 0; i < m_items.size(); i++) - { - if (m_items[i] == item) - { - // Unregister item in case it was registered. It is ok if it wasn't. This is still safe to call. - m_pManager->UnregisterItem(m_items[i]); - m_items.erase(m_items.begin() + i); - SetModified(); - break; - } - } -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibrary::FindItem(const QString& name) -{ - for (int i = 0; i < m_items.size(); i++) - { - if (QString::compare(m_items[i]->GetName(), name, Qt::CaseInsensitive) == 0) - { - return m_items[i]; - } - } - return nullptr; -} - -bool CBaseLibrary::AddLibraryToSourceControl(const QString& fullPathName) const -{ - IEditor* pEditor = GetIEditor(); - IFileUtil* pFileUtil = pEditor ? pEditor->GetFileUtil() : nullptr; - if (pFileUtil) - { - return pFileUtil->CheckoutFile(fullPathName.toUtf8().data(), nullptr); - } - - return false; -} - -bool CBaseLibrary::SaveLibrary(const char* name, bool saveEmptyLibrary) -{ - assert(name != nullptr); - if (name == nullptr) - { - CryFatalError("The library you are attempting to save has no name specified."); - return false; - } - - QString fileName(GetFilename()); - if (fileName.isEmpty() && !saveEmptyLibrary) - { - return false; - } - - fileName = Path::GamePathToFullPath(fileName); - - XmlNodeRef root = GetIEditor()->GetSystem()->CreateXmlNode(name); - Serialize(root, false); - bool bRes = XmlHelpers::SaveXmlNode(GetIEditor()->GetFileUtil(), root, fileName.toUtf8().data()); - if (m_bNewLibrary) - { - AddLibraryToSourceControl(fileName); - m_bNewLibrary = false; - } - if (!bRes) - { - QByteArray filenameUtf8 = fileName.toUtf8(); - AZStd::string strMessage = AZStd::string::format("The file %s is read-only and the save of the library couldn't be performed. Try to remove the \"read-only\" flag or check-out the file and then try again.", filenameUtf8.data()); - CryMessageBox(strMessage.c_str(), "Saving Error", MB_OK | MB_ICONWARNING); - } - return bRes; -} - -//CONFETTI BEGIN -void CBaseLibrary::ChangeItemOrder(CBaseLibraryItem* item, unsigned int newLocation) -{ - std::vector<_smart_ptr > temp; - for (unsigned int i = 0; i < m_items.size(); i++) - { - if (i == newLocation) - { - temp.push_back(_smart_ptr(item)); - } - if (m_items[i] != item) - { - temp.push_back(m_items[i]); - } - } - // If newLocation is greater than the original size, append the item to end of the list - if (newLocation >= m_items.size()) - { - temp.push_back(_smart_ptr(item)); - } - m_items = temp; -} -//CONFETTI END - -#include diff --git a/Code/Editor/BaseLibrary.h b/Code/Editor/BaseLibrary.h deleted file mode 100644 index 55079d3fde..0000000000 --- a/Code/Editor/BaseLibrary.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_BASELIBRARY_H -#define CRYINCLUDE_EDITOR_BASELIBRARY_H -#pragma once - -#if !defined(Q_MOC_RUN) -#include "Include/IDataBaseLibrary.h" -#include "Include/IBaseLibraryManager.h" -#include "Include/EditorCoreAPI.h" -#include "Util/TRefCountBase.h" - -#include -#endif - -// Ensure we don't try to dllimport when moc includes us -#if defined(Q_MOC_BUILD) && !defined(EDITOR_CORE) -#define EDITOR_CORE -#endif - -/** This a base class for all Libraries used by Editor. -*/ -class EDITOR_CORE_API CBaseLibrary - : public QObject - , public TRefCountBase -{ - Q_OBJECT - -public: - explicit CBaseLibrary(IBaseLibraryManager* pManager); - ~CBaseLibrary(); - - //! Set library name. - virtual void SetName(const QString& name); - //! Get library name. - const QString& GetName() const override; - - //! Set new filename for this library. - virtual bool SetFilename(const QString& filename, [[maybe_unused]] bool checkForUnique = true) { m_filename = filename.toLower(); return true; }; - const QString& GetFilename() const override { return m_filename; }; - - bool Save() override = 0; - bool Load(const QString& filename) override = 0; - void Serialize(XmlNodeRef& node, bool bLoading) override = 0; - - //! Mark library as modified. - void SetModified(bool bModified = true) override; - //! Check if library was modified. - bool IsModified() const override { return m_bModified; }; - - ////////////////////////////////////////////////////////////////////////// - // Working with items. - ////////////////////////////////////////////////////////////////////////// - //! Add a new prototype to library. - void AddItem(IDataBaseItem* item, bool bRegister = true) override; - //! Get number of known prototypes. - int GetItemCount() const override { return static_cast(m_items.size()); } - //! Get prototype by index. - IDataBaseItem* GetItem(int index) override; - - //! Delete item by pointer of item. - void RemoveItem(IDataBaseItem* item) override; - - //! Delete all items from library. - void RemoveAllItems() override; - - //! Find library item by name. - //! Using linear search. - IDataBaseItem* FindItem(const QString& name) override; - - //! Check if this library is local level library. - bool IsLevelLibrary() const override { return m_bLevelLib; }; - - //! Set library to be level library. - void SetLevelLibrary(bool bEnable) override { m_bLevelLib = bEnable; }; - - ////////////////////////////////////////////////////////////////////////// - //! Return manager for this library. - IBaseLibraryManager* GetManager() override; - - // Saves the library with the main tag defined by the parameter name - bool SaveLibrary(const char* name, bool saveEmptyLibrary = false); - - //CONFETTI BEGIN - // Used to change the library item order - void ChangeItemOrder(CBaseLibraryItem* item, unsigned int newLocation) override; - //CONFETTI END - -signals: - void Modified(bool bModified); - -private: - // Add the library to the source control - bool AddLibraryToSourceControl(const QString& fullPathName) const; - -protected: - - //! Name of the library. - QString m_name; - //! Filename of the library. - QString m_filename; - - //! Flag set when library was modified. - bool m_bModified; - - // Flag set when the library is just created and it's not yet saved for the first time. - bool m_bNewLibrary; - - //! Level library is saved within the level .ly file and is local for this level. - bool m_bLevelLib; - - ////////////////////////////////////////////////////////////////////////// - // Manager. - IBaseLibraryManager* m_pManager; - - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - // Array of all our library items. - std::vector<_smart_ptr > m_items; - AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING -}; - -#endif // CRYINCLUDE_EDITOR_BASELIBRARY_H diff --git a/Code/Editor/BaseLibraryItem.cpp b/Code/Editor/BaseLibraryItem.cpp deleted file mode 100644 index e3788bc3e4..0000000000 --- a/Code/Editor/BaseLibraryItem.cpp +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "BaseLibraryItem.h" -#include "BaseLibrary.h" -#include "BaseLibraryManager.h" -#include "Undo/IUndoObject.h" - -#include - -//undo object for multi-changes inside library item. such as set all variables to default values. -//For example: change particle emitter shape will lead to multiple variable changes -class CUndoBaseLibraryItem - : public IUndoObject -{ -public: - CUndoBaseLibraryItem(IBaseLibraryManager *libMgr, CBaseLibraryItem* libItem, bool ignoreChild) - : m_libMgr(libMgr) - { - assert(libItem); - assert(libMgr); - - m_itemPath = libItem->GetFullName(); - - //serialize the lib item to undo - m_undoCtx.node = GetIEditor()->GetSystem()->CreateXmlNode("Undo"); - m_undoCtx.bIgnoreChilds = ignoreChild; - m_undoCtx.bLoading = false; //saving - m_undoCtx.bUniqName = false; //don't generate new name - m_undoCtx.bCopyPaste = true; //so it won't override guid - m_undoCtx.bUndo = true; - libItem->Serialize(m_undoCtx); - - //evaluate size - XmlString xmlStr = m_undoCtx.node->getXML(); - m_size = sizeof(CUndoBaseLibraryItem); - m_size += static_cast(xmlStr.GetAllocatedMemory()); - m_size += m_itemPath.length(); - } - - -protected: - int GetSize() override - { - return m_size; - } - - void Undo(bool bUndo) override - { - //find the libItem - IDataBaseItem *libItem = m_libMgr->FindItemByName(m_itemPath); - if (libItem == nullptr) - { - //the undo stack is not reliable any more.. - assert(false); - return; - } - - //save for redo - if (bUndo) - { - m_redoCtx.node = GetIEditor()->GetSystem()->CreateXmlNode("Redo"); - m_redoCtx.bIgnoreChilds = m_undoCtx.bIgnoreChilds; - m_redoCtx.bLoading = false; //saving - m_redoCtx.bUniqName = false; - m_redoCtx.bCopyPaste = true; - m_redoCtx.bUndo = true; - libItem->Serialize(m_redoCtx); - - XmlString xmlStr = m_redoCtx.node->getXML(); - m_size += static_cast(xmlStr.GetAllocatedMemory()); - } - - //load previous saved data - m_undoCtx.bLoading = true; - libItem->Serialize(m_undoCtx); - } - - void Redo() override - { - //find the libItem - IDataBaseItem *libItem = m_libMgr->FindItemByName(m_itemPath); - if (libItem == nullptr || m_redoCtx.node == nullptr) - { - //the undo stack is not reliable any more.. - assert(false); - return; - } - - m_redoCtx.bLoading = true; - libItem->Serialize(m_redoCtx); - } - -private: - QString m_itemPath; - IDataBaseItem::SerializeContext m_undoCtx; //saved before operation - IDataBaseItem::SerializeContext m_redoCtx; //saved after operation so used for redo - IBaseLibraryManager* m_libMgr; - int m_size; -}; - -////////////////////////////////////////////////////////////////////////// -// CBaseLibraryItem implementation. -////////////////////////////////////////////////////////////////////////// -CBaseLibraryItem::CBaseLibraryItem() -{ - m_library = nullptr; - GenerateId(); - m_bModified = false; -} - -CBaseLibraryItem::~CBaseLibraryItem() -{ -} - -////////////////////////////////////////////////////////////////////////// -QString CBaseLibraryItem::GetFullName() const -{ - QString name; - if (m_library) - { - name = m_library->GetName() + "."; - } - name += m_name; - return name; -} - -////////////////////////////////////////////////////////////////////////// -QString CBaseLibraryItem::GetGroupName() -{ - QString str = GetName(); - int p = str.lastIndexOf('.'); - if (p >= 0) - { - return str.mid(0, p); - } - return ""; -} - -////////////////////////////////////////////////////////////////////////// -QString CBaseLibraryItem::GetShortName() -{ - QString str = GetName(); - int p = str.lastIndexOf('.'); - if (p >= 0) - { - return str.mid(p + 1); - } - p = str.lastIndexOf('/'); - if (p >= 0) - { - return str.mid(p + 1); - } - return str; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryItem::SetName(const QString& name) -{ - assert(m_library); - if (name == m_name) - { - return; - } - QString oldName = GetFullName(); - m_name = name; - ((CBaseLibraryManager*)m_library->GetManager())->OnRenameItem(this, oldName); -} - -////////////////////////////////////////////////////////////////////////// -const QString& CBaseLibraryItem::GetName() const -{ - return m_name; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryItem::GenerateId() -{ - GUID guid = AZ::Uuid::CreateRandom(); - SetGUID(guid); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryItem::SetGUID(REFGUID guid) -{ - if (m_library) - { - ((CBaseLibraryManager*)m_library->GetManager())->RegisterItem(this, guid); - } - m_guid = guid; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryItem::Serialize(SerializeContext& ctx) -{ - assert(m_library); - - XmlNodeRef node = ctx.node; - if (ctx.bLoading) - { - QString name = m_name; - // Loading - node->getAttr("Name", name); - - if (!ctx.bUniqName) - { - SetName(name); - } - else - { - SetName(GetLibrary()->GetManager()->MakeUniqueItemName(name)); - } - - if (!ctx.bCopyPaste) - { - GUID guid; - if (node->getAttr("Id", guid)) - { - SetGUID(guid); - } - } - } - else - { - // Saving. - node->setAttr("Name", m_name.toUtf8().data()); - node->setAttr("Id", m_guid); - node->setAttr("Library", GetLibrary()->GetName().toUtf8().data()); - } - m_bModified = false; -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseLibrary* CBaseLibraryItem::GetLibrary() const -{ - return m_library; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryItem::SetLibrary(CBaseLibrary* pLibrary) -{ - m_library = pLibrary; -} - -//! Mark library as modified. -void CBaseLibraryItem::SetModified(bool bModified) -{ - m_bModified = bModified; - if (m_bModified && m_library != nullptr) - { - m_library->SetModified(bModified); - } -} diff --git a/Code/Editor/BaseLibraryItem.h b/Code/Editor/BaseLibraryItem.h deleted file mode 100644 index 53cf0add2b..0000000000 --- a/Code/Editor/BaseLibraryItem.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_BASELIBRARYITEM_H -#define CRYINCLUDE_EDITOR_BASELIBRARYITEM_H -#pragma once - -#include "Include/IDataBaseItem.h" -#include "BaseLibrary.h" - -#include - -class CBaseLibrary; - -////////////////////////////////////////////////////////////////////////// -AZ_PUSH_DISABLE_DLL_EXPORT_BASECLASS_WARNING -/** Base class for all items contained in BaseLibraray. -*/ -class EDITOR_CORE_API CBaseLibraryItem - : public TRefCountBase -{ - AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING -public: - CBaseLibraryItem(); - ~CBaseLibraryItem(); - - //! Set item name. - //! Its virtual, in case you want to override it in derrived item. - virtual void SetName(const QString& name); - //! Get item name. - const QString& GetName() const; - - //! Get full item name, including name of library. - //! Name formed by adding dot after name of library - //! eg. library Pickup and item PickupRL form full item name: "Pickups.PickupRL". - QString GetFullName() const; - - //! Get only nameof group from prototype. - QString GetGroupName(); - //! Get short name of prototype without group. - QString GetShortName(); - - //! Return Library this item are contained in. - //! Item can only be at one library. - IDataBaseLibrary* GetLibrary() const; - void SetLibrary(CBaseLibrary* pLibrary); - - ////////////////////////////////////////////////////////////////////////// - //! Serialize library item to archive. - virtual void Serialize(SerializeContext& ctx); - - ////////////////////////////////////////////////////////////////////////// - //! Generate new unique id for this item. - void GenerateId(); - //! Returns GUID of this material. - const GUID& GetGUID() const { return m_guid; } - - //! Mark library as modified. - void SetModified(bool bModified = true); - //! Check if library was modified. - bool IsModified() const { return m_bModified; }; - - //! Returns true if the item is registered, otherwise false - bool IsRegistered() const { return m_bRegistered; }; - - //! Validate item for errors. - virtual void Validate() {}; - - //! Get number of sub childs. - virtual int GetChildCount() const { return 0; } - //! Get sub child by index. - virtual CBaseLibraryItem* GetChild([[maybe_unused]] int index) const { return nullptr; } - - - ////////////////////////////////////////////////////////////////////////// - //! Gathers resources by this item. - virtual void GatherUsedResources([[maybe_unused]] CUsedResources& resources) {}; - - //! Get if stored item is enabled - virtual bool GetIsEnabled() { return true; }; - - - int IsParticleItem = -1; -protected: - void SetGUID(REFGUID guid); - friend class CBaseLibrary; - friend class CBaseLibraryManager; - // Name of this prototype. - QString m_name; - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - //! Reference to prototype library who contains this prototype. - _smart_ptr m_library; - AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - - //! Every base library item have unique id. - GUID m_guid; - // True when item modified by editor. - bool m_bModified; - // True when item registered in manager. - bool m_bRegistered = false; -}; - -Q_DECLARE_METATYPE(CBaseLibraryItem*); - -TYPEDEF_AUTOPTR(CBaseLibraryItem); - - -#endif // CRYINCLUDE_EDITOR_BASELIBRARYITEM_H diff --git a/Code/Editor/BaseLibraryManager.cpp b/Code/Editor/BaseLibraryManager.cpp deleted file mode 100644 index 0e51a5238c..0000000000 --- a/Code/Editor/BaseLibraryManager.cpp +++ /dev/null @@ -1,822 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - - -#include "EditorDefs.h" - -#include "BaseLibraryManager.h" - -// Editor -#include "BaseLibraryItem.h" -#include "ErrorReport.h" -#include "Undo/IUndoObject.h" - -////////////////////////////////////////////////////////////////////////// -// CBaseLibraryManager implementation. -////////////////////////////////////////////////////////////////////////// -CBaseLibraryManager::CBaseLibraryManager() -{ - m_bUniqNameMap = false; - m_bUniqGuidMap = true; - GetIEditor()->RegisterNotifyListener(this); -} - -////////////////////////////////////////////////////////////////////////// -CBaseLibraryManager::~CBaseLibraryManager() -{ - ClearAll(); - GetIEditor()->UnregisterNotifyListener(this); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::ClearAll() -{ - // Delete all items from all libraries. - for (int i = 0; i < m_libs.size(); i++) - { - m_libs[i]->RemoveAllItems(); - } - - // if we will not copy maps locally then destructors of the elements of - // the map will operate on the already invalid map object - // see: - // CBaseLibraryManager::UnregisterItem() - // CBaseLibraryManager::DeleteItem() - // CMaterial::~CMaterial() - - ItemsGUIDMap itemsGuidMap; - ItemsNameMap itemsNameMap; - - { - AZStd::lock_guard lock(m_itemsNameMapMutex); - std::swap(itemsGuidMap, m_itemsGuidMap); - std::swap(itemsNameMap, m_itemsNameMap); - - m_libs.clear(); - } -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseLibrary* CBaseLibraryManager::FindLibrary(const QString& library) -{ - const int index = FindLibraryIndex(library); - return index == -1 ? nullptr : m_libs[index]; -} - -////////////////////////////////////////////////////////////////////////// -int CBaseLibraryManager::FindLibraryIndex(const QString& library) -{ - QString lib = library; - lib.replace('\\', '/'); - for (int i = 0; i < m_libs.size(); i++) - { - QString _lib = m_libs[i]->GetFilename(); - _lib.replace('\\', '/'); - if (QString::compare(lib, m_libs[i]->GetName(), Qt::CaseInsensitive) == 0 || QString::compare(lib, _lib, Qt::CaseInsensitive) == 0) - { - return i; - } - } - return -1; -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibraryManager::FindItem(REFGUID guid) const -{ - CBaseLibraryItem* pMtl = stl::find_in_map(m_itemsGuidMap, guid, nullptr); - return pMtl; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::SplitFullItemName(const QString& fullItemName, QString& libraryName, QString& itemName) -{ - int p; - p = fullItemName.indexOf('.'); - if (p < 0 || !QString::compare(fullItemName.mid(p + 1), "mtl", Qt::CaseInsensitive)) - { - libraryName = ""; - itemName = fullItemName; - return; - } - libraryName = fullItemName.mid(0, p); - itemName = fullItemName.mid(p + 1); -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibraryManager::FindItemByName(const QString& fullItemName) -{ - AZStd::lock_guard lock(m_itemsNameMapMutex); - return stl::find_in_map(m_itemsNameMap, fullItemName, nullptr); -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibraryManager::LoadItemByName(const QString& fullItemName) -{ - QString libraryName, itemName; - SplitFullItemName(fullItemName, libraryName, itemName); - - if (!FindLibrary(libraryName)) - { - LoadLibrary(MakeFilename(libraryName)); - } - - return FindItemByName(fullItemName); -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibraryManager::FindItemByName(const char* fullItemName) -{ - return FindItemByName(QString(fullItemName)); -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibraryManager::LoadItemByName(const char* fullItemName) -{ - return LoadItemByName(QString(fullItemName)); -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibraryManager::CreateItem(IDataBaseLibrary* pLibrary) -{ - assert(pLibrary); - - // Add item to this library. - TSmartPtr pItem = MakeNewItem(); - pLibrary->AddItem(pItem); - return pItem; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::DeleteItem(IDataBaseItem* pItem) -{ - assert(pItem); - - UnregisterItem((CBaseLibraryItem*)pItem); - if (pItem->GetLibrary()) - { - pItem->GetLibrary()->RemoveItem(pItem); - } -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseLibrary* CBaseLibraryManager::LoadLibrary(const QString& inFilename, [[maybe_unused]] bool bReload) -{ - if (auto lib = FindLibrary(inFilename)) - { - return lib; - } - - TSmartPtr pLib = MakeNewLibrary(); - if (!pLib->Load(MakeFilename(inFilename))) - { - Error(QObject::tr("Failed to Load Item Library: %1").arg(inFilename).toUtf8().data()); - return nullptr; - } - - m_libs.push_back(pLib); - return pLib; -} - -////////////////////////////////////////////////////////////////////////// -int CBaseLibraryManager::GetModifiedLibraryCount() const -{ - int count = 0; - for (int i = 0; i < m_libs.size(); i++) - { - if (m_libs[i]->IsModified()) - { - count++; - } - } - return count; -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseLibrary* CBaseLibraryManager::AddLibrary(const QString& library, bool bIsLevelLibrary, bool bIsLoading) -{ - // Make a filename from name of library. - QString filename = library; - - if (filename.indexOf(".xml") == -1) // if its already a filename, we don't do anything - { - filename.replace(' ', '_'); - if (!bIsLevelLibrary) - { - filename = MakeFilename(library); - } - else - { - // if its the level library it gets saved in the level and should not be concatenated with any other file name - filename = filename + ".xml"; - } - } - - IDataBaseLibrary* pBaseLib = FindLibrary(library); //library name - if (!pBaseLib) - { - pBaseLib = FindLibrary(filename); //library file name - } - if (pBaseLib) - { - return pBaseLib; - } - - CBaseLibrary* lib = MakeNewLibrary(); - lib->SetName(library); - lib->SetLevelLibrary(bIsLevelLibrary); - lib->SetFilename(filename, !bIsLoading); - // set modified to true, so even empty particle libraries get saved - lib->SetModified(true); - - m_libs.push_back(lib); - return lib; -} - -////////////////////////////////////////////////////////////////////////// -QString CBaseLibraryManager::MakeFilename(const QString& library) -{ - QString filename = library; - filename.replace(' ', '_'); - filename.replace(".xml", ""); - - // make it contain the canonical libs path: - Path::ConvertBackSlashToSlash(filename); - - QString LibsPath(GetLibsPath()); - Path::ConvertBackSlashToSlash(LibsPath); - - if (filename.left(LibsPath.length()).compare(LibsPath, Qt::CaseInsensitive) == 0) - { - filename = filename.mid(LibsPath.length()); - } - - return LibsPath + filename + ".xml"; -} - -////////////////////////////////////////////////////////////////////////// -bool CBaseLibraryManager::IsUniqueFilename(const QString& library) -{ - QString resultPath = MakeFilename(library); - CCryFile xmlFile; - // If we can find a file for the path - return !xmlFile.Open(resultPath.toUtf8().data(), "rb"); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::DeleteLibrary(const QString& library, bool forceDeleteLevel) -{ - for (int i = 0; i < m_libs.size(); i++) - { - if (QString::compare(library, m_libs[i]->GetName(), Qt::CaseInsensitive) == 0) - { - CBaseLibrary* pLibrary = m_libs[i]; - // Check if not level library, they cannot be deleted. - if (!pLibrary->IsLevelLibrary() || forceDeleteLevel) - { - for (int j = 0; j < pLibrary->GetItemCount(); j++) - { - UnregisterItem((CBaseLibraryItem*)pLibrary->GetItem(j)); - } - pLibrary->RemoveAllItems(); - - if (pLibrary->IsLevelLibrary()) - { - m_pLevelLibrary = nullptr; - } - m_libs.erase(m_libs.begin() + i); - } - break; - } - } -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseLibrary* CBaseLibraryManager::GetLibrary(int index) const -{ - assert(index >= 0 && index < m_libs.size()); - return m_libs[index]; -}; - -////////////////////////////////////////////////////////////////////////// -IDataBaseLibrary* CBaseLibraryManager::GetLevelLibrary() const -{ - IDataBaseLibrary* pLevelLib = nullptr; - - for (int i = 0; i < GetLibraryCount(); i++) - { - if (GetLibrary(i)->IsLevelLibrary()) - { - pLevelLib = GetLibrary(i); - break; - } - } - - - return pLevelLib; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::SaveAllLibs() -{ - for (int i = 0; i < GetLibraryCount(); i++) - { - // Check if library is modified. - IDataBaseLibrary* pLibrary = GetLibrary(i); - - //Level library is saved when the level is saved - if (pLibrary->IsLevelLibrary()) - { - continue; - } - if (pLibrary->IsModified()) - { - if (pLibrary->Save()) - { - pLibrary->SetModified(false); - } - } - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::Serialize(XmlNodeRef& node, bool bLoading) -{ - static const char* const LEVEL_LIBRARY_TAG = "LevelLibrary"; - - QString rootNodeName = GetRootNodeName(); - if (bLoading) - { - XmlNodeRef libs = node->findChild(rootNodeName.toUtf8().data()); - if (libs) - { - for (int i = 0; i < libs->getChildCount(); i++) - { - // Load only library name. - XmlNodeRef libNode = libs->getChild(i); - if (strcmp(libNode->getTag(), LEVEL_LIBRARY_TAG) == 0) - { - if (!m_pLevelLibrary) - { - QString libName; - libNode->getAttr("Name", libName); - m_pLevelLibrary = static_cast(AddLibrary(libName, true)); - } - m_pLevelLibrary->Serialize(libNode, bLoading); - } - else - { - QString libName; - if (libNode->getAttr("Name", libName)) - { - // Load this library. - if (!FindLibrary(libName)) - { - LoadLibrary(MakeFilename(libName)); - } - } - } - } - } - } - else - { - // Save all libraries. - XmlNodeRef libs = node->newChild(rootNodeName.toUtf8().data()); - for (int i = 0; i < GetLibraryCount(); i++) - { - IDataBaseLibrary* pLib = GetLibrary(i); - if (pLib->IsLevelLibrary()) - { - // Level libraries are saved in in level. - XmlNodeRef libNode = libs->newChild(LEVEL_LIBRARY_TAG); - pLib->Serialize(libNode, bLoading); - } - else - { - // Save only library name. - XmlNodeRef libNode = libs->newChild("Library"); - libNode->setAttr("Name", pLib->GetName().toUtf8().data()); - } - } - SaveAllLibs(); - } -} - -////////////////////////////////////////////////////////////////////////// -QString CBaseLibraryManager::MakeUniqueItemName(const QString& srcName, const QString& libName) -{ - // unlikely we'll ever encounter more than 16 - std::vector possibleDuplicates; - possibleDuplicates.reserve(16); - - // search for strings in the database that might have a similar name (ignore case) - IDataBaseItemEnumerator* pEnum = GetItemEnumerator(); - for (IDataBaseItem* pItem = pEnum->GetFirst(); pItem != nullptr; pItem = pEnum->GetNext()) - { - //Check if the item is in the target library first. - IDataBaseLibrary* itemLibrary = pItem->GetLibrary(); - QString itemLibraryName; - if (itemLibrary) - { - itemLibraryName = itemLibrary->GetName(); - } - - // Item is not in the library so there cannot be a naming conflict. - if (!libName.isEmpty() && !itemLibraryName.isEmpty() && itemLibraryName != libName) - { - continue; - } - - const QString& name = pItem->GetName(); - if (name.startsWith(srcName, Qt::CaseInsensitive)) - { - possibleDuplicates.push_back(AZStd::string(name.toUtf8().data())); - } - } - pEnum->Release(); - - if (possibleDuplicates.empty()) - { - return srcName; - } - - std::sort(possibleDuplicates.begin(), possibleDuplicates.end(), [](const AZStd::string& strOne, const AZStd::string& strTwo) - { - // I can assume size sorting since if the length is different, either one of the two strings doesn't - // closely match the string we are trying to duplicate, or it's a bigger number (X1 vs X10) - if (strOne.size() != strTwo.size()) - { - return strOne.size() < strTwo.size(); - } - else - { - return azstricmp(strOne.c_str(), strTwo.c_str()) < 0; - } - } - ); - - int num = 0; - QString returnValue = srcName; - while (num < possibleDuplicates.size() && QString::compare(possibleDuplicates[num].c_str(), returnValue, Qt::CaseInsensitive) == 0) - { - returnValue = QStringLiteral("%1%2%3").arg(srcName).arg("_").arg(num); - ++num; - } - - return returnValue; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::Validate() -{ - IDataBaseItemEnumerator* pEnum = GetItemEnumerator(); - for (IDataBaseItem* pItem = pEnum->GetFirst(); pItem != nullptr; pItem = pEnum->GetNext()) - { - pItem->Validate(); - } - pEnum->Release(); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::RegisterItem(CBaseLibraryItem* pItem, REFGUID newGuid) -{ - assert(pItem); - - bool bNotify = false; - - if (m_bUniqGuidMap) - { - REFGUID oldGuid = pItem->GetGUID(); - if (!GuidUtil::IsEmpty(oldGuid)) - { - m_itemsGuidMap.erase(oldGuid); - } - if (GuidUtil::IsEmpty(newGuid)) - { - return; - } - CBaseLibraryItem* pOldItem = stl::find_in_map(m_itemsGuidMap, newGuid, nullptr); - if (!pOldItem) - { - pItem->m_guid = newGuid; - m_itemsGuidMap[newGuid] = pItem; - pItem->m_bRegistered = true; - bNotify = true; - } - else - { - if (pOldItem != pItem) - { - ReportDuplicateItem(pItem, pOldItem); - } - } - } - - if (m_bUniqNameMap) - { - QString fullName = pItem->GetFullName(); - if (!pItem->GetName().isEmpty()) - { - CBaseLibraryItem* pOldItem = static_cast(FindItemByName(fullName)); - if (!pOldItem) - { - AZStd::lock_guard lock(m_itemsNameMapMutex); - m_itemsNameMap[fullName] = pItem; - pItem->m_bRegistered = true; - bNotify = true; - } - else - { - if (pOldItem != pItem) - { - ReportDuplicateItem(pItem, pOldItem); - } - } - } - } - - // Notify listeners. - if (bNotify) - { - NotifyItemEvent(pItem, EDB_ITEM_EVENT_ADD); - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::RegisterItem(CBaseLibraryItem* pItem) -{ - assert(pItem); - - bool bNotify = false; - - if (m_bUniqGuidMap) - { - if (GuidUtil::IsEmpty(pItem->GetGUID())) - { - return; - } - CBaseLibraryItem* pOldItem = stl::find_in_map(m_itemsGuidMap, pItem->GetGUID(), nullptr); - if (!pOldItem) - { - m_itemsGuidMap[pItem->GetGUID()] = pItem; - pItem->m_bRegistered = true; - bNotify = true; - } - else - { - if (pOldItem != pItem) - { - ReportDuplicateItem(pItem, pOldItem); - } - } - } - - if (m_bUniqNameMap) - { - QString fullName = pItem->GetFullName(); - if (!fullName.isEmpty()) - { - CBaseLibraryItem* pOldItem = static_cast(FindItemByName(fullName)); - if (!pOldItem) - { - AZStd::lock_guard lock(m_itemsNameMapMutex); - m_itemsNameMap[fullName] = pItem; - pItem->m_bRegistered = true; - bNotify = true; - } - else - { - if (pOldItem != pItem) - { - ReportDuplicateItem(pItem, pOldItem); - } - } - } - } - - // Notify listeners. - if (bNotify) - { - NotifyItemEvent(pItem, EDB_ITEM_EVENT_ADD); - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::SetRegisteredFlag(CBaseLibraryItem* pItem, bool bFlag) -{ - pItem->m_bRegistered = bFlag; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::ReportDuplicateItem(CBaseLibraryItem* pItem, CBaseLibraryItem* pOldItem) -{ - QString sLibName; - if (pOldItem->GetLibrary()) - { - sLibName = pOldItem->GetLibrary()->GetName(); - } - CErrorRecord err; - err.pItem = pItem; - err.error = QStringLiteral("Item %1 with duplicate GUID to loaded item %2 ignored").arg(pItem->GetFullName(), pOldItem->GetFullName()); - GetIEditor()->GetErrorReport()->ReportError(err); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::UnregisterItem(CBaseLibraryItem* pItem) -{ - // Notify listeners. - NotifyItemEvent(pItem, EDB_ITEM_EVENT_DELETE); - - if (!pItem) - { - return; - } - - if (m_bUniqGuidMap) - { - m_itemsGuidMap.erase(pItem->GetGUID()); - } - if (m_bUniqNameMap && !pItem->GetFullName().isEmpty()) - { - AZStd::lock_guard lock(m_itemsNameMapMutex); - auto findIter = m_itemsNameMap.find(pItem->GetFullName()); - if (findIter != m_itemsNameMap.end()) - { - _smart_ptr item = findIter->second; - m_itemsNameMap.erase(findIter); - } - } - - pItem->m_bRegistered = false; -} - -////////////////////////////////////////////////////////////////////////// -QString CBaseLibraryManager::MakeFullItemName(IDataBaseLibrary* pLibrary, const QString& group, const QString& itemName) -{ - assert(pLibrary); - QString name = pLibrary->GetName() + "."; - if (!group.isEmpty()) - { - name += group + "."; - } - name += itemName; - return name; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::GatherUsedResources(CUsedResources& resources) -{ - IDataBaseItemEnumerator* pEnum = GetItemEnumerator(); - for (IDataBaseItem* pItem = pEnum->GetFirst(); pItem != nullptr; pItem = pEnum->GetNext()) - { - pItem->GatherUsedResources(resources); - } - pEnum->Release(); -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItemEnumerator* CBaseLibraryManager::GetItemEnumerator() -{ - if (m_bUniqNameMap) - { - return new CDataBaseItemEnumerator(&m_itemsNameMap); - } - else - { - return new CDataBaseItemEnumerator(&m_itemsGuidMap); - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::OnEditorNotifyEvent(EEditorNotifyEvent event) -{ - switch (event) - { - case eNotify_OnBeginNewScene: - SetSelectedItem(nullptr); - ClearAll(); - break; - case eNotify_OnBeginSceneOpen: - SetSelectedItem(nullptr); - ClearAll(); - break; - case eNotify_OnCloseScene: - SetSelectedItem(nullptr); - ClearAll(); - break; - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::OnRenameItem(CBaseLibraryItem* pItem, const QString& oldName) -{ - m_itemsNameMapMutex.lock(); - if (!oldName.isEmpty()) - { - m_itemsNameMap.erase(oldName); - } - if (!pItem->GetFullName().isEmpty()) - { - m_itemsNameMap[pItem->GetFullName()] = pItem; - } - m_itemsNameMapMutex.unlock(); - - OnItemChanged(pItem); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::AddListener(IDataBaseManagerListener* pListener) -{ - stl::push_back_unique(m_listeners, pListener); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::RemoveListener(IDataBaseManagerListener* pListener) -{ - stl::find_and_erase(m_listeners, pListener); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::NotifyItemEvent(IDataBaseItem* pItem, EDataBaseItemEvent event) -{ - // Notify listeners. - if (!m_listeners.empty()) - { - for (int i = 0; i < m_listeners.size(); i++) - { - m_listeners[i]->OnDataBaseItemEvent(pItem, event); - } - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::OnItemChanged(IDataBaseItem* pItem) -{ - NotifyItemEvent(pItem, EDB_ITEM_EVENT_CHANGED); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::OnUpdateProperties(IDataBaseItem* pItem, bool bRefresh) -{ - NotifyItemEvent(pItem, bRefresh ? EDB_ITEM_EVENT_UPDATE_PROPERTIES - : EDB_ITEM_EVENT_UPDATE_PROPERTIES_NO_EDITOR_REFRESH); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::SetSelectedItem(IDataBaseItem* pItem) -{ - if (m_pSelectedItem == pItem) - { - return; - } - m_pSelectedItem = (CBaseLibraryItem*)pItem; - NotifyItemEvent(m_pSelectedItem, EDB_ITEM_EVENT_SELECTED); -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibraryManager::GetSelectedItem() const -{ - return m_pSelectedItem; -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibraryManager::GetSelectedParentItem() const -{ - return m_pSelectedParent; -} - -void CBaseLibraryManager::ChangeLibraryOrder(IDataBaseLibrary* lib, unsigned int newLocation) -{ - if (!lib || newLocation >= m_libs.size() || lib == m_libs[newLocation]) - { - return; - } - - for (int i = 0; i < m_libs.size(); i++) - { - if (lib == m_libs[i]) - { - _smart_ptr curLib = m_libs[i]; - m_libs.erase(m_libs.begin() + i); - m_libs.insert(m_libs.begin() + newLocation, curLib); - return; - } - } -} - -bool CBaseLibraryManager::SetLibraryName(CBaseLibrary* lib, const QString& name) -{ - // SetFilename will validate if the name is duplicate with exist libraries. - if (lib->SetFilename(MakeFilename(name))) - { - lib->SetName(name); - return true; - } - return false; -} diff --git a/Code/Editor/BaseLibraryManager.h b/Code/Editor/BaseLibraryManager.h deleted file mode 100644 index 118c7ef1f0..0000000000 --- a/Code/Editor/BaseLibraryManager.h +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - - -#ifndef CRYINCLUDE_EDITOR_BASELIBRARYMANAGER_H -#define CRYINCLUDE_EDITOR_BASELIBRARYMANAGER_H -#pragma once - -#include "Include/IBaseLibraryManager.h" -#include "Include/IDataBaseItem.h" -#include "Include/IDataBaseLibrary.h" -#include "Include/IDataBaseManager.h" -#include "Util/TRefCountBase.h" -#include "Util/GuidUtil.h" -#include "BaseLibrary.h" -#include "Util/smartptr.h" -#include -#include - -AZ_PUSH_DISABLE_DLL_EXPORT_BASECLASS_WARNING -/** Manages all Libraries and Items. -*/ -class SANDBOX_API CBaseLibraryManager - : public IBaseLibraryManager -{ -AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING -public: - CBaseLibraryManager(); - ~CBaseLibraryManager(); - - //! Clear all libraries. - void ClearAll() override; - - ////////////////////////////////////////////////////////////////////////// - // IDocListener implementation. - ////////////////////////////////////////////////////////////////////////// - void OnEditorNotifyEvent(EEditorNotifyEvent event) override; - - ////////////////////////////////////////////////////////////////////////// - // Library items. - ////////////////////////////////////////////////////////////////////////// - //! Make a new item in specified library. - IDataBaseItem* CreateItem(IDataBaseLibrary* pLibrary) override; - //! Delete item from library and manager. - void DeleteItem(IDataBaseItem* pItem) override; - - //! Find Item by its GUID. - IDataBaseItem* FindItem(REFGUID guid) const override; - IDataBaseItem* FindItemByName(const QString& fullItemName) override; - IDataBaseItem* LoadItemByName(const QString& fullItemName) override; - virtual IDataBaseItem* FindItemByName(const char* fullItemName); - virtual IDataBaseItem* LoadItemByName(const char* fullItemName); - - IDataBaseItemEnumerator* GetItemEnumerator() override; - - ////////////////////////////////////////////////////////////////////////// - // Set item currently selected. - void SetSelectedItem(IDataBaseItem* pItem) override; - // Get currently selected item. - IDataBaseItem* GetSelectedItem() const override; - IDataBaseItem* GetSelectedParentItem() const override; - - ////////////////////////////////////////////////////////////////////////// - // Libraries. - ////////////////////////////////////////////////////////////////////////// - //! Add Item library. - IDataBaseLibrary* AddLibrary(const QString& library, bool bIsLevelLibrary = false, bool bIsLoading = true) override; - void DeleteLibrary(const QString& library, bool forceDeleteLevel = false) override; - //! Get number of libraries. - int GetLibraryCount() const override { return static_cast(m_libs.size()); }; - //! Get number of modified libraries. - int GetModifiedLibraryCount() const override; - - //! Get Item library by index. - IDataBaseLibrary* GetLibrary(int index) const override; - - //! Get Level Item library. - IDataBaseLibrary* GetLevelLibrary() const override; - - //! Find Items Library by name. - IDataBaseLibrary* FindLibrary(const QString& library) override; - - //! Find Items Library's index by name. - int FindLibraryIndex(const QString& library) override; - - //! Load Items library. - IDataBaseLibrary* LoadLibrary(const QString& filename, bool bReload = false) override; - - //! Save all modified libraries. - void SaveAllLibs() override; - - //! Serialize property manager. - void Serialize(XmlNodeRef& node, bool bLoading) override; - - //! Export items to game. - void Export([[maybe_unused]] XmlNodeRef& node) override {}; - - //! Returns unique name base on input name. - QString MakeUniqueItemName(const QString& name, const QString& libName = "") override; - QString MakeFullItemName(IDataBaseLibrary* pLibrary, const QString& group, const QString& itemName) override; - - //! Root node where this library will be saved. - QString GetRootNodeName() override = 0; - //! Path to libraries in this manager. - QString GetLibsPath() override = 0; - - ////////////////////////////////////////////////////////////////////////// - //! Validate library items for errors. - void Validate() override; - - ////////////////////////////////////////////////////////////////////////// - void GatherUsedResources(CUsedResources& resources) override; - - void AddListener(IDataBaseManagerListener* pListener) override; - void RemoveListener(IDataBaseManagerListener* pListener) override; - - ////////////////////////////////////////////////////////////////////////// - void RegisterItem(CBaseLibraryItem* pItem, REFGUID newGuid) override; - void RegisterItem(CBaseLibraryItem* pItem) override; - void UnregisterItem(CBaseLibraryItem* pItem) override; - - // Only Used internally. - void OnRenameItem(CBaseLibraryItem* pItem, const QString& oldName) override; - - // Called by items to indicated that they have been modified. - // Sends item changed event to listeners. - void OnItemChanged(IDataBaseItem* pItem) override; - void OnUpdateProperties(IDataBaseItem* pItem, bool bRefresh) override; - - QString MakeFilename(const QString& library); - bool IsUniqueFilename(const QString& library) override; - - //CONFETTI BEGIN - // Used to change the library item order - void ChangeLibraryOrder(IDataBaseLibrary* lib, unsigned int newLocation) override; - - bool SetLibraryName(CBaseLibrary* lib, const QString& name) override; - -protected: - void SplitFullItemName(const QString& fullItemName, QString& libraryName, QString& itemName); - void NotifyItemEvent(IDataBaseItem* pItem, EDataBaseItemEvent event); - void SetRegisteredFlag(CBaseLibraryItem* pItem, bool bFlag); - - ////////////////////////////////////////////////////////////////////////// - // Must be overriden. - //! Makes a new Item. - virtual CBaseLibraryItem* MakeNewItem() = 0; - virtual CBaseLibrary* MakeNewLibrary() = 0; - ////////////////////////////////////////////////////////////////////////// - - virtual void ReportDuplicateItem(CBaseLibraryItem* pItem, CBaseLibraryItem* pOldItem); - -protected: - bool m_bUniqGuidMap; - bool m_bUniqNameMap; - - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - //! Array of all loaded entity items libraries. - std::vector<_smart_ptr > m_libs; - - // There is always one current level library. - TSmartPtr m_pLevelLibrary; - - // GUID to item map. - typedef std::map, guid_less_predicate> ItemsGUIDMap; - ItemsGUIDMap m_itemsGuidMap; - - // Case insensitive name to items map. - typedef std::map, stl::less_stricmp> ItemsNameMap; - ItemsNameMap m_itemsNameMap; - AZStd::mutex m_itemsNameMapMutex; - - std::vector m_listeners; - - // Currently selected item. - _smart_ptr m_pSelectedItem; - _smart_ptr m_pSelectedParent; - AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING -}; - -////////////////////////////////////////////////////////////////////////// -template -class CDataBaseItemEnumerator - : public IDataBaseItemEnumerator -{ - TMap* m_pMap; - typename TMap::iterator m_iterator; - -public: - CDataBaseItemEnumerator(TMap* pMap) - { - assert(pMap); - m_pMap = pMap; - m_iterator = m_pMap->begin(); - } - void Release() override { delete this; }; - IDataBaseItem* GetFirst() override - { - m_iterator = m_pMap->begin(); - if (m_iterator == m_pMap->end()) - { - return 0; - } - return m_iterator->second; - } - IDataBaseItem* GetNext() override - { - if (m_iterator != m_pMap->end()) - { - m_iterator++; - } - if (m_iterator == m_pMap->end()) - { - return 0; - } - return m_iterator->second; - } -}; - -#endif // CRYINCLUDE_EDITOR_BASELIBRARYMANAGER_H diff --git a/Code/Editor/ErrorRecorder.cpp b/Code/Editor/ErrorRecorder.cpp index 999dab323c..253e103527 100644 --- a/Code/Editor/ErrorRecorder.cpp +++ b/Code/Editor/ErrorRecorder.cpp @@ -7,7 +7,6 @@ */ #include "EditorDefs.h" #include "ErrorRecorder.h" -#include "BaseLibraryItem.h" #include "Include/IErrorReport.h" diff --git a/Code/Editor/ErrorRecorder.h b/Code/Editor/ErrorRecorder.h index e4b3706a16..beacc3f0e5 100644 --- a/Code/Editor/ErrorRecorder.h +++ b/Code/Editor/ErrorRecorder.h @@ -14,6 +14,8 @@ #define CRYINCLUDE_EDITOR_CORE_ERRORRECORDER_H #pragma once +#include "Include/EditorCoreAPI.h" + ////////////////////////////////////////////////////////////////////////// //! Automatic class to record and display error. class EDITOR_CORE_API CErrorsRecorder diff --git a/Code/Editor/ErrorReport.cpp b/Code/Editor/ErrorReport.cpp index 4fd7d41a96..f93ea7606d 100644 --- a/Code/Editor/ErrorReport.cpp +++ b/Code/Editor/ErrorReport.cpp @@ -67,24 +67,6 @@ QString CErrorRecord::GetErrorText() const { str += QString("\t "); } - if (pItem) - { - switch (pItem->GetType()) - { - case EDB_TYPE_MATERIAL: - str += QString("\t Material=\""); - break; - case EDB_TYPE_PARTICLE: - str += QString("\t Particle=\""); - break; - case EDB_TYPE_MUSIC: - str += QString("\t Music=\""); - break; - default: - str += QString("\t Item=\""); - } - str += pItem->GetFullName() + "\""; - } if (pObject) { str += QString("\t Object=\"") + pObject->GetName() + "\""; @@ -101,7 +83,6 @@ CErrorReport::CErrorReport() m_bImmediateMode = true; m_bShowErrors = true; m_pObject = nullptr; - m_pItem = nullptr; m_pParticle = nullptr; } @@ -140,10 +121,6 @@ void CErrorReport::ReportError(CErrorRecord& err) { err.pObject = m_pObject; } - else if (err.pItem == nullptr && m_pItem != nullptr) - { - err.pItem = m_pItem; - } m_errors.push_back(err); } bNoRecurse = false; @@ -255,12 +232,6 @@ void CErrorReport::SetCurrentValidatorObject(CBaseObject* pObject) m_pObject = pObject; } -////////////////////////////////////////////////////////////////////////// -void CErrorReport::SetCurrentValidatorItem(CBaseLibraryItem* pItem) -{ - m_pItem = pItem; -} - ////////////////////////////////////////////////////////////////////////// void CErrorReport::SetCurrentFile(const QString& file) { diff --git a/Code/Editor/ErrorReport.h b/Code/Editor/ErrorReport.h index 3b9a860301..7e2a57a421 100644 --- a/Code/Editor/ErrorReport.h +++ b/Code/Editor/ErrorReport.h @@ -17,7 +17,6 @@ // forward declarations. class CParticleItem; -#include "BaseLibraryItem.h" #include "Objects/BaseObject.h" #include "Include/IErrorReport.h" #include "ErrorRecorder.h" @@ -56,16 +55,13 @@ public: int count; //! Object that caused this error. _smart_ptr pObject; - //! Library Item that caused this error. - _smart_ptr pItem; int flags; CErrorRecord(CBaseObject* object, ESeverity _severity, const QString& _error, int _flags = 0, int _count = 0, - CBaseLibraryItem* item = 0, EValidatorModule _module = VALIDATOR_MODULE_EDITOR) + EValidatorModule _module = VALIDATOR_MODULE_EDITOR) : severity(_severity) , module(_module) , pObject(object) - , pItem(item) , flags(_flags) , count(_count) , error(_error) @@ -77,7 +73,6 @@ public: severity = ESEVERITY_WARNING; module = VALIDATOR_MODULE_EDITOR; pObject = 0; - pItem = 0; flags = 0; count = 0; } @@ -116,8 +111,6 @@ public: //! Assign current Object to which new reported warnings are assigned. void SetCurrentValidatorObject(CBaseObject* pObject); - //! Assign current Item to which new reported warnings are assigned. - void SetCurrentValidatorItem(CBaseLibraryItem* pItem); //! Assign current filename. void SetCurrentFile(const QString& file); @@ -127,7 +120,6 @@ private: bool m_bImmediateMode; bool m_bShowErrors; _smart_ptr m_pObject; - _smart_ptr m_pItem; CParticleItem* m_pParticle; QString m_currentFilename; }; diff --git a/Code/Editor/ErrorReportDialog.cpp b/Code/Editor/ErrorReportDialog.cpp index 2d551d6c8b..bbeede79ef 100644 --- a/Code/Editor/ErrorReportDialog.cpp +++ b/Code/Editor/ErrorReportDialog.cpp @@ -362,10 +362,6 @@ void CErrorReportDialog::CopyToClipboard() { str += QString::fromLatin1(" [Object: %1]").arg(pRecord->pObject->GetName()); } - if (pRecord->pItem) - { - str += QString::fromLatin1(" [Material: %1]").arg(pRecord->pItem->GetName()); - } str += QString::fromLatin1("\r\n"); } } diff --git a/Code/Editor/ErrorReportTableModel.cpp b/Code/Editor/ErrorReportTableModel.cpp index f5dce1a86d..923991bb62 100644 --- a/Code/Editor/ErrorReportTableModel.cpp +++ b/Code/Editor/ErrorReportTableModel.cpp @@ -149,11 +149,7 @@ QVariant CErrorReportTableModel::data(const CErrorRecord& record, int column, in case ColumnFile: return record.file; case ColumnObject: - if (record.pItem) - { - return record.pItem->GetFullName(); - } - else if (record.pObject) + if (record.pObject) { return record.pObject->GetName(); } diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h index d2d4998187..c91ca62c5e 100644 --- a/Code/Editor/IEditor.h +++ b/Code/Editor/IEditor.h @@ -44,7 +44,6 @@ class CMusicManager; struct IEditorParticleManager; class CEAXPresetManager; class CErrorReport; -class CBaseLibraryItem; class ICommandManager; class CEditorCommandManager; class CHyperGraphManager; @@ -52,9 +51,7 @@ class CConsoleSynchronization; class CUIEnumsDatabase; struct ISourceControl; struct IEditorClassFactory; -struct IDataBaseItem; struct ITransformManipulator; -struct IDataBaseManager; class IFacialEditor; class CDialog; #if defined(AZ_PLATFORM_WINDOWS) @@ -82,8 +79,6 @@ struct IEventLoopHook; struct IErrorReport; // Vladimir@conffx struct IFileUtil; // Vladimir@conffx struct IEditorLog; // Vladimir@conffx -struct IEditorMaterialManager; // Vladimir@conffx -struct IBaseLibraryManager; // Vladimir@conffx struct IImageUtil; // Vladimir@conffx struct IEditorParticleUtils; // Leroy@conffx struct ILogFile; // Vladimir@conffx @@ -519,10 +514,6 @@ struct IEditor //! Get access to object manager. virtual struct IObjectManager* GetObjectManager() = 0; virtual CSettingsManager* GetSettingsManager() = 0; - //! Get DB manager that own items of specified type. - virtual IDataBaseManager* GetDBItemManager(EDataBaseItemType itemType) = 0; - virtual IBaseLibraryManager* GetMaterialManagerLibrary() = 0; // Vladimir@conffx - virtual IEditorMaterialManager* GetIEditorMaterialManager() = 0; // Vladimir@Conffx //! Returns IconManager. virtual IIconManager* GetIconManager() = 0; //! Get Music Manager. diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp index 0846cf8a9e..38006c6fca 100644 --- a/Code/Editor/IEditorImpl.cpp +++ b/Code/Editor/IEditorImpl.cpp @@ -892,11 +892,6 @@ void CEditorImpl::CloseView(const GUID& classId) } } -IDataBaseManager* CEditorImpl::GetDBItemManager([[maybe_unused]] EDataBaseItemType itemType) -{ - return nullptr; -} - bool CEditorImpl::SelectColor(QColor& color, QWidget* parent) { const AZ::Color c = AzQtComponents::fromQColor(color); @@ -1624,18 +1619,6 @@ SEditorSettings* CEditorImpl::GetEditorSettings() return &gSettings; } -// Vladimir@Conffx -IBaseLibraryManager* CEditorImpl::GetMaterialManagerLibrary() -{ - return nullptr; -} - -// Vladimir@Conffx -IEditorMaterialManager* CEditorImpl::GetIEditorMaterialManager() -{ - return nullptr; -} - IImageUtil* CEditorImpl::GetImageUtil() { return m_pImageUtil; diff --git a/Code/Editor/IEditorImpl.h b/Code/Editor/IEditorImpl.h index d99b8ae802..7867912941 100644 --- a/Code/Editor/IEditorImpl.h +++ b/Code/Editor/IEditorImpl.h @@ -157,7 +157,6 @@ public: void LockSelection(bool bLock) override; bool IsSelectionLocked() override; - IDataBaseManager* GetDBItemManager(EDataBaseItemType itemType) override; CMusicManager* GetMusicManager() override { return m_pMusicManager; }; IEditorFileMonitor* GetFileMonitor() override; @@ -294,8 +293,6 @@ public: void RegisterObjectContextMenuExtension(TContextMenuExtensionFunc func) override; SSystemGlobalEnvironment* GetEnv() override; - IBaseLibraryManager* GetMaterialManagerLibrary() override; // Vladimir@Conffx - IEditorMaterialManager* GetIEditorMaterialManager() override; // Vladimir@Conffx IImageUtil* GetImageUtil() override; // Vladimir@conffx SEditorSettings* GetEditorSettings() override; ILogFile* GetLogFile() override { return m_pLogFile; } diff --git a/Code/Editor/Include/IBaseLibraryManager.h b/Code/Editor/Include/IBaseLibraryManager.h deleted file mode 100644 index 4116b573fa..0000000000 --- a/Code/Editor/Include/IBaseLibraryManager.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IBASELIBRARYMANAGER_H -#define CRYINCLUDE_EDITOR_INCLUDE_IBASELIBRARYMANAGER_H -#pragma once - -#include -#include "Include/IDataBaseItem.h" -#include "Include/IDataBaseLibrary.h" -#include "Include/IDataBaseManager.h" -#include "Util/TRefCountBase.h" - -class CBaseLibraryItem; -class CBaseLibrary; - -struct IBaseLibraryManager - : public TRefCountBase - , public IEditorNotifyListener -{ - //! Clear all libraries. - virtual void ClearAll() = 0; - - ////////////////////////////////////////////////////////////////////////// - // IDocListener implementation. - ////////////////////////////////////////////////////////////////////////// - virtual void OnEditorNotifyEvent(EEditorNotifyEvent event) = 0; - - ////////////////////////////////////////////////////////////////////////// - // Library items. - ////////////////////////////////////////////////////////////////////////// - //! Make a new item in specified library. - virtual IDataBaseItem* CreateItem(IDataBaseLibrary* pLibrary) = 0; - //! Delete item from library and manager. - virtual void DeleteItem(IDataBaseItem* pItem) = 0; - - //! Find Item by its GUID. - virtual IDataBaseItem* FindItem(REFGUID guid) const = 0; - virtual IDataBaseItem* FindItemByName(const QString& fullItemName) = 0; - virtual IDataBaseItem* LoadItemByName(const QString& fullItemName) = 0; - - virtual IDataBaseItemEnumerator* GetItemEnumerator() = 0; - - ////////////////////////////////////////////////////////////////////////// - // Set item currently selected. - virtual void SetSelectedItem(IDataBaseItem* pItem) = 0; - // Get currently selected item. - virtual IDataBaseItem* GetSelectedItem() const = 0; - virtual IDataBaseItem* GetSelectedParentItem() const = 0; - - ////////////////////////////////////////////////////////////////////////// - // Libraries. - ////////////////////////////////////////////////////////////////////////// - //! Add Item library. - virtual IDataBaseLibrary* AddLibrary(const QString& library, bool isLevelLibrary = false, bool bIsLoading = true) = 0; - virtual void DeleteLibrary(const QString& library, bool forceDeleteLevel = false) = 0; - //! Get number of libraries. - virtual int GetLibraryCount() const = 0; - //! Get number of modified libraries. - virtual int GetModifiedLibraryCount() const = 0; - - //! Get Item library by index. - virtual IDataBaseLibrary* GetLibrary(int index) const = 0; - - //! Get Level Item library. - virtual IDataBaseLibrary* GetLevelLibrary() const = 0; - - //! Find Items Library by name. - virtual IDataBaseLibrary* FindLibrary(const QString& library) = 0; - - //! Find the Library's index by name. - virtual int FindLibraryIndex(const QString& library) = 0; - - //! Load Items library. -#ifdef LoadLibrary -#undef LoadLibrary -#endif - virtual IDataBaseLibrary* LoadLibrary(const QString& filename, bool bReload = false) = 0; - - //! Save all modified libraries. - virtual void SaveAllLibs() = 0; - - //! Serialize property manager. - virtual void Serialize(XmlNodeRef& node, bool bLoading) = 0; - - //! Export items to game. - virtual void Export(XmlNodeRef& node) = 0; - - //! Returns unique name base on input name. - // Vera@conffx, add LibName parameter so we could make an unique name depends on input library. - // Arguments: - // - name: name of the item - // - libName: The library of the item. Given the library name, the function will return a unique name in the library - // Default value "": The function will ignore the library name and return a unique name in the manager - virtual QString MakeUniqueItemName(const QString& name, const QString& libName = "") = 0; - virtual QString MakeFullItemName(IDataBaseLibrary* pLibrary, const QString& group, const QString& itemName) = 0; - - //! Root node where this library will be saved. - virtual QString GetRootNodeName() = 0; - //! Path to libraries in this manager. - virtual QString GetLibsPath() = 0; - - ////////////////////////////////////////////////////////////////////////// - //! Validate library items for errors. - virtual void Validate() = 0; - - ////////////////////////////////////////////////////////////////////////// - virtual void GatherUsedResources(CUsedResources& resources) = 0; - - virtual void AddListener(IDataBaseManagerListener* pListener) = 0; - virtual void RemoveListener(IDataBaseManagerListener* pListener) = 0; - - ////////////////////////////////////////////////////////////////////////// - virtual void RegisterItem(CBaseLibraryItem* pItem, REFGUID newGuid) = 0; - virtual void RegisterItem(CBaseLibraryItem* pItem) = 0; - virtual void UnregisterItem(CBaseLibraryItem* pItem) = 0; - - // Only Used internally. - virtual void OnRenameItem(CBaseLibraryItem* pItem, const QString& oldName) = 0; - - // Called by items to indicated that they have been modified. - // Sends item changed event to listeners. - virtual void OnItemChanged(IDataBaseItem* pItem) = 0; - virtual void OnUpdateProperties(IDataBaseItem* pItem, bool bRefresh) = 0; - - //CONFETTI BEGIN - // Used to change the library item order - virtual void ChangeLibraryOrder(IDataBaseLibrary* lib, unsigned int newLocation) = 0; - // simplifies the library renaming process - virtual bool SetLibraryName(CBaseLibrary* lib, const QString& name) = 0; - - - //Check if the file name is unique. - //Params: library: library name. NOT the file path. - virtual bool IsUniqueFilename(const QString& library) = 0; - //CONFETTI END -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_IBASELIBRARYMANAGER_H diff --git a/Code/Editor/Include/IDataBaseItem.h b/Code/Editor/Include/IDataBaseItem.h deleted file mode 100644 index 6be5f49c2d..0000000000 --- a/Code/Editor/Include/IDataBaseItem.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IDATABASEITEM_H -#define CRYINCLUDE_EDITOR_INCLUDE_IDATABASEITEM_H -#pragma once - -#include -#include - -struct IDataBaseLibrary; -class CUsedResources; - -////////////////////////////////////////////////////////////////////////// -/** Base class for all items contained in BaseLibraray. -*/ -struct IDataBaseItem -{ - struct SerializeContext - { - XmlNodeRef node; - bool bUndo; - bool bLoading; - bool bCopyPaste; - bool bIgnoreChilds; - bool bUniqName; - SerializeContext() - : node(0) - , bLoading(false) - , bCopyPaste(false) - , bIgnoreChilds(false) - , bUniqName(false) - , bUndo(false) {}; - SerializeContext(XmlNodeRef _node, bool bLoad) - : node(_node) - , bLoading(bLoad) - , bCopyPaste(false) - , bIgnoreChilds(false) - , bUniqName(false) - , bUndo(false) {}; - SerializeContext(const SerializeContext& ctx) - : node(ctx.node) - , bLoading(ctx.bLoading) - , bCopyPaste(ctx.bCopyPaste) - , bIgnoreChilds(ctx.bIgnoreChilds) - , bUniqName(ctx.bUniqName) - , bUndo(ctx.bUndo) {}; - }; - - virtual EDataBaseItemType GetType() const = 0; - - //! Return Library this item are contained in. - //! Item can only be at one library. - virtual IDataBaseLibrary* GetLibrary() const = 0; - - //! Change item name. - virtual void SetName(const QString& name) = 0; - //! Get item name. - virtual const QString& GetName() const = 0; - - //! Get full item name, including name of library. - //! Name formed by adding dot after name of library - //! eg. library Pickup and item PickupRL form full item name: "Pickups.PickupRL". - virtual QString GetFullName() const = 0; - - //! Get only nameof group from prototype. - virtual QString GetGroupName() = 0; - //! Get short name of prototype without group. - virtual QString GetShortName() = 0; - - //! Serialize library item to archive. - virtual void Serialize(SerializeContext& ctx) = 0; - - //! Generate new unique id for this item. - virtual void GenerateId() = 0; - //! Returns GUID of this material. - virtual const GUID& GetGUID() const = 0; - - //! Validate item for errors. - virtual void Validate() {}; - - //! Gathers resources by this item. - virtual void GatherUsedResources([[maybe_unused]] CUsedResources& resources) {}; -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_IDATABASEITEM_H diff --git a/Code/Editor/Include/IDataBaseLibrary.h b/Code/Editor/Include/IDataBaseLibrary.h deleted file mode 100644 index 75437d93e2..0000000000 --- a/Code/Editor/Include/IDataBaseLibrary.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IDATABASELIBRARY_H -#define CRYINCLUDE_EDITOR_INCLUDE_IDATABASELIBRARY_H -#pragma once - - -struct IDataBaseManager; -struct IDataBaseItem; - -class QString; -class XmlNodeRef; - -////////////////////////////////////////////////////////////////////////// -// Description: -// Interface to access specific library of editor data base. -// Ex. Archetype library, Material Library. -// See Also: -// IDataBaseItem,IDataBaseManager -////////////////////////////////////////////////////////////////////////// -struct IDataBaseLibrary -{ - // Description: - // Return IDataBaseManager interface to the manager for items stored in this library. - virtual IDataBaseManager* GetManager() = 0; - - // Description: - // Return library name. - virtual const QString& GetName() const = 0; - - // Description: - // Return filename where this library is stored. - virtual const QString& GetFilename() const = 0; - - // Description: - // Save contents of library to file. - virtual bool Save() = 0; - - // Description: - // Load library from file. - // Arguments: - // filename - Full specified library filename (relative to root game folder). - virtual bool Load(const QString& filename) = 0; - - // Description: - // Serialize library parameters and items to/from XML node. - virtual void Serialize(XmlNodeRef& node, bool bLoading) = 0; - - // Description: - // Marks library as modified, indicates that some item in library was modified. - virtual void SetModified(bool bModified = true) = 0; - - // Description: - // Check if library parameters or any items where modified. - // If any item was modified library may need saving before closing editor. - virtual bool IsModified() const = 0; - - // Description: - // Check if this library is not shared and internal to current level. - virtual bool IsLevelLibrary() const = 0; - - // Description: - // Make this library accessible only from current Level. (not shared) - virtual void SetLevelLibrary(bool bEnable) = 0; - - // Description: - // Associate a new item with the library. - // Watch out if item was already in another library. - virtual void AddItem(IDataBaseItem* pItem, bool bRegister = true) = 0; - - // Description: - // Return number of items in library. - virtual int GetItemCount() const = 0; - - // Description: - // Get item by index. - // See Also: - // GetItemCount - // Arguments: - // index - Index from 0 to GetItemCount() - virtual IDataBaseItem* GetItem(int index) = 0; - - // Description: - // Remove item from library, does not destroy item, - // only unliks it from this library, to delete item use IDataBaseManager. - // See Also: - // AddItem - virtual void RemoveItem(IDataBaseItem* item) = 0; - - // Description: - // Remove all items from library, does not destroy items, - // only unliks them from this library, to delete item use IDataBaseManager. - // See Also: - // RemoveItem,AddItem - virtual void RemoveAllItems() = 0; - - // Description: - // Find item in library by name. - // This function usually uses linear search so it is not particularry fast. - // See Also: - // GetItem - virtual IDataBaseItem* FindItem(const QString& name) = 0; - - - //CONFETTI BEGIN - // Used to change the library item order - virtual void ChangeItemOrder(CBaseLibraryItem* item, unsigned int newLocation) = 0; - //CONFETTI END -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_IDATABASELIBRARY_H diff --git a/Code/Editor/Include/IDataBaseManager.h b/Code/Editor/Include/IDataBaseManager.h deleted file mode 100644 index 3d701d51fc..0000000000 --- a/Code/Editor/Include/IDataBaseManager.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IDATABASEMANAGER_H -#define CRYINCLUDE_EDITOR_INCLUDE_IDATABASEMANAGER_H -#pragma once - -#include - -struct IDataBaseItem; -struct IDataBaseLibrary; -class CUsedResources; - -enum EDataBaseItemEvent -{ - EDB_ITEM_EVENT_ADD, - EDB_ITEM_EVENT_DELETE, - EDB_ITEM_EVENT_CHANGED, - EDB_ITEM_EVENT_SELECTED, - EDB_ITEM_EVENT_UPDATE_PROPERTIES, - EDB_ITEM_EVENT_UPDATE_PROPERTIES_NO_EDITOR_REFRESH -}; - -////////////////////////////////////////////////////////////////////////// -// Description: -// Callback class to intercept item creation and deletion events. -////////////////////////////////////////////////////////////////////////// -struct IDataBaseManagerListener -{ - virtual void OnDataBaseItemEvent(IDataBaseItem* pItem, EDataBaseItemEvent event) = 0; -}; - -////////////////////////////////////////////////////////////////////////// -// Description: -// his interface is used to enumerate al items registered to the database manager. -////////////////////////////////////////////////////////////////////////// -struct IDataBaseItemEnumerator -{ - virtual ~IDataBaseItemEnumerator() = default; - - virtual void Release() = 0; - virtual IDataBaseItem* GetFirst() = 0; - virtual IDataBaseItem* GetNext() = 0; -}; - -////////////////////////////////////////////////////////////////////////// -// -// Interface to the collection of all items or specific type -// in data base libraries. -// -////////////////////////////////////////////////////////////////////////// -struct IDataBaseManager -{ - //! Clear all libraries. - virtual void ClearAll() = 0; - - ////////////////////////////////////////////////////////////////////////// - // Library items. - ////////////////////////////////////////////////////////////////////////// - //! Make a new item in specified library. - virtual IDataBaseItem* CreateItem(IDataBaseLibrary* pLibrary) = 0; - //! Delete item from library and manager. - virtual void DeleteItem(IDataBaseItem* pItem) = 0; - - //! Find Item by its GUID. - virtual IDataBaseItem* FindItem(REFGUID guid) const = 0; - virtual IDataBaseItem* FindItemByName(const QString& fullItemName) = 0; - - virtual IDataBaseItemEnumerator* GetItemEnumerator() = 0; - - // Select one item in DB. - virtual void SetSelectedItem(IDataBaseItem* pItem) = 0; - - ////////////////////////////////////////////////////////////////////////// - // Libraries. - ////////////////////////////////////////////////////////////////////////// - //! Add Item library. Set isLevelLibrary to true if its the "level" library which gets saved inside the level - virtual IDataBaseLibrary* AddLibrary(const QString& library, bool isLevelLibrary = false, bool bIsLoading = true) = 0; - virtual void DeleteLibrary(const QString& library, bool forceDeleteLibrary = false) = 0; - //! Get number of libraries. - virtual int GetLibraryCount() const = 0; - //! Get Item library by index. - virtual IDataBaseLibrary* GetLibrary(int index) const = 0; - - //! Find Items Library by name. - virtual IDataBaseLibrary* FindLibrary(const QString& library) = 0; - - //! Load Items library. -#ifdef LoadLibrary -#undef LoadLibrary -#endif - virtual IDataBaseLibrary* LoadLibrary(const QString& filename, bool bReload = false) = 0; - - //! Save all modified libraries. - virtual void SaveAllLibs() = 0; - - //! Serialize property manager. - virtual void Serialize(XmlNodeRef& node, bool bLoading) = 0; - - //! Export items to game. - virtual void Export([[maybe_unused]] XmlNodeRef& node) {}; - - //! Returns unique name base on input name. - virtual QString MakeUniqueItemName(const QString& name, const QString& libName = "") = 0; - virtual QString MakeFullItemName(IDataBaseLibrary* pLibrary, const QString& group, const QString& itemName) = 0; - - //! Root node where this library will be saved. - virtual QString GetRootNodeName() = 0; - //! Path to libraries in this manager. - virtual QString GetLibsPath() = 0; - - ////////////////////////////////////////////////////////////////////////// - //! Validate library items for errors. - virtual void Validate() = 0; - - // Description: - // Collects names of all resource files used by managed items. - // Arguments: - // resources - Structure where all filenames are collected. - virtual void GatherUsedResources(CUsedResources& resources) = 0; - - ////////////////////////////////////////////////////////////////////////// - // Register listeners. - virtual void AddListener(IDataBaseManagerListener* pListener) = 0; - virtual void RemoveListener(IDataBaseManagerListener* pListener) = 0; -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_IDATABASEMANAGER_H diff --git a/Code/Editor/Include/IEditorMaterial.h b/Code/Editor/Include/IEditorMaterial.h deleted file mode 100644 index 329b0ae53f..0000000000 --- a/Code/Editor/Include/IEditorMaterial.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - - -#include "BaseLibraryItem.h" -#include - -struct IEditorMaterial - : public CBaseLibraryItem -{ - virtual int GetFlags() const = 0; - virtual IMaterial* GetMatInfo(bool bUseExistingEngineMaterial = false) = 0; - virtual void DisableHighlightForFrame() = 0; -}; diff --git a/Code/Editor/Include/IEditorMaterialManager.h b/Code/Editor/Include/IEditorMaterialManager.h deleted file mode 100644 index 6f71c5ddd1..0000000000 --- a/Code/Editor/Include/IEditorMaterialManager.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef CRYINCLUDE_EDITOR_MATERIAL_IEDITORMATERIALMANAGER_H -#define CRYINCLUDE_EDITOR_MATERIAL_IEDITORMATERIALMANAGER_H -#pragma once - -#include -#include - - -struct IEditorMaterialManager -{ - virtual void GotoMaterial(IMaterial* pMaterial) = 0; -}; - -#endif // CRYINCLUDE_EDITOR_MATERIAL_MATERIALMANAGER_H diff --git a/Code/Editor/Include/IErrorReport.h b/Code/Editor/Include/IErrorReport.h index 7bf00d6973..c409dbc7dd 100644 --- a/Code/Editor/Include/IErrorReport.h +++ b/Code/Editor/Include/IErrorReport.h @@ -14,7 +14,6 @@ // forward declarations. class CParticleItem; class CBaseObject; -class CBaseLibraryItem; class CErrorRecord; class QString; @@ -52,9 +51,6 @@ struct IErrorReport //! Assign current Object to which new reported warnings are assigned. virtual void SetCurrentValidatorObject(CBaseObject* pObject) = 0; - //! Assign current Item to which new reported warnings are assigned. - virtual void SetCurrentValidatorItem(CBaseLibraryItem* pItem) = 0; - //! Assign current filename. virtual void SetCurrentFile(const QString& file) = 0; }; diff --git a/Code/Editor/Lib/Tests/IEditorMock.h b/Code/Editor/Lib/Tests/IEditorMock.h index 590f98e6d7..aaee34c2c6 100644 --- a/Code/Editor/Lib/Tests/IEditorMock.h +++ b/Code/Editor/Lib/Tests/IEditorMock.h @@ -85,9 +85,6 @@ public: MOCK_METHOD0(IsSelectionLocked, bool()); MOCK_METHOD0(GetObjectManager, struct IObjectManager* ()); MOCK_METHOD0(GetSettingsManager, CSettingsManager* ()); - MOCK_METHOD1(GetDBItemManager, IDataBaseManager* (EDataBaseItemType)); - MOCK_METHOD0(GetMaterialManagerLibrary, IBaseLibraryManager* ()); - MOCK_METHOD0(GetIEditorMaterialManager, IEditorMaterialManager* ()); MOCK_METHOD0(GetIconManager, IIconManager* ()); MOCK_METHOD0(GetMusicManager, CMusicManager* ()); MOCK_METHOD2(GetTerrainElevation, float(float , float )); diff --git a/Code/Editor/TrackView/TrackViewSequenceManager.cpp b/Code/Editor/TrackView/TrackViewSequenceManager.cpp index d7c1e3c709..515af4df38 100644 --- a/Code/Editor/TrackView/TrackViewSequenceManager.cpp +++ b/Code/Editor/TrackView/TrackViewSequenceManager.cpp @@ -408,20 +408,6 @@ void CTrackViewSequenceManager::OnSequenceRemoved(CTrackViewSequence* sequence) } } -//////////////////////////////////////////////////////////////////////////// -void CTrackViewSequenceManager::OnDataBaseItemEvent([[maybe_unused]] IDataBaseItem* pItem, EDataBaseItemEvent event) -{ - if (event != EDataBaseItemEvent::EDB_ITEM_EVENT_ADD) - { - const size_t numSequences = m_sequences.size(); - - for (size_t i = 0; i < numSequences; ++i) - { - m_sequences[i]->UpdateDynamicParams(); - } - } -} - //////////////////////////////////////////////////////////////////////////// CTrackViewAnimNodeBundle CTrackViewSequenceManager::GetAllRelatedAnimNodes(const AZ::EntityId entityId) const { diff --git a/Code/Editor/TrackView/TrackViewSequenceManager.h b/Code/Editor/TrackView/TrackViewSequenceManager.h index 1474323dc6..6c65a7f1a9 100644 --- a/Code/Editor/TrackView/TrackViewSequenceManager.h +++ b/Code/Editor/TrackView/TrackViewSequenceManager.h @@ -13,13 +13,11 @@ #include "TrackViewSequence.h" -#include "IDataBaseManager.h" #include class CTrackViewSequenceManager : public IEditorNotifyListener - , public IDataBaseManagerListener , public ITrackViewSequenceManager , public AZ::EntitySystemBus::Handler { @@ -65,8 +63,6 @@ private: void OnSequenceAdded(CTrackViewSequence* pSequence); void OnSequenceRemoved(CTrackViewSequence* pSequence); - void OnDataBaseItemEvent(IDataBaseItem* pItem, EDataBaseItemEvent event) override; - // AZ::EntitySystemBus void OnEntityNameChanged(const AZ::EntityId& entityId, const AZStd::string& name) override; void OnEntityDestruction(const AZ::EntityId& entityId) override; diff --git a/Code/Editor/Viewport.h b/Code/Editor/Viewport.h index a71df6a9cd..1b0e5a4d93 100644 --- a/Code/Editor/Viewport.h +++ b/Code/Editor/Viewport.h @@ -46,7 +46,6 @@ struct HitContext; struct IRenderListener; class CImageEx; class QMenu; -struct IDataBaseItem; /** Type of viewport. */ @@ -230,8 +229,6 @@ public: // Drag and drop support on viewports. // To be overrided in derived classes. ////////////////////////////////////////////////////////////////////////// - virtual bool CanDrop([[maybe_unused]] const QPoint& point, [[maybe_unused]] IDataBaseItem* pItem) { return false; }; - virtual void Drop([[maybe_unused]] const QPoint& point, [[maybe_unused]] IDataBaseItem* pItem) {}; virtual void SetGlobalDropCallback(DropCallback dropCallback, void* dropCallbackCustom) { m_dropCallback = dropCallback; diff --git a/Code/Editor/editor_core_files.cmake b/Code/Editor/editor_core_files.cmake index 53dd8d79a5..1f0a5a3618 100644 --- a/Code/Editor/editor_core_files.cmake +++ b/Code/Editor/editor_core_files.cmake @@ -7,17 +7,12 @@ # set(FILES - BaseLibrary.h - BaseLibraryItem.h UsedResources.h UIEnumsDatabase.h Include/EditorCoreAPI.cpp Include/IErrorReport.h - Include/IBaseLibraryManager.h Include/IFileUtil.h Include/EditorCoreAPI.h - Include/IEditorMaterial.h - Include/IEditorMaterialManager.h Include/IImageUtil.h Controls/ReflectedPropertyControl/ReflectedPropertyCtrl.qrc Controls/ReflectedPropertyControl/ReflectedPropertyCtrl.cpp @@ -35,8 +30,6 @@ set(FILES Controls/QBitmapPreviewDialogImp.h Controls/QToolTipWidget.h Controls/QToolTipWidget.cpp - BaseLibraryItem.cpp - BaseLibrary.cpp UsedResources.cpp UIEnumsDatabase.cpp LyViewPaneNames.h diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index c81a326aff..59a1a91647 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -271,9 +271,6 @@ set(FILES Include/HitContext.h Include/ICommandManager.h Include/IConsoleConnectivity.h - Include/IDataBaseItem.h - Include/IDataBaseLibrary.h - Include/IDataBaseManager.h Include/IDisplayViewport.h Include/IEditorClassFactory.h Include/IEventLoopHook.h @@ -369,9 +366,6 @@ set(FILES ActionManager.h ShortcutDispatcher.cpp ShortcutDispatcher.h - BaseLibraryManager.cpp - BaseLibraryItem.h - BaseLibraryManager.h CheckOutDialog.cpp CheckOutDialog.h CheckOutDialog.ui From 353d4bb2bb7515c2ee4e05b175626abb2c16cbaf Mon Sep 17 00:00:00 2001 From: Allen Jackson <23512001+jackalbe@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:47:04 -0600 Subject: [PATCH 296/399] {lyn8938} looks into the asset database to detect products (#6709) Signed-off-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> --- .../PythonAssetBuilder/AssetBuilder_test.py | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test.py b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test.py index 45e633a979..cb2c445246 100644 --- a/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test.py +++ b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test.py @@ -12,12 +12,36 @@ import sys import os import pytest import logging +import sqlite3 pytest.importorskip('ly_test_tools') import ly_test_tools.environment.file_system as file_system import ly_test_tools.log.log_monitor import ly_test_tools.environment.waiter as waiter +def detect_product(sql_connection, platform, target): + cur = sql_connection.cursor() + product_target = f'{platform}/{target}' + print(f'Detecting {product_target} in assetdb.sqlite') + hits = 0 + for row in cur.execute(f'select ProductID from Products where ProductName is "{product_target}"'): + hits = hits + 1 + assert hits == 1 + + +def find_products(cache_folder, platform): + con = sqlite3.connect(os.path.join(cache_folder, 'assetdb.sqlite')) + detect_product(con, platform, 'gem/pythontests/pythonassetbuilder/test_asset.mock_asset') + detect_product(con, platform, 'gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_positive_1.azmodel') + detect_product(con, platform, 'gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_negative_1.azmodel') + detect_product(con, platform, 'gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_positive_1.azmodel') + detect_product(con, platform, 'gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_negative_1.azmodel') + detect_product(con, platform, 'gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_positive_1.azmodel') + detect_product(con, platform, 'gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_negative_1.azmodel') + detect_product(con, platform, 'gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_center_1.azmodel') + con.close() + + @pytest.mark.SUITE_periodic @pytest.mark.parametrize('launcher_platform', ['windows_editor']) @pytest.mark.parametrize('project', ['AutomatedTesting']) @@ -25,16 +49,7 @@ import ly_test_tools.environment.waiter as waiter class TestPythonAssetProcessing(object): def test_DetectPythonCreatedAsset(self, request, editor, level, launcher_platform): unexpected_lines = [] - expected_lines = [ - 'Mock asset exists', - 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_positive_1.azmodel) found', - 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_negative_1.azmodel) found', - 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_positive_1.azmodel) found', - 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_negative_1.azmodel) found', - 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_positive_1.azmodel) found', - 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_negative_1.azmodel) found', - 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_center_1.azmodel) found' - ] + expected_lines = [] timeout = 180 halt_on_unexpected = False test_directory = os.path.join(os.path.dirname(__file__)) @@ -50,3 +65,9 @@ class TestPythonAssetProcessing(object): exc=("Log file '{}' was never opened by another process.".format(editorlog_file)), interval=1) log_monitor.monitor_log_for_lines(expected_lines, unexpected_lines, halt_on_unexpected, timeout) + + cache_folder = editor.workspace.paths.cache() + platform = editor.workspace.asset_processor_platform + if platform == 'windows': + platform = 'pc' + find_products(cache_folder, platform) From e5c2d574fc06a377a6015b7d49f34dbc9806ffc9 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 6 Jan 2022 12:51:10 -0600 Subject: [PATCH 297/399] Added a missing include and forward declare Signed-off-by: Chris Galvan --- Code/Editor/Objects/EntityObject.h | 1 + Code/Editor/TrackView/TrackViewSequence.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Code/Editor/Objects/EntityObject.h b/Code/Editor/Objects/EntityObject.h index c3e379bccc..c6b7e4ce2d 100644 --- a/Code/Editor/Objects/EntityObject.h +++ b/Code/Editor/Objects/EntityObject.h @@ -27,6 +27,7 @@ #define CLASS_ENVIRONMENT_LIGHT "EnvironmentLight" class CEntityObject; +class CSelectionGroup; class QMenu; /*! diff --git a/Code/Editor/TrackView/TrackViewSequence.h b/Code/Editor/TrackView/TrackViewSequence.h index a392ad00f9..8f686af0cb 100644 --- a/Code/Editor/TrackView/TrackViewSequence.h +++ b/Code/Editor/TrackView/TrackViewSequence.h @@ -11,6 +11,7 @@ #define CRYINCLUDE_EDITOR_TRACKVIEW_TRACKVIEWSEQUENCE_H #pragma once +#include #include "IMovieSystem.h" #include From 603967d61f62b09688d5f30c87edd86074452519 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:04:54 -0800 Subject: [PATCH 298/399] Fixed build issues with Spawnable Entity Aliases. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp | 5 ++++- Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp b/Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp index 42a817987e..aef13fbfe2 100644 --- a/Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp +++ b/Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp @@ -57,6 +57,7 @@ namespace UnitTest TEST_F(PrefabProcessingTestFixture, NetworkPrefabProcessor_ProcessPrefabTwoEntities_NetEntityGoesToNetSpawnable) { using AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext; + using AzToolsFramework::Prefab::PrefabConversionUtils::PrefabDocument; AZStd::vector entities; @@ -74,7 +75,9 @@ namespace UnitTest // Add the prefab into the Prefab Processor Context const AZStd::string prefabName = "testPrefab"; PrefabProcessorContext prefabProcessorContext{AZ::Uuid::CreateRandom()}; - prefabProcessorContext.AddPrefab(prefabName, AZStd::move(prefabDom)); + PrefabDocument document(prefabName); + ASSERT_TRUE(document.SetPrefabDom(AZStd::move(prefabDom))); + prefabProcessorContext.AddPrefab(AZStd::move(document)); // Request NetworkPrefabProcessor to process the prefab Multiplayer::NetworkPrefabProcessor processor; diff --git a/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp b/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp index 2ed05b4dfe..5ee23a9e3c 100644 --- a/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp +++ b/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp @@ -106,7 +106,8 @@ namespace UnitTest AzToolsFramework::Prefab::PrefabDom prefabDom; prefabDom.CopyFrom(prefabSystemComponentInterface->FindTemplateDom(parentInstance->GetTemplateId()), prefabDom.GetAllocator(), false); - ASSERT_TRUE(prefabBuilderComponent.ProcessPrefab({AZ::Crc32("pc")}, "parent.prefab", "unused", AZ::Uuid(), prefabDom, jobProducts)); + ASSERT_TRUE(prefabBuilderComponent.ProcessPrefab( + { AZ::Crc32("pc") }, "parent.prefab", "unused", AZ::Uuid(), AZStd::move(prefabDom), jobProducts)); ASSERT_EQ(jobProducts.size(), 1); ASSERT_EQ(jobProducts[0].m_dependencies.size(), 1); From 7b172667cfe321982b7594bc70fe530bf60604a9 Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Thu, 6 Jan 2022 13:13:00 -0600 Subject: [PATCH 299/399] Adding info lines for debugging File Menu tests and waits during drag and drop operations in Docking test Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../editor/EditorScripts/Docking_BasicDockedTools.py | 9 ++++++--- .../editor/EditorScripts/Menus_EditMenuOptions.py | 1 + .../editor/EditorScripts/Menus_FileMenuOptions.py | 1 + .../editor/EditorScripts/Menus_ViewMenuOptions.py | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py index d83db7d90c..8734769225 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py @@ -85,22 +85,25 @@ def Docking_BasicDockedTools(): # We drag/drop it over the viewport since it doesn't allow docking, so this will undock it render_overlay = editor_window.findChild(QtWidgets.QWidget, "renderOverlay") pyside_utils.drag_and_drop(entity_outliner, render_overlay) - + general.idle_wait(0.5) + # We need to grab a new reference to the Entity Outliner QDockWidget because when it gets moved - # to the floating window, its parent changes so the wrapped intance we had becomes invalid + # to the floating window, its parent changes so the wrapped instance we had becomes invalid entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner") # Dock the Entity Inspector tabbed with the floating Entity Outliner entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector") pyside_utils.drag_and_drop(entity_inspector, entity_outliner) + general.idle_wait(0.5) # We need to grab a new reference to the Entity Inspector QDockWidget because when it gets moved - # to the floating window, its parent changes so the wrapped intance we had becomes invalid + # to the floating window, its parent changes so the wrapped instance we had becomes invalid entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector") # Dock the Console tabbed with the floating Entity Inspector console = editor_window.findChild(QtWidgets.QDockWidget, "Console") pyside_utils.drag_and_drop(console, entity_inspector) + general.idle_wait(0.5) # Check to ensure all the tools are parented to the same QStackedWidget def check_all_panes_tabbed(): diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py index 7d72d76776..0536575893 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py @@ -64,6 +64,7 @@ def Menus_EditMenuOptions_Work(): for option in edit_menu_options: try: action = pyside_utils.get_action_for_menu_path(editor_window, "Edit", *option) + Report.info(f"Triggering {action.iconText()}") action.trigger() action_triggered = True except Exception as e: diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py index cade2125e2..a4e702cbd1 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py @@ -53,6 +53,7 @@ def Menus_FileMenuOptions_Work(): for option in file_menu_options: try: action = pyside_utils.get_action_for_menu_path(editor_window, "File", *option) + Report.info(f"Triggering {action.iconText()}") action.trigger() action_triggered = True except Exception as e: diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py index 2d92fdb97c..e2ee3e2a55 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py @@ -52,6 +52,7 @@ def Menus_ViewMenuOptions_Work(): for option in view_menu_options: try: action = pyside_utils.get_action_for_menu_path(editor_window, "View", *option) + Report.info(f"Triggering {action.iconText()}") action.trigger() action_triggered = True except Exception as e: From 53e6f0f99f44430ccdc7bde0518fc3f8e11a4cd8 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 6 Jan 2022 13:27:44 -0600 Subject: [PATCH 300/399] Added another missing include Signed-off-by: Chris Galvan --- Code/Editor/ErrorReport.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Code/Editor/ErrorReport.h b/Code/Editor/ErrorReport.h index 7e2a57a421..a80bb36404 100644 --- a/Code/Editor/ErrorReport.h +++ b/Code/Editor/ErrorReport.h @@ -18,6 +18,7 @@ class CParticleItem; #include "Objects/BaseObject.h" +#include "Include/EditorCoreAPI.h" #include "Include/IErrorReport.h" #include "ErrorRecorder.h" From d3b36f18148744d477d751c628e647f11a3efd59 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 6 Jan 2022 13:55:52 -0600 Subject: [PATCH 301/399] Added a couple more missing includes Signed-off-by: Chris Galvan --- Code/Editor/ErrorReport.h | 3 +++ Code/Editor/Objects/ObjectLoader.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/Code/Editor/ErrorReport.h b/Code/Editor/ErrorReport.h index a80bb36404..98d230e383 100644 --- a/Code/Editor/ErrorReport.h +++ b/Code/Editor/ErrorReport.h @@ -17,6 +17,9 @@ // forward declarations. class CParticleItem; +#include +#include + #include "Objects/BaseObject.h" #include "Include/EditorCoreAPI.h" #include "Include/IErrorReport.h" diff --git a/Code/Editor/Objects/ObjectLoader.h b/Code/Editor/Objects/ObjectLoader.h index fc1014ad03..fa576fa983 100644 --- a/Code/Editor/Objects/ObjectLoader.h +++ b/Code/Editor/Objects/ObjectLoader.h @@ -13,6 +13,8 @@ #include "ErrorReport.h" #include +#include + class CErrorRecord; struct IObjectManager; From 741a9059f6540f44c252edeb5780c592efe18c9c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 12:13:23 -0800 Subject: [PATCH 302/399] More packaging cleanup (#6728) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../build/Platform/Android/build_config.json | 10 ---------- scripts/build/Platform/Android/pipeline.json | 3 --- scripts/build/Platform/Linux/pipeline.json | 3 --- scripts/build/Platform/Mac/build_config.json | 10 ---------- scripts/build/Platform/Mac/pipeline.json | 3 --- .../build/Platform/Windows/build_config.json | 20 ------------------- scripts/build/Platform/Windows/pipeline.json | 3 --- scripts/build/Platform/iOS/pipeline.json | 3 --- 8 files changed, 55 deletions(-) diff --git a/scripts/build/Platform/Android/build_config.json b/scripts/build/Platform/Android/build_config.json index 06fa1ffb5f..7a7e90c0b0 100644 --- a/scripts/build/Platform/Android/build_config.json +++ b/scripts/build/Platform/Android/build_config.json @@ -41,16 +41,6 @@ "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" } }, - "android_packaging_all": { - "TAGS": [ - "packaging" - ], - "COMMAND": "../Windows/python_windows.cmd", - "PARAMETERS": { - "SCRIPT_PATH": "scripts/build/package/package.py", - "SCRIPT_PARAMETERS": "--platform Android --type all" - } - }, "profile": { "TAGS":[ "weekly-build-metrics", diff --git a/scripts/build/Platform/Android/pipeline.json b/scripts/build/Platform/Android/pipeline.json index 230d5d3477..f0292f4501 100644 --- a/scripts/build/Platform/Android/pipeline.json +++ b/scripts/build/Platform/Android/pipeline.json @@ -12,9 +12,6 @@ "daily-pipeline-metrics": { "CLEAN_WORKSPACE": true }, - "packaging": { - "CLEAN_WORKSPACE": true - }, "nightly-clean": { "CLEAN_WORKSPACE": true } diff --git a/scripts/build/Platform/Linux/pipeline.json b/scripts/build/Platform/Linux/pipeline.json index d10e2886f2..e9667d312d 100644 --- a/scripts/build/Platform/Linux/pipeline.json +++ b/scripts/build/Platform/Linux/pipeline.json @@ -10,9 +10,6 @@ "daily-pipeline-metrics": { "CLEAN_WORKSPACE": true }, - "packaging": { - "CLEAN_WORKSPACE": true - }, "nightly-clean": { "CLEAN_WORKSPACE": true } diff --git a/scripts/build/Platform/Mac/build_config.json b/scripts/build/Platform/Mac/build_config.json index fb960a96fa..6ba264cdb2 100644 --- a/scripts/build/Platform/Mac/build_config.json +++ b/scripts/build/Platform/Mac/build_config.json @@ -153,16 +153,6 @@ "CMAKE_TARGET": "ALL_BUILD" } }, - "mac_packaging_all": { - "TAGS": [ - "packaging" - ], - "COMMAND": "python_mac.sh", - "PARAMETERS": { - "SCRIPT_PATH": "scripts/build/package/package.py", - "SCRIPT_PARAMETERS": "--platform Mac --type all" - } - }, "install_profile": { "TAGS": [], "COMMAND": "build_mac.sh", diff --git a/scripts/build/Platform/Mac/pipeline.json b/scripts/build/Platform/Mac/pipeline.json index e8cea0f06d..24f42a0c69 100644 --- a/scripts/build/Platform/Mac/pipeline.json +++ b/scripts/build/Platform/Mac/pipeline.json @@ -10,9 +10,6 @@ "daily-pipeline-metrics": { "CLEAN_WORKSPACE": true }, - "packaging": { - "CLEAN_WORKSPACE": true - }, "nightly-clean": { "CLEAN_WORKSPACE": true } diff --git a/scripts/build/Platform/Windows/build_config.json b/scripts/build/Platform/Windows/build_config.json index c591ca0eac..e3d5a4a3fc 100644 --- a/scripts/build/Platform/Windows/build_config.json +++ b/scripts/build/Platform/Windows/build_config.json @@ -59,26 +59,6 @@ "SCRIPT_PARAMETERS": "--platform=Windows --repository=%REPOSITORY_NAME% --jobname=%JOB_NAME% --jobnumber=%BUILD_NUMBER% --jobnode=%NODE_LABEL% --changelist=%CHANGE_ID%" } }, - "windows_packaging_all": { - "TAGS": [ - "packaging" - ], - "COMMAND": "python_windows.cmd", - "PARAMETERS": { - "SCRIPT_PATH": "scripts/build/package/package.py", - "SCRIPT_PARAMETERS": "--platform Windows --type all" - } - }, - "3rdParty_all": { - "TAGS": [ - "packaging" - ], - "COMMAND": "python_windows.cmd", - "PARAMETERS": { - "SCRIPT_PATH": "scripts/build/package/package.py", - "SCRIPT_PARAMETERS": "--platform 3rdParty --type 3rdParty_all" - } - }, "test_impact_analysis_profile": { "TAGS": [ ], diff --git a/scripts/build/Platform/Windows/pipeline.json b/scripts/build/Platform/Windows/pipeline.json index b18a1e8c63..28d8437408 100644 --- a/scripts/build/Platform/Windows/pipeline.json +++ b/scripts/build/Platform/Windows/pipeline.json @@ -10,9 +10,6 @@ "daily-pipeline-metrics": { "CLEAN_WORKSPACE": true }, - "packaging": { - "CLEAN_WORKSPACE": true - }, "nightly-clean": { "CLEAN_WORKSPACE": true } diff --git a/scripts/build/Platform/iOS/pipeline.json b/scripts/build/Platform/iOS/pipeline.json index a5e2ff710e..369152a7a4 100644 --- a/scripts/build/Platform/iOS/pipeline.json +++ b/scripts/build/Platform/iOS/pipeline.json @@ -10,9 +10,6 @@ "daily-pipeline-metrics": { "CLEAN_WORKSPACE": true }, - "packaging": { - "CLEAN_WORKSPACE": true - }, "nightly-clean": { "CLEAN_WORKSPACE": true } From ad9bcba6e283d0d935473dea04fe2894689b4001 Mon Sep 17 00:00:00 2001 From: Vincent Liu <5900509+onecent1101@users.noreply.github.com> Date: Thu, 6 Jan 2022 13:17:48 -0800 Subject: [PATCH 303/399] [Linux] Update to use AWSNativeSDK 1.9.50 (#6715) --- Gems/AWSCore/Code/Platform/Linux/AWSCore_Traits_Linux.h | 2 +- cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/AWSCore/Code/Platform/Linux/AWSCore_Traits_Linux.h b/Gems/AWSCore/Code/Platform/Linux/AWSCore_Traits_Linux.h index d7b1f32461..2cacfb0d34 100644 --- a/Gems/AWSCore/Code/Platform/Linux/AWSCore_Traits_Linux.h +++ b/Gems/AWSCore/Code/Platform/Linux/AWSCore_Traits_Linux.h @@ -7,4 +7,4 @@ */ #pragma once -#define AWSCORE_BACKWARD_INCOMPATIBLE_CHANGE 0 +#define AWSCORE_BACKWARD_INCOMPATIBLE_CHANGE 1 diff --git a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake index 109ae75f38..f7bc2721ae 100644 --- a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake +++ b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake @@ -24,7 +24,7 @@ ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform ly_associate_package(PACKAGE_NAME AWSGameLiftServerSDK-3.4.1-rev1-linux TARGETS AWSGameLiftServerSDK PACKAGE_HASH a8149a95bd100384af6ade97e2b21a56173740d921e6c3da8188cd51554d39af) ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-rev3-linux TARGETS TIFF PACKAGE_HASH 2377f48b2ebc2d1628d9f65186c881544c92891312abe478a20d10b85877409a) ly_associate_package(PACKAGE_NAME freetype-2.10.4.16-linux TARGETS freetype PACKAGE_HASH 3f10c703d9001ecd2bb51a3bd003d3237c02d8f947ad0161c0252fdc54cbcf97) -ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev6-linux TARGETS AWSNativeSDK PACKAGE_HASH 490291e4c8057975c3ab86feb971b8a38871c58bac5e5d86abdd1aeb7141eec4) +ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.9.50-rev1-linux TARGETS AWSNativeSDK PACKAGE_HASH f30b6969c6732a7c1a23a59d205a150633a7f219dcb60d837b543888d2c63ea1) ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev5-linux TARGETS Lua PACKAGE_HASH 1adc812abe3dd0dbb2ca9756f81d8f0e0ba45779ac85bf1d8455b25c531a38b0) ly_associate_package(PACKAGE_NAME PhysX-4.1.2.29882248-rev5-linux TARGETS PhysX PACKAGE_HASH fa72365df409376aef02d1763194dc91d255bdfcb4e8febcfbb64d23a3e50b96) ly_associate_package(PACKAGE_NAME mcpp-2.7.2_az.2-rev1-linux TARGETS mcpp PACKAGE_HASH df7a998d0bc3fedf44b5bdebaf69ddad6033355b71a590e8642445ec77bc6c41) From f1c8fbe7c07fadb288466909877f8a445b04e469 Mon Sep 17 00:00:00 2001 From: mrieggeramzn Date: Thu, 6 Jan 2022 13:45:54 -0800 Subject: [PATCH 304/399] remove std and replace with az Signed-off-by: mrieggeramzn --- .../Tests/PropertyIntCtrlCommonTests.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h b/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h index 1bd6f72a19..6710d4b7cd 100644 --- a/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h +++ b/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h @@ -113,19 +113,17 @@ namespace UnitTest auto& widget = m_widget; auto& handler = m_handler; QString tooltip; - std::stringstream expected; // Retrieve the tooltip string for this widget auto success = handler->ModifyTooltip(widget, tooltip); const QString minString = QLocale().toString(widget->minimum()); const QString maxString = QLocale().toString(widget->maximum()); - - expected << "[" << minString.toStdString() << ", " << maxString.toStdString() << "]"; + const AZStd::string expected = AZStd::string::format("[%d, %d]", minString.toStdString().c_str(), maxString.toStdString().c_str()); // Expect the operation to be successful and a valid limit tooltip string generated EXPECT_TRUE(success); - EXPECT_STREQ(tooltip.toStdString().c_str(), expected.str().c_str()); + EXPECT_STREQ(tooltip.toStdString().c_str(), expected.c_str()); } void HandlerMinMaxLessLimit_ModifyHandler_ExpectSuccessAndValidLessLimitToolTipString() @@ -134,7 +132,6 @@ namespace UnitTest auto& widget = m_widget; auto& handler = m_handler; QString tooltip; - std::stringstream expected; // That is not at the extremeties of the type range limit SetWidgetRangeToNonExtremeties(widget); @@ -145,11 +142,11 @@ namespace UnitTest const QString minString = QLocale().toString(widget->minimum()); const QString maxString = QLocale().toString(widget->maximum()); - expected << "[" << minString.toStdString() << ", " << maxString.toStdString() << "]"; + const AZStd::string expected = AZStd::string::format("[%d, %d]", minString.toStdString().c_str(), maxString.toStdString().c_str()); // Expect the operation to be successful and a valid less than limit tooltip string generated EXPECT_TRUE(success); - EXPECT_STREQ(tooltip.toStdString().c_str(), expected.str().c_str()); + EXPECT_STREQ(tooltip.toStdString().c_str(), expected.c_str()); } void EmitWidgetValueChanged() From 273d6e225aaf76436566cdfb56f53a6f1000e15b Mon Sep 17 00:00:00 2001 From: mrieggeramzn Date: Thu, 6 Jan 2022 14:00:33 -0800 Subject: [PATCH 305/399] Previous commit wasnt correct. Should be using a string not a int Signed-off-by: mrieggeramzn --- .../AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h b/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h index 6710d4b7cd..b73e9e0a26 100644 --- a/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h +++ b/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h @@ -119,7 +119,7 @@ namespace UnitTest const QString minString = QLocale().toString(widget->minimum()); const QString maxString = QLocale().toString(widget->maximum()); - const AZStd::string expected = AZStd::string::format("[%d, %d]", minString.toStdString().c_str(), maxString.toStdString().c_str()); + const AZStd::string expected = AZStd::string::format("[%s, %s]", minString.toStdString().c_str(), maxString.toStdString().c_str()); // Expect the operation to be successful and a valid limit tooltip string generated EXPECT_TRUE(success); @@ -142,7 +142,7 @@ namespace UnitTest const QString minString = QLocale().toString(widget->minimum()); const QString maxString = QLocale().toString(widget->maximum()); - const AZStd::string expected = AZStd::string::format("[%d, %d]", minString.toStdString().c_str(), maxString.toStdString().c_str()); + const AZStd::string expected = AZStd::string::format("[%s, %s]", minString.toStdString().c_str(), maxString.toStdString().c_str()); // Expect the operation to be successful and a valid less than limit tooltip string generated EXPECT_TRUE(success); From 39edcd06e4cee7ad222e518a1a103c7e87e1608f Mon Sep 17 00:00:00 2001 From: Jeremy Ong Date: Thu, 6 Jan 2022 16:51:40 -0700 Subject: [PATCH 306/399] Add missing `precise` attribute to depth prepass output Commit 67689d48cc0f142eccd4856b0686277b49ca42d0 enforced precision in many vertex position outputs. This adds the attribute to the output of the z-prepass, needed to ensure proper depth testing in the forward passes. Signed-off-by: Jeremy Ong --- .../Feature/Common/Assets/Shaders/Depth/DepthPassCommon.azsli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/Depth/DepthPassCommon.azsli b/Gems/Atom/Feature/Common/Assets/Shaders/Depth/DepthPassCommon.azsli index f658dd13da..ba06dada74 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/Depth/DepthPassCommon.azsli +++ b/Gems/Atom/Feature/Common/Assets/Shaders/Depth/DepthPassCommon.azsli @@ -17,7 +17,7 @@ struct VSInput struct VSDepthOutput { - float4 m_position : SV_Position; + precise float4 m_position : SV_Position; }; VSDepthOutput DepthPassVS(VSInput IN) From 54e0b8b7b5d7ad8a7c888ac82297e1284d883518 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:16:48 -0800 Subject: [PATCH 307/399] Enabling mac tests (#6716) * Adds mac test job Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Points to sysctl properly to handle zsh Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Fixes some macos differences with Linux when reading the CTEST_RUN_FLAGS parameters Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * adding the test job to the profile pipe Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Disables some tests in Mac that are not passing Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * passes config to cli_test_driver and sets the right trait for the test (pytest instead of lytesttools) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Set proper traits for AtomRHI Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Corrected AZ_TRAIT_UNIT_TEST_PERLINE_GRADIANT_GOLDEN_VALUES_7878 values for Mac Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Disables EMotionFX tests in Mac Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Removes debugging prints Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Removes filters that were meant just for Linux Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * quotes are re-quoted in the test_mac.sh script Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzTest/Platform/Mac/AzTest_Traits_Mac.h | 11 +++++--- .../Mac/ProjectManager_Test_Traits_Mac.h | 2 +- .../Mac/AtomRHITests_traits_mac.cmake | 2 +- scripts/build/Platform/Mac/build_config.json | 23 +++++++++++++--- scripts/build/Platform/Mac/build_mac.sh | 4 +-- scripts/build/Platform/Mac/test_mac.sh | 5 ++-- scripts/ctest/CMakeLists.txt | 26 +++++++++---------- scripts/ctest/ctest_driver_test.py | 9 ++++--- 8 files changed, 53 insertions(+), 29 deletions(-) diff --git a/Code/Framework/AzTest/AzTest/Platform/Mac/AzTest_Traits_Mac.h b/Code/Framework/AzTest/AzTest/Platform/Mac/AzTest_Traits_Mac.h index 4915fb9cab..23ea87cd1c 100644 --- a/Code/Framework/AzTest/AzTest/Platform/Mac/AzTest_Traits_Mac.h +++ b/Code/Framework/AzTest/AzTest/Platform/Mac/AzTest_Traits_Mac.h @@ -16,9 +16,12 @@ #define AZ_TRAIT_DISABLE_ASSET_JOB_PARALLEL_TESTS true #define AZ_TRAIT_DISABLE_ASSET_MANAGER_FLOOD_TEST true #define AZ_TRAIT_DISABLE_ASSETCONTAINERDISABLETEST true +#define AZ_TRAIT_DISABLE_FAILED_DLL_TESTS true +#define AZ_TRAIT_DISABLE_FAILED_MODULE_TESTS true +#define AZ_TRAIT_DISABLE_FAILED_EMOTION_FX_TESTS true // Golden perline gradiant values for random seed 7878 for this platform -#define AZ_TRAIT_UNIT_TEST_PERLINE_GRADIANT_GOLDEN_VALUES_7878 0.5000f, 0.5456f, 0.5138f, 0.4801f, \ - 0.4174f, 0.4942f, 0.5493f, 0.5431f, \ - 0.4984f, 0.5204f, 0.5526f, 0.5840f, \ - 0.5251f, 0.5029f, 0.6153f, 0.5802f, +#define AZ_TRAIT_UNIT_TEST_PERLINE_GRADIANT_GOLDEN_VALUES_7878 0.5000f, 0.5276f, 0.5341f, 0.4801f, \ + 0.5220f, 0.5162f, 0.4828f, 0.5431f, \ + 0.4799f, 0.4486f, 0.5054f, 0.4129f, \ + 0.6023f, 0.5029f, 0.4529f, 0.4428f, diff --git a/Code/Tools/ProjectManager/Platform/Mac/ProjectManager_Test_Traits_Mac.h b/Code/Tools/ProjectManager/Platform/Mac/ProjectManager_Test_Traits_Mac.h index 8d7fe068c2..3ebe7d8e44 100644 --- a/Code/Tools/ProjectManager/Platform/Mac/ProjectManager_Test_Traits_Mac.h +++ b/Code/Tools/ProjectManager/Platform/Mac/ProjectManager_Test_Traits_Mac.h @@ -8,4 +8,4 @@ #pragma once -#define AZ_TRAIT_DISABLE_FAILED_PROJECT_MANAGER_TESTS false +#define AZ_TRAIT_DISABLE_FAILED_PROJECT_MANAGER_TESTS true diff --git a/Gems/Atom/RHI/Code/Platform/Mac/AtomRHITests_traits_mac.cmake b/Gems/Atom/RHI/Code/Platform/Mac/AtomRHITests_traits_mac.cmake index 419331db3b..4645eb9444 100644 --- a/Gems/Atom/RHI/Code/Platform/Mac/AtomRHITests_traits_mac.cmake +++ b/Gems/Atom/RHI/Code/Platform/Mac/AtomRHITests_traits_mac.cmake @@ -6,6 +6,6 @@ # # -set(ATOM_RHI_TRAIT_BUILD_SUPPORTS_TEST TRUE) +set(ATOM_RHI_TRAIT_BUILD_SUPPORTS_TEST FALSE) set(ATOM_RHI_TRAIT_BUILD_SUPPORTS_EDIT TRUE) set(PAL_TRAIT_BUILD_RENDERDOC_SUPPORTED FALSE) diff --git a/scripts/build/Platform/Mac/build_config.json b/scripts/build/Platform/Mac/build_config.json index 6ba264cdb2..6147f70f0c 100644 --- a/scripts/build/Platform/Mac/build_config.json +++ b/scripts/build/Platform/Mac/build_config.json @@ -14,7 +14,8 @@ ], "steps": [ "profile", - "asset_profile" + "asset_profile", + "test_profile" ] }, "metrics": { @@ -89,6 +90,22 @@ "ASSET_PROCESSOR_PLATFORMS": "mac" } }, + "test_profile": { + "TAGS": [ + "daily-pipeline-metrics", + "weekly-build-metrics" + ], + "COMMAND": "build_test_mac.sh", + "PARAMETERS": { + "CONFIGURATION": "profile", + "OUTPUT_DIRECTORY": "build/mac", + "CMAKE_OPTIONS": "-G Xcode", + "CMAKE_LY_PROJECTS": "AutomatedTesting", + "CMAKE_TARGET": "ALL_BUILD", + "CTEST_OPTIONS": "-L (SUITE_smoke|SUITE_main) -LE (REQUIRES_gpu) --no-tests=error", + "TEST_RESULTS": "False" + } + }, "periodic_test_profile": { "TAGS": [ "nightly-incremental", @@ -102,7 +119,7 @@ "CMAKE_OPTIONS": "-G Xcode", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_periodic", - "CTEST_OPTIONS": "-L \"(SUITE_periodic)\"", + "CTEST_OPTIONS": "-L (SUITE_periodic)", "TEST_RESULTS": "False" } }, @@ -119,7 +136,7 @@ "CMAKE_OPTIONS": "-G Xcode", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_benchmark", - "CTEST_OPTIONS": "-L \"(SUITE_benchmark)\"", + "CTEST_OPTIONS": "-L (SUITE_benchmark)", "TEST_RESULTS": "False" } }, diff --git a/scripts/build/Platform/Mac/build_mac.sh b/scripts/build/Platform/Mac/build_mac.sh index 2ea5eeab8a..d6a66fc6c6 100755 --- a/scripts/build/Platform/Mac/build_mac.sh +++ b/scripts/build/Platform/Mac/build_mac.sh @@ -48,7 +48,7 @@ if [[ ! -z "$RUN_CONFIGURE" ]]; then echo "${CONFIGURE_CMD}" > ${LAST_CONFIGURE_CMD_FILE} fi -echo [ci_build] cmake --build . --target ${CMAKE_TARGET} --config ${CONFIGURATION} -j $(sysctl -n hw.ncpu) -- ${CMAKE_NATIVE_BUILD_ARGS} -cmake --build . --target ${CMAKE_TARGET} --config ${CONFIGURATION} -j $(sysctl -n hw.ncpu) -- ${CMAKE_NATIVE_BUILD_ARGS} +echo [ci_build] cmake --build . --target ${CMAKE_TARGET} --config ${CONFIGURATION} -j $(/usr/sbin/sysctl -n hw.ncpu) -- ${CMAKE_NATIVE_BUILD_ARGS} +cmake --build . --target ${CMAKE_TARGET} --config ${CONFIGURATION} -j $(/usr/sbin/sysctl -n hw.ncpu) -- ${CMAKE_NATIVE_BUILD_ARGS} popd diff --git a/scripts/build/Platform/Mac/test_mac.sh b/scripts/build/Platform/Mac/test_mac.sh index e398de3061..46dffab84d 100755 --- a/scripts/build/Platform/Mac/test_mac.sh +++ b/scripts/build/Platform/Mac/test_mac.sh @@ -19,8 +19,9 @@ fi pushd $OUTPUT_DIRECTORY # Find the CTEST_RUN_FLAGS from the CMakeCache.txt file, then replace the $ with the current configuration -IFS='=' read -ra CTEST_RUN_FLAGS <<< $(cmake -N -LA . | grep "CTEST_RUN_FLAGS:STRING") -CTEST_RUN_FLAGS=${CTEST_RUN_FLAGS[1]/$/${CONFIGURATION}} +CTEST_RUN_FLAGS=$(cmake -N -LA . | grep "CTEST_RUN_FLAGS:STRING") +CTEST_RUN_FLAGS=${CTEST_RUN_FLAGS/CTEST_RUN_FLAGS:STRING=/} +CTEST_RUN_FLAGS=${CTEST_RUN_FLAGS/$/${CONFIGURATION}} # Run ctest echo [ci_build] ctest ${CTEST_RUN_FLAGS} ${CTEST_OPTIONS} diff --git a/scripts/ctest/CMakeLists.txt b/scripts/ctest/CMakeLists.txt index 98ea21e938..064d27a9cf 100644 --- a/scripts/ctest/CMakeLists.txt +++ b/scripts/ctest/CMakeLists.txt @@ -17,7 +17,7 @@ endif() # Tests ################################################################################ -if(PAL_TRAIT_TEST_LYTESTTOOLS_SUPPORTED) +if(PAL_TRAIT_TEST_PYTEST_SUPPORTED) foreach(suite_name ${LY_TEST_GLOBAL_KNOWN_SUITE_NAMES}) ly_add_pytest( NAME pytest_sanity_${suite_name}_no_gpu @@ -32,16 +32,16 @@ if(PAL_TRAIT_TEST_LYTESTTOOLS_SUPPORTED) TEST_REQUIRES gpu ) endforeach() -endif() - -# add a custom test which makes sure that the test filtering works! - -ly_add_test( - NAME cli_test_driver - EXCLUDE_TEST_RUN_TARGET_FROM_IDE - TEST_COMMAND ${LY_PYTHON_CMD} ${CMAKE_CURRENT_LIST_DIR}/ctest_driver_test.py - -x ${CMAKE_CTEST_COMMAND} - --build-path ${CMAKE_BINARY_DIR} - TEST_LIBRARY pytest -) + # add a custom test which makes sure that the test filtering works! + ly_add_test( + NAME cli_test_driver + EXCLUDE_TEST_RUN_TARGET_FROM_IDE + TEST_COMMAND ${LY_PYTHON_CMD} ${CMAKE_CURRENT_LIST_DIR}/ctest_driver_test.py + -x ${CMAKE_CTEST_COMMAND} + --build-path ${CMAKE_BINARY_DIR} + --config $ + TEST_LIBRARY pytest + ) + +endif() \ No newline at end of file diff --git a/scripts/ctest/ctest_driver_test.py b/scripts/ctest/ctest_driver_test.py index 82d92ce098..b9a7283b25 100755 --- a/scripts/ctest/ctest_driver_test.py +++ b/scripts/ctest/ctest_driver_test.py @@ -15,10 +15,10 @@ import sys import argparse from ctest_driver import SUITES_AND_DESCRIPTIONS -def main(build_path, ctest_executable): +def main(build_path, ctest_executable, config): script_folder = os.path.dirname(__file__) # -N prevents tests from running, just lists them: - base_args = [sys.executable, os.path.join(script_folder,'ctest_driver.py'), "--build-path", build_path, '-N'] + base_args = [sys.executable, os.path.join(script_folder,'ctest_driver.py'), "--build-path", build_path, "--config", config, '-N'] if ctest_executable: base_args.append("--ctest-executable") base_args.append(ctest_executable) @@ -77,7 +77,10 @@ if __name__ == '__main__': parser.add_argument('-b', '--build-path', required=True, help="Path to a CMake build folder (generated by running cmake)") + parser.add_argument('-c', '--config', + required=True, + help="Configuration to run") args = parser.parse_args() - sys.exit(main(args.build_path, args.ctest_executable)) + sys.exit(main(args.build_path, args.ctest_executable, args.config)) From 7f4fe67f773f0e2508631f947f60a2e7cd9ee8a2 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:35:36 -0800 Subject: [PATCH 308/399] Fix issues caused by SC editor component holding onto a live graph (#6734) Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilder.cpp | 10 ++++ .../Code/Builder/ScriptCanvasBuilder.h | 2 + .../EditorScriptCanvasComponent.cpp | 47 ++++++------------- .../Components/EditorScriptCanvasComponent.h | 2 +- 4 files changed, 28 insertions(+), 33 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index d62ebb9c3a..fbacfd8c32 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -246,6 +246,16 @@ namespace ScriptCanvasBuilder } } + void BuildVariableOverrides::SetHandlesToDescription() + { + m_source = m_source.Describe(); + + for (auto& dependency : m_dependencies) + { + dependency.SetHandlesToDescription(); + } + } + ScriptCanvas::RuntimeDataOverrides ConvertToRuntime(const BuildVariableOverrides& buildOverrides) { ScriptCanvas::RuntimeDataOverrides runtimeOverrides; diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h index 6e8e176145..1770e48dfa 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h @@ -38,6 +38,8 @@ namespace ScriptCanvasBuilder // use this to initialize the new data, and make sure they have a editor graph variable for proper editor display void PopulateFromParsedResults(ScriptCanvas::Grammar::AbstractCodeModelConstPtr abstractCodeModel, const ScriptCanvas::VariableData& variables); + void SetHandlesToDescription(); + // #functions2 provide an identifier for the node/variable in the source that caused the dependency. the root will not have one. ScriptCanvasEditor::SourceHandle m_source; diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 750097b428..f8f867d7e3 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -245,13 +245,13 @@ namespace ScriptCanvasEditor void EditorScriptCanvasComponent::OpenEditor([[maybe_unused]] const AZ::Data::AssetId& assetId, const AZ::Data::AssetType&) { AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); - + AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - + if (m_sourceHandle.IsDescriptionValid()) { GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_sourceHandle, Tracker::ScriptCanvasFileState::UNMODIFIED, -1); - + if (!openOutcome) { AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); @@ -261,7 +261,7 @@ namespace ScriptCanvasEditor { AzToolsFramework::EntityIdList selectedEntityIds; AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - + // Going to bypass the multiple selected entities flow for right now. if (selectedEntityIds.size() == 1) { @@ -279,7 +279,7 @@ namespace ScriptCanvasEditor void EditorScriptCanvasComponent::InitializeSource(const SourceHandle& sourceHandle) { - m_sourceHandle = sourceHandle; + m_sourceHandle = sourceHandle.Describe(); } //========================================================================= @@ -345,6 +345,7 @@ namespace ScriptCanvasEditor } m_variableOverrides = parseOutcome.TakeValue(); + m_variableOverrides.SetHandlesToDescription(); m_runtimeDataIsValid = true; } @@ -373,13 +374,7 @@ namespace ScriptCanvasEditor void EditorScriptCanvasComponent::SetPrimaryAsset(const AZ::Data::AssetId& assetId) { m_sourceHandle = SourceHandle(nullptr, assetId.m_guid, {}); - - auto completeAsset = CompleteDescription(m_sourceHandle); - if (completeAsset) - { - m_sourceHandle = *completeAsset; - } - + CompleteDescriptionInPlace(m_sourceHandle); OnScriptCanvasAssetChanged(SourceChangeDescription::SelectionChanged); SetName(m_sourceHandle.Path().Filename().Native()); AzToolsFramework::ToolsApplicationEvents::Bus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_AttributesAndValues); @@ -399,7 +394,7 @@ namespace ScriptCanvasEditor OnScriptCanvasAssetChanged(SourceChangeDescription::SelectionChanged); return AZ::Edit::PropertyRefreshLevels::EntireTree; } - + void EditorScriptCanvasComponent::OnScriptCanvasAssetChanged(SourceChangeDescription changeDescription) { ScriptCanvas::GraphIdentifier newIdentifier = GetGraphIdentifier(); @@ -417,20 +412,11 @@ namespace ScriptCanvasEditor ClearVariables(); } + m_sourceHandle = m_previousHandle; + if (m_sourceHandle.IsDescriptionValid()) { - if (!m_sourceHandle.Get()) - { - if (auto loaded = LoadFromFile(m_sourceHandle.Path().c_str()); loaded.IsSuccess()) - { - m_sourceHandle = SourceHandle(loaded.TakeValue(), m_sourceHandle.Id(), m_sourceHandle.Path().c_str()); - } - } - - if (m_sourceHandle.Get()) - { - UpdatePropertyDisplay(m_sourceHandle); - } + UpdatePropertyDisplay(); } AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); @@ -492,14 +478,11 @@ namespace ScriptCanvasEditor return ScriptCanvas::GraphIdentifier(m_sourceHandle.Id(), 0); } - void EditorScriptCanvasComponent::UpdatePropertyDisplay(const SourceHandle& sourceHandle) + void EditorScriptCanvasComponent::UpdatePropertyDisplay() { - if (sourceHandle.IsGraphValid()) - { - BuildGameEntityData(); - UpdateName(); - AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); - } + BuildGameEntityData(); + UpdateName(); + AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); } void EditorScriptCanvasComponent::ClearVariables() diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index ca381445ea..b86df2d9c2 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -121,7 +121,7 @@ namespace ScriptCanvasEditor void UpdateName(); //===================================================================== - void UpdatePropertyDisplay(const SourceHandle& sourceHandle); + void UpdatePropertyDisplay(); //===================================================================== void BuildGameEntityData(); From 6a171d17697b8c6415967ca86a62e2d28fc2c308 Mon Sep 17 00:00:00 2001 From: Mike Chang Date: Thu, 6 Jan 2022 16:41:35 -0800 Subject: [PATCH 309/399] Windows installer build tag date fix (#6735) Makes the % string replacement optional in the palSh function Signed-off-by: Mike Chang --- scripts/build/Jenkins/Jenkinsfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/build/Jenkins/Jenkinsfile b/scripts/build/Jenkins/Jenkinsfile index 570c553444..51f89d7829 100644 --- a/scripts/build/Jenkins/Jenkinsfile +++ b/scripts/build/Jenkins/Jenkinsfile @@ -38,7 +38,7 @@ def pipelineParameters = [ booleanParam(defaultValue: false, description: 'Recreates the volume used for the workspace. The volume will be created out of a snapshot taken from main.', name: 'RECREATE_VOLUME') ] -def palSh(cmd, lbl = '', winSlashReplacement = true) { +def palSh(cmd, lbl = '', winSlashReplacement = true, winCharReplacement = true) { if (env.IS_UNIX) { sh label: lbl, script: cmd @@ -46,7 +46,9 @@ def palSh(cmd, lbl = '', winSlashReplacement = true) { if (winSlashReplacement) { cmd = cmd.replace('/','\\') } - cmd = cmd.replace('%', '%%') + if (winCharReplacement) { + cmd = cmd.replace('%', '%%') + } bat label: lbl, script: cmd } @@ -262,7 +264,7 @@ def CheckoutRepo(boolean disableSubmodules = false) { commitDateFmt = '%%cI' if (env.IS_UNIX) commitDateFmt = '%cI' - palSh("git show -s --format=${commitDateFmt} ${env.CHANGE_ID} > commitdate", 'Getting commit date') + palSh("git show -s --format=${commitDateFmt} ${env.CHANGE_ID} > commitdate", 'Getting commit date', winSlashReplacement=true, winCharReplacement=false) env.CHANGE_DATE = readFile file: 'commitdate' env.CHANGE_DATE = env.CHANGE_DATE.trim() palRm('commitdate') From e7f573d22a37321ecdd6de0578d527f0186115a6 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Thu, 6 Jan 2022 16:48:07 -0800 Subject: [PATCH 310/399] Make Value ctor explicit Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 30 ----------- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 51 +++++++++---------- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 8 +-- .../AzCore/Tests/DOM/DomValueTests.cpp | 33 ++++++------ 4 files changed, 45 insertions(+), 77 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 824b38e47b..f48586709d 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -969,16 +969,6 @@ namespace AZ::Dom m_value = value; } - int32_t Value::GetInt32() const - { - return aznumeric_cast(GetInt64()); - } - - void Value::SetInt32(int32_t value) - { - m_value = aznumeric_cast(value); - } - uint64_t Value::GetUint64() const { switch (m_value.index()) @@ -999,16 +989,6 @@ namespace AZ::Dom m_value = value; } - uint32_t Value::GetUint32() const - { - return aznumeric_cast(GetUint64()); - } - - void Value::SetUint32(uint32_t value) - { - m_value = aznumeric_cast(value); - } - bool Value::GetBool() const { if (IsBool()) @@ -1044,16 +1024,6 @@ namespace AZ::Dom m_value = value; } - float Value::GetFloat() const - { - return aznumeric_cast(GetDouble()); - } - - void Value::SetFloat(float value) - { - m_value = aznumeric_cast(value); - } - void Value::SetString(SharedStringType sharedString) { m_value = sharedString; diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index a6990fcbce..fa496e8dfc 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -198,28 +198,39 @@ namespace AZ::Dom Value(const Value&); Value(Value&&) noexcept; Value(AZStd::string_view stringView, bool copy); - Value(SharedStringType sharedString); - - Value(int8_t value); - Value(uint8_t value); - Value(int16_t value); - Value(uint16_t value); - Value(int32_t value); - Value(uint32_t value); - Value(int64_t value); - Value(uint64_t value); - Value(float value); - Value(double value); - Value(bool value); + explicit Value(const ValueType&); + explicit Value(ValueType&&); + explicit Value(SharedStringType sharedString); + + explicit Value(int8_t value); + explicit Value(uint8_t value); + explicit Value(int16_t value); + explicit Value(uint16_t value); + explicit Value(int32_t value); + explicit Value(uint32_t value); + explicit Value(int64_t value); + explicit Value(uint64_t value); + explicit Value(float value); + explicit Value(double value); + explicit Value(bool value); explicit Value(Type type); + template + explicit Value(T, AZStd::enable_if_t>* enabled = 0) = delete; + static Value FromOpaqueValue(const AZStd::any& value); // Equality / comparison / swap... Value& operator=(const Value&); Value& operator=(Value&&) noexcept; + template + Value& operator=(T value) + { + return operator=(Value(value)); + } + bool operator==(const Value& rhs) const; bool operator!=(const Value& rhs) const; @@ -330,22 +341,10 @@ namespace AZ::Dom // int API... int64_t GetInt64() const; void SetInt64(int64_t); - int32_t GetInt32() const; - void SetInt32(int32_t); - int16_t GetInt16() const; - void SetInt16(int16_t); - int8_t GetInt8() const; - void SetInt8(int8_t); // uint API... uint64_t GetUint64() const; void SetUint64(uint64_t); - uint32_t GetUint32() const; - void SetUint32(uint32_t); - uint16_t GetUint16() const; - void SetUint16(uint16_t); - uint8_t GetUint8() const; - void SetUint8(uint8_t); // bool API... bool GetBool() const; @@ -354,8 +353,6 @@ namespace AZ::Dom // double API... double GetDouble() const; void SetDouble(double); - float GetFloat() const; - void SetFloat(float); // String API... AZStd::string_view GetString() const; diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index b20091b232..40b96e148b 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -66,9 +66,9 @@ namespace AZ::Dom::Benchmark { Value entry(Type::Object); entry.AddMember("string", createString(n)); - entry.AddMember("int", n); - entry.AddMember("double", static_cast(n) * 0.5); - entry.AddMember("bool", n % 2 == 0); + entry.AddMember("int", Value(n)); + entry.AddMember("double", Value(static_cast(n) * 0.5)); + entry.AddMember("bool", Value(n % 2 == 0)); entry.AddMember("null", Value(Type::Null)); return entry; }; @@ -153,7 +153,7 @@ namespace AZ::Dom::Benchmark for (auto _ : state) { Value copy = original; - copy["entries"]["Key0"].ArrayPushBack(42); + copy["entries"]["Key0"].ArrayPushBack(Value(42)); TakeAndDiscardWithoutTimingDtor(AZStd::move(copy), state); } diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp index a98eb307a2..10e9f29a44 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -68,7 +68,7 @@ namespace AZ::Dom::Tests { m_value.ArrayPushBack(Value(i)); EXPECT_EQ(m_value.ArraySize(), i + 1); - EXPECT_EQ(m_value[i].GetInt32(), i); + EXPECT_EQ(m_value[i].GetInt64(), i); } PerformValueChecks(); @@ -76,6 +76,7 @@ namespace AZ::Dom::Tests TEST_F(DomValueTests, NestedArrays) { + Value x(5); m_value.SetArray(); for (int j = 0; j < 5; ++j) { @@ -93,7 +94,7 @@ namespace AZ::Dom::Tests EXPECT_EQ(m_value[i].ArraySize(), 5); for (int j = 0; j < 5; ++j) { - EXPECT_EQ(m_value[i][j].GetInt32(), j); + EXPECT_EQ(m_value[i][j].GetInt64(), j); } } @@ -116,7 +117,7 @@ namespace AZ::Dom::Tests AZStd::string key = AZStd::string::format("Key%i", i); m_value.AddMember(key, Value(i)); EXPECT_EQ(m_value.MemberCount(), i + 1); - EXPECT_EQ(m_value[key].GetInt32(), i); + EXPECT_EQ(m_value[key].GetInt64(), i); } PerformValueChecks(); @@ -142,7 +143,7 @@ namespace AZ::Dom::Tests EXPECT_EQ(nestedObject.MemberCount(), 5); for (int i = 0; i < 5; ++i) { - EXPECT_EQ(nestedObject[AZStd::string::format("Key%i", i)].GetInt32(), i); + EXPECT_EQ(nestedObject[AZStd::string::format("Key%i", i)].GetInt64(), i); } } @@ -167,14 +168,14 @@ namespace AZ::Dom::Tests { m_value.ArrayPushBack(Value(i)); EXPECT_EQ(m_value.ArraySize(), i + 1); - EXPECT_EQ(m_value[i].GetInt32(), i); + EXPECT_EQ(m_value[i].GetInt64(), i); if (i < 5) { AZ::Name key = AZ::Name(AZStd::string::format("TwoTimes%i", i)); m_value.AddMember(key, Value(i * 2)); EXPECT_EQ(m_value.MemberCount(), i + 1); - EXPECT_EQ(m_value[key].GetInt32(), i * 2); + EXPECT_EQ(m_value[key].GetInt64(), i * 2); } } @@ -191,9 +192,9 @@ namespace AZ::Dom::Tests { Value childNode(Type::Node); childNode.SetNodeName(childNodeName); - childNode.SetNodeValue(i); + childNode.SetNodeValue(Value(i)); - childNode.AddMember("foo", i); + childNode.AddMember("foo", Value(i)); childNode.AddMember("bar", Value("test", false)); m_value.ArrayPushBack(childNode); @@ -204,8 +205,8 @@ namespace AZ::Dom::Tests { const Value& childNode = m_value[i]; EXPECT_EQ(childNode.GetNodeName(), childNodeName); - EXPECT_EQ(childNode.GetNodeValue().GetInt32(), i); - EXPECT_EQ(childNode["foo"].GetInt32(), i); + EXPECT_EQ(childNode.GetNodeValue().GetInt64(), i); + EXPECT_EQ(childNode["foo"].GetInt64(), i); EXPECT_EQ(childNode["bar"].GetString(), "test"); } @@ -334,8 +335,8 @@ namespace AZ::Dom::Tests TEST_F(DomValueTests, CopyOnWrite_Array) { Value v1(Type::Array); - v1.ArrayPushBack(1); - v1.ArrayPushBack(2); + v1.ArrayPushBack(Value(1)); + v1.ArrayPushBack(Value(2)); Value nestedArray(Type::Array); v1.ArrayPushBack(nestedArray); @@ -349,7 +350,7 @@ namespace AZ::Dom::Tests EXPECT_NE(&v1.GetArray(), &v2.GetArray()); EXPECT_EQ(&v1.ArrayAt(2).GetArray(), &v2.ArrayAt(2).GetArray()); - v2[2].ArrayPushBack(42); + v2[2].ArrayPushBack(Value(42)); EXPECT_NE(&v1.GetArray(), &v2.GetArray()); EXPECT_NE(&v1.ArrayAt(2).GetArray(), &v2.ArrayAt(2).GetArray()); @@ -365,8 +366,8 @@ namespace AZ::Dom::Tests Value v1; v1.SetNode("TopLevel"); - v1.ArrayPushBack(1); - v1.ArrayPushBack(2); + v1.ArrayPushBack(Value(1)); + v1.ArrayPushBack(Value(2)); v1["obj"].SetNode("Nested"); Value v2 = v1; @@ -378,7 +379,7 @@ namespace AZ::Dom::Tests EXPECT_NE(&v1.GetNode(), &v2.GetNode()); EXPECT_EQ(&v1["obj"].GetNode(), &v2["obj"].GetNode()); - v2["obj"].ArrayPushBack(42); + v2["obj"].ArrayPushBack(Value(42)); EXPECT_NE(&v1.GetNode(), &v2.GetNode()); EXPECT_NE(&v1["obj"].GetNode(), &v2["obj"].GetNode()); From 25924c3d384452e67775b2a4c11a84df09cf99d4 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Thu, 6 Jan 2022 16:54:57 -0800 Subject: [PATCH 311/399] Use more explicit operator= override Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index fa496e8dfc..23f4bd570f 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -225,10 +225,12 @@ namespace AZ::Dom Value& operator=(const Value&); Value& operator=(Value&&) noexcept; - template - Value& operator=(T value) + //! Assignment operator to allow forwarding types constructible via Value(T) to be assigned + template + auto operator=(T&& arg) + -> AZStd::enable_if_t, Value> && AZStd::is_constructible_v, Value&> { - return operator=(Value(value)); + return operator=(Value(AZStd::forward(arg))); } bool operator==(const Value& rhs) const; From 839bbd734aea320ebf383c6b390cf52a6d867f54 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Thu, 6 Jan 2022 16:55:24 -0800 Subject: [PATCH 312/399] Make operator== avoid implicit comparisons Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index f48586709d..6d944c9f45 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -262,21 +262,6 @@ namespace AZ::Dom { return GetString() == rhs.GetString(); } - else if (IsNumber() && rhs.IsNumber()) - { - if (IsInt()) - { - return GetInt64() == rhs.GetInt64(); - } - else if (IsUint()) - { - return GetUint64() == rhs.GetUint64(); - } - else - { - return GetDouble() == rhs.GetDouble(); - } - } else { return m_value == rhs.m_value; From 8668fac564d38fec00b142bc309ab405106257d7 Mon Sep 17 00:00:00 2001 From: Mikhail Naumov <82239319+AMZN-mnaumov@users.noreply.github.com> Date: Thu, 6 Jan 2022 19:09:27 -0600 Subject: [PATCH 313/399] Fixing character controller triggering collision on creation (#6546) * Fixing character controller triggering collision on creation Signed-off-by: Mikhail Naumov * PR feedback Signed-off-by: Mikhail Naumov --- Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp b/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp index f4cdd01889..1151c0ffff 100644 --- a/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp +++ b/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp @@ -73,6 +73,7 @@ namespace PhysX::Utils::Characters physx::PxMaterial* pxMaterial = static_cast(materials.front()->GetNativePointer()); controllerDesc.material = pxMaterial; + controllerDesc.position = PxMathConvertExtended(characterConfig.m_position); controllerDesc.slopeLimit = cosf(AZ::DegToRad(characterConfig.m_maximumSlopeAngle)); controllerDesc.stepOffset = characterConfig.m_stepHeight; controllerDesc.upDirection = characterConfig.m_upDirection.IsZero() From 2492c0a4f4db175268742fe9dcf4191d4ad44bea Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Thu, 6 Jan 2022 17:56:00 -0800 Subject: [PATCH 314/399] enum must be dereferenced with .value also added get_outcome.GetError() to pull more information from any get_container_item failures Signed-off-by: Scott Murray --- .../editor_python_test_tools/editor_entity_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index d354c4ece6..bf27ec06e0 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -174,7 +174,9 @@ class EditorComponent: get_outcome = self.property_tree_editor.get_container_item(component_property_path, key) assert ( get_outcome.IsSuccess() - ), f"Failure: could not get a value for {self.get_component_name()}: '{component_property_path}' [{key}]" + ), ( + f"Failure: could not get a value for {self.get_component_name()}: '{component_property_path}' [{key}]. " + f"Error returned by get_container_item: {get_outcome.GetError()}") return get_outcome.GetValue() def remove_container_item(self, component_property_path: str, key: any): @@ -277,7 +279,7 @@ class EditorComponent: :return: List of type ids of given components. Type id is a UUID as provided by the ebus call """ type_ids = editor.EditorComponentAPIBus( - bus.Broadcast, "FindComponentTypeIdsByEntityType", component_names, entity_type) + bus.Broadcast, "FindComponentTypeIdsByEntityType", component_names, entity_type.value) return type_ids From 9cb7d05e6b105aef2467dbfdd1854a138224ddb3 Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Thu, 6 Jan 2022 22:50:16 -0600 Subject: [PATCH 315/399] Adding a temporarily exclusion for terrain gem materials and shaders when building on mac (#6739) * Adding a temporarily exclusion for terrain gem materials and shaders when building on mac. This is a short term fix until either: - there's a generic way to exclude assets based on platform - materialtype assets can directly exclude certain platforms (or ignore excluded shaders) - shader compiling for mac supports unbounded texture arrays. Signed-off-by: Ken Pruiksma * moving setreg to gem and contraining to the exact files that are problematic Signed-off-by: Ken Pruiksma --- .../Mac/AssetProcessorPlatformConfig.setreg | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Gems/Terrain/Registry/Platform/Mac/AssetProcessorPlatformConfig.setreg diff --git a/Gems/Terrain/Registry/Platform/Mac/AssetProcessorPlatformConfig.setreg b/Gems/Terrain/Registry/Platform/Mac/AssetProcessorPlatformConfig.setreg new file mode 100644 index 0000000000..ac0c854b19 --- /dev/null +++ b/Gems/Terrain/Registry/Platform/Mac/AssetProcessorPlatformConfig.setreg @@ -0,0 +1,16 @@ +{ + "Amazon": { + "AssetProcessor": { + "Settings": { + // The terrain shader doesn't work on mac due to unbounded arrays, so disable problematic materials and material types + // in the terrain gem to prevent dependencies from failing. + "Exclude Terrain DefaultPbrTerrain.material": { + "pattern": "^Materials/Terrain/DefaultPbrTerrain.material" + }, + "Exclude Terrain PbrTerrain.materialtype": { + "pattern": "^Materials/Terrain/PbrTerrain.materialtype" + } + } + } + } +} From 1a8b7aeb4891f103300cb770fe1537612f4adadb Mon Sep 17 00:00:00 2001 From: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> Date: Fri, 7 Jan 2022 09:37:33 +0000 Subject: [PATCH 316/399] Small workaround and fix to ensure line fade (alpha) displays correctly (#6733) Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> --- .../Manipulators/ManipulatorSnapping.cpp | 4 ++++ .../Code/Source/AtomDebugDisplayViewportInterface.cpp | 9 +-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSnapping.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSnapping.cpp index 5bea383630..3b2f78ef2d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSnapping.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSnapping.cpp @@ -184,6 +184,10 @@ namespace AzToolsFramework const float halfGridSquareCount = float(gridSquareCount) * 0.5f; const float halfGridSize = halfGridSquareCount * squareSize; const float fadeLineLength = cl_viewportFadeLineDistanceScale * squareSize; + + // ensure AuxGeomDraw::OpacityType::Translucent render state is set + debugDisplay.SetAlpha(0.5f); + for (size_t lineIndex = 0; lineIndex <= gridSquareCount; ++lineIndex) { const float lineOffset = -halfGridSize + (lineIndex * squareSize); diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp b/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp index af91615283..352ffb6486 100644 --- a/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp +++ b/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp @@ -348,14 +348,7 @@ namespace AZ::AtomBridge void AtomDebugDisplayViewportInterface::SetAlpha(float a) { m_rendState.m_color.SetA(a); - if (a < 1.0f) - { - m_rendState.m_opacityType = AZ::RPI::AuxGeomDraw::OpacityType::Opaque; - } - else - { - m_rendState.m_opacityType = AZ::RPI::AuxGeomDraw::OpacityType::Translucent; - } + m_rendState.m_opacityType = a < 1.0f ? AZ::RPI::AuxGeomDraw::OpacityType::Translucent : AZ::RPI::AuxGeomDraw::OpacityType::Opaque; } void AtomDebugDisplayViewportInterface::DrawQuad( From 042ed3b877d373b7a54dbc2c66b22380faece137 Mon Sep 17 00:00:00 2001 From: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> Date: Fri, 7 Jan 2022 12:29:32 +0000 Subject: [PATCH 317/399] AssetBrowser SearchFilteringTest: Added delay when inserting a string to the search file. (#6036) * Added delay when inserting a string to the search file. Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Added explanatory comment Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> --- .../editor/EditorScripts/AssetBrowser_SearchFiltering.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py index 7366faafdc..b18bf65312 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py @@ -98,7 +98,13 @@ def AssetBrowser_SearchFiltering(): # 3) Type the name of an asset in the search bar and make sure it is filtered to and selectable asset_browser = editor_window.findChild(QtWidgets.QDockWidget, "Asset Browser") search_bar = asset_browser.findChild(QtWidgets.QLineEdit, "textSearch") - search_bar.setText("cedar.fbx") + + # Add a small pause when typing in the search bar in order to check that the entries are updated properly + search_bar.setText("Cedar.f") + general.idle_wait(0.5) + search_bar.setText("Cedar.fbx") + general.idle_wait(0.5) + asset_browser_tree = asset_browser.findChild(QtWidgets.QTreeView, "m_assetBrowserTreeViewWidget") asset_browser_table = asset_browser.findChild(QtWidgets.QTreeView, "m_assetBrowserTableViewWidget") found = await pyside_utils.wait_for_condition(lambda: pyside_utils.find_child_by_pattern(asset_browser_table, "cedar.fbx"), 5.0) From 8503915cddcdfab7a0cc11325f15888472b8fa22 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Fri, 7 Jan 2022 06:43:34 -0800 Subject: [PATCH 318/399] bugfix: correct mouseMove under AzToolsFrameworkHelper (#6493) * bugfix: correct mouseMove under AzToolsFrameworkHelper REF: https://github.com/o3de/o3de/issues/6481 Signed-off-by: Michael Pollind * chore: added unit test Signed-off-by: Michael Pollind * chore: address comments Signed-off-by: Michael Pollind * chore: correct fixture Signed-off-by: Michael Pollind * chore: tweak mouse move logic Signed-off-by: Michael Pollind * updates to track mouse/cursor position via events instead of using QCursor::pos() Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * rename AzToolFrameworkTestHelperTest.cpp to AzToolsFrameworkTestHelpersTest.cpp Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> Co-authored-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> --- .../UnitTest/AzToolsFrameworkTestHelpers.cpp | 29 ++++-- .../UnitTest/AzToolsFrameworkTestHelpers.h | 21 ++++- .../Tests/AzToolsFrameworkTestHelpersTest.cpp | 88 +++++++++++++++++++ .../Tests/aztoolsframeworktests_files.cmake | 1 + 4 files changed, 133 insertions(+), 6 deletions(-) create mode 100644 Code/Framework/AzToolsFramework/Tests/AzToolsFrameworkTestHelpersTest.cpp diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.cpp index 4f952a3edc..7f877facb6 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.cpp @@ -30,8 +30,7 @@ namespace UnitTest void MousePressAndMove( QWidget* widget, const QPoint& initialPositionWidget, const QPoint& mouseDelta, const Qt::MouseButton mouseButton) { - QPoint position = widget->mapToGlobal(initialPositionWidget); - QTest::mousePress(widget, mouseButton, Qt::NoModifier, position); + QTest::mousePress(widget, mouseButton, Qt::NoModifier, initialPositionWidget); MouseMove(widget, initialPositionWidget, mouseDelta, mouseButton); } @@ -45,14 +44,15 @@ namespace UnitTest // - https://lists.qt-project.org/pipermail/development/2019-July/036873.html void MouseMove(QWidget* widget, const QPoint& initialPositionWidget, const QPoint& mouseDelta, const Qt::MouseButton mouseButton) { - QPoint nextPosition = widget->mapToGlobal(initialPositionWidget + mouseDelta); + const QPoint nextLocalPosition = initialPositionWidget + mouseDelta; + const QPoint nextGlobalPosition = widget->mapToGlobal(nextLocalPosition); // ^1 To ensure a mouse move event is fired we must call the test mouse move function // and also send a mouse move event that matches. Each on their own do not appear to // work - please see the links above for more context. - QTest::mouseMove(widget, nextPosition); + QTest::mouseMove(widget, nextLocalPosition); QMouseEvent mouseMoveEvent( - QEvent::MouseMove, QPointF(nextPosition), QPointF(nextPosition), Qt::NoButton, mouseButton, Qt::NoModifier); + QEvent::MouseMove, QPointF(nextLocalPosition), QPointF(nextGlobalPosition), Qt::NoButton, mouseButton, Qt::NoModifier); QApplication::sendEvent(widget, &mouseMoveEvent); } @@ -157,6 +157,23 @@ namespace UnitTest return QWidget::event(event); } + MouseMoveDetector::MouseMoveDetector(QWidget* parent) + : QObject(parent) + { + } + + bool MouseMoveDetector::eventFilter(QObject* watched, QEvent* event) + { + if (const auto eventType = event->type(); eventType == QEvent::Type::MouseMove) + { + auto mouseEvent = static_cast(event); + m_mouseGlobalPosition = mouseEvent->globalPos(); + m_mouseLocalPosition = mouseEvent->pos(); + } + + return QObject::eventFilter(watched, event); + } + void TestEditorActions::Connect() { using AzToolsFramework::GetEntityContextId; @@ -571,3 +588,5 @@ namespace UnitTest sliceAssets.clear(); } } // namespace UnitTest + +#include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h index 79a87391b4..2c60ca914c 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h @@ -111,10 +111,29 @@ namespace UnitTest { Q_OBJECT public: - FocusInteractionWidget(QWidget* parent = nullptr) : QWidget(parent) {} + FocusInteractionWidget(QWidget* parent = nullptr) + : QWidget(parent) + { + } + bool event(QEvent* event) override; }; + /// Records mouse move events and stores the local and global position of the cursor. + /// @note To use, install as an event filter for the widget being interacted with + /// e.g. m_testWidget->installEventFilter(&m_mouseMoveDetector); + class MouseMoveDetector : public QObject + { + Q_OBJECT + public: + MouseMoveDetector(QWidget* parent = nullptr); + + bool eventFilter([[maybe_unused]] QObject* watched, QEvent* event) override; + + QPoint m_mouseGlobalPosition; + QPoint m_mouseLocalPosition; + }; + /// Stores actions registered for either normal mode (regular viewport) editing and /// component mode editing. class TestEditorActions diff --git a/Code/Framework/AzToolsFramework/Tests/AzToolsFrameworkTestHelpersTest.cpp b/Code/Framework/AzToolsFramework/Tests/AzToolsFrameworkTestHelpersTest.cpp new file mode 100644 index 0000000000..2a1254f2e9 --- /dev/null +++ b/Code/Framework/AzToolsFramework/Tests/AzToolsFrameworkTestHelpersTest.cpp @@ -0,0 +1,88 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +#include +#include + +namespace UnitTest +{ + class AzToolsFrameworkTestHelpersFixture : public AllocatorsTestFixture + { + public: + void SetUp() override + { + AllocatorsTestFixture::SetUp(); + + m_rootWidget = AZStd::make_unique(); + m_rootWidget->setFixedSize(0, 0); + m_rootWidget->setMouseTracking(true); + m_rootWidget->move(0, 0); // explicitly set the widget to be in the upper left corner + + m_mouseMoveDetector = AZStd::make_unique(); + m_rootWidget->installEventFilter(m_mouseMoveDetector.get()); + } + + void TearDown() override + { + m_rootWidget->removeEventFilter(m_mouseMoveDetector.get()); + m_rootWidget.reset(); + m_mouseMoveDetector.reset(); + + AllocatorsTestFixture::TearDown(); + } + + AZStd::unique_ptr m_rootWidget; + AZStd::unique_ptr m_mouseMoveDetector; + }; + + struct MouseMoveParams + { + QSize m_widgetSize; + QPoint m_widgetPosition; + QPoint m_localCursorPosition; + QPoint m_cursorDelta; + }; + + class MouseMoveAzToolsFrameworkTestHelperFixture + : public AzToolsFrameworkTestHelpersFixture + , public ::testing::WithParamInterface + { + }; + + TEST_P(MouseMoveAzToolsFrameworkTestHelperFixture, MouseMoveCorrectlyTransformsCursorPositionInGlobalAndLocalSpace) + { + // given + const MouseMoveParams mouseMoveParams = GetParam(); + m_rootWidget->move(mouseMoveParams.m_widgetPosition); + m_rootWidget->setFixedSize(mouseMoveParams.m_widgetSize); + + // when + MouseMove(m_rootWidget.get(), mouseMoveParams.m_localCursorPosition, mouseMoveParams.m_cursorDelta); + + // then + const QPoint mouseLocalPosition = m_mouseMoveDetector->m_mouseLocalPosition; + const QPoint mouseLocalPositionFromGlobal = m_rootWidget->mapFromGlobal(m_mouseMoveDetector->m_mouseGlobalPosition); + const QPoint expectedPosition = mouseMoveParams.m_localCursorPosition + mouseMoveParams.m_cursorDelta; + + using ::testing::Eq; + EXPECT_THAT(mouseLocalPosition.x(), Eq(expectedPosition.x())); + EXPECT_THAT(mouseLocalPosition.y(), Eq(expectedPosition.y())); + EXPECT_THAT(mouseLocalPositionFromGlobal.x(), Eq(expectedPosition.x())); + EXPECT_THAT(mouseLocalPositionFromGlobal.y(), Eq(expectedPosition.y())); + } + + INSTANTIATE_TEST_CASE_P( + All, + MouseMoveAzToolsFrameworkTestHelperFixture, + testing::Values( + MouseMoveParams{ QSize(100, 100), QPoint(0, 0), QPoint(0, 0), QPoint(10, 10) }, + MouseMoveParams{ QSize(100, 100), QPoint(100, 100), QPoint(0, 0), QPoint(10, 10) }, + MouseMoveParams{ QSize(100, 100), QPoint(20, 20), QPoint(50, 50), QPoint(20, 20) })); +} // namespace UnitTest diff --git a/Code/Framework/AzToolsFramework/Tests/aztoolsframeworktests_files.cmake b/Code/Framework/AzToolsFramework/Tests/aztoolsframeworktests_files.cmake index 9a1f61ab56..2631a84325 100644 --- a/Code/Framework/AzToolsFramework/Tests/aztoolsframeworktests_files.cmake +++ b/Code/Framework/AzToolsFramework/Tests/aztoolsframeworktests_files.cmake @@ -12,6 +12,7 @@ set(FILES AssetFileInfoListComparison.cpp AssetSeedManager.cpp AssetSystemMocks.h + AzToolsFrameworkTestHelpersTest.cpp BoundsTestComponent.cpp BoundsTestComponent.h ComponentAdapterTests.cpp From f8734d7d067e12ca0755e4fd4f50798964ca58f5 Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Fri, 7 Jan 2022 09:44:43 -0600 Subject: [PATCH 319/399] Finalizing update of Editor tests to utilize prefab system Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../Gem/PythonTests/editor/CMakeLists.txt | 32 +------ .../EditorScripts/Docking_BasicDockedTools.py | 5 +- .../EditorScripts/Menus_EditMenuOptions.py | 5 +- .../EditorScripts/Menus_FileMenuOptions.py | 2 +- .../EditorScripts/Menus_ViewMenuOptions.py | 2 + .../Gem/PythonTests/editor/TestSuite_Main.py | 83 +++++++++++++------ .../editor/TestSuite_Main_Optimized.py | 83 ------------------- .../PythonTests/editor/TestSuite_Periodic.py | 68 --------------- .../PythonTests/editor/TestSuite_Sandbox.py | 27 ------ .../editor/TestSuite_Sandbox_Optimized.py | 26 ------ 10 files changed, 67 insertions(+), 266 deletions(-) delete mode 100644 AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py delete mode 100644 AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py delete mode 100644 AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py delete mode 100644 AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py diff --git a/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt index a43b3647f9..b3f0d2da8e 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt @@ -9,10 +9,10 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_FOUNDATION_TEST_SUPPORTED) ly_add_pytest( - NAME AutomatedTesting::EditorTests_Main_Optimized + NAME AutomatedTesting::EditorTests_Main TEST_SUITE main TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main_Optimized.py + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py PYTEST_MARKS "not REQUIRES_gpu" RUNTIME_DEPENDENCIES Legacy::Editor @@ -27,7 +27,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ TEST_SUITE main TEST_SERIAL TEST_REQUIRES gpu - PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main_Optimized.py + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py PYTEST_MARKS "REQUIRES_gpu" RUNTIME_DEPENDENCIES Legacy::Editor @@ -37,30 +37,4 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ Editor ) - ly_add_pytest( - NAME AutomatedTesting::EditorTests_Sandbox_Optimized - TEST_SUITE sandbox - TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Sandbox_Optimized.py - RUNTIME_DEPENDENCIES - Legacy::Editor - AZ::AssetProcessor - AutomatedTesting.Assets - COMPONENT - Editor - ) - - ly_add_pytest( - NAME AutomatedTesting::EditorTests_Periodic - TEST_SUITE periodic - TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Periodic.py - RUNTIME_DEPENDENCIES - Legacy::Editor - AZ::AssetProcessor - AutomatedTesting.Assets - COMPONENT - Editor - ) - endif() diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py index 8734769225..a5a94f06a5 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py @@ -85,8 +85,7 @@ def Docking_BasicDockedTools(): # We drag/drop it over the viewport since it doesn't allow docking, so this will undock it render_overlay = editor_window.findChild(QtWidgets.QWidget, "renderOverlay") pyside_utils.drag_and_drop(entity_outliner, render_overlay) - general.idle_wait(0.5) - + # We need to grab a new reference to the Entity Outliner QDockWidget because when it gets moved # to the floating window, its parent changes so the wrapped instance we had becomes invalid entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner") @@ -94,7 +93,6 @@ def Docking_BasicDockedTools(): # Dock the Entity Inspector tabbed with the floating Entity Outliner entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector") pyside_utils.drag_and_drop(entity_inspector, entity_outliner) - general.idle_wait(0.5) # We need to grab a new reference to the Entity Inspector QDockWidget because when it gets moved # to the floating window, its parent changes so the wrapped instance we had becomes invalid @@ -103,7 +101,6 @@ def Docking_BasicDockedTools(): # Dock the Console tabbed with the floating Entity Inspector console = editor_window.findChild(QtWidgets.QDockWidget, "Console") pyside_utils.drag_and_drop(console, entity_inspector) - general.idle_wait(0.5) # Check to ensure all the tools are parented to the same QStackedWidget def check_all_panes_tabbed(): diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py index 0536575893..ce85cf223f 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py @@ -52,8 +52,9 @@ def Menus_EditMenuOptions_Work(): ("Editor Settings", "Global Preferences"), ("Editor Settings", "Editor Settings Manager"), ("Editor Settings", "Keyboard Customization", "Customize Keyboard"), - ("Editor Settings", "Keyboard Customization", "Export Keyboard Settings"), - ("Editor Settings", "Keyboard Customization", "Import Keyboard Settings"), + # The following menu options are temporarily disabled due to https://github.com/o3de/o3de/issues/6746 + #("Editor Settings", "Keyboard Customization", "Export Keyboard Settings"), + #("Editor Settings", "Keyboard Customization", "Import Keyboard Settings"), ] # 1) Open an existing simple level diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py index a4e702cbd1..4fcdc371e7 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py @@ -33,7 +33,7 @@ def Menus_FileMenuOptions_Work(): file_menu_options = [ ("New Level",), #("Open Level",), Temporarily disabled due to https://github.com/o3de/o3de/issues/6605 - ("Import",), + #("Import",), Temporarily disabled due to https://github.com/o3de/o3de/issues/6746 ("Save",), #("Save As",), Temporarily disabled due to https://github.com/o3de/o3de/issues/6605 ("Save Level Statistics",), diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py index e2ee3e2a55..bb9ff15082 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py @@ -33,6 +33,8 @@ def Menus_ViewMenuOptions_Work(): view_menu_options = [ ("Center on Selection",), ("Show Quick Access Bar",), + ("Layouts", "Component Entity Layout",), + ("Layouts", "Save Layout",), ("Viewport", "Configure Layout"), ("Viewport", "Go to Position"), ("Viewport", "Center on Selection"), diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py index 949aab140d..3805ef15dd 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py @@ -7,46 +7,77 @@ SPDX-License-Identifier: Apache-2.0 OR MIT import os import pytest -import sys import ly_test_tools.environment.file_system as file_system +from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite -sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared') -from base import TestAutomationBase +@pytest.mark.SUITE_main +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +class TestAutomationNoAutoTestMode(EditorTestSuite): + + # Disable -autotest_mode and -BatchMode. Tests cannot run in -BatchMode due to UI interactions, and these tests + # interact with modal dialogs + global_extra_cmdline_args = [] + + class test_AssetPicker_UI_UX(EditorSharedTest): + from .EditorScripts import AssetPicker_UI_UX as test_module -@pytest.fixture -def remove_test_level(request, workspace, project): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True) + class test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(EditorSharedTest): + from .EditorScripts import BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD as test_module + + class test_BasicEditorWorkflows_LevelEntityComponentCRUD(EditorSingleTest): + # Custom teardown to remove level created during test + def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): + file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")], + True, True) + from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module + + @pytest.mark.REQUIRES_gpu + class test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(EditorSingleTest): + # Disable null renderer + use_null_renderer = False - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True) + # Custom teardown to remove level created during test + def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): + file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")], + True, True) + from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module - request.addfinalizer(teardown) + class test_InputBindings_Add_Remove_Input_Events(EditorSharedTest): + from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module @pytest.mark.SUITE_main @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomation(TestAutomationBase): +class TestAutomationAutoTestMode(EditorTestSuite): - def test_BasicEditorWorkflows_LevelEntityComponentCRUD(self, request, workspace, editor, launcher_platform, - remove_test_level): - from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False) + # Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions + global_extra_cmdline_args = ["-autotest_mode"] - @pytest.mark.REQUIRES_gpu - def test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(self, request, workspace, editor, launcher_platform, - remove_test_level): - from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False, - use_null_renderer=False) + class test_AssetBrowser_SearchFiltering(EditorSharedTest): + from .EditorScripts import AssetBrowser_SearchFiltering as test_module - def test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(self, request, workspace, editor, - launcher_platform): - from .EditorScripts import BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False) + class test_AssetBrowser_TreeNavigation(EditorSharedTest): + from .EditorScripts import AssetBrowser_TreeNavigation as test_module - def test_EntityOutliner_EntityOrdering(self, request, workspace, editor, launcher_platform): + class test_ComponentCRUD_Add_Delete_Components(EditorSharedTest): + from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module + + @pytest.mark.skip("Passes locally/fails on Jenkins. https://github.com/o3de/o3de/issues/6747") + class test_Docking_BasicDockedTools(EditorSharedTest): + from .EditorScripts import Docking_BasicDockedTools as test_module + + class test_EntityOutliner_EntityOrdering(EditorSharedTest): from .EditorScripts import EntityOutliner_EntityOrdering as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) + + class test_Menus_EditMenuOptions_Work(EditorSharedTest): + from .EditorScripts import Menus_EditMenuOptions as test_module + + class test_Menus_FileMenuOptions_Work(EditorSharedTest): + from .EditorScripts import Menus_FileMenuOptions as test_module + + class test_Menus_ViewMenuOptions_Work(EditorSharedTest): + from .EditorScripts import Menus_ViewMenuOptions as test_module diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py deleted file mode 100644 index 7e07d125fd..0000000000 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py +++ /dev/null @@ -1,83 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest - -import ly_test_tools.environment.file_system as file_system -from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite - - -@pytest.mark.SUITE_main -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomationNoAutoTestMode(EditorTestSuite): - - # Disable -autotest_mode and -BatchMode. Tests cannot run in -BatchMode due to UI interactions, and these tests - # interact with modal dialogs - global_extra_cmdline_args = [] - - class test_AssetPicker_UI_UX(EditorSharedTest): - from .EditorScripts import AssetPicker_UI_UX as test_module - - class test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(EditorSharedTest): - from .EditorScripts import BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD as test_module - - class test_BasicEditorWorkflows_LevelEntityComponentCRUD(EditorSingleTest): - # Custom teardown to remove level created during test - def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): - file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")], - True, True) - from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module - - @pytest.mark.REQUIRES_gpu - class test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(EditorSingleTest): - # Disable null renderer - use_null_renderer = False - - # Custom teardown to remove level created during test - def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): - file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")], - True, True) - from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module - - class test_InputBindings_Add_Remove_Input_Events(EditorSharedTest): - from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module - - -@pytest.mark.SUITE_main -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomationAutoTestMode(EditorTestSuite): - - # Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions - global_extra_cmdline_args = ["-autotest_mode"] - - class test_AssetBrowser_SearchFiltering(EditorSharedTest): - from .EditorScripts import AssetBrowser_SearchFiltering as test_module - - class test_AssetBrowser_TreeNavigation(EditorSharedTest): - from .EditorScripts import AssetBrowser_TreeNavigation as test_module - - class test_ComponentCRUD_Add_Delete_Components(EditorSharedTest): - from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module - - @pytest.mark.skip("Passes locally, fails on Jenkins") - class test_Docking_BasicDockedTools(EditorSharedTest): - from .EditorScripts import Docking_BasicDockedTools as test_module - - class test_EntityOutliner_EntityOrdering(EditorSharedTest): - from .EditorScripts import EntityOutliner_EntityOrdering as test_module - - class test_Menus_EditMenuOptions_Work(EditorSharedTest): - from .EditorScripts import Menus_EditMenuOptions as test_module - - class test_Menus_FileMenuOptions_Work(EditorSharedTest): - from .EditorScripts import Menus_FileMenuOptions as test_module - - class test_Menus_ViewMenuOptions_Work(EditorSharedTest): - from .EditorScripts import Menus_ViewMenuOptions as test_module \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py deleted file mode 100644 index 6e7bc413d3..0000000000 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py +++ /dev/null @@ -1,68 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest -import sys - -import ly_test_tools.environment.file_system as file_system -import ly_test_tools.environment.process_utils as process_utils - -sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared') -from base import TestAutomationBase - - -@pytest.fixture -def remove_test_level(request, workspace, project): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True) - - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True) - - request.addfinalizer(teardown) - - -@pytest.mark.SUITE_periodic -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomation(TestAutomationBase): - - def test_AssetBrowser_SearchFiltering(self, request, workspace, editor, launcher_platform): - from .EditorScripts import AssetBrowser_SearchFiltering as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, use_null_renderer=False) - - def test_AssetBrowser_TreeNavigation(self, request, workspace, editor, launcher_platform): - from .EditorScripts import AssetBrowser_TreeNavigation as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) - - def test_AssetPicker_UI_UX(self, request, workspace, editor, launcher_platform): - from .EditorScripts import AssetPicker_UI_UX as test_module - self._run_test(request, workspace, editor, test_module, autotest_mode=False, batch_mode=False) - - def test_ComponentCRUD_Add_Delete_Components(self, request, workspace, editor, launcher_platform): - from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) - - def test_Docking_BasicDockedTools(self, request, workspace, editor, launcher_platform): - from .EditorScripts import Docking_BasicDockedTools as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) - - def test_InputBindings_Add_Remove_Input_Events(self, request, workspace, editor, launcher_platform): - from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False) - - def test_Menus_EditMenuOptions_Work(self, request, workspace, editor, launcher_platform): - from .EditorScripts import Menus_EditMenuOptions as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) - - def test_Menus_FileMenuOptions_Work(self, request, workspace, editor, launcher_platform): - from .EditorScripts import Menus_FileMenuOptions as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) - - def test_Menus_ViewMenuOptions_Work(self, request, workspace, editor, launcher_platform): - from .EditorScripts import Menus_ViewMenuOptions as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py deleted file mode 100644 index 98a6620d9c..0000000000 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py +++ /dev/null @@ -1,27 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest -import sys - -sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared') -from base import TestAutomationBase - - -@pytest.mark.SUITE_sandbox -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomation(TestAutomationBase): - - def test_Menus_EditMenuOptions_Work(self, request, workspace, editor, launcher_platform): - from .EditorScripts import Menus_EditMenuOptions as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) - - def test_Docking_BasicDockedTools(self, request, workspace, editor, launcher_platform): - from .EditorScripts import Docking_BasicDockedTools as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py deleted file mode 100644 index 4a472095ae..0000000000 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py +++ /dev/null @@ -1,26 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest - -from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite - - -@pytest.mark.SUITE_sandbox -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomationAutoTestMode(EditorTestSuite): - - # Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions - global_extra_cmdline_args = ["-autotest_mode"] - - class test_Docking_BasicDockedTools(EditorSharedTest): - from .EditorScripts import Docking_BasicDockedTools as test_module - - class test_Menus_EditMenuOptions_Work(EditorSharedTest): - from .EditorScripts import Menus_EditMenuOptions as test_module From 8b9e3d2175bb7766e0e9e81f0bba310cafd14a90 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Fri, 7 Jan 2022 09:53:14 -0800 Subject: [PATCH 320/399] Simplify disabling Value ctor for pointer types Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 23f4bd570f..ecf8326525 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -216,8 +216,9 @@ namespace AZ::Dom explicit Value(Type type); + // Disable accidental calls to Value(bool) with pointer types template - explicit Value(T, AZStd::enable_if_t>* enabled = 0) = delete; + explicit Value(T*) = delete; static Value FromOpaqueValue(const AZStd::any& value); From 7123ed18beed40fbf91f5b0fc8a2cbbe0b86d9a7 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Fri, 7 Jan 2022 12:12:09 -0600 Subject: [PATCH 321/399] Naive GetValues() implementation. (#6741) * Naive GetValues() implementation. Added the method itself, and the benchmarks which show that even the naive version is currently 10-50% faster than calling GetValue() for multiple values. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added comments documenting why the const_cast is there. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed link errors by creating new Shared.Tests lib. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Addressed PR feedback. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed incorrect comparison. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- Gems/GradientSignal/Code/CMakeLists.txt | 22 +++ .../Ebuses/GradientRequestBus.h | 32 ++++ .../Include/GradientSignal/GradientSampler.h | 90 ++++++++++ .../Code/Tests/GradientSignalBenchmarks.cpp | 169 +++++++++++++----- .../Code/Tests/GradientSignalTestFixtures.cpp | 156 +++++++++++++++- .../Code/Tests/GradientSignalTestFixtures.h | 10 +- .../Code/Tests/GradientSignalTestMocks.cpp | 40 +++-- .../Code/Tests/GradientSignalTestMocks.h | 6 +- .../gradientsignal_editor_tests_files.cmake | 1 - .../gradientsignal_shared_tests_files.cmake | 14 ++ .../Code/gradientsignal_tests_files.cmake | 4 - 11 files changed, 466 insertions(+), 78 deletions(-) create mode 100644 Gems/GradientSignal/Code/gradientsignal_shared_tests_files.cmake diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index d1ac8cdacf..657a88db47 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -124,6 +124,26 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) Mocks ) + ly_add_target( + NAME GradientSignal.Tests.Static STATIC + NAMESPACE Gem + FILES_CMAKE + gradientsignal_shared_tests_files.cmake + INCLUDE_DIRECTORIES + PUBLIC + Tests + PRIVATE + . + Source + BUILD_DEPENDENCIES + PRIVATE + AZ::AzTest + AZ::AzTestShared + Gem::GradientSignal.Static + Gem::LmbrCentral + Gem::GradientSignal.Mocks + ) + ly_add_target( NAME GradientSignal.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE Gem @@ -137,6 +157,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) PRIVATE AZ::AzTest AZ::AzTestShared + Gem::GradientSignal.Tests.Static Gem::GradientSignal.Static Gem::LmbrCentral Gem::GradientSignal.Mocks @@ -165,6 +186,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) PRIVATE AZ::AzTest AZ::AzTestShared + Gem::GradientSignal.Tests.Static Gem::GradientSignal.Static Gem::GradientSignal.Editor.Static Gem::LmbrCentral.Editor diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h index 1782972acf..d0fcabf746 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h @@ -11,6 +11,8 @@ #include #include +#include + namespace GradientSignal { struct GradientSampleParams final @@ -49,6 +51,36 @@ namespace GradientSignal */ virtual float GetValue(const GradientSampleParams& sampleParams) const = 0; + /** + * Given a list of positions, generate values. Implementations of this need to be thread-safe without using locks, + * as it can get called from multiple threads simultaneously and has the potential to cause lock inversion deadlocks. + * \param positions The input list of positions to query. + * \param outValues The output list of values. This list is expected to be the same size as the positions list. + */ + virtual void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + { + // Reference implementation of GetValues for any gradients that don't have their own optimized implementations. + // This is 10%-60% faster than calling GetValue via EBus many times due to the per-call EBus overhead. + + AZ_Assert( + positions.size() == outValues.size(), "input and output lists are different sizes (%zu vs %zu).", + positions.size(), outValues.size()); + + if (positions.size() == outValues.size()) + { + GradientSampleParams sampleParams; + for (size_t index = 0; index < positions.size(); index++) + { + sampleParams.m_position = positions[index]; + + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + outValue = GetValue(sampleParams); + } + } + } + /** * Call to check the hierarchy to see if a given entityId exists in the gradient signal chain */ diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h index 1dd7d44376..454be938a5 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h @@ -33,6 +33,7 @@ namespace GradientSignal static void Reflect(AZ::ReflectContext* context); inline float GetValue(const GradientSampleParams& sampleParams) const; + inline void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const; @@ -145,4 +146,93 @@ namespace GradientSignal return output * m_opacity; } + + inline void GradientSampler::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + { + auto ClearOutputValues = [](AZStd::array_view outValues) + { + // If we don't have a valid gradient (or it is fully transparent), clear out all the output values. + for (size_t index = 0; index < outValues.size(); index++) + { + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + outValue = 0.0f; + } + }; + + if (m_opacity <= 0.0f || !m_gradientId.IsValid()) + { + ClearOutputValues(outValues); + return; + } + + AZStd::vector transformedPositions; + bool useTransformedPositions = false; + + // apply transform if set + if (m_enableTransform && GradientSamplerUtil::AreTransformParamsSet(*this)) + { + AZ::Matrix3x4 matrix3x4; + matrix3x4.SetFromEulerDegrees(m_rotate); + matrix3x4.MultiplyByScale(m_scale); + matrix3x4.SetTranslation(m_translate); + + useTransformedPositions = true; + transformedPositions.resize(positions.size()); + for (size_t index = 0; index < positions.size(); index++) + { + transformedPositions[index] = matrix3x4 * positions[index]; + } + } + + { + // Block other threads from accessing the surface data bus while we are in GetValue (which may call into the SurfaceData bus). + // We lock our surface data mutex *before* checking / setting "isRequestInProgress" so that we prevent race conditions + // that create false detection of cyclic dependencies when multiple requests occur on different threads simultaneously. + // (One case where this was previously able to occur was in rapid updating of the Preview widget on the + // GradientSurfaceDataComponent in the Editor when moving the threshold sliders back and forth rapidly) + auto& surfaceDataContext = SurfaceData::SurfaceDataSystemRequestBus::GetOrCreateContext(false); + typename SurfaceData::SurfaceDataSystemRequestBus::Context::DispatchLockGuard scopeLock(surfaceDataContext.m_contextMutex); + + if (m_isRequestInProgress) + { + AZ_ErrorOnce("GradientSignal", !m_isRequestInProgress, "Detected cyclic dependences with gradient entity references"); + ClearOutputValues(outValues); + return; + } + else + { + m_isRequestInProgress = true; + + GradientRequestBus::Event( + m_gradientId, &GradientRequestBus::Events::GetValues, useTransformedPositions ? transformedPositions : positions, + outValues); + + m_isRequestInProgress = false; + } + } + + // Perform any post-fetch transformations on the gradient values (invert, levels, opacity). + for (size_t index = 0; index < outValues.size(); index++) + { + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + + if (m_invertInput) + { + outValue = 1.0f - outValue; + } + + // apply levels if set + if (m_enableLevels && GradientSamplerUtil::AreLevelParamsSet(*this)) + { + outValue = GetLevels(outValue, m_inputMid, m_inputMin, m_inputMax, m_outputMin, m_outputMax); + } + + outValue = outValue * m_opacity; + } + } + } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp index dd179bd253..6383b627c1 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp @@ -23,74 +23,145 @@ namespace UnitTest { - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientGetValue)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientEBusGetValue)(benchmark::State& state) { - // Create the Image Gradient Component with some default sizes and parameters. - GradientSignal::ImageGradientConfig config; - const uint32_t imageSize = 4096; - const int32_t imageSeed = 12345; - config.m_imageAsset = ImageAssetMockAssetHandler::CreateImageAsset(imageSize, imageSize, imageSeed); - config.m_tilingX = 1.0f; - config.m_tilingY = 1.0f; - CreateComponent(m_testEntity.get(), config); - - // Create the Gradient Transform Component with some default parameters. - GradientSignal::GradientTransformConfig gradientTransformConfig; - gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(m_testEntity.get(), gradientTransformConfig); - - // Run the benchmark - RunGetValueBenchmark(state); + CreateTestImageGradient(m_testEntity.get()); + RunEBusGetValueBenchmark(state); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientGetValue) + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientEBusGetValue) ->Args({ 1024, 1024 }) ->Args({ 2048, 2048 }) ->Args({ 4096, 4096 }) ->Unit(::benchmark::kMillisecond); - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientGetValue)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientEBusGetValues)(benchmark::State& state) { - // Create the Perlin Gradient Component with some default sizes and parameters. - GradientSignal::PerlinGradientConfig config; - config.m_amplitude = 1.0f; - config.m_frequency = 1.1f; - config.m_octave = 4; - config.m_randomSeed = 12345; - CreateComponent(m_testEntity.get(), config); - - // Create the Gradient Transform Component with some default parameters. - GradientSignal::GradientTransformConfig gradientTransformConfig; - gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(m_testEntity.get(), gradientTransformConfig); - - // Run the benchmark - RunGetValueBenchmark(state); + CreateTestImageGradient(m_testEntity.get()); + RunEBusGetValuesBenchmark(state); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientGetValue) + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientEBusGetValues) ->Args({ 1024, 1024 }) ->Args({ 2048, 2048 }) ->Args({ 4096, 4096 }) ->Unit(::benchmark::kMillisecond); - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientGetValue)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientSamplerGetValue)(benchmark::State& state) { - // Create the Random Gradient Component with some default parameters. - GradientSignal::RandomGradientConfig config; - config.m_randomSeed = 12345; - CreateComponent(m_testEntity.get(), config); - - // Create the Gradient Transform Component with some default parameters. - GradientSignal::GradientTransformConfig gradientTransformConfig; - gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(m_testEntity.get(), gradientTransformConfig); - - // Run the benchmark - RunGetValueBenchmark(state); + CreateTestImageGradient(m_testEntity.get()); + RunSamplerGetValueBenchmark(state); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientGetValue) + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientSamplerGetValue) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientSamplerGetValues)(benchmark::State& state) + { + CreateTestImageGradient(m_testEntity.get()); + RunSamplerGetValuesBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientSamplerGetValues) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientEBusGetValue)(benchmark::State& state) + { + CreateTestPerlinGradient(m_testEntity.get()); + RunEBusGetValueBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientEBusGetValue) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientEBusGetValues)(benchmark::State& state) + { + CreateTestPerlinGradient(m_testEntity.get()); + RunEBusGetValuesBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientEBusGetValues) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientSamplerGetValue)(benchmark::State& state) + { + CreateTestPerlinGradient(m_testEntity.get()); + RunSamplerGetValueBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientSamplerGetValue) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientSamplerGetValues)(benchmark::State& state) + { + CreateTestPerlinGradient(m_testEntity.get()); + RunSamplerGetValuesBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientSamplerGetValues) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientEBusGetValue)(benchmark::State& state) + { + CreateTestRandomGradient(m_testEntity.get()); + RunEBusGetValueBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientEBusGetValue) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientEBusGetValues)(benchmark::State& state) + { + CreateTestRandomGradient(m_testEntity.get()); + RunEBusGetValuesBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientEBusGetValues) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientSamplerGetValue)(benchmark::State& state) + { + CreateTestRandomGradient(m_testEntity.get()); + RunSamplerGetValueBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientSamplerGetValue) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientSamplerGetValues)(benchmark::State& state) + { + CreateTestRandomGradient(m_testEntity.get()); + RunSamplerGetValuesBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientSamplerGetValues) ->Args({ 1024, 1024 }) ->Args({ 2048, 2048 }) ->Args({ 4096, 4096 }) diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp index bc9b39aae8..77568d3321 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp @@ -9,6 +9,11 @@ #include +#include +#include +#include +#include + namespace UnitTest { void GradientSignalBaseFixture::SetupCoreSystems() @@ -86,8 +91,56 @@ namespace UnitTest m_testEntity.reset(); } - void GradientSignalBenchmarkFixture::RunGetValueBenchmark(benchmark::State& state) + void GradientSignalBenchmarkFixture::CreateTestImageGradient(AZ::Entity* entity) + { + // Create the Image Gradient Component with some default sizes and parameters. + GradientSignal::ImageGradientConfig config; + const uint32_t imageSize = 4096; + const int32_t imageSeed = 12345; + config.m_imageAsset = ImageAssetMockAssetHandler::CreateImageAsset(imageSize, imageSize, imageSeed); + config.m_tilingX = 1.0f; + config.m_tilingY = 1.0f; + CreateComponent(entity, config); + + // Create the Gradient Transform Component with some default parameters. + GradientSignal::GradientTransformConfig gradientTransformConfig; + gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; + CreateComponent(entity, gradientTransformConfig); + } + + void GradientSignalBenchmarkFixture::CreateTestPerlinGradient(AZ::Entity* entity) + { + // Create the Perlin Gradient Component with some default sizes and parameters. + GradientSignal::PerlinGradientConfig config; + config.m_amplitude = 1.0f; + config.m_frequency = 1.1f; + config.m_octave = 4; + config.m_randomSeed = 12345; + CreateComponent(entity, config); + + // Create the Gradient Transform Component with some default parameters. + GradientSignal::GradientTransformConfig gradientTransformConfig; + gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; + CreateComponent(entity, gradientTransformConfig); + } + + void GradientSignalBenchmarkFixture::CreateTestRandomGradient(AZ::Entity* entity) + { + // Create the Random Gradient Component with some default parameters. + GradientSignal::RandomGradientConfig config; + config.m_randomSeed = 12345; + CreateComponent(entity, config); + + // Create the Gradient Transform Component with some default parameters. + GradientSignal::GradientTransformConfig gradientTransformConfig; + gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; + CreateComponent(entity, gradientTransformConfig); + } + + void GradientSignalBenchmarkFixture::RunSamplerGetValueBenchmark(benchmark::State& state) { + AZ_PROFILE_FUNCTION(Entity); + // All components are created, so activate the entity ActivateEntity(m_testEntity.get()); @@ -115,6 +168,107 @@ namespace UnitTest } } + void GradientSignalBenchmarkFixture::RunSamplerGetValuesBenchmark(benchmark::State& state) + { + AZ_PROFILE_FUNCTION(Entity); + + // All components are created, so activate the entity + ActivateEntity(m_testEntity.get()); + + // Create a gradient sampler and run through a series of points to see if they match expectations. + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = m_testEntity->GetId(); + + // Get the height and width ranges for querying from our benchmark parameters + float height = aznumeric_cast(state.range(0)); + float width = aznumeric_cast(state.range(1)); + int64_t totalQueryPoints = state.range(0) * state.range(1); + + // Call GetValues() for every height and width in our ranges. + for (auto _ : state) + { + // Set up our vector of query positions. + AZStd::vector positions(totalQueryPoints); + size_t index = 0; + for (float y = 0.0f; y < height; y += 1.0f) + { + for (float x = 0.0f; x < width; x += 1.0f) + { + positions[index++] = AZ::Vector3(x, y, 0.0f); + } + } + + // Query and get the results. + AZStd::vector results(totalQueryPoints); + gradientSampler.GetValues(positions, results); + } + } + + void GradientSignalBenchmarkFixture::RunEBusGetValueBenchmark(benchmark::State& state) + { + AZ_PROFILE_FUNCTION(Entity); + + // All components are created, so activate the entity + ActivateEntity(m_testEntity.get()); + + GradientSignal::GradientSampleParams params; + + // Get the height and width ranges for querying from our benchmark parameters + float height = aznumeric_cast(state.range(0)); + float width = aznumeric_cast(state.range(1)); + + // Call GetValue() for every height and width in our ranges. + for (auto _ : state) + { + for (float y = 0.0f; y < height; y += 1.0f) + { + for (float x = 0.0f; x < width; x += 1.0f) + { + float value = 0.0f; + params.m_position = AZ::Vector3(x, y, 0.0f); + GradientSignal::GradientRequestBus::EventResult( + value, m_testEntity->GetId(), &GradientSignal::GradientRequestBus::Events::GetValue, params); + benchmark::DoNotOptimize(value); + } + } + } + } + + void GradientSignalBenchmarkFixture::RunEBusGetValuesBenchmark(benchmark::State& state) + { + AZ_PROFILE_FUNCTION(Entity); + + // All components are created, so activate the entity + ActivateEntity(m_testEntity.get()); + + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = m_testEntity->GetId(); + + // Get the height and width ranges for querying from our benchmark parameters + float height = aznumeric_cast(state.range(0)); + float width = aznumeric_cast(state.range(1)); + int64_t totalQueryPoints = state.range(0) * state.range(1); + + // Call GetValues() for every height and width in our ranges. + for (auto _ : state) + { + // Set up our vector of query positions. + AZStd::vector positions(totalQueryPoints); + size_t index = 0; + for (float y = 0.0f; y < height; y += 1.0f) + { + for (float x = 0.0f; x < width; x += 1.0f) + { + positions[index++] = AZ::Vector3(x, y, 0.0f); + } + } + + // Query and get the results. + AZStd::vector results(totalQueryPoints); + GradientSignal::GradientRequestBus::Event( + m_testEntity->GetId(), &GradientSignal::GradientRequestBus::Events::GetValues, positions, results); + } + } #endif } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h index 5e05cba374..13ff69c82d 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h @@ -97,7 +97,15 @@ namespace UnitTest void CreateTestEntity(float shapeHalfBounds); void DestroyTestEntity(); - void RunGetValueBenchmark(benchmark::State& state); + void CreateTestImageGradient(AZ::Entity* entity); + void CreateTestPerlinGradient(AZ::Entity* entity); + void CreateTestRandomGradient(AZ::Entity* entity); + + void RunSamplerGetValueBenchmark(benchmark::State& state); + void RunSamplerGetValuesBenchmark(benchmark::State& state); + + void RunEBusGetValueBenchmark(benchmark::State& state); + void RunEBusGetValuesBenchmark(benchmark::State& state); protected: void SetUp(const benchmark::State& state) override diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.cpp index ccbe17dee8..7ac6ef1ecc 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.cpp @@ -13,13 +13,14 @@ namespace UnitTest { AZ::Data::Asset ImageAssetMockAssetHandler::CreateImageAsset(AZ::u32 width, AZ::u32 height, AZ::s32 seed) { - GradientSignal::ImageAsset* imageData = - aznew GradientSignal::ImageAsset(AZ::Data::AssetId(AZ::Uuid::CreateRandom()), AZ::Data::AssetData::AssetStatus::Ready); - imageData->m_imageWidth = width; - imageData->m_imageHeight = height; - imageData->m_bytesPerPixel = 1; - imageData->m_imageFormat = ImageProcessingAtom::EPixelFormat::ePixelFormat_R8; - imageData->m_imageData.reserve(width * height); + auto imageAsset = AZ::Data::AssetManager::Instance().CreateAsset( + AZ::Data::AssetId(AZ::Uuid::CreateRandom()), AZ::Data::AssetLoadBehavior::Default); + + imageAsset->m_imageWidth = width; + imageAsset->m_imageHeight = height; + imageAsset->m_bytesPerPixel = 1; + imageAsset->m_imageFormat = ImageProcessingAtom::EPixelFormat::ePixelFormat_R8; + imageAsset->m_imageData.reserve(width * height); size_t value = 0; AZStd::hash_combine(value, seed); @@ -30,23 +31,24 @@ namespace UnitTest { AZStd::hash_combine(value, x); AZStd::hash_combine(value, y); - imageData->m_imageData.push_back(static_cast(value)); + imageAsset->m_imageData.push_back(static_cast(value)); } } - return AZ::Data::Asset(imageData, AZ::Data::AssetLoadBehavior::Default); + return imageAsset; } AZ::Data::Asset ImageAssetMockAssetHandler::CreateSpecificPixelImageAsset( AZ::u32 width, AZ::u32 height, AZ::u32 pixelX, AZ::u32 pixelY) { - GradientSignal::ImageAsset* imageData = - aznew GradientSignal::ImageAsset(AZ::Data::AssetId(AZ::Uuid::CreateRandom()), AZ::Data::AssetData::AssetStatus::Ready); - imageData->m_imageWidth = width; - imageData->m_imageHeight = height; - imageData->m_bytesPerPixel = 1; - imageData->m_imageFormat = ImageProcessingAtom::EPixelFormat::ePixelFormat_R8; - imageData->m_imageData.reserve(width * height); + auto imageAsset = AZ::Data::AssetManager::Instance().CreateAsset( + AZ::Data::AssetId(AZ::Uuid::CreateRandom()), AZ::Data::AssetLoadBehavior::Default); + + imageAsset->m_imageWidth = width; + imageAsset->m_imageHeight = height; + imageAsset->m_bytesPerPixel = 1; + imageAsset->m_imageFormat = ImageProcessingAtom::EPixelFormat::ePixelFormat_R8; + imageAsset->m_imageData.reserve(width * height); const AZ::u8 pixelValue = 255; @@ -57,16 +59,16 @@ namespace UnitTest { if ((x == static_cast(pixelX)) && (y == static_cast(pixelY))) { - imageData->m_imageData.push_back(pixelValue); + imageAsset->m_imageData.push_back(pixelValue); } else { - imageData->m_imageData.push_back(0); + imageAsset->m_imageData.push_back(0); } } } - return AZ::Data::Asset(imageData, AZ::Data::AssetLoadBehavior::Default); + return imageAsset; } } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.h b/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.h index 1d83a5eb55..30f262d9b4 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.h +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.h @@ -47,10 +47,10 @@ namespace UnitTest static AZ::Data::Asset CreateSpecificPixelImageAsset( AZ::u32 width, AZ::u32 height, AZ::u32 pixelX, AZ::u32 pixelY); - AZ::Data::AssetPtr CreateAsset( - [[maybe_unused]] const AZ::Data::AssetId& id, [[maybe_unused]] const AZ::Data::AssetType& type) override + AZ::Data::AssetPtr CreateAsset(const AZ::Data::AssetId& id, [[maybe_unused]] const AZ::Data::AssetType& type) override { - return AZ::Data::AssetPtr(); + // For our mock handler, always mark our assets as immediately ready. + return aznew GradientSignal::ImageAsset(id, AZ::Data::AssetData::AssetStatus::Ready); } void DestroyAsset(AZ::Data::AssetPtr ptr) override diff --git a/Gems/GradientSignal/Code/gradientsignal_editor_tests_files.cmake b/Gems/GradientSignal/Code/gradientsignal_editor_tests_files.cmake index 8172591afa..5a3a75602b 100644 --- a/Gems/GradientSignal/Code/gradientsignal_editor_tests_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_editor_tests_files.cmake @@ -7,6 +7,5 @@ # set(FILES - Tests/GradientSignalTestFixtures.cpp Tests/EditorGradientSignalPreviewTests.cpp ) diff --git a/Gems/GradientSignal/Code/gradientsignal_shared_tests_files.cmake b/Gems/GradientSignal/Code/gradientsignal_shared_tests_files.cmake new file mode 100644 index 0000000000..7d867b0a33 --- /dev/null +++ b/Gems/GradientSignal/Code/gradientsignal_shared_tests_files.cmake @@ -0,0 +1,14 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +set(FILES + Tests/GradientSignalTestFixtures.cpp + Tests/GradientSignalTestFixtures.h + Tests/GradientSignalTestMocks.cpp + Tests/GradientSignalTestMocks.h +) diff --git a/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake b/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake index 8e081e5711..eb799811b7 100644 --- a/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake @@ -13,10 +13,6 @@ set(FILES Tests/GradientSignalServicesTests.cpp Tests/GradientSignalSurfaceTests.cpp Tests/GradientSignalTransformTests.cpp - Tests/GradientSignalTestFixtures.cpp - Tests/GradientSignalTestFixtures.h - Tests/GradientSignalTestMocks.cpp - Tests/GradientSignalTestMocks.h Tests/GradientSignalTest.cpp Tests/ImageAssetTests.cpp ) From 67a89c6cd0c1dc4c581b64ff9a147ea6406fa99d Mon Sep 17 00:00:00 2001 From: Junbo Liang <68558268+junbo75@users.noreply.github.com> Date: Fri, 7 Jan 2022 10:51:08 -0800 Subject: [PATCH 322/399] Fix an issue where npm is not found (#6706) Signed-off-by: Junbo Liang <68558268+junbo75@users.noreply.github.com> --- scripts/build/Platform/Linux/deploy_cdk_applications.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/build/Platform/Linux/deploy_cdk_applications.sh b/scripts/build/Platform/Linux/deploy_cdk_applications.sh index 97668ee70c..9a0a31397e 100755 --- a/scripts/build/Platform/Linux/deploy_cdk_applications.sh +++ b/scripts/build/Platform/Linux/deploy_cdk_applications.sh @@ -7,9 +7,6 @@ # # Deploy the CDK applications for AWS gems (Linux only) -# Prerequisites: -# 1) Node.js is installed -# 2) Node.js version >= 10.13.0, except for versions 13.0.0 - 13.6.0. A version in active long-term support is recommended. SOURCE_DIRECTORY=$(dirname "$0") PATH=$SOURCE_DIRECTORY/python:$PATH @@ -70,12 +67,12 @@ echo [cdk_installation] Install the current version of nodejs nvm install node echo [cdk_installation] Install the latest version of CDK -if ! sudo npm uninstall -g aws-cdk; +if ! npm uninstall -g aws-cdk; then echo [cdk_bootstrap] Failed to uninstall the current version of CDK exit 1 fi -if ! sudo npm install -g aws-cdk@latest; +if ! npm install -g aws-cdk@latest; then echo [cdk_bootstrap] Failed to install the latest version of CDK exit 1 From 641f7be041b0671a12340ae678608cbb757ff7ec Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 7 Jan 2022 14:24:53 -0600 Subject: [PATCH 323/399] Removed more unused Editor code and images Signed-off-by: Chris Galvan --- Code/Editor/EditorViewportWidget.cpp | 3 - Code/Editor/IEditor.h | 1 - Code/Editor/Include/IConsoleConnectivity.h | 85 ------------------- Code/Editor/Include/IFacialEditor.h | 43 ---------- Code/Editor/Include/IRenderListener.h | 29 ------- Code/Editor/Include/ITextureDatabaseUpdater.h | 38 --------- Code/Editor/MainWindow.qrc | 1 - Code/Editor/Resource.h | 2 - Code/Editor/TimeOfDay/main-00.png | 3 - Code/Editor/TimeOfDay/main-01.png | 3 - Code/Editor/TimeOfDay/main-02.png | 3 - Code/Editor/TimeOfDay/main-03.png | 3 - Code/Editor/TimeOfDay/main-04.png | 3 - Code/Editor/TimeOfDay/main-05.png | 3 - Code/Editor/TimeOfDay/main-06.png | 3 - Code/Editor/TimeOfDay/main-07.png | 3 - Code/Editor/TimeOfDay/main-08.png | 3 - Code/Editor/TimeOfDay/main-09.png | 3 - Code/Editor/TimeOfDay/main-10.png | 3 - Code/Editor/TimeOfDay/main-11.png | 3 - Code/Editor/TimeOfDay/main-12.png | 3 - Code/Editor/Viewport.cpp | 68 --------------- Code/Editor/Viewport.h | 13 --- Code/Editor/editor_lib_files.cmake | 3 - Code/Editor/water.png | 3 - 25 files changed, 328 deletions(-) delete mode 100644 Code/Editor/Include/IConsoleConnectivity.h delete mode 100644 Code/Editor/Include/IFacialEditor.h delete mode 100644 Code/Editor/Include/IRenderListener.h delete mode 100644 Code/Editor/Include/ITextureDatabaseUpdater.h delete mode 100644 Code/Editor/TimeOfDay/main-00.png delete mode 100644 Code/Editor/TimeOfDay/main-01.png delete mode 100644 Code/Editor/TimeOfDay/main-02.png delete mode 100644 Code/Editor/TimeOfDay/main-03.png delete mode 100644 Code/Editor/TimeOfDay/main-04.png delete mode 100644 Code/Editor/TimeOfDay/main-05.png delete mode 100644 Code/Editor/TimeOfDay/main-06.png delete mode 100644 Code/Editor/TimeOfDay/main-07.png delete mode 100644 Code/Editor/TimeOfDay/main-08.png delete mode 100644 Code/Editor/TimeOfDay/main-09.png delete mode 100644 Code/Editor/TimeOfDay/main-10.png delete mode 100644 Code/Editor/TimeOfDay/main-11.png delete mode 100644 Code/Editor/TimeOfDay/main-12.png delete mode 100644 Code/Editor/water.png diff --git a/Code/Editor/EditorViewportWidget.cpp b/Code/Editor/EditorViewportWidget.cpp index 754ea84544..828812fb7e 100644 --- a/Code/Editor/EditorViewportWidget.cpp +++ b/Code/Editor/EditorViewportWidget.cpp @@ -454,9 +454,6 @@ void EditorViewportWidget::Update() // Render { - // TODO: Move out this logic to a controller and refactor to work with Atom - ProcessRenderLisneters(m_displayContext); - m_displayContext.Flush2D(); // Post Render Callback diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h index c91ca62c5e..90f1b63f55 100644 --- a/Code/Editor/IEditor.h +++ b/Code/Editor/IEditor.h @@ -52,7 +52,6 @@ class CUIEnumsDatabase; struct ISourceControl; struct IEditorClassFactory; struct ITransformManipulator; -class IFacialEditor; class CDialog; #if defined(AZ_PLATFORM_WINDOWS) class C3DConnexionDriver; diff --git a/Code/Editor/Include/IConsoleConnectivity.h b/Code/Editor/Include/IConsoleConnectivity.h deleted file mode 100644 index 0f5e9bf35c..0000000000 --- a/Code/Editor/Include/IConsoleConnectivity.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : Standard interface for console connectivity plugins. - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_ICONSOLECONNECTIVITY_H -#define CRYINCLUDE_EDITOR_INCLUDE_ICONSOLECONNECTIVITY_H -#pragma once - - -////////////////////////////////////////////////////////////////////////// -// Description -// This interface provide access to the console connectivity -// functionality. -////////////////////////////////////////////////////////////////////////// -struct IConsoleConnectivity - : public IUnknown -{ - DEFINE_UUID(0x4DAA85E1, 0x8498, 0x402f, 0x9B, 0x85, 0x7F, 0x62, 0x9D, 0x76, 0x79, 0x8A); - - ////////////////////////////////////////////////////////////////////////// - //TODO: Must add the useful interface here. - ////////////////////////////////////////////////////////////////////////// - - // Description: - // Checks if a development console is connected to the development PC. - // See Also: - // Arguments: - // Nothing - // Return: - // bool - true if it is connected, false otherwise. - virtual bool IsConnectedToConsole() = 0; - - // Description: - // Send a file from the specified local filename to the console platform creating the full path - // as required so it can copy to the remote filename. - // See Also: - // Nothing - // Arguments: - // szLocalFileName - is the local filename from which you want to copy the file. - // szRemoteFilename - is the full path and filename to where you want to copy the file. - // Return: - // bool - true if the copy succeeded, false otherwise. - virtual bool SendFile(const char* szLocalFileName, const char* szRemoteFilename) = 0; - - // Description: - // Notifies to the console that a file has been changed, typically uploaded. - // This will be usually called after a SendFile (see above) call, so that the - // system running on the console may decide what to do with this new file. - // Typically the system will have to load or reloads this new file. - // See Also: - // SendFile - // Arguments: - // szRemoteFilename - is the full path and filename in the console of the changed - // file. - // Return: - // bool - true if succeeded sending the notification, false otherwise. - virtual bool NotifyFileChange(const char* szRemoteFilename) = 0; - - - // Description: - // Gets the the title IP for the connected console . - // Arguments: - // dwConsoleAddressPlaceholder - is the pointer to the placeholder of the variable - // which will contain the title IP of the console. - // Return: - // bool - true if dwConsoleAddressPlaceholder now contains the IP address, else false. - virtual bool GetConsoleAddress(DWORD* dwConsoleAddressPlaceholder) = 0; - ////////////////////////////////////////////////////////////////////////// - // IUnknown - ////////////////////////////////////////////////////////////////////////// - virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) { return E_NOINTERFACE; }; - virtual ULONG STDMETHODCALLTYPE AddRef() { return 0; }; - virtual ULONG STDMETHODCALLTYPE Release() { return 0; }; - ////////////////////////////////////////////////////////////////////////// -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_ICONSOLECONNECTIVITY_H diff --git a/Code/Editor/Include/IFacialEditor.h b/Code/Editor/Include/IFacialEditor.h deleted file mode 100644 index 5dfa9ab03f..0000000000 --- a/Code/Editor/Include/IFacialEditor.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IFACIALEDITOR_H -#define CRYINCLUDE_EDITOR_INCLUDE_IFACIALEDITOR_H -#pragma once - - -class IFacialEditor -{ -public: - enum EyeType - { - EYE_LEFT, - EYE_RIGHT - }; - - virtual int GetNumMorphTargets() const = 0; - virtual const char* GetMorphTargetName(int index) const = 0; - virtual void PreviewEffector(int index, float value) = 0; - virtual void ClearAllPreviewEffectors() = 0; - virtual void SetForcedNeckRotation(const Quat& rotation) = 0; - virtual void SetForcedEyeRotation(const Quat& rotation, EyeType eye) = 0; - virtual int GetJoystickCount() const = 0; - virtual const char* GetJoystickName(int joystickIndex) const = 0; - virtual void SetJoystickPosition(int joystickIndex, float x, float y) = 0; - virtual void GetJoystickPosition(int joystickIndex, float& x, float& y) const = 0; - virtual void LoadJoystickFile(const char* filename) = 0; - virtual void LoadCharacter(const char* filename) = 0; - virtual void LoadSequence(const char* filename) = 0; - virtual void SetVideoFrameResolution(int width, int height, int bpp) = 0; - virtual int GetVideoFramePitch() = 0; - virtual void* GetVideoFrameBits() = 0; - virtual void ShowVideoFramePane() = 0; -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_IFACIALEDITOR_H diff --git a/Code/Editor/Include/IRenderListener.h b/Code/Editor/Include/IRenderListener.h deleted file mode 100644 index 892a42b701..0000000000 --- a/Code/Editor/Include/IRenderListener.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : Interface for rendering custom 3D elements in the main -// render viewport. Particularly usefull for debug geometries. - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IRENDERLISTENER_H -#define CRYINCLUDE_EDITOR_INCLUDE_IRENDERLISTENER_H -#pragma once - - -struct DisplayContext; - -struct IRenderListener - : public IUnknown -{ - DEFINE_UUID(0x8D52F857, 0x1027, 0x4346, 0xAC, 0x7B, 0xF6, 0x20, 0xDA, 0x7C, 0xCE, 0x42) - - virtual void Render(DisplayContext& rDisplayContext) = 0; -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_IRENDERLISTENER_H diff --git a/Code/Editor/Include/ITextureDatabaseUpdater.h b/Code/Editor/Include/ITextureDatabaseUpdater.h deleted file mode 100644 index 4482135b47..0000000000 --- a/Code/Editor/Include/ITextureDatabaseUpdater.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : This file declares the interface used by the texture viewer -// and (implemented first implemented by the Texture Database Creator) to -// syncronize their threads. A thread interace could be useful there. - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_ITEXTUREDATABASEUPDATER_H -#define CRYINCLUDE_EDITOR_INCLUDE_ITEXTUREDATABASEUPDATER_H -#pragma once - - -class CTextureDatabaseItem; - -struct ITextureDatabaseUpdater -{ -public: - ////////////////////////////////////////////////////////////////////////// - // Thread control - virtual void NotifyShutDown() = 0; - virtual void Lock() = 0; - virtual void Unlock() = 0; - virtual void WaitForThread() = 0; - ////////////////////////////////////////////////////////////////////////// - - ////////////////////////////////////////////////////////////////////////// - // Data access - virtual CTextureDatabaseItem* GetItem(const char* szAddItem) = 0; - ////////////////////////////////////////////////////////////////////////// -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_ITEXTUREDATABASEUPDATER_H diff --git a/Code/Editor/MainWindow.qrc b/Code/Editor/MainWindow.qrc index 4506a4a2a8..c68e05ef41 100644 --- a/Code/Editor/MainWindow.qrc +++ b/Code/Editor/MainWindow.qrc @@ -166,7 +166,6 @@ arhitype_tree_01.png arhitype_tree_02.png arhitype_tree_03.png - water.png bmp00005_00.png bmp00005_01.png bmp00005_02.png diff --git a/Code/Editor/Resource.h b/Code/Editor/Resource.h index 432f07a531..ef72bfc9be 100644 --- a/Code/Editor/Resource.h +++ b/Code/Editor/Resource.h @@ -196,7 +196,6 @@ #define ID_FILE_EXPORT_TERRAINAREA 33904 #define ID_FILE_EXPORT_TERRAINAREAWITHOBJECTS 33910 #define ID_FILE_EXPORT_SELECTEDOBJECTS 33911 -#define ID_TERRAIN_TIMEOFDAY 33912 #define ID_SPLINE_PREVIOUS_KEY 33916 #define ID_SPLINE_NEXT_KEY 33917 #define ID_SPLINE_FLATTEN_ALL 33918 @@ -290,7 +289,6 @@ #define ID_TV_TRACKS_TOOLBAR_LAST 35183 // for up to 100 "Add Tracks..." dynamically added Track View Track buttons #define ID_OPEN_TERRAIN_EDITOR 36007 #define ID_OPEN_UICANVASEDITOR 36010 -#define ID_TERRAIN_TIMEOFDAYBUTTON 36011 #define ID_OPEN_TERRAINTEXTURE_EDITOR 36012 #define ID_SKINS_REFRESH 36014 #define ID_FILE_GENERATETERRAIN 36016 diff --git a/Code/Editor/TimeOfDay/main-00.png b/Code/Editor/TimeOfDay/main-00.png deleted file mode 100644 index 2c44fec541..0000000000 --- a/Code/Editor/TimeOfDay/main-00.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5201dbba6c8114914ed680b04b72a5e18e22c0519a514bcccdc7ae8d32670b4e -size 993 diff --git a/Code/Editor/TimeOfDay/main-01.png b/Code/Editor/TimeOfDay/main-01.png deleted file mode 100644 index 5cc1bf33d8..0000000000 --- a/Code/Editor/TimeOfDay/main-01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:48a7250ad41c5e298079ddd13910b58baca2ef592defcc162ccc9df542d28905 -size 981 diff --git a/Code/Editor/TimeOfDay/main-02.png b/Code/Editor/TimeOfDay/main-02.png deleted file mode 100644 index b7d90648a3..0000000000 --- a/Code/Editor/TimeOfDay/main-02.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:98b9e9abcc54b4f3e6903ad74bb50f364bfe4c8cd9fedc9653a6603d64a1ee0a -size 838 diff --git a/Code/Editor/TimeOfDay/main-03.png b/Code/Editor/TimeOfDay/main-03.png deleted file mode 100644 index e073dbf60b..0000000000 --- a/Code/Editor/TimeOfDay/main-03.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1199c834fc8de69f9d7c76e8c7fbd84e9b92713b9f07b513137085e5089432cb -size 857 diff --git a/Code/Editor/TimeOfDay/main-04.png b/Code/Editor/TimeOfDay/main-04.png deleted file mode 100644 index 6049dbfe18..0000000000 --- a/Code/Editor/TimeOfDay/main-04.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:79b44be1dbe5518e06dc8c8823d00462136d39ffe60a32ef4f64dc0712654d33 -size 646 diff --git a/Code/Editor/TimeOfDay/main-05.png b/Code/Editor/TimeOfDay/main-05.png deleted file mode 100644 index 054419f39a..0000000000 --- a/Code/Editor/TimeOfDay/main-05.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6ea7450c1a278570e2a1dba3a8b4d7d4e5f0d054e8371139ebdb5220c405d355 -size 537 diff --git a/Code/Editor/TimeOfDay/main-06.png b/Code/Editor/TimeOfDay/main-06.png deleted file mode 100644 index 35f8afdae2..0000000000 --- a/Code/Editor/TimeOfDay/main-06.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bc73f0720f2ff877aff5c6646938b7fc509a69d92e766fecb9fa010eecadee7b -size 606 diff --git a/Code/Editor/TimeOfDay/main-07.png b/Code/Editor/TimeOfDay/main-07.png deleted file mode 100644 index aca9597355..0000000000 --- a/Code/Editor/TimeOfDay/main-07.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e63519ed54fc19a4b4a2a38cb2c5f148b7404ac614d4aab039b71fee64cd7425 -size 569 diff --git a/Code/Editor/TimeOfDay/main-08.png b/Code/Editor/TimeOfDay/main-08.png deleted file mode 100644 index abeb114fc2..0000000000 --- a/Code/Editor/TimeOfDay/main-08.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8742cad4b8f8f5bba59abb9cc028db84de222ed8b393398f6837fea16bb4a1d8 -size 563 diff --git a/Code/Editor/TimeOfDay/main-09.png b/Code/Editor/TimeOfDay/main-09.png deleted file mode 100644 index cc77b8c9e2..0000000000 --- a/Code/Editor/TimeOfDay/main-09.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ef85628301b4edc4f858f0988e4f072772be3feb92d27a2ec33b72a27bcee7ff -size 583 diff --git a/Code/Editor/TimeOfDay/main-10.png b/Code/Editor/TimeOfDay/main-10.png deleted file mode 100644 index dc463c6497..0000000000 --- a/Code/Editor/TimeOfDay/main-10.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d17bfbdee6d37566b241adf64241ef47b62145aaac3e9e8f9691d1fb866b5fcb -size 717 diff --git a/Code/Editor/TimeOfDay/main-11.png b/Code/Editor/TimeOfDay/main-11.png deleted file mode 100644 index d686ab18c8..0000000000 --- a/Code/Editor/TimeOfDay/main-11.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:98b629abf927bcea41d8857b1761d12a37836471d7106b2f5210337c0ace0d9c -size 1103 diff --git a/Code/Editor/TimeOfDay/main-12.png b/Code/Editor/TimeOfDay/main-12.png deleted file mode 100644 index 069510ab24..0000000000 --- a/Code/Editor/TimeOfDay/main-12.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e949111b33e28834995807cab30ecb58d988a81a2d58fa166117962c85b8e149 -size 849 diff --git a/Code/Editor/Viewport.cpp b/Code/Editor/Viewport.cpp index 437dcead3b..dcf86abb02 100644 --- a/Code/Editor/Viewport.cpp +++ b/Code/Editor/Viewport.cpp @@ -30,7 +30,6 @@ #include "Objects/ObjectManager.h" #include "Util/3DConnexionDriver.h" #include "PluginManager.h" -#include "Include/IRenderListener.h" #include "GameEngine.h" #include "Settings.h" @@ -227,61 +226,6 @@ void QtViewport::GetDimensions(int* pWidth, int* pHeight) const } } -////////////////////////////////////////////////////////////////////////// -void QtViewport::RegisterRenderListener(IRenderListener* piListener) -{ -#ifdef _DEBUG - size_t nCount(0); - size_t nTotal(0); - - nTotal = m_cRenderListeners.size(); - for (nCount = 0; nCount < nTotal; ++nCount) - { - if (m_cRenderListeners[nCount] == piListener) - { - assert(!"Registered the same RenderListener multiple times."); - break; - } - } -#endif //_DEBUG - m_cRenderListeners.push_back(piListener); -} - -////////////////////////////////////////////////////////////////////////// -bool QtViewport::UnregisterRenderListener(IRenderListener* piListener) -{ - size_t nCount(0); - size_t nTotal(0); - - nTotal = m_cRenderListeners.size(); - for (nCount = 0; nCount < nTotal; ++nCount) - { - if (m_cRenderListeners[nCount] == piListener) - { - m_cRenderListeners.erase(m_cRenderListeners.begin() + nCount); - return true; - } - } - return false; -} - -////////////////////////////////////////////////////////////////////////// -bool QtViewport::IsRenderListenerRegistered(IRenderListener* piListener) -{ - size_t nCount(0); - size_t nTotal(0); - - nTotal = m_cRenderListeners.size(); - for (nCount = 0; nCount < nTotal; ++nCount) - { - if (m_cRenderListeners[nCount] == piListener) - { - return true; - } - } - return false; -} - ////////////////////////////////////////////////////////////////////////// void QtViewport::AddPostRenderer(IPostRenderer* pPostRenderer) { @@ -1164,18 +1108,6 @@ bool QtViewport::GetAdvancedSelectModeFlag() return m_bAdvancedSelectMode; } -////////////////////////////////////////////////////////////////////////// -void QtViewport::ProcessRenderLisneters(DisplayContext& rstDisplayContext) -{ - size_t nCount(0); - size_t nTotal(0); - - nTotal = m_cRenderListeners.size(); - for (nCount = 0; nCount < nTotal; ++nCount) - { - m_cRenderListeners[nCount]->Render(rstDisplayContext); - } -} ////////////////////////////////////////////////////////////////////////// #if defined(AZ_PLATFORM_WINDOWS) // Note: Both CreateAnglesYPR and CreateOrientationYPR were copied verbatim from Cry_Camera.h which has been removed. diff --git a/Code/Editor/Viewport.h b/Code/Editor/Viewport.h index 1b0e5a4d93..d992eb4cb0 100644 --- a/Code/Editor/Viewport.h +++ b/Code/Editor/Viewport.h @@ -43,7 +43,6 @@ class CLayoutViewPane; class CViewManager; class CBaseObjectsCache; struct HitContext; -struct IRenderListener; class CImageEx; class QMenu; @@ -104,10 +103,6 @@ public: //! Access to view manager. CViewManager* GetViewManager() const { return m_viewManager; }; - virtual void RegisterRenderListener(IRenderListener* piListener) = 0; - virtual bool UnregisterRenderListener(IRenderListener* piListener) = 0; - virtual bool IsRenderListenerRegistered(IRenderListener* piListener) = 0; - virtual void AddPostRenderer(IPostRenderer* pPostRenderer) = 0; virtual bool RemovePostRenderer(IPostRenderer* pPostRenderer) = 0; @@ -477,10 +472,6 @@ public: void ResetCursor() override; void SetSupplementaryCursorStr(const QString& str) override; - void RegisterRenderListener(IRenderListener* piListener) override; - bool UnregisterRenderListener(IRenderListener* piListener) override; - bool IsRenderListenerRegistered(IRenderListener* piListener) override; - void AddPostRenderer(IPostRenderer* pPostRenderer) override; bool RemovePostRenderer(IPostRenderer* pPostRenderer) override; @@ -508,8 +499,6 @@ protected: void setRenderOverlayVisible(bool); bool isRenderOverlayVisible() const; - void ProcessRenderLisneters(DisplayContext& rstDisplayContext); - void mousePressEvent(QMouseEvent* event) override; void mouseReleaseEvent(QMouseEvent* event) override; void mouseDoubleClickEvent(QMouseEvent* event) override; @@ -597,8 +586,6 @@ protected: // Same construction matrix is shared by all viewports. Matrix34 m_constructionMatrix[LAST_COORD_SYSTEM]; - std::vector m_cRenderListeners; - typedef std::vector<_smart_ptr > PostRenderers; PostRenderers m_postRenderers; AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 59a1a91647..345a8e15e1 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -270,7 +270,6 @@ set(FILES Include/Command.h Include/HitContext.h Include/ICommandManager.h - Include/IConsoleConnectivity.h Include/IDisplayViewport.h Include/IEditorClassFactory.h Include/IEventLoopHook.h @@ -282,9 +281,7 @@ set(FILES Include/IObjectManager.h Include/IPlugin.h Include/IPreferencesPage.h - Include/IRenderListener.h Include/ISourceControl.h - Include/ITextureDatabaseUpdater.h Include/ITransformManipulator.h Include/IViewPane.h Include/ObjectEvent.h diff --git a/Code/Editor/water.png b/Code/Editor/water.png deleted file mode 100644 index 342dee81e3..0000000000 --- a/Code/Editor/water.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4abde33fa9c29e927e403e275979536e7defbb6476eb375e85f847396645953f -size 41419 From b04cecc34dd9ace183fab95b97e393c3212de272 Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Fri, 7 Jan 2022 14:28:38 -0800 Subject: [PATCH 324/399] Move Draw2d interface back to IDraw2d (#6730) * Move Draw2d interface back to IDraw2d Signed-off-by: abrmich * Fix compile error for gems using LyShine Signed-off-by: abrmich --- Gems/LyShine/Code/CMakeLists.txt | 3 + Gems/LyShine/Code/Include/LyShine/Draw2d.h | 363 +------------- Gems/LyShine/Code/Include/LyShine/IDraw2d.h | 457 ++++++++++++++++++ Gems/LyShine/Code/Source/LyShineDebug.cpp | 26 +- .../LyShine/Code/Source/UiCanvasComponent.cpp | 4 +- Gems/LyShine/Code/Source/UiCanvasComponent.h | 4 +- Gems/LyShine/Code/Source/UiCanvasManager.cpp | 6 +- Gems/LyShine/Code/Source/UiRenderer.cpp | 2 +- 8 files changed, 502 insertions(+), 363 deletions(-) diff --git a/Gems/LyShine/Code/CMakeLists.txt b/Gems/LyShine/Code/CMakeLists.txt index 77aaa681e0..4f2c4e90a7 100644 --- a/Gems/LyShine/Code/CMakeLists.txt +++ b/Gems/LyShine/Code/CMakeLists.txt @@ -47,6 +47,9 @@ ly_add_target( Gem::LyShine.Static Legacy::CryCommon Gem::LmbrCentral + PUBLIC + Gem::Atom_RHI.Reflect + Gem::Atom_RPI.Public RUNTIME_DEPENDENCIES Gem::LmbrCentral Gem::TextureAtlas diff --git a/Gems/LyShine/Code/Include/LyShine/Draw2d.h b/Gems/LyShine/Code/Include/LyShine/Draw2d.h index f92c6ce2e1..d138f41b03 100644 --- a/Gems/LyShine/Code/Include/LyShine/Draw2d.h +++ b/Gems/LyShine/Code/Include/LyShine/Draw2d.h @@ -8,13 +8,10 @@ #pragma once #include -#include -#include #include #include #include -#include #include //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -23,69 +20,11 @@ //! The CDraw2d class implements the IDraw2d interface for drawing 2D images, shapes and text. //! Positions and sizes are specified in pixels in the associated 2D viewport. class CDraw2d - : public IDraw2d // [LYSHINE_ATOM_TODO][GHI #3573] Make Draw2d work better as an API + : public IDraw2d , public AZ::Render::Bootstrap::NotificationBus::Handler { public: // types - struct RenderState - { - RenderState() - { - m_blendState.m_enable = true; - m_blendState.m_blendSource = AZ::RHI::BlendFactor::AlphaSource; - m_blendState.m_blendDest = AZ::RHI::BlendFactor::AlphaSourceInverse; - - m_depthState.m_enable = false; - } - - AZ::RHI::TargetBlendState m_blendState; - AZ::RHI::DepthState m_depthState; - }; - - //! Struct used to pass additional image options. - // - //! If this is not passed then the defaults are used - struct ImageOptions - { - AZ::Vector3 color = AZ::Vector3(1.0f, 1.0f, 1.0f); - Rounding pixelRounding = Rounding::Nearest; - bool m_clamp = false; - RenderState m_renderState; - }; - - //! Struct used to pass additional text options - mostly ones that do not change from call to call. - // - //! If this is not passed then the defaults below are used - struct TextOptions - { - AZStd::string fontName; //!< default is "default" - unsigned int effectIndex; //!< default is 0 - AZ::Vector3 color; //!< default is (1,1,1) - HAlign horizontalAlignment; //!< default is HAlign::Left - VAlign verticalAlignment; //!< default is VAlign::Top - AZ::Vector2 dropShadowOffset; //!< default is (0,0), zero offset means no drop shadow is drawn - AZ::Color dropShadowColor; //!< default is (0,0,0,0), zero alpha means no drop shadow is drawn - float rotation; //!< default is 0 - bool depthTestEnabled; //!< default is false - }; - - //! Used to pass in arrays of vertices (e.g. to DrawQuad) - struct VertexPosColUV - { - VertexPosColUV() {} - VertexPosColUV(const AZ::Vector2& inPos, const AZ::Color& inColor, const AZ::Vector2& inUV) - { - position = inPos; - color = inColor; - uv = inUV; - } - - AZ::Vector2 position; //!< 2D position of vertex - AZ::Color color; //!< Float color - AZ::Vector2 uv; //!< Texture coordinate - }; - public: // member functions //! Constructor, constructed by the LyShine class @@ -116,7 +55,7 @@ public: // member functions //! \param imageOptions Optional struct specifying options that tend to be the same from call to call void DrawImage(AZ::Data::Instance image, AZ::Vector2 position, AZ::Vector2 size, float opacity = 1.0f, float rotation = 0.0f, const AZ::Vector2* pivotPoint = nullptr, const AZ::Vector2* minMaxTexCoords = nullptr, - ImageOptions* imageOptions = nullptr); + ImageOptions* imageOptions = nullptr) override; //! Draw a textured quad where the position specifies the point specified by the alignment. // @@ -135,7 +74,7 @@ public: // member functions void DrawImageAligned(AZ::Data::Instance image, AZ::Vector2 position, AZ::Vector2 size, HAlign horizontalAlignment, VAlign verticalAlignment, float opacity = 1.0f, float rotation = 0.0f, const AZ::Vector2* minMaxTexCoords = nullptr, - ImageOptions* imageOptions = nullptr); + ImageOptions* imageOptions = nullptr) override; //! Draw a textured quad where the position, color and uv of each point is specified explicitly // @@ -143,11 +82,11 @@ public: // member functions //! \param verts An array of 4 vertices, in clockwise order (e.g. top left, top right, bottom right, bottom left) //! \param pixelRounding Whether and how to round pixel coordinates //! \param renderState Blend mode and depth state - virtual void DrawQuad(AZ::Data::Instance image, + void DrawQuad(AZ::Data::Instance image, VertexPosColUV* verts, Rounding pixelRounding = Rounding::Nearest, bool clamp = false, - const RenderState& renderState = RenderState{}); + const RenderState& renderState = RenderState{}) override; //! Draw a line // @@ -156,9 +95,9 @@ public: // member functions //! \param color The color of the line //! \param pixelRounding Whether and how to round pixel coordinates //! \param renderState Blend mode and depth state - virtual void DrawLine(AZ::Vector2 start, AZ::Vector2 end, AZ::Color color, + void DrawLine(AZ::Vector2 start, AZ::Vector2 end, AZ::Color color, IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, - const RenderState& renderState = RenderState{}); + const RenderState& renderState = RenderState{}) override; //! Draw a line with a texture so it can be dotted or dashed // @@ -166,10 +105,10 @@ public: // member functions //! \param verts An array of 2 vertices for the start and end points of the line //! \param pixelRounding Whether and how to round pixel coordinates //! \param renderState Blend mode and depth state - virtual void DrawLineTextured(AZ::Data::Instance image, + void DrawLineTextured(AZ::Data::Instance image, VertexPosColUV* verts, IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, - const RenderState& renderState = RenderState{}); + const RenderState& renderState = RenderState{}) override; //! Draw a text string. Only supports ASCII text. // //! The font and effect used to render the text are specified in the textOptions structure @@ -179,7 +118,7 @@ public: // member functions //! \param opacity The opacity (alpha value) to use to draw the text //! \param textOptions Pointer to an options struct. If null the default options are used void DrawText(const char* textString, AZ::Vector2 position, float pointSize, - float opacity = 1.0f, TextOptions* textOptions = nullptr); + float opacity = 1.0f, TextOptions* textOptions = nullptr) override; //! Draw a rectangular outline with a texture // @@ -194,43 +133,43 @@ public: // member functions AZ::Vector2 rightVec, AZ::Vector2 downVec, AZ::Color color, - uint32_t lineThickness = 0); + uint32_t lineThickness = 0) override; //! Get the width and height (in pixels) that would be used to draw the given text string. // //! Pass the same parameter values that would be used to draw the string - AZ::Vector2 GetTextSize(const char* textString, float pointSize, TextOptions* textOptions = nullptr); + AZ::Vector2 GetTextSize(const char* textString, float pointSize, TextOptions* textOptions = nullptr) override; //! Get the width of the rendering viewport (in pixels). - float GetViewportWidth() const; + float GetViewportWidth() const override; //! Get the height of the rendering viewport (in pixels). - float GetViewportHeight() const; + float GetViewportHeight() const override; //! Get dpi scale factor - float GetViewportDpiScalingFactor() const; + float GetViewportDpiScalingFactor() const override; //! Get the default values that would be used if no image options were passed in // //! This is a convenient way to initialize the imageOptions struct - virtual const ImageOptions& GetDefaultImageOptions() const; + const ImageOptions& GetDefaultImageOptions() const override; //! Get the default values that would be used if no text options were passed in // //! This is a convenient way to initialize the textOptions struct - virtual const TextOptions& GetDefaultTextOptions() const; + const TextOptions& GetDefaultTextOptions() const override; //! Render the primitives that have been deferred - void RenderDeferredPrimitives(); + void RenderDeferredPrimitives() override; //! Specify whether to defer future primitives or render them right away - void SetDeferPrimitives(bool deferPrimitives); + void SetDeferPrimitives(bool deferPrimitives) override; //! Return whether future primitives will be deferred or rendered right away - bool GetDeferPrimitives(); + bool GetDeferPrimitives() override; //! Set sort key offset for following draws. - void SetSortKey(int64_t key); + void SetSortKey(int64_t key) override; private: @@ -378,263 +317,3 @@ protected: // attributes AZ::RHI::Ptr m_dynamicDraw; Draw2dShaderData m_shaderData; }; - -//////////////////////////////////////////////////////////////////////////////////////////////////// -//! Helper class for using the IDraw2d interface -//! -//! The Draw2dHelper class is an inline wrapper that provides the convenience feature of -//! automatically setting member options structures to their defaults and providing set functions. -class Draw2dHelper -{ -public: // member functions - - //! Start a section of 2D drawing function calls that will render to the default viewport - Draw2dHelper(bool deferCalls = false) - { - InitCommon(nullptr, deferCalls); - } - - //! Start a section of 2D drawing function calls that will render to the viewport - //! associated with the specified Draw2d object - Draw2dHelper(CDraw2d* draw2d, bool deferCalls = false) - { - InitCommon(draw2d, deferCalls); - } - - void InitCommon(CDraw2d* draw2d, bool deferCalls) - { - m_draw2d = draw2d; - - if (!m_draw2d) - { - // Set to default which is the game's draw 2d object - m_draw2d = GetDefaultDraw2d(); - } - - if (m_draw2d) - { - m_previousDeferCalls = m_draw2d->GetDeferPrimitives(); - m_draw2d->SetDeferPrimitives(deferCalls); - m_imageOptions = m_draw2d->GetDefaultImageOptions(); - m_textOptions = m_draw2d->GetDefaultTextOptions(); - } - } - - //! End a section of 2D drawing function calls. - ~Draw2dHelper() - { - if (m_draw2d) - { - m_draw2d->SetDeferPrimitives(m_previousDeferCalls); - } - } - - //! Draw a textured quad, optional rotation is counter-clockwise in degrees. - // - //! See IDraw2d:DrawImage for parameter descriptions - void DrawImage(AZ::Data::Instance image, AZ::Vector2 position, AZ::Vector2 size, float opacity = 1.0f, - float rotation = 0.0f, const AZ::Vector2* pivotPoint = nullptr, const AZ::Vector2* minMaxTexCoords = nullptr) - { - if (m_draw2d) - { - m_draw2d->DrawImage(image, position, size, opacity, rotation, pivotPoint, minMaxTexCoords, &m_imageOptions); - } - } - - //! Draw a textured quad where the position specifies the point specified by the alignment. - // - //! See IDraw2d:DrawImageAligned for parameter descriptions - void DrawImageAligned(AZ::Data::Instance image, AZ::Vector2 position, AZ::Vector2 size, - IDraw2d::HAlign horizontalAlignment, IDraw2d::VAlign verticalAlignment, - float opacity = 1.0f, float rotation = 0.0f, const AZ::Vector2* minMaxTexCoords = nullptr) - { - if (m_draw2d) - { - m_draw2d->DrawImageAligned(image, position, size, horizontalAlignment, verticalAlignment, - opacity, rotation, minMaxTexCoords, &m_imageOptions); - } - } - - //! Draw a textured quad where the position, color and uv of each point is specified explicitly - // - //! See IDraw2d:DrawQuad for parameter descriptions - void DrawQuad(AZ::Data::Instance image, CDraw2d::VertexPosColUV* verts, - IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, - bool clamp = false, - const CDraw2d::RenderState& renderState = CDraw2d::RenderState{}) - { - if (m_draw2d) - { - m_draw2d->DrawQuad(image, verts, pixelRounding, clamp, renderState); - } - } - - //! Draw a line - // - //! See IDraw2d:DrawLine for parameter descriptions - void DrawLine(AZ::Vector2 start, AZ::Vector2 end, AZ::Color color, - IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, - const CDraw2d::RenderState& renderState = CDraw2d::RenderState{}) - { - if (m_draw2d) - { - m_draw2d->DrawLine(start, end, color, pixelRounding, renderState); - } - } - - //! Draw a line with a texture so it can be dotted or dashed - // - //! See IDraw2d:DrawLineTextured for parameter descriptions - void DrawLineTextured(AZ::Data::Instance image, CDraw2d::VertexPosColUV* verts, - IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, - const CDraw2d::RenderState& renderState = CDraw2d::RenderState{}) - { - if (m_draw2d) - { - m_draw2d->DrawLineTextured(image, verts, pixelRounding, renderState); - } - } - - //! Draw a rect outline with a texture - // - //! See IDraw2d:DrawRectOutlineTextured for parameter descriptions - void DrawRectOutlineTextured(AZ::Data::Instance image, - UiTransformInterface::RectPoints points, - AZ::Vector2 rightVec, - AZ::Vector2 downVec, - AZ::Color color, - uint32_t lineThickness = 0) - { - if (m_draw2d) - { - m_draw2d->DrawRectOutlineTextured(image, points, rightVec, downVec, color, lineThickness); - } - } - - //! Draw a text string. Only supports ASCII text. - // - //! See IDraw2d:DrawText for parameter descriptions - void DrawText(const char* textString, AZ::Vector2 position, float pointSize, float opacity = 1.0f) - { - if (m_draw2d) - { - m_draw2d->DrawText(textString, position, pointSize, opacity, &m_textOptions); - } - } - - //! Get the width and height (in pixels) that would be used to draw the given text string. - // - //! See IDraw2d:GetTextSize for parameter descriptions - AZ::Vector2 GetTextSize(const char* textString, float pointSize) - { - if (m_draw2d) - { - return m_draw2d->GetTextSize(textString, pointSize, &m_textOptions); - } - else - { - return AZ::Vector2(0, 0); - } - } - - // State management - - //! Set the blend mode used for images, default is GS_BLSRC_SRCALPHA|GS_BLDST_ONEMINUSSRCALPHA. - void SetImageBlendMode(const AZ::RHI::TargetBlendState& blendState) { m_imageOptions.m_renderState.m_blendState = blendState; } - - //! Set the color used for DrawImage and other image drawing. - void SetImageColor(AZ::Vector3 color) { m_imageOptions.color = color; } - - //! Set whether images are rounded to have the points on exact pixel boundaries. - void SetImagePixelRounding(IDraw2d::Rounding round) { m_imageOptions.pixelRounding = round; } - - //! Set the base state (that blend mode etc is combined with) used for images, default is GS_NODEPTHTEST. - void SetImageDepthState(const AZ::RHI::DepthState& depthState) { m_imageOptions.m_renderState.m_depthState = depthState; } - - //! Set image clamp mode - void SetImageClamp(bool clamp) { m_imageOptions.m_clamp = clamp; } - - //! Set the text font. - void SetTextFont(AZStd::string_view fontName) { m_textOptions.fontName = fontName; } - - //! Set the text font effect index. - void SetTextEffectIndex(unsigned int effectIndex) { m_textOptions.effectIndex = effectIndex; } - - //! Set the text color. - void SetTextColor(AZ::Vector3 color) { m_textOptions.color = color; } - - //! Set the text alignment. - void SetTextAlignment(IDraw2d::HAlign horizontalAlignment, IDraw2d::VAlign verticalAlignment) - { - m_textOptions.horizontalAlignment = horizontalAlignment; - m_textOptions.verticalAlignment = verticalAlignment; - } - - //! Set a drop shadow for text drawing. An alpha of zero disables drop shadow. - void SetTextDropShadow(AZ::Vector2 offset, AZ::Color color) - { - m_textOptions.dropShadowOffset = offset; - m_textOptions.dropShadowColor = color; - } - - //! Set a rotation for the text. The text rotates around its position (taking into account alignment). - void SetTextRotation(float rotation) - { - m_textOptions.rotation = rotation; - } - - //! Set wheter to enable depth test for the text - void SetTextDepthTestEnabled(bool enabled) - { - m_textOptions.depthTestEnabled = enabled; - } - -public: // static member functions - - //! Helper to get the default IDraw2d interface - static CDraw2d* GetDefaultDraw2d() - { - if (gEnv && gEnv->pLyShine) // [LYSHINE_ATOM_TODO][GHI #3569] Remove LyShine global interface pointer from legacy global environment - { - IDraw2d* draw2d = gEnv->pLyShine->GetDraw2d(); - return reinterpret_cast(draw2d); - } - - return nullptr; - } - - //! Round the X and Y coordinates of a point using the given rounding policy - template - static T RoundXY(T value, IDraw2d::Rounding roundingType) - { - T result = value; - - switch (roundingType) - { - case IDraw2d::Rounding::None: - // nothing to do - break; - case IDraw2d::Rounding::Nearest: - result.SetX(floor(value.GetX() + 0.5f)); - result.SetY(floor(value.GetY() + 0.5f)); - break; - case IDraw2d::Rounding::Down: - result.SetX(floor(value.GetX())); - result.SetY(floor(value.GetY())); - break; - case IDraw2d::Rounding::Up: - result.SetX(ceil(value.GetX())); - result.SetY(ceil(value.GetY())); - break; - } - - return result; - } - -protected: // attributes - - CDraw2d::ImageOptions m_imageOptions; //!< image options are stored locally and updated by member functions - CDraw2d::TextOptions m_textOptions; //!< text options are stored locally and updated by member functions - CDraw2d* m_draw2d; - bool m_previousDeferCalls; -}; diff --git a/Gems/LyShine/Code/Include/LyShine/IDraw2d.h b/Gems/LyShine/Code/Include/LyShine/IDraw2d.h index 3bfa3a1c14..620b8c23c9 100644 --- a/Gems/LyShine/Code/Include/LyShine/IDraw2d.h +++ b/Gems/LyShine/Code/Include/LyShine/IDraw2d.h @@ -11,6 +11,10 @@ #include #include #include +#include +#include +#include +#include //////////////////////////////////////////////////////////////////////////////////////////////////// //! Class for 2D drawing in screen space @@ -55,8 +59,461 @@ public: // types MAX_TEXT_STRING_LENGTH = 1024, }; + struct RenderState + { + RenderState() + { + m_blendState.m_enable = true; + m_blendState.m_blendSource = AZ::RHI::BlendFactor::AlphaSource; + m_blendState.m_blendDest = AZ::RHI::BlendFactor::AlphaSourceInverse; + + m_depthState.m_enable = false; + } + + AZ::RHI::TargetBlendState m_blendState; + AZ::RHI::DepthState m_depthState; + }; + + //! Struct used to pass additional image options. + // + //! If this is not passed then the defaults are used + struct ImageOptions + { + AZ::Vector3 color = AZ::Vector3(1.0f, 1.0f, 1.0f); + Rounding pixelRounding = Rounding::Nearest; + bool m_clamp = false; + RenderState m_renderState; + }; + + //! Struct used to pass additional text options - mostly ones that do not change from call to call. + // + //! If this is not passed then the defaults below are used + struct TextOptions + { + AZStd::string fontName; //!< default is "default" + unsigned int effectIndex; //!< default is 0 + AZ::Vector3 color; //!< default is (1,1,1) + HAlign horizontalAlignment; //!< default is HAlign::Left + VAlign verticalAlignment; //!< default is VAlign::Top + AZ::Vector2 dropShadowOffset; //!< default is (0,0), zero offset means no drop shadow is drawn + AZ::Color dropShadowColor; //!< default is (0,0,0,0), zero alpha means no drop shadow is drawn + float rotation; //!< default is 0 + bool depthTestEnabled; //!< default is false + }; + + //! Used to pass in arrays of vertices (e.g. to DrawQuad) + struct VertexPosColUV + { + VertexPosColUV() {} + VertexPosColUV(const AZ::Vector2& inPos, const AZ::Color& inColor, const AZ::Vector2& inUV) + { + position = inPos; + color = inColor; + uv = inUV; + } + + AZ::Vector2 position; //!< 2D position of vertex + AZ::Color color; //!< Float color + AZ::Vector2 uv; //!< Texture coordinate + }; + public: // member functions //! Implement virtual destructor just for safety. virtual ~IDraw2d() {} + + //! Draw a textured quad with the top left corner at the given position. + // + //! The image is drawn with the color specified by SetShapeColor and the opacity + //! passed as an argument. + //! If rotation is non-zero then the quad is rotated. If the pivot point is + //! provided then the points of the quad are rotated about that point, otherwise + //! they are rotated about the top left corner of the quad. + //! \param texId The texture ID returned by ITexture::GetTextureID() + //! \param position Position of the top left corner of the quad (before rotation) in pixels + //! \param size The width and height of the quad. Use texture width and height to avoid minification, + //! magnification or stretching (assuming the minMaxTexCoords are left to the default) + //! \param opacity The alpha value used when blending + //! \param rotation Angle of rotation in degrees counter-clockwise + //! \param pivotPoint The point about which the quad is rotated + //! \param minMaxTexCoords An optional two component array. The first component is the UV coord for the top left + //! point of the quad and the second is the UV coord of the bottom right point of the quad + //! \param imageOptions Optional struct specifying options that tend to be the same from call to call + virtual void DrawImage(AZ::Data::Instance image, AZ::Vector2 position, AZ::Vector2 size, float opacity = 1.0f, + float rotation = 0.0f, const AZ::Vector2* pivotPoint = nullptr, const AZ::Vector2* minMaxTexCoords = nullptr, + ImageOptions* imageOptions = nullptr) = 0; + + //! Draw a textured quad where the position specifies the point specified by the alignment. + // + //! Rotation is always around the position. + //! \param texId The texture ID returned by ITexture::GetTextureID() + //! \param position Position align point of the quad (before rotation) in pixels + //! \param size The width and height of the quad. Use texture width and height to avoid minification, + //! magnification or stretching (assuming the minMaxTexCoords are left to the default) + //! \param horizontalAlignment Specifies how the quad is horizontally aligned to the given position + //! \param verticalAlignment Specifies how the quad is vertically aligned to the given position + //! \param opacity The alpha value used when blending + //! \param rotation Angle of rotation in degrees counter-clockwise + //! \param minMaxTexCoords An optional two component array. The first component is the UV coord for the top left + //! point of the quad and the second is the UV coord of the bottom right point of the quad + //! \param imageOptions Optional struct specifying options that tend to be the same from call to call + virtual void DrawImageAligned(AZ::Data::Instance image, AZ::Vector2 position, AZ::Vector2 size, + HAlign horizontalAlignment, VAlign verticalAlignment, + float opacity = 1.0f, float rotation = 0.0f, const AZ::Vector2* minMaxTexCoords = nullptr, + ImageOptions* imageOptions = nullptr) = 0; + + //! Draw a textured quad where the position, color and uv of each point is specified explicitly + // + //! \param texId The texture ID returned by ITexture::GetTextureID() + //! \param verts An array of 4 vertices, in clockwise order (e.g. top left, top right, bottom right, bottom left) + //! \param pixelRounding Whether and how to round pixel coordinates + //! \param renderState Blend mode and depth state + virtual void DrawQuad(AZ::Data::Instance image, + VertexPosColUV* verts, + Rounding pixelRounding = Rounding::Nearest, + bool clamp = false, + const RenderState& renderState = RenderState{}) = 0; + + //! Draw a line + // + //! \param start The start position + //! \param end The end position + //! \param color The color of the line + //! \param pixelRounding Whether and how to round pixel coordinates + //! \param renderState Blend mode and depth state + virtual void DrawLine(AZ::Vector2 start, AZ::Vector2 end, AZ::Color color, + IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, + const RenderState& renderState = RenderState{}) = 0; + + //! Draw a line with a texture so it can be dotted or dashed + // + //! \param texId The texture ID returned by ITexture::GetTextureID() + //! \param verts An array of 2 vertices for the start and end points of the line + //! \param pixelRounding Whether and how to round pixel coordinates + //! \param renderState Blend mode and depth state + virtual void DrawLineTextured(AZ::Data::Instance image, + VertexPosColUV* verts, + IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, + const RenderState& renderState = RenderState{}) = 0; + //! Draw a text string. Only supports ASCII text. + // + //! The font and effect used to render the text are specified in the textOptions structure + //! \param textString A null terminated ASCII text string. May contain \n characters + //! \param position Position of the text in pixels. Alignment values in textOptions affect actual position + //! \param pointSize The size of the font to use + //! \param opacity The opacity (alpha value) to use to draw the text + //! \param textOptions Pointer to an options struct. If null the default options are used + virtual void DrawText(const char* textString, AZ::Vector2 position, float pointSize, + float opacity = 1.0f, TextOptions* textOptions = nullptr) = 0; + + //! Draw a rectangular outline with a texture + // + //! \param image The texture to be used for drawing the outline + //! \param points The rect's vertices (top left, top right, bottom right, bottom left) + //! \param rightVec Right vector. Specified because the rect's width/height could be 0 + //! \param downVec Down vector. Specified because the rect's width/height could be 0 + //! \param color The color of the outline + //! \param lineThickness The thickness in pixels of the outline. If 0, it will be based on image height + virtual void DrawRectOutlineTextured(AZ::Data::Instance image, + UiTransformInterface::RectPoints points, + AZ::Vector2 rightVec, + AZ::Vector2 downVec, + AZ::Color color, + uint32_t lineThickness = 0) = 0; + + //! Get the width and height (in pixels) that would be used to draw the given text string. + // + //! Pass the same parameter values that would be used to draw the string + virtual AZ::Vector2 GetTextSize(const char* textString, float pointSize, TextOptions* textOptions = nullptr) = 0; + + //! Get the width of the rendering viewport (in pixels). + virtual float GetViewportWidth() const = 0; + + //! Get the height of the rendering viewport (in pixels). + virtual float GetViewportHeight() const = 0; + + //! Get dpi scale factor + virtual float GetViewportDpiScalingFactor() const = 0; + + //! Get the default values that would be used if no image options were passed in + // + //! This is a convenient way to initialize the imageOptions struct + virtual const ImageOptions& GetDefaultImageOptions() const = 0; + + //! Get the default values that would be used if no text options were passed in + // + //! This is a convenient way to initialize the textOptions struct + virtual const TextOptions& GetDefaultTextOptions() const = 0; + + //! Render the primitives that have been deferred + virtual void RenderDeferredPrimitives() = 0; + + //! Specify whether to defer future primitives or render them right away + virtual void SetDeferPrimitives(bool deferPrimitives) = 0; + + //! Return whether future primitives will be deferred or rendered right away + virtual bool GetDeferPrimitives() = 0; + + //! Set sort key offset for following draws. + virtual void SetSortKey(int64_t key) = 0; +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////// +//! Helper class for using the IDraw2d interface +//! +//! The Draw2dHelper class is an inline wrapper that provides the convenience feature of +//! automatically setting member options structures to their defaults and providing set functions. +class Draw2dHelper +{ +public: // member functions + + //! Start a section of 2D drawing function calls that will render to the default viewport + Draw2dHelper(bool deferCalls = false) + { + InitCommon(nullptr, deferCalls); + } + + //! Start a section of 2D drawing function calls that will render to the viewport + //! associated with the specified Draw2d object + Draw2dHelper(IDraw2d* draw2d, bool deferCalls = false) + { + InitCommon(draw2d, deferCalls); + } + + void InitCommon(IDraw2d* draw2d, bool deferCalls) + { + m_draw2d = draw2d; + + if (!m_draw2d) + { + // Set to default which is the game's draw 2d object + m_draw2d = GetDefaultDraw2d(); + } + + if (m_draw2d) + { + m_previousDeferCalls = m_draw2d->GetDeferPrimitives(); + m_draw2d->SetDeferPrimitives(deferCalls); + m_imageOptions = m_draw2d->GetDefaultImageOptions(); + m_textOptions = m_draw2d->GetDefaultTextOptions(); + } + } + + //! End a section of 2D drawing function calls. + ~Draw2dHelper() + { + if (m_draw2d) + { + m_draw2d->SetDeferPrimitives(m_previousDeferCalls); + } + } + + //! Draw a textured quad, optional rotation is counter-clockwise in degrees. + // + //! See IDraw2d:DrawImage for parameter descriptions + void DrawImage(AZ::Data::Instance image, AZ::Vector2 position, AZ::Vector2 size, float opacity = 1.0f, + float rotation = 0.0f, const AZ::Vector2* pivotPoint = nullptr, const AZ::Vector2* minMaxTexCoords = nullptr) + { + if (m_draw2d) + { + m_draw2d->DrawImage(image, position, size, opacity, rotation, pivotPoint, minMaxTexCoords, &m_imageOptions); + } + } + + //! Draw a textured quad where the position specifies the point specified by the alignment. + // + //! See IDraw2d:DrawImageAligned for parameter descriptions + void DrawImageAligned(AZ::Data::Instance image, AZ::Vector2 position, AZ::Vector2 size, + IDraw2d::HAlign horizontalAlignment, IDraw2d::VAlign verticalAlignment, + float opacity = 1.0f, float rotation = 0.0f, const AZ::Vector2* minMaxTexCoords = nullptr) + { + if (m_draw2d) + { + m_draw2d->DrawImageAligned(image, position, size, horizontalAlignment, verticalAlignment, + opacity, rotation, minMaxTexCoords, &m_imageOptions); + } + } + + //! Draw a textured quad where the position, color and uv of each point is specified explicitly + // + //! See IDraw2d:DrawQuad for parameter descriptions + void DrawQuad(AZ::Data::Instance image, IDraw2d::VertexPosColUV* verts, + IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, + bool clamp = false, + const IDraw2d::RenderState& renderState = IDraw2d::RenderState{}) + { + if (m_draw2d) + { + m_draw2d->DrawQuad(image, verts, pixelRounding, clamp, renderState); + } + } + + //! Draw a line + // + //! See IDraw2d:DrawLine for parameter descriptions + void DrawLine(AZ::Vector2 start, AZ::Vector2 end, AZ::Color color, + IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, + const IDraw2d::RenderState& renderState = IDraw2d::RenderState{}) + { + if (m_draw2d) + { + m_draw2d->DrawLine(start, end, color, pixelRounding, renderState); + } + } + + //! Draw a line with a texture so it can be dotted or dashed + // + //! See IDraw2d:DrawLineTextured for parameter descriptions + void DrawLineTextured(AZ::Data::Instance image, IDraw2d::VertexPosColUV* verts, + IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, + const IDraw2d::RenderState& renderState = IDraw2d::RenderState{}) + { + if (m_draw2d) + { + m_draw2d->DrawLineTextured(image, verts, pixelRounding, renderState); + } + } + + //! Draw a rect outline with a texture + // + //! See IDraw2d:DrawRectOutlineTextured for parameter descriptions + void DrawRectOutlineTextured(AZ::Data::Instance image, + UiTransformInterface::RectPoints points, + AZ::Vector2 rightVec, + AZ::Vector2 downVec, + AZ::Color color, + uint32_t lineThickness = 0) + { + if (m_draw2d) + { + m_draw2d->DrawRectOutlineTextured(image, points, rightVec, downVec, color, lineThickness); + } + } + + //! Draw a text string. Only supports ASCII text. + // + //! See IDraw2d:DrawText for parameter descriptions + void DrawText(const char* textString, AZ::Vector2 position, float pointSize, float opacity = 1.0f) + { + if (m_draw2d) + { + m_draw2d->DrawText(textString, position, pointSize, opacity, &m_textOptions); + } + } + + //! Get the width and height (in pixels) that would be used to draw the given text string. + // + //! See IDraw2d:GetTextSize for parameter descriptions + AZ::Vector2 GetTextSize(const char* textString, float pointSize) + { + if (m_draw2d) + { + return m_draw2d->GetTextSize(textString, pointSize, &m_textOptions); + } + else + { + return AZ::Vector2(0, 0); + } + } + + // State management + + //! Set the blend mode used for images, default is GS_BLSRC_SRCALPHA|GS_BLDST_ONEMINUSSRCALPHA. + void SetImageBlendMode(const AZ::RHI::TargetBlendState& blendState) { m_imageOptions.m_renderState.m_blendState = blendState; } + + //! Set the color used for DrawImage and other image drawing. + void SetImageColor(AZ::Vector3 color) { m_imageOptions.color = color; } + + //! Set whether images are rounded to have the points on exact pixel boundaries. + void SetImagePixelRounding(IDraw2d::Rounding round) { m_imageOptions.pixelRounding = round; } + + //! Set the base state (that blend mode etc is combined with) used for images, default is GS_NODEPTHTEST. + void SetImageDepthState(const AZ::RHI::DepthState& depthState) { m_imageOptions.m_renderState.m_depthState = depthState; } + + //! Set image clamp mode + void SetImageClamp(bool clamp) { m_imageOptions.m_clamp = clamp; } + + //! Set the text font. + void SetTextFont(AZStd::string_view fontName) { m_textOptions.fontName = fontName; } + + //! Set the text font effect index. + void SetTextEffectIndex(unsigned int effectIndex) { m_textOptions.effectIndex = effectIndex; } + + //! Set the text color. + void SetTextColor(AZ::Vector3 color) { m_textOptions.color = color; } + + //! Set the text alignment. + void SetTextAlignment(IDraw2d::HAlign horizontalAlignment, IDraw2d::VAlign verticalAlignment) + { + m_textOptions.horizontalAlignment = horizontalAlignment; + m_textOptions.verticalAlignment = verticalAlignment; + } + + //! Set a drop shadow for text drawing. An alpha of zero disables drop shadow. + void SetTextDropShadow(AZ::Vector2 offset, AZ::Color color) + { + m_textOptions.dropShadowOffset = offset; + m_textOptions.dropShadowColor = color; + } + + //! Set a rotation for the text. The text rotates around its position (taking into account alignment). + void SetTextRotation(float rotation) + { + m_textOptions.rotation = rotation; + } + + //! Set wheter to enable depth test for the text + void SetTextDepthTestEnabled(bool enabled) + { + m_textOptions.depthTestEnabled = enabled; + } + +public: // static member functions + + //! Helper to get the default IDraw2d interface + static IDraw2d* GetDefaultDraw2d() + { + if (gEnv && gEnv->pLyShine) // [LYSHINE_ATOM_TODO][GHI #3569] Remove LyShine global interface pointer from legacy global environment + { + IDraw2d* draw2d = gEnv->pLyShine->GetDraw2d(); + return reinterpret_cast(draw2d); + } + + return nullptr; + } + + //! Round the X and Y coordinates of a point using the given rounding policy + template + static T RoundXY(T value, IDraw2d::Rounding roundingType) + { + T result = value; + + switch (roundingType) + { + case IDraw2d::Rounding::None: + // nothing to do + break; + case IDraw2d::Rounding::Nearest: + result.SetX(floor(value.GetX() + 0.5f)); + result.SetY(floor(value.GetY() + 0.5f)); + break; + case IDraw2d::Rounding::Down: + result.SetX(floor(value.GetX())); + result.SetY(floor(value.GetY())); + break; + case IDraw2d::Rounding::Up: + result.SetX(ceil(value.GetX())); + result.SetY(ceil(value.GetY())); + break; + } + + return result; + } + +protected: // attributes + + IDraw2d::ImageOptions m_imageOptions; //!< image options are stored locally and updated by member functions + IDraw2d::TextOptions m_textOptions; //!< text options are stored locally and updated by member functions + IDraw2d* m_draw2d; + bool m_previousDeferCalls; }; diff --git a/Gems/LyShine/Code/Source/LyShineDebug.cpp b/Gems/LyShine/Code/Source/LyShineDebug.cpp index 7762b1403b..bb57e70857 100644 --- a/Gems/LyShine/Code/Source/LyShineDebug.cpp +++ b/Gems/LyShine/Code/Source/LyShineDebug.cpp @@ -375,7 +375,7 @@ static void DebugDrawColoredBox(AZ::Vector2 pos, AZ::Vector2 size, AZ::Color col IDraw2d::HAlign horizontalAlignment = IDraw2d::HAlign::Left, IDraw2d::VAlign verticalAlignment = IDraw2d::VAlign::Top) { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); CDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); imageOptions.color = color.GetAsVector3(); @@ -390,7 +390,7 @@ static void DebugDrawColoredBox(AZ::Vector2 pos, AZ::Vector2 size, AZ::Color col static void DebugDrawStringWithSizeBox(AZStd::string_view font, unsigned int effectIndex, const char* sizeString, const char* testString, AZ::Vector2 pos, float spacing, float size) { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); CDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); if (!font.empty()) @@ -424,7 +424,7 @@ static void DebugDrawStringWithSizeBox(AZStd::string_view font, unsigned int eff #if !defined(_RELEASE) static void DebugDraw2dFontSizes(AZStd::string_view font, unsigned int effectIndex) { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); float xOffset = 20.0f; float yOffset = 20.0f; @@ -546,7 +546,7 @@ static void DebugDrawAlignedTextWithOriginBox(AZ::Vector2 pos, #if !defined(_RELEASE) static void DebugDraw2dFontAlignment() { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); float w = draw2d->GetViewportWidth(); float yPos = 20; @@ -613,7 +613,7 @@ static void DebugDraw2dFontAlignment() #if !defined(_RELEASE) static AZ::Vector2 DebugDrawFontColorTestBox(AZ::Vector2 pos, const char* string, AZ::Vector3 color, float opacity) { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); float pointSize = 32.0f; const float spacing = 6.0f; @@ -648,7 +648,7 @@ static AZ::Vector2 DebugDrawFontColorTestBox(AZ::Vector2 pos, const char* string #if !defined(_RELEASE) static void DebugDraw2dFontColorAndOpacity() { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); AZ::Vector2 size; AZ::Vector2 pos(20.0f, 20.0f); @@ -686,7 +686,7 @@ static void DebugDraw2dFontColorAndOpacity() #if !defined(_RELEASE) static void DebugDraw2dImageRotations() { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); AZ::Data::Instance texture = GetMonoTestTexture(); @@ -738,7 +738,7 @@ static void DebugDraw2dImageRotations() #if !defined(_RELEASE) static void DebugDraw2dImageColor() { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); AZ::Data::Instance texture = GetMonoAlphaTestTexture(); @@ -774,7 +774,7 @@ static void DebugDraw2dImageColor() #if !defined(_RELEASE) static void DebugDraw2dImageBlendMode() { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); auto whiteTexture = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::White); @@ -841,7 +841,7 @@ static void DebugDraw2dImageBlendMode() #if !defined(_RELEASE) static void DebugDraw2dImageUVs() { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); AZ::Data::Instance texture = GetColorTestTexture(); @@ -890,7 +890,7 @@ static void DebugDraw2dImageUVs() #if !defined(_RELEASE) static void DebugDraw2dImagePixelRounding() { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); AZ::Data::Instance texture = GetColorTestTexture(); @@ -931,7 +931,7 @@ static void DebugDraw2dImagePixelRounding() #if !defined(_RELEASE) static void DebugDraw2dLineBasic() { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); CDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); @@ -1422,7 +1422,7 @@ void LyShineDebug::RenderDebug() #if !defined(_RELEASE) #ifndef EXCLUDE_DOCUMENTATION_PURPOSE - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); if (!draw2d) { return; diff --git a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp index 78b9c71f8e..0a21f92119 100644 --- a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp +++ b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp @@ -2122,13 +2122,13 @@ void UiCanvasComponent::DebugReportDrawCalls(AZ::IO::HandleType fileHandle, LySh } //////////////////////////////////////////////////////////////////////////////////////////////////// -void UiCanvasComponent::DebugDisplayElemBounds(CDraw2d* draw2d) const +void UiCanvasComponent::DebugDisplayElemBounds(IDraw2d* draw2d) const { DebugDisplayChildElemBounds(draw2d, m_rootElement); } //////////////////////////////////////////////////////////////////////////////////////////////////// -void UiCanvasComponent::DebugDisplayChildElemBounds(CDraw2d* draw2d, const AZ::EntityId entity) const +void UiCanvasComponent::DebugDisplayChildElemBounds(IDraw2d* draw2d, const AZ::EntityId entity) const { AZ::u64 time = AZStd::GetTimeUTCMilliSecond(); uint32 fractionsOfOneSecond = time % 1000; diff --git a/Gems/LyShine/Code/Source/UiCanvasComponent.h b/Gems/LyShine/Code/Source/UiCanvasComponent.h index 79cb044af0..050773131f 100644 --- a/Gems/LyShine/Code/Source/UiCanvasComponent.h +++ b/Gems/LyShine/Code/Source/UiCanvasComponent.h @@ -292,8 +292,8 @@ public: // member functions void DebugReportDrawCalls(AZ::IO::HandleType fileHandle, LyShineDebug::DebugInfoDrawCallReport& reportInfo, void* context) const; - void DebugDisplayElemBounds(CDraw2d* draw2d) const; - void DebugDisplayChildElemBounds(CDraw2d* draw2d, const AZ::EntityId entity) const; + void DebugDisplayElemBounds(IDraw2d* draw2d) const; + void DebugDisplayChildElemBounds(IDraw2d* draw2d, const AZ::EntityId entity) const; #endif public: // static member functions diff --git a/Gems/LyShine/Code/Source/UiCanvasManager.cpp b/Gems/LyShine/Code/Source/UiCanvasManager.cpp index c6564f9b3a..70646246f0 100644 --- a/Gems/LyShine/Code/Source/UiCanvasManager.cpp +++ b/Gems/LyShine/Code/Source/UiCanvasManager.cpp @@ -997,7 +997,7 @@ void UiCanvasManager::DebugDisplayCanvasData(int setting) const { bool onlyShowEnabledCanvases = (setting == 2) ? true : false; - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); float dpiScale = draw2d->GetViewportDpiScalingFactor(); float xOffset = 20.0f * dpiScale; @@ -1152,7 +1152,7 @@ void UiCanvasManager::DebugDisplayCanvasData(int setting) const //////////////////////////////////////////////////////////////////////////////////////////////////// void UiCanvasManager::DebugDisplayDrawCallData() const { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); float dpiScale = draw2d->GetViewportDpiScalingFactor(); float xOffset = 20.0f * dpiScale; @@ -1486,7 +1486,7 @@ void UiCanvasManager::DebugReportDrawCalls(const AZStd::string& name) const //////////////////////////////////////////////////////////////////////////////////////////////////// void UiCanvasManager::DebugDisplayElemBounds(int canvasIndexFilter) const { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); int canvasIndex = 0; for (auto canvas : m_loadedCanvases) diff --git a/Gems/LyShine/Code/Source/UiRenderer.cpp b/Gems/LyShine/Code/Source/UiRenderer.cpp index 64ec1bb485..acf17049ad 100644 --- a/Gems/LyShine/Code/Source/UiRenderer.cpp +++ b/Gems/LyShine/Code/Source/UiRenderer.cpp @@ -414,7 +414,7 @@ void UiRenderer::DebugDisplayTextureData(int recordingOption) return lhs.second > rhs.second; }); - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); // setup to render lines of text for the debug display From 57e4fb9b393a9f37a6c31e4d65a87cff49de2aa7 Mon Sep 17 00:00:00 2001 From: moraaar Date: Mon, 10 Jan 2022 09:05:35 +0000 Subject: [PATCH 325/399] Fixed script canvas component asset not being found (#6727) Script canvas component has the member m_sourceData (that points to the script canvas asset) that internally has data, id and path. Path is serialized as the absolute path of the pc that is saving the level. So when another pc loads the same level it cannot find the script canvas asset. The function CompleteDescription takes a look at the id and takes the path from the asset catalog, but at the moment it's doing an early return because id and path are not empty (but path is the value serialized from other user saving the level). By removing the early return condition then it it will resolve by using id, looking into the catalog and getting the real path. This fix makes several physics automated tests that relied on script canvas to work. Signed-off-by: moraaar moraaar@amazon.com --- Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp index 2cd2dda89e..363f477fbf 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp @@ -33,11 +33,6 @@ namespace ScriptCanvasEditor { AZStd::optional CompleteDescription(const SourceHandle& source) { - if (source.IsDescriptionValid()) - { - return source; - } - AzToolsFramework::AssetSystemRequestBus::Events* assetSystem = AzToolsFramework::AssetSystemRequestBus::FindFirstHandler(); if (assetSystem) { From afc531d4c3ad1e7a413df68a7a22d7717a7b6a2a Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Mon, 10 Jan 2022 10:22:02 +0100 Subject: [PATCH 326/399] Fixes VS2022 error C5233: explicit lambda capture 'isSlash' is not used (#6745) Signed-off-by: Benjamin Jillich --- Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp index f802bdbada..993e7f2760 100644 --- a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp +++ b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp @@ -25,7 +25,7 @@ static bool IsSubfolder(const QString& folderA, const QString& folderB) using AZStd::begin; using AZStd::end; - constexpr auto isSlash = [](const QChar c) constexpr + auto isSlash = [](const QChar c) constexpr { return c == AZ::IO::WindowsPathSeparator || c == AZ::IO::PosixPathSeparator; }; From 7c88f20e1e6bf4b24ea6c0631cccc20867c024bb Mon Sep 17 00:00:00 2001 From: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> Date: Mon, 10 Jan 2022 11:49:22 +0000 Subject: [PATCH 327/399] Spinboxes now correct when rounding. (#6748) * Spinboxes now correct when rounding. Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> * Changes from PR Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> * Fixed tests after change to rounding in spinbox Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> --- .../Components/Widgets/SpinBox.cpp | 2 +- .../AzQtComponents/Tests/AzQtComponentTests.cpp | 16 ++++++++++++++++ .../AzQtComponents/Utilities/Conversions.cpp | 16 ++++++++++++---- .../AzQtComponents/Utilities/Conversions.h | 2 +- .../AzToolsFramework/Tests/SpinBoxTests.cpp | 8 ++++---- 5 files changed, 34 insertions(+), 10 deletions(-) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SpinBox.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SpinBox.cpp index 8ace8d0f40..e9f484ee11 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SpinBox.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SpinBox.cpp @@ -1460,7 +1460,7 @@ QString DoubleSpinBox::stringValue(double value, bool truncated) const numDecimals = 0; } - return toString(value, numDecimals, locale(), isGroupSeparatorShown()); + return toString(value, numDecimals, locale(), isGroupSeparatorShown(), true); } void DoubleSpinBox::updateToolTip(double value) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Tests/AzQtComponentTests.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Tests/AzQtComponentTests.cpp index 3c911c8acc..d87b238250 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Tests/AzQtComponentTests.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Tests/AzQtComponentTests.cpp @@ -9,6 +9,8 @@ #include #include #include +#include +#include // Environments subclass from AZ::Test::ITestEnvironment class AzQtComponentsTestEnvironment : public AZ::Test::ITestEnvironment @@ -34,3 +36,17 @@ protected: }; AZ_UNIT_TEST_HOOK(new AzQtComponentsTestEnvironment); + +TEST(AzQtComponents, ToStringReturnsTruncatedString) +{ + double testVal = 1.2399999; + QString result = AzQtComponents::toString(testVal, 3, QLocale(), false, false); + EXPECT_TRUE(result == "1.239"); +} + +TEST(AzQtComponents, ToStringReturnsRoundedString) +{ + double testVal = 1.2399999; + QString result = AzQtComponents::toString(testVal, 3, QLocale(), false, true); + EXPECT_TRUE(result == "1.24"); +} diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Utilities/Conversions.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Utilities/Conversions.cpp index bef41bb487..542bfaf7c8 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Utilities/Conversions.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Utilities/Conversions.cpp @@ -39,15 +39,23 @@ namespace AzQtComponents return AZ::Color(static_cast(rgb.redF()), static_cast(rgb.greenF()), static_cast(rgb.blueF()), static_cast(rgb.alphaF())); } - QString toString(double value, int numDecimals, const QLocale& locale, bool showGroupSeparator) + QString toString(double value, int numDecimals, const QLocale& locale, bool showGroupSeparator, bool round) { const QChar decimalPoint = locale.decimalPoint(); const QChar zeroDigit = locale.zeroDigit(); const int numToStringDecimals = AZStd::max(numDecimals, 20); + QString retValue; - // We want to truncate, not round. toString will round, so we add extra decimal places to the formatting - // so we can remove the last values - QString retValue = locale.toString(value, 'f', (numDecimals > 0) ? numToStringDecimals : 0); + // If we want to truncate, not round, we add extra decimal places to the formatting + // so we can remove the last values otherwise we allow rounding + if (round) + { + retValue = locale.toString(value, 'f', (numDecimals > 0) ? numDecimals : 0); + } + else + { + retValue = locale.toString(value, 'f', (numDecimals > 0) ? numToStringDecimals : 0); + } // Handle special cases when we have decimals in our value if (numDecimals > 0) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Utilities/Conversions.h b/Code/Framework/AzQtComponents/AzQtComponents/Utilities/Conversions.h index 84e874fc5a..29988545f7 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Utilities/Conversions.h +++ b/Code/Framework/AzQtComponents/AzQtComponents/Utilities/Conversions.h @@ -22,7 +22,7 @@ namespace AzQtComponents AZ_QT_COMPONENTS_API AZ::Color fromQColor(const QColor& color); - AZ_QT_COMPONENTS_API QString toString(double value, int numDecimals, const QLocale& locale, bool showGroupSeparator = false); + AZ_QT_COMPONENTS_API QString toString(double value, int numDecimals, const QLocale& locale, bool showGroupSeparator = false, bool round = false); // Maintained for backwards compile compatibility inline QColor ToQColor(const AZ::Color& color) diff --git a/Code/Framework/AzToolsFramework/Tests/SpinBoxTests.cpp b/Code/Framework/AzToolsFramework/Tests/SpinBoxTests.cpp index 2d524cbcf4..f885240fde 100644 --- a/Code/Framework/AzToolsFramework/Tests/SpinBoxTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/SpinBoxTests.cpp @@ -275,7 +275,7 @@ namespace UnitTest QString testString = "0" + QString(testLocale.decimalPoint()) + "9999999"; QString value = setupTruncationTest(testString); - testString = "0" + QString(testLocale.decimalPoint()) + "999"; + testString = "1" + QString(testLocale.decimalPoint()) + "0"; EXPECT_TRUE(value == testString); } @@ -295,19 +295,19 @@ namespace UnitTest QString testString = "0" + QString(testLocale.decimalPoint()) + "12395"; QString value = setupTruncationTest(testString); - testString = "0" + QString(testLocale.decimalPoint()) + "123"; + testString = "0" + QString(testLocale.decimalPoint()) + "124"; EXPECT_TRUE(value == testString); testString = "0" + QString(testLocale.decimalPoint()) + "94496"; value = setupTruncationTest(testString); - testString = "0" + QString(testLocale.decimalPoint()) + "944"; + testString = "0" + QString(testLocale.decimalPoint()) + "945"; EXPECT_TRUE(value == testString); testString = "0" + QString(testLocale.decimalPoint()) + "0009999"; value = setupTruncationTest(testString); - testString = "0" + QString(testLocale.decimalPoint()) + "0"; + testString = "0" + QString(testLocale.decimalPoint()) + "001"; EXPECT_TRUE(value == testString); } From 098005afbce28facfcaf23673d07b8ba343ab366 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Mon, 10 Jan 2022 10:03:31 -0600 Subject: [PATCH 328/399] AZStd::basic_string improvements (#6438) * AZStd::basic_string improvements The AZStd::basic_string class has a better implementation of the Short String Optimization, which increases the amount of characters that can be stored in a `basic_string` from 15 characters to 22 characters(not-including null-terminating characters). For a `basic_string` on Windows the amount of characters that can be stored increases from 7 to 10. Using `basic_string` on Unix platforms SSO character amount from 3 to 4 characters. An additional benefit is that the size of the AZStd::basic_string class has been reduced from 40 bytes to 32 bytes when using the AZStd::allocator. When using a stateless allocator with no non static data members such as AZStd::stateless_allocator, the size of the AZStd::basic_string is 24 bytes. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Corrected comments and updated type alias to usings for AZStd::basic_string Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Added Benchmarks for the basic_string and basic_fixed_string class The benchmarks currently measure the speed of the `assign` overloads. A benchmark has also been added to compare the speed swapping two `basic_string` instances by 3 memcpy vs 3 pointer swap operations Speed up string operation when in the iterator overload cases of the `assign`, `append`, `insert` and `replace` function. The code was always performing the logic to copy over a string that is overlapping, without actually checking if the string was overlapping in the first place. Added an `az_builtin_is_constant_evaluated` macro that allows use of the C++20 `std::is_constant_evaluated` feature to determine if an operation is being performed at compile time vs run time. That macro is being used to speed up the char_trait operations at run time, by using the faster standard library functions. For example char_traits::move now uses "memmove" at runtime, instead of a for loop. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Simplified string logic in AWSMetricsServiceApiTest. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/PlatformDef.h | 76 + .../AzCore/AzCore/std/allocator_stateless.cpp | 10 +- .../AzCore/AzCore/std/allocator_stateless.h | 6 +- .../AzCore/std/containers/compressed_pair.h | 17 +- .../AzCore/std/containers/compressed_pair.inl | 4 +- .../AzCore/AzCore/std/string/fixed_string.h | 20 - .../AzCore/AzCore/std/string/fixed_string.inl | 415 +++-- .../AzCore/AzCore/std/string/string.h | 1488 +++++++++-------- .../AzCore/AzCore/std/string/string_view.h | 154 +- .../VisualStudio/AzCore/Natvis/azcore.natvis | 53 +- Code/Framework/AzCore/Tests/AZStd/String.cpp | 914 ++++++---- .../AWSAttributionServiceApiTest.cpp | 9 +- .../Code/Tests/AWSMetricsServiceApiTest.cpp | 7 +- .../Code/Tests/AnimGraphEventTests.cpp | 2 +- .../Code/Tests/AnimGraphRefCountTests.cpp | 2 +- 15 files changed, 1860 insertions(+), 1317 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/PlatformDef.h b/Code/Framework/AzCore/AzCore/PlatformDef.h index 8d28d27959..7f00f7e90e 100644 --- a/Code/Framework/AzCore/AzCore/PlatformDef.h +++ b/Code/Framework/AzCore/AzCore/PlatformDef.h @@ -149,3 +149,79 @@ #if !defined(AZ_COMMAND_LINE_LEN) # define AZ_COMMAND_LINE_LEN 2048 #endif + +#include +#include +#include +#include +#include + +// First check if the feature if is_constant_evaluated is available via the feature test macro +// https://en.cppreference.com/w/User:D41D8CD98F/feature_testing_macros#C.2B.2B20 +#if __cpp_lib_is_constant_evaluated + #define az_builtin_is_constant_evaluated() std::is_constant_evaluated() +#endif + +// Next check if there is a __builtin_is_constant_evaluated that can be used +// This works on MSVC 19.28+ toolsets when using C++17, as well as +// clang 9.0.0+ when using C++17. +// Finally it works on gcc 9.0+ when using C++17 +#if !defined(az_builtin_is_constant_evaluated) + #if defined(__has_builtin) + #if __has_builtin(__builtin_is_constant_evaluated) + #define az_builtin_is_constant_evaluated() __builtin_is_constant_evaluated() + #define az_has_builtin_is_constant_evaluated() true + #endif + #elif AZ_COMPILER_MSVC >= 1928 + #define az_builtin_is_constant_evaluated() __builtin_is_constant_evaluated() + #define az_has_builtin_is_constant_evaluated() true + #elif AZ_COMPILER_GCC + #define az_builtin_is_constant_evaluated() __builtin_is_constant_evaluated() + #define az_has_builtin_is_constant_evaluated() true + #endif +#endif + +// In this case no support for the determining whether an operation is occuring +// at compile time is supported so assume that evaluation is always occuring at compile time +// in order to make sure the "safe" operation is being performed +#if !defined(az_builtin_is_constant_evaluated) + namespace AZ::Internal + { + constexpr bool builtin_is_constant_evaluated() + { + return true; + } + } + #define az_builtin_is_constant_evaluated() AZ::Internal::builtin_is_constant_evaluated() + #define az_has_builtin_is_constant_evaluated() false +#endif + +// define builtin functions used by char_traits class for efficient compile time and runtime +// operations +#if defined(__has_builtin) + #if __has_builtin(__builtin_memcpy) + #define az_has_builtin_memcpy true + #endif + #if __has_builtin(__builtin_wmemcpy) + #define az_has_builtin_wmemcpy true + #endif + #if __has_builtin(__builtin_memmove) + #define az_has_builtin_memmove true + #endif + #if __has_builtin(__builtin_wmemmove) + #define az_has_builtin_wmemmove true + #endif +#endif + +#if !defined(az_has_builtin_memcpy) + #define az_has_builtin_memcpy false +#endif +#if !defined(az_has_builtin_wmemcpy) + #define az_has_builtin_wmemcpy false +#endif +#if !defined(az_has_builtin_memmove) + #define az_has_builtin_memmove false +#endif +#if !defined(az_has_builtin_wmemmove) + #define az_has_builtin_wmemmove false +#endif diff --git a/Code/Framework/AzCore/AzCore/std/allocator_stateless.cpp b/Code/Framework/AzCore/AzCore/std/allocator_stateless.cpp index 5806cc485c..baf650a560 100644 --- a/Code/Framework/AzCore/AzCore/std/allocator_stateless.cpp +++ b/Code/Framework/AzCore/AzCore/std/allocator_stateless.cpp @@ -11,17 +11,17 @@ namespace AZStd { - stateless_allocator::stateless_allocator(const char* name) - : m_name(name) {} + stateless_allocator::stateless_allocator() = default; + stateless_allocator::stateless_allocator(const char*) + {} const char* stateless_allocator::get_name() const { - return m_name; + return "AZStd::stateless_allocator"; } - void stateless_allocator::set_name(const char* name) + void stateless_allocator::set_name(const char*) { - m_name = name; } auto stateless_allocator::allocate(size_type byteSize) -> pointer_type diff --git a/Code/Framework/AzCore/AzCore/std/allocator_stateless.h b/Code/Framework/AzCore/AzCore/std/allocator_stateless.h index b73c680c32..6b78aca53d 100644 --- a/Code/Framework/AzCore/AzCore/std/allocator_stateless.h +++ b/Code/Framework/AzCore/AzCore/std/allocator_stateless.h @@ -26,7 +26,8 @@ namespace AZStd using difference_type = ptrdiff_t; using allow_memory_leaks = AZStd::true_type; - stateless_allocator(const char* name = "AZStd::stateless_allocator"); + stateless_allocator(); + explicit stateless_allocator(const char*); // Stateless allocator does not store a name stateless_allocator(const stateless_allocator& rhs) = default; stateless_allocator& operator=(const stateless_allocator& rhs) = default; @@ -51,9 +52,6 @@ namespace AZStd bool is_lock_free(); bool is_stale_read_allowed(); bool is_delayed_recycling(); - - private: - const char* m_name; }; bool operator==(const stateless_allocator& left, const stateless_allocator& right); diff --git a/Code/Framework/AzCore/AzCore/std/containers/compressed_pair.h b/Code/Framework/AzCore/AzCore/std/containers/compressed_pair.h index 066ec7be5e..c79ddf11ee 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/compressed_pair.h +++ b/Code/Framework/AzCore/AzCore/std/containers/compressed_pair.h @@ -8,6 +8,7 @@ #pragma once #include +#include #include /* Microsoft C++ ABI puts 1 byte of padding between each empty base class when multiple inheritance is being used @@ -20,7 +21,7 @@ #if defined(AZ_COMPILER_MSVC) #define AZSTD_COMPRESSED_PAIR_EMPTY_BASE_OPTIMIZATION __declspec(empty_bases) #else -#define AZSTD_COMPRESSED_PAIR_EMPTY_BASE_OPTIMIZATION +#define AZSTD_COMPRESSED_PAIR_EMPTY_BASE_OPTIMIZATION #endif namespace AZStd @@ -97,16 +98,14 @@ namespace AZStd using second_base_value_type = typename second_base_type::value_type; public: - // First template argument is a placeholder argument of void as MSVC examines the types - // of a templated function to determine if they are the same template - // Due to the "template compressed_pair(skip_element_tag, T&&)" - // constructor below, the default constructor template types needs to be distinguished from it - template ::value - && AZStd::is_default_constructible::value>> + // First template argument is used to perform a substitution into AZStd::enable_if_t + // so that SFINAE can trigger + template + && AZStd::is_default_constructible_v, Unused>> constexpr compressed_pair(); - template , compressed_pair>::value, bool> = true> + template , compressed_pair>, bool> = true> constexpr explicit compressed_pair(T&& firstElement); template diff --git a/Code/Framework/AzCore/AzCore/std/containers/compressed_pair.inl b/Code/Framework/AzCore/AzCore/std/containers/compressed_pair.inl index 9fb5eb87fb..8e585a1467 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/compressed_pair.inl +++ b/Code/Framework/AzCore/AzCore/std/containers/compressed_pair.inl @@ -75,7 +75,7 @@ namespace AZStd } template - template , compressed_pair>::value, bool>> + template , compressed_pair>, bool>> inline constexpr compressed_pair::compressed_pair(T&& firstElement) : first_base_type{ AZStd::forward(firstElement) } , second_base_type{} @@ -117,7 +117,7 @@ namespace AZStd { return static_cast(*this).get(); } - + template inline constexpr auto compressed_pair::second() -> second_base_value_type& { diff --git a/Code/Framework/AzCore/AzCore/std/string/fixed_string.h b/Code/Framework/AzCore/AzCore/std/string/fixed_string.h index a8e0f96988..ea841bc4ca 100644 --- a/Code/Framework/AzCore/AzCore/std/string/fixed_string.h +++ b/Code/Framework/AzCore/AzCore/std/string/fixed_string.h @@ -343,26 +343,6 @@ namespace AZStd static decltype(auto) format(const wchar_t* format, ...); protected: - template - constexpr auto append_iter(InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v, basic_fixed_string&>; - - template - constexpr auto construct_iter(InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v>; - - template - constexpr auto assign_iter(InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v, basic_fixed_string&>; - - template - constexpr auto insert_iter(const_iterator insertPos, InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v, iterator>; - - template - constexpr auto replace_iter(const_iterator first, const_iterator last, InputIt first2, InputIt last2) - -> enable_if_t && !is_convertible_v, basic_fixed_string&>; - constexpr auto fits_in_capacity(size_type newSize) -> bool; inline static constexpr size_type Capacity = MaxElementCount; // current storage reserved for string not including null-terminator diff --git a/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl b/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl index 8b973d3b2c..15d2acf7a1 100644 --- a/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl +++ b/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl @@ -62,14 +62,7 @@ namespace AZStd template inline constexpr basic_fixed_string::basic_fixed_string(InputIt first, InputIt last) { // construct from [first, last) - if (first == last) - { - Traits::assign(m_buffer[0], Element()); // terminate - } - else - { - construct_iter(first, last); - } + assign(first, last); } // #7 @@ -98,8 +91,7 @@ namespace AZStd template inline constexpr basic_fixed_string::basic_fixed_string(const T& convertibleToView) { - AZStd::basic_string_view view = convertibleToView; - assign(view.begin(), view.end()); + assign(convertibleToView); } // #11 @@ -313,15 +305,7 @@ namespace AZStd if (count > 0 && fits_in_capacity(num)) { pointer data = m_buffer; - // make room and append new stuff using assign - if (count == 1) - { - Traits::assign(*(data + m_size), ch); - } - else - { - Traits::assign(data + m_size, count, ch); - } + Traits::assign(data + m_size, count, ch); m_size = static_cast(num); Traits::assign(data[num], Element()); // terminate } @@ -332,13 +316,47 @@ namespace AZStd template inline constexpr auto basic_fixed_string::append(InputIt first, InputIt last) -> enable_if_t && !is_convertible_v, basic_fixed_string&> - { // append [first, last) - return append_iter(first, last); + { + if constexpr (Internal::satisfies_contiguous_iterator_concept_v + && is_same_v::value_type, value_type>) + { + return append(AZStd::to_address(first), AZStd::distance(first, last)); + } + else if constexpr (Internal::is_forward_iterator_v) + { + // Input Iterator pointer type doesn't match the const_pointer type + // So the elements need to be appended one by one into the buffer + size_type newSize = m_size + AZStd::distance(first, last); + if (fits_in_capacity(newSize)) + { + for (size_t updateIndex = m_size; first != last; ++first, ++updateIndex) + { + Traits::assign(m_buffer[updateIndex], static_cast(*first)); + } + m_size = static_cast(newSize); + Traits::assign(m_buffer[newSize], Element()); // terminate + } + return *this; + } + else + { + // input iterator that aren't forward iterators can only be used in a single pass + // algorithm. Therefore AZStd::distance can't be used + // So the input is copied into a local string and then delegated + // to use the (const_pointer, size_type) overload + basic_fixed_string inputCopy; + for (; first != last; ++first) + { + inputCopy.push_back(static_cast(*first)); + } + + return append(inputCopy.c_str(), inputCopy.size()); + } } template inline constexpr auto basic_fixed_string::append(AZStd::initializer_list ilist) -> basic_fixed_string& - { // append [first, last) - return append_iter(ilist.begin(), ilist.end()); + { + return append(ilist.begin(), ilist.size()); } template @@ -420,18 +438,10 @@ namespace AZStd inline constexpr auto basic_fixed_string::assign(size_type count, Element ch) -> basic_fixed_string& { // assign count * ch - AZSTD_CONTAINER_ASSERT(count != npos, "result is too long!"); if (fits_in_capacity(count)) { // make room and assign new stuff pointer data = m_buffer; - if (count == 1) - { - Traits::assign(*(data), ch); - } - else - { - Traits::assign(data, count, ch); - } + Traits::assign(data, count, ch); m_size = static_cast(count); Traits::assign(data[count], Element()); // terminate } @@ -443,12 +453,46 @@ namespace AZStd inline constexpr auto basic_fixed_string::assign(InputIt first, InputIt last) -> enable_if_t && !is_convertible_v, basic_fixed_string&> { - return assign_iter(first, last); + if constexpr (Internal::satisfies_contiguous_iterator_concept_v + && is_same_v::value_type, value_type>) + { + return assign(AZStd::to_address(first), AZStd::distance(first, last)); + } + else if constexpr (Internal::is_forward_iterator_v) + { + // Input Iterator pointer type doesn't match the const_pointer type + // So the elements need to be assigned one by one into the buffer + size_type newSize = AZStd::distance(first, last); + if (fits_in_capacity(newSize)) + { + for (size_t updateIndex = 0; first != last; ++first, ++updateIndex) + { + Traits::assign(m_buffer[updateIndex], static_cast(*first)); + } + m_size = static_cast(newSize); + Traits::assign(m_buffer[newSize], Element()); // terminate + } + return *this; + } + else + { + // input iterator that aren't forward iterators can only be used in a single pass + // algorithm. Therefore AZStd::distance can't be used + // So the input is copied into a local string and then delegated + // to use the (const_pointer, size_type) overload + basic_fixed_string inputCopy; + for (; first != last; ++first) + { + inputCopy.push_back(static_cast(*first)); + } + + return assign(inputCopy.c_str(), inputCopy.size()); + } } template inline constexpr auto basic_fixed_string::assign(AZStd::initializer_list ilist) -> basic_fixed_string& { - return assign_iter(ilist.begin(), ilist.end()); + return assign(ilist.begin(), ilist.size()); } template @@ -536,14 +580,7 @@ namespace AZStd pointer data = m_buffer; // make room and insert new stuff Traits::copy_backward(data + offset + count, data + offset, m_size - offset); // empty out hole - if (count == 1) - { - Traits::assign(*(data + offset), ch); - } - else - { - Traits::assign(data + offset, count, ch); - } + Traits::assign(data + offset, count, ch); m_size = static_cast(num); Traits::assign(data[num], Element()); // terminate } @@ -582,14 +619,51 @@ namespace AZStd inline constexpr auto basic_fixed_string::insert(const_iterator insertPos, InputIt first, InputIt last)-> enable_if_t && !is_convertible_v, iterator> { // insert [_First, _Last) at _Where - return insert_iter(insertPos, first, last); + size_type insertOffset = AZStd::distance(cbegin(), insertPos); + if constexpr (Internal::satisfies_contiguous_iterator_concept_v + && is_same_v::value_type, value_type>) + { + insert(insertOffset, AZStd::to_address(first), AZStd::distance(first, last)); + } + else if constexpr (Internal::is_forward_iterator_v) + { + // Input Iterator pointer type doesn't match the const_pointer type + // So the elements need to be inserted one by one into the buffer + size_type count = AZStd::distance(first, last); + size_type newSize = m_size + count; + if (fits_in_capacity(newSize)) + { + Traits::copy_backward(m_buffer + insertOffset + count, m_buffer + insertOffset, m_size - insertOffset); // empty out hole + for (size_t updateIndex = insertOffset; first != last; ++first, ++updateIndex) + { + Traits::assign(m_buffer[updateIndex], static_cast(*first)); + } + m_size = static_cast(newSize); + Traits::assign(m_buffer[newSize], Element()); // terminate + } + } + else + { + // input iterator that aren't forward iterators can only be used in a single pass + // algorithm. Therefore AZStd::distance can't be used + // So the input is copied into a local string and then delegated + // to use the (const_pointer, size_type) overload + basic_fixed_string inputCopy; + for (; first != last; ++first) + { + inputCopy.push_back(static_cast(*first)); + } + + insert(insertOffset, inputCopy.c_str(), inputCopy.size()); + } + return begin() + insertOffset; } template inline constexpr auto basic_fixed_string::insert(const_iterator insertPos, AZStd::initializer_list ilist) -> iterator { // insert [_First, _Last) at _Where - return insert_iter(insertPos, ilist.begin(), ilist.end()); + return insert(insertPos, ilist.begin(), ilist.end()); } template @@ -604,7 +678,7 @@ namespace AZStd { // move elements down pointer data = m_buffer; - Traits::copy(data + offset, data + offset + count, m_size - offset - count); + Traits::move(data + offset, data + offset + count, m_size - offset - count); m_size = static_cast(m_size - count); Traits::assign(data[m_size], Element()); // terminate } @@ -643,7 +717,7 @@ namespace AZStd const basic_fixed_string& rhs) -> basic_fixed_string& { // replace [offset, offset + count) with rhs - return replace(offset, count, rhs, size_type(0), npos); + return replace(offset, count, rhs.c_str(), rhs.size()); } template @@ -651,56 +725,7 @@ namespace AZStd const basic_fixed_string& rhs, size_type rhsOffset, size_type rhsCount) -> basic_fixed_string& { // replace [offset, offset + count) with rhs [rhsOffset, rhsOffset + rhsCount) - AZSTD_CONTAINER_ASSERT(m_size >= offset && rhs.m_size >= rhsOffset, "Invalid offsets"); - if (m_size - offset < count) - { - count = m_size - offset; // trim count to size - } - size_type num = rhs.m_size - rhsOffset; - if (num < rhsCount) - { - rhsCount = num; // trim rhsCount to size - } - AZSTD_CONTAINER_ASSERT(npos - rhsCount > m_size - count, "Result is too long"); - - size_type nm = m_size - count - offset; // length of preserved tail - size_type newSize = m_size + rhsCount - count; - if (fits_in_capacity(newSize)) - { - pointer data = m_buffer; - const_pointer rhsData = rhs.m_buffer; - - if (this != &rhs) - { // no overlap, just move down and copy in new stuff - Traits::copy_backward(data + offset + rhsCount, data + offset + count, nm); // empty hole - Traits::copy(data + offset, rhsData + rhsOffset, rhsCount); // fill hole - } - else if (rhsCount <= count) - { // hole doesn't get larger, just copy in substring - Traits::copy(data + offset, data + rhsOffset, rhsCount); // fill hole - Traits::copy_backward(data + offset + rhsCount, data + offset + count, nm); // move tail down - } - else if (rhsOffset <= offset) - { // hole gets larger, substring begins before hole - Traits::copy_backward(data + offset + rhsCount, data + offset + count, nm); // move tail down - Traits::copy(data + offset, data + rhsOffset, rhsCount); // fill hole - } - else if (offset + count <= rhsOffset) - { // hole gets larger, substring begins after hole - Traits::copy_backward(data + offset + rhsCount, data + offset + count, nm); // move tail down - Traits::copy(data + offset, data + (rhsOffset + rhsCount - count), rhsCount); // fill hole - } - else - { // hole gets larger, substring begins in hole - Traits::copy(data + offset, data + rhsOffset, count); // fill old hole - Traits::copy_backward(data + offset + rhsCount, data + offset + count, nm); // move tail down - Traits::copy(data + offset + count, data + rhsOffset + rhsCount, rhsCount - count); // fill rest of new hole - } - - m_size = static_cast(newSize); - Traits::assign(data[newSize], Element()); // terminate - } - return *this; + return replace(offset, count, rhs.c_str() + rhsOffset, AZStd::min(rhsCount, rhs.size() - rhsOffset)); } template template @@ -720,35 +745,83 @@ namespace AZStd pointer data = m_buffer; // replace [offset, offset + count) with [ptr, ptr + ptrCount) AZSTD_CONTAINER_ASSERT(m_size >= offset, "Invalid offset"); - if (m_size - offset < count) - { - count = m_size - offset; // trim _N0 to size - } - AZSTD_CONTAINER_ASSERT(npos - ptrCount > m_size - count, "Result too long"); + // Make sure count is within is no larger than the distance from the offset + // to the end of this string + count = AZStd::min(count, m_size - offset); - size_type nm = m_size - count - offset; - if (ptrCount < count) - { - Traits::copy(data + offset + ptrCount, data + offset + count, nm); // smaller hole, move tail up - } - size_type num = m_size + ptrCount - count; - if ((0 != ptrCount || 0 != count) && fits_in_capacity(num)) + size_type newSize = m_size + ptrCount - count; + if (fits_in_capacity(newSize)) { - data = m_buffer; - // make room and rearrange - if (count < ptrCount) + // The code assumes that compile time evaluation will not need to deal with overlapping input + size_type charsAfterCountToMove = m_size - count - offset; + if (az_builtin_is_constant_evaluated() || !((ptr >= data + offset && ptr < data + offset + count) + || (ptr + ptrCount > data + offset && ptr + ptrCount <= data + offset + count))) { - Traits::copy_backward(data + offset + ptrCount, data + offset + count, nm); // move tail down + // Ex1. this = "ABCDEFG", offset = 1, count = 4 + // Input string is "CDE" + // First the text post offset + count is moved to right after the input string will be copied + // "ABCDFG" + // ^^^ + // Next the input string is copied into the buffer + // "ACDEFG" + // + // Ex2. this = "ABCDEFG", offset = 1, count = 2 + // Input string is "CDE" + // Performing the same two steps above, the string transform as follows + // "ABCDEFG" -> "ABCDDEFG" -> "ACDEDEFG" + // ^^^ + if (count != ptrCount) + { + Traits::move(data + offset + ptrCount, data + offset + count, charsAfterCountToMove); + } + if (ptrCount > 0) + { + // Copy bytes up to the minimum of this string count and input string count + Traits::copy(data + offset, ptr, ptrCount); + } } - - if (ptrCount > 0) + else { - Traits::copy(data + offset, ptr, ptrCount); // fill hole + // Overlap checks for fixed_string only needs to check between this string + // [offset, offset + count) due to fixed_string never moving memory + // + // Ex. this = "ABCDEFG", offset = 1, count=4 + // substring is "CDE" + // The text from offset 1 for 4 chars "BCDE": should be replaced with "CDE" + // making a whole for the bytes results in output = "ABCDFG" + // Afterwards output = "ACDEFG" + // The input string overlaps with this string in this case + // So the string is copied piecewise + if (ptrCount <= count) + { // hole doesn't get larger, just copy in substring + Traits::move(data + offset, ptr, ptrCount); // fill hole + Traits::copy(data + offset + ptrCount, data + offset + count, charsAfterCountToMove); // move tail down + } + else + { + if (ptr <= data + offset) + { // hole gets larger, substring begins before hole + Traits::copy_backward(data + offset + ptrCount, data + offset + count, charsAfterCountToMove); // move tail down + Traits::copy(data + offset, ptr, ptrCount); // fill hole + } + else if (data + offset + count <= ptr) + { // hole gets larger, substring begins after hole + Traits::copy_backward(data + offset + ptrCount, data + offset + count, charsAfterCountToMove); // move tail down + Traits::copy(data + offset, ptr + (ptrCount - count), ptrCount); // fill hole + } + else + { // hole gets larger, substring begins in hole + Traits::copy(data + offset, ptr, count); // fill old hole + Traits::copy_backward(data + offset + ptrCount, data + offset + count, charsAfterCountToMove); // move tail down + Traits::copy(data + offset + count, ptr + ptrCount, ptrCount - count); // fill rest of new hole + } + } } - - m_size = static_cast(num); - Traits::assign(data[num], Element()); // terminate } + + m_size = static_cast(newSize); + Traits::assign(data[newSize], Element()); // terminate + return *this; } @@ -793,14 +866,7 @@ namespace AZStd { Traits::copy_backward(data + offset + num, data + offset + count, nm); // move tail down } - if (count == 1) - { - Traits::assign(*(data + offset), ch); - } - else - { - Traits::assign(data + offset, num, ch); - } + Traits::assign(data + offset, num, ch); m_size = static_cast(numToGrow); Traits::assign(data[numToGrow], Element()); // terminate } @@ -851,15 +917,54 @@ namespace AZStd template template inline constexpr auto basic_fixed_string::replace(const_iterator first, const_iterator last, - InputIt first2, InputIt last2) -> enable_if_t && !is_convertible_v, basic_fixed_string&> - { // replace [first, last) with [first2,last2) - return replace_iter(first, last, first2, last2); + InputIt replaceFirst, InputIt replaceLast) -> enable_if_t && !is_convertible_v, basic_fixed_string&> + { // replace [first, last) with [replaceFirst,replaceLast) + if constexpr (Internal::satisfies_contiguous_iterator_concept_v + && is_same_v::value_type, value_type>) + { + return replace(first, last, AZStd::to_address(replaceFirst), AZStd::distance(replaceFirst, replaceLast)); + } + else if constexpr (Internal::is_forward_iterator_v) + { + // Input Iterator pointer type doesn't match the const_pointer type + // So the elements need to be appended one by one into the buffer + + size_type insertOffset = AZStd::distance(cbegin(), first); + size_type postInsertOffset = AZStd::distance(cbegin(), last); + size_type count = AZStd::distance(replaceFirst, replaceLast); + size_type newSize = m_size + count - AZStd::distance(first, last); + if (fits_in_capacity(newSize)) + { + Traits::move(first + count, last, m_size - postInsertOffset); // empty out hole + for (size_t updateIndex = insertOffset; replaceFirst != replaceLast; ++replaceFirst, ++updateIndex) + { + Traits::assign(m_buffer[updateIndex], static_cast(*replaceFirst)); + } + m_size = static_cast(newSize); + Traits::assign(m_buffer[newSize], Element()); // terminate + } + return *this; + } + else + { + // input iterator that aren't forward iterators can only be used in a single pass + // algorithm. Therefore AZStd::distance can't be used + // So the input is copied into a local string and then delegated + // to use the (const_pointer, size_type) overload + basic_fixed_string inputCopy; + for (; replaceFirst != replaceLast; ++replaceFirst) + { + inputCopy.push_back(static_cast(*replaceFirst)); + } + + return replace(first, last, inputCopy.c_str(), inputCopy.size()); + } } template inline constexpr auto basic_fixed_string::replace(const_iterator first, const_iterator last, AZStd::initializer_list ilist) -> basic_fixed_string& - { // replace [first, last) with [first2,last2) - return replace_iter(first, last, ilist.begin(), ilist.end()); + { + return replace(first, last, ilist.begin(), ilist.end()); } template @@ -1411,54 +1516,6 @@ namespace AZStd return result; } - template - template - inline constexpr auto basic_fixed_string::construct_iter(InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v> - { - // initialize from [first, last), input iterators - for (; first != last; ++first) - { - append((size_type)1, (Element)* first); - } - } - - template - template - inline constexpr auto basic_fixed_string::append_iter(InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v, basic_fixed_string&> - { // append [first, last), input iterators - return replace(end(), end(), first, last); - } - - template - template - inline constexpr auto basic_fixed_string::assign_iter(InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v, basic_fixed_string&> - { - return replace(begin(), end(), first, last); - } - - template - template - inline constexpr auto basic_fixed_string::insert_iter(const_iterator insertPos, InputIt first, - InputIt last) -> enable_if_t && !is_convertible_v, iterator> - { // insert [first, last) at insertPos, input iterators - difference_type offset = insertPos - cbegin(); - replace(insertPos, insertPos, first, last); - return iterator(m_buffer + offset); - } - - template - template - inline constexpr auto basic_fixed_string::replace_iter(const_iterator first, const_iterator last, - InputIt first2, InputIt last2) -> enable_if_t && !is_convertible_v, basic_fixed_string&> - { // replace [first, last) with [first2, last2), input iterators - basic_fixed_string rhs(first2, last2); - replace(first, last, rhs); - return *this; - } - template inline constexpr auto basic_fixed_string::fits_in_capacity(size_type newSize)-> bool { diff --git a/Code/Framework/AzCore/AzCore/std/string/string.h b/Code/Framework/AzCore/AzCore/std/string/string.h index e107c4657d..7dd6dd7065 100644 --- a/Code/Framework/AzCore/AzCore/std/string/string.h +++ b/Code/Framework/AzCore/AzCore/std/string/string.h @@ -5,24 +5,43 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef AZSTD_STRING_H -#define AZSTD_STRING_H +#pragma once #include #include #include #include +#include #include #include #include #include #include -#include #include #include +namespace AZStd::StringInternal +{ + template + struct Padding + { + AZ::u8 m_padding[ElementSize - 1]; + }; + + template + struct Padding + {}; +} + +#if defined(HAVE_BENCHMARK) +namespace Benchmark +{ + class StringBenchmarkFixture; +} +#endif + namespace AZStd { /** @@ -35,130 +54,95 @@ namespace AZStd : public Debug::checked_container_base #endif { - typedef basic_string this_type; + using this_type = basic_string; public: - typedef Element* pointer; - typedef const Element* const_pointer; + using pointer = Element*; + using const_pointer = const Element*; - typedef Element& reference; - typedef const Element& const_reference; - typedef typename Allocator::difference_type difference_type; - typedef typename Allocator::size_type size_type; + using reference = Element&; + using const_reference = const Element&; + using difference_type = typename Allocator::difference_type; + using size_type = typename Allocator::size_type; - typedef pointer iterator_impl; - typedef const_pointer const_iterator_impl; + using iterator_impl = pointer; + using const_iterator_impl = const_pointer; #ifdef AZSTD_HAS_CHECKED_ITERATORS - typedef Debug::checked_randomaccess_iterator iterator; - typedef Debug::checked_randomaccess_iterator const_iterator; + using iterator = Debug::checked_randomaccess_iterator; + using const_iterator = Debug::checked_randomaccess_iterator; #else - typedef iterator_impl iterator; - typedef const_iterator_impl const_iterator; + using iterator = iterator_impl; + using const_iterator = const_iterator_impl; #endif - typedef AZStd::reverse_iterator reverse_iterator; - typedef AZStd::reverse_iterator const_reverse_iterator; - typedef Element value_type; - typedef Traits traits_type; - typedef Allocator allocator_type; + using reverse_iterator = AZStd::reverse_iterator; + using const_reverse_iterator = AZStd::reverse_iterator; + using value_type = Element; + using traits_type = Traits; + using allocator_type = Allocator; // AZSTD extension. /** * \brief Allocation node type. Common for all AZStd containers. * In vectors case we allocate always "sizeof(node_type)*capacity" block. */ - typedef value_type node_type; + using node_type = value_type; - static const size_type npos = size_type(-1); + inline static constexpr size_type npos = size_type(-1); inline basic_string(const Allocator& alloc = Allocator()) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) - , m_allocator(alloc) + : m_storage{ skip_element_tag{}, alloc } { - Traits::assign(m_buffer[0], Element()); + Traits::assign(m_storage.first().GetData()[0], Element()); } inline basic_string(const_pointer ptr, size_type count, const Allocator& alloc = Allocator()) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) - , m_allocator(alloc) + : m_storage{ skip_element_tag{}, alloc } { // construct from [ptr, ptr + count) assign(ptr, count); } inline basic_string(const_pointer ptr, const Allocator& alloc = Allocator()) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) - , m_allocator(alloc) + : m_storage{ skip_element_tag{}, alloc } { // construct from [ptr, ) assign(ptr); } inline basic_string(size_type count, Element ch, const Allocator& alloc = Allocator()) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) - , m_allocator(alloc) + : m_storage{ skip_element_tag{}, alloc } { // construct from count * ch assign(count, ch); } - template - inline basic_string(InputIterator first, InputIterator last, const Allocator& alloc = Allocator()) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) - , m_allocator(alloc) + template && !is_convertible_v>> + inline basic_string(InputIt first, InputIt last, const Allocator& alloc = Allocator()) + : m_storage{ skip_element_tag{}, alloc } { // construct from [first, last) - if (first == last) - { - Traits::assign(m_buffer[0], Element()); // terminate - } - else - { - construct_iter(first, last, is_integral()); - } + assign(first, last); } inline basic_string(const_pointer first, const_pointer last) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) { // construct from [first, last), const pointers - assign(&*first, last - first); + assign(first, last - first); } - //inline basic_string(const_iterator _First, const_iterator _Last) - // : m_size(0) - // , m_capacity(SSO_BUF_SIZE-1) - //{ // construct from [_First, _Last), const_iterators - // if (first != last) - // assign(&*first, last - first); - //} - inline basic_string(const this_type& rhs) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) - , m_allocator(rhs.m_allocator) + : m_storage{ skip_element_tag{}, rhs.m_storage.second() } { assign(rhs, 0, npos); } inline basic_string(this_type&& rhs) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) - , m_allocator(AZStd::move(rhs.m_allocator)) + : m_storage{ skip_element_tag{}, AZStd::move(rhs.m_storage.second()) } { assign(AZStd::forward(rhs)); } inline basic_string(const this_type& rhs, size_type rhsOffset, size_type count = npos) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) { // construct from rhs [rhsOffset, rhsOffset + count) assign(rhs, rhsOffset, count); } inline basic_string(const this_type& rhs, size_type rhsOffset, size_type count, const Allocator& alloc) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) - , m_allocator(alloc) + : m_storage{ skip_element_tag{}, alloc } { // construct from rhs [rhsOffset, rhsOffset + count) with allocator assign(rhs, rhsOffset, count); } @@ -174,7 +158,7 @@ namespace AZStd inline ~basic_string() { // destroy the string - deallocate_memory(m_data, 0, typename allocator_type::allow_memory_leaks()); + deallocate_memory(m_storage.first().GetData(), 0, typename allocator_type::allow_memory_leaks()); } operator AZStd::basic_string_view() const @@ -182,12 +166,12 @@ namespace AZStd return AZStd::basic_string_view(data(), size()); } - inline iterator begin() { return iterator(AZSTD_CHECKED_ITERATOR(iterator_impl, SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer)); } - inline const_iterator begin() const { return const_iterator(AZSTD_CHECKED_ITERATOR(const_iterator_impl, SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer)); } - inline const_iterator cbegin() const { return const_iterator(AZSTD_CHECKED_ITERATOR(const_iterator_impl, SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer)); } - inline iterator end() { return iterator(AZSTD_CHECKED_ITERATOR(iterator_impl, (SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer) + m_size)); } - inline const_iterator end() const { return const_iterator(AZSTD_CHECKED_ITERATOR(const_iterator_impl, (SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer) + m_size)); } - inline const_iterator cend() const { return const_iterator(AZSTD_CHECKED_ITERATOR(const_iterator_impl, (SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer) + m_size)); } + inline iterator begin() { return iterator(AZSTD_CHECKED_ITERATOR(iterator_impl, m_storage.first().GetData())); } + inline const_iterator begin() const { return const_iterator(AZSTD_CHECKED_ITERATOR(const_iterator_impl, m_storage.first().GetData())); } + inline const_iterator cbegin() const { return const_iterator(AZSTD_CHECKED_ITERATOR(const_iterator_impl, m_storage.first().GetData())); } + inline iterator end() { return iterator(AZSTD_CHECKED_ITERATOR(iterator_impl, (m_storage.first().GetData()) + m_storage.first().GetSize())); } + inline const_iterator end() const { return const_iterator(AZSTD_CHECKED_ITERATOR(const_iterator_impl, (m_storage.first().GetData()) + m_storage.first().GetSize())); } + inline const_iterator cend() const { return const_iterator(AZSTD_CHECKED_ITERATOR(const_iterator_impl, (m_storage.first().GetData()) + m_storage.first().GetSize())); } inline reverse_iterator rbegin() { return reverse_iterator(end()); } inline const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); } inline const_reverse_iterator crbegin() const { return const_reverse_iterator(end()); } @@ -196,7 +180,7 @@ namespace AZStd inline const_reverse_iterator crend() const { return const_reverse_iterator(begin()); } inline this_type& operator=(const this_type& rhs) { return assign(rhs); } - inline this_type& operator=(this_type&& rhs) { return assign(AZStd::forward(rhs)); } + inline this_type& operator=(this_type&& rhs) { return assign(AZStd::move(rhs)); } inline this_type& operator=(AZStd::basic_string_view view) { return assign(view); } inline this_type& operator=(const_pointer ptr) { return assign(ptr); } inline this_type& operator=(Element ch) { return assign(1, ch); } @@ -208,21 +192,18 @@ namespace AZStd this_type& append(const this_type& rhs, size_type rhsOffset, size_type count) { // append rhs [rhsOffset, rhsOffset + count) AZSTD_CONTAINER_ASSERT(rhs.size() >= rhsOffset, "Invalid offset!"); - size_type num = rhs.m_size - rhsOffset; - if (num < count) - { - count = num; // trim count to size - } - AZSTD_CONTAINER_ASSERT(npos - m_size > count && m_size + count >= m_size, "result is too long!"); - num = m_size + count; - if (count > 0 && grow(num)) + count = AZStd::min(count, rhs.size() - rhsOffset); + + size_type oldSize = size(); + size_type newSize = oldSize + count; + if (count > 0 && grow(newSize)) { - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; + pointer data = m_storage.first().GetData(); + const_pointer rhsData = rhs.data(); // make room and append new stuff - Traits::copy(data + m_size /*, m_capacity - m_size*/, rhsData + rhsOffset, count); - m_size = num; - Traits::assign(data[num], Element()); // terminate + Traits::copy(data + oldSize, rhsData + rhsOffset, count); + m_storage.first().SetSize(newSize); + Traits::assign(data[newSize], Element()); // terminate } return *this; } @@ -230,20 +211,21 @@ namespace AZStd this_type& append(const_pointer ptr, size_type count) { // append [ptr, ptr + count) - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - if (ptr != 0 && ptr >= data && (data + m_size) > ptr) + pointer data = m_storage.first().GetData(); + if (ptr != nullptr && ptr >= data && (data + size()) > ptr) { return append(*this, ptr - data, count); // substring } - AZSTD_CONTAINER_ASSERT(npos - m_size > count && m_size + count >= m_size, "result is too long!"); - size_type num = m_size + count; - if (count > 0 && grow(num)) + AZSTD_CONTAINER_ASSERT(npos - size() > count && size() + count >= size(), "result is too long!"); + size_type oldSize = size(); + size_type newSize = oldSize + count; + if (count > 0 && grow(newSize)) { // make room and append new stuff - data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - Traits::copy(data + m_size /*, m_capacity - m_size*/, ptr, count); - m_size = num; - Traits::assign(data[num], Element()); // terminate + data = m_storage.first().GetData(); + Traits::copy(data + oldSize , ptr, count); + m_storage.first().SetSize(newSize); + Traits::assign(data[newSize], Element()); // terminate } return *this; } @@ -252,30 +234,60 @@ namespace AZStd this_type& append(size_type count, Element ch) { // append count * ch - AZSTD_CONTAINER_ASSERT(npos - m_size > count, "result is too long"); - size_type num = m_size + count; + AZSTD_CONTAINER_ASSERT(npos - size() > count, "result is too long"); + size_type num = size() + count; if (count > 0 && grow(num)) { - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); // make room and append new stuff using assign - if (count == 1) - { - Traits::assign(*(data + m_size), ch); - } - else - { - Traits::assign(data + m_size, count, ch); - } - m_size = num; + Traits::assign(data + size(), count, ch); + m_storage.first().SetSize(num); Traits::assign(data[num], Element()); // terminate } return *this; } - template - inline this_type& append(InputIterator first, InputIterator last) + template + inline auto append(InputIt first, InputIt last) + -> enable_if_t && !is_convertible_v, this_type&> { // append [first, last) - return append_iter(first, last, AZStd::is_integral()); + if constexpr (Internal::satisfies_contiguous_iterator_concept_v + && is_same_v::value_type, value_type>) + { + return append(AZStd::to_address(first), AZStd::distance(first, last)); + } + else if constexpr (Internal::is_forward_iterator_v) + { + // Input Iterator pointer type doesn't match the const_pointer type + // So the elements need to be appended one by one into the buffer + size_type oldSize = size(); + size_type newSize = oldSize + AZStd::distance(first, last); + if (grow(newSize)) + { + pointer buffer = data(); + for (size_t updateIndex = oldSize; first != last; ++first, ++updateIndex) + { + Traits::assign(buffer[updateIndex], static_cast(*first)); + } + m_storage.first().SetSize(newSize); + Traits::assign(buffer[newSize], Element()); // terminate + } + return *this; + } + else + { + // input iterator that aren't forward iterators can only be used in a single pass + // algorithm. Therefore AZStd::distance can't be used + // So the input is copied into a local string and then delegated + // to use the (const_pointer, size_type) overload + basic_string inputCopy; + for (; first != last; ++first) + { + inputCopy.push_back(static_cast(*first)); + } + + return append(inputCopy.c_str(), inputCopy.size()); + } } inline this_type& append(const_pointer first, const_pointer last) @@ -283,11 +295,6 @@ namespace AZStd return replace(end(), end(), first, last); } - //inline this_type& append(const_iterator first, const_iterator last) - //{ // append [first, last), const_iterators - // return replace(end(), end(), first, last); - //} - inline this_type& assign(const this_type& rhs) { return assign(rhs, 0, npos); @@ -302,27 +309,34 @@ namespace AZStd { if (this != &rhs) { - if (SSO_BUF_SIZE <= m_capacity) + deallocate_memory(m_storage.first().GetData(), 0, typename allocator_type::allow_memory_leaks()); + + m_storage.first().SetCapacity(rhs.capacity()); + + pointer data = m_storage.first().GetData(); + pointer rhsData = rhs.data(); + // Memmove the right hand side string data if it is using the short string optimization + // Otherwise set the pointer to the right hand side + if (rhs.m_storage.first().ShortStringOptimizationActive()) { - deallocate_memory(m_data, 0, typename allocator_type::allow_memory_leaks()); + Traits::move(data, rhsData, rhs.size() + 1); // string + null-terminator } + else + { + m_storage.first().SetData(rhsData); + } + m_storage.first().SetSize(rhs.size()); + m_storage.second() = rhs.m_storage.second(); - Traits::move(m_buffer, rhs.m_buffer, sizeof(m_buffer)); - m_size = rhs.m_size; - m_capacity = rhs.m_capacity; - m_allocator = rhs.m_allocator; - - rhs.m_data = nullptr; - rhs.m_size = 0; - rhs.m_capacity = SSO_BUF_SIZE - 1; + rhs.leak_and_reset(); } return *this; } this_type& assign(const this_type& rhs, size_type rhsOffset, size_type count) { // assign rhs [rhsOffset, rhsOffset + count) - AZSTD_CONTAINER_ASSERT(rhs.m_size >= rhsOffset, "Invalid offset"); - size_type num = rhs.m_size - rhsOffset; + AZSTD_CONTAINER_ASSERT(rhs.size() >= rhsOffset, "Invalid offset"); + size_type num = rhs.size() - rhsOffset; if (count < num) { num = count; // trim num to size @@ -334,10 +348,10 @@ namespace AZStd } else if (grow(num)) { // make room and assign new stuff - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - Traits::copy(data /*, m_capacity*/, rhsData + rhsOffset, num); - m_size = num; + pointer data = m_storage.first().GetData(); + const_pointer rhsData = rhs.data(); + Traits::copy(data, rhsData + rhsOffset, num); + m_storage.first().SetSize(num); Traits::assign(data[num], Element()); // terminate } return *this; @@ -345,20 +359,20 @@ namespace AZStd this_type& assign(const_pointer ptr, size_type count) { // assign [ptr, ptr + count) - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - if (ptr != 0 && ptr >= data && (data + m_size) > ptr) + pointer data = m_storage.first().GetData(); + if (ptr != nullptr && ptr >= data && (data + size()) > ptr) { return assign(*this, ptr - data, count); // substring } if (grow(count)) { // make room and assign new stuff - data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + data = m_storage.first().GetData(); if (count > 0) { Traits::copy(data, ptr, count); } - m_size = count; + m_storage.first().SetSize(count); Traits::assign(data[count], Element()); // terminate } return *this; @@ -367,109 +381,132 @@ namespace AZStd this_type& assign(size_type count, Element ch) { // assign count * ch - AZSTD_CONTAINER_ASSERT(count != npos, "result is too long!"); if (grow(count)) { // make room and assign new stuff - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - if (count == 1) + pointer data = m_storage.first().GetData(); + Traits::assign(data, count, ch); + m_storage.first().SetSize(count); + Traits::assign(data[count], Element()); // terminate + } + return *this; + } + + template + auto assign(InputIt first, InputIt last) + -> enable_if_t && !is_convertible_v, this_type&> + { + if constexpr (Internal::satisfies_contiguous_iterator_concept_v + && is_same_v::value_type, value_type>) + { + return assign(AZStd::to_address(first), AZStd::distance(first, last)); + } + else if constexpr (Internal::is_forward_iterator_v) + { + // forward iterator pointer type doesn't match the const_pointer type + // So the elements need to be assigned one by one into the buffer + size_type newSize = AZStd::distance(first, last); + if (grow(newSize)) { - Traits::assign(*(data), ch); + pointer buffer = data(); + for (size_t updateIndex = 0; first != last; ++first, ++updateIndex) + { + Traits::assign(buffer[updateIndex], static_cast(*first)); + } + m_storage.first().SetSize(newSize); + Traits::assign(buffer[newSize], Element()); // terminate } - else + return *this; + } + else + { + // input iterator that aren't forward iterators can only be used in a single pass + // algorithm. Therefore AZStd::distance can't be used + // So the input is copied into a local string and then delegated + // to use the (const_pointer, size_type) overload + basic_string inputCopy; + for (; first != last; ++first) { - Traits::assign(data, count, ch); + inputCopy.push_back(static_cast(*first)); } - m_size = count; - Traits::assign(data[count], Element()); // terminate + + return assign(inputCopy.c_str(), inputCopy.size()); } - return *this; } - - template - inline this_type& assign(InputIterator first, InputIterator last) { return assign_iter(first, last, AZStd::is_integral()); } - inline this_type& assign(const_pointer first, const_pointer last) { return replace(begin(), end(), first, last); } - inline this_type& insert(size_type offset, const this_type& rhs) { return insert(offset, rhs, 0, npos); } + inline this_type& insert(size_type offset, const this_type& rhs) { return insert(offset, rhs, 0, npos); } this_type& insert(size_type offset, const this_type& rhs, size_type rhsOffset, size_type count) { // insert rhs [rhsOffset, rhsOffset + count) at offset - AZSTD_CONTAINER_ASSERT(m_size >= offset && rhs.m_size >= rhsOffset, "Invalid offset(s)"); - size_type num = rhs.m_size - rhsOffset; + AZSTD_CONTAINER_ASSERT(size() >= offset && rhs.size() >= rhsOffset, "Invalid offset(s)"); + size_type num = rhs.size() - rhsOffset; if (num < count) { count = num; // trim _Count to size } - AZSTD_CONTAINER_ASSERT(npos - m_size > count, "Result is too long"); - num = m_size + count; + AZSTD_CONTAINER_ASSERT(npos - size() > count, "Result is too long"); + num = size() + count; if (count > 0 && grow(num)) { - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); // make room and insert new stuff - Traits::move(data + offset + count /*, m_capacity - offset - count*/, data + offset, m_size - offset); // empty out hole + Traits::move(data + offset + count, data + offset, size() - offset); // empty out hole if (this == &rhs) { - Traits::move(data + offset /*, m_capacity - offset*/, data + (offset < rhsOffset ? rhsOffset + count : rhsOffset), count); // substring + Traits::move(data + offset, data + (offset < rhsOffset ? rhsOffset + count : rhsOffset), count); // substring } else { - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - Traits::copy(data + offset /*, m_capacity - offset*/, rhsData + rhsOffset, count); // fill hole + const_pointer rhsData = rhs.data(); + Traits::copy(data + offset, rhsData + rhsOffset, count); // fill hole } - m_size = num; + m_storage.first().SetSize(num); Traits::assign(data[num], Element()); // terminate } return (*this); } - this_type& insert(size_type offset, const_pointer ptr, size_type count) + this_type& insert(size_type offset, const_pointer ptr, size_type count) { // insert [ptr, ptr + count) at offset - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - if (ptr != 0 && ptr >= data && (data + m_size) > ptr) + pointer data = m_storage.first().GetData(); + if (ptr != nullptr && ptr >= data && (data + size()) > ptr) { - return insert(offset, *this, ptr - data, count); // substring + return insert(offset, *this, ptr - data, count); // substring } - AZSTD_CONTAINER_ASSERT(m_size >= offset, "Invalid offset"); - AZSTD_CONTAINER_ASSERT(npos - m_size > count, "Result is too long"); - size_type num = m_size + count; + AZSTD_CONTAINER_ASSERT(size() >= offset, "Invalid offset"); + AZSTD_CONTAINER_ASSERT(npos - size() > count, "Result is too long"); + size_type num = size() + count; if (count > 0 && grow(num)) { // make room and insert new stuff - data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - Traits::move(data + offset + count /*, m_capacity - offset - count*/, data + offset, m_size - offset); // empty out hole - Traits::copy(data + offset /*, m_capacity - offset*/, ptr, count); // fill hole - m_size = num; + data = m_storage.first().GetData(); + Traits::move(data + offset + count, data + offset, size() - offset); // empty out hole + Traits::copy(data + offset, ptr, count); // fill hole + m_storage.first().SetSize(num); Traits::assign(data[num], Element()); // terminate } return *this; } - inline this_type& insert(size_type offset, const_pointer ptr) { return insert(offset, ptr, Traits::length(ptr)); } + inline this_type& insert(size_type offset, const_pointer ptr) { return insert(offset, ptr, Traits::length(ptr)); } this_type& insert(size_type offset, size_type count, Element ch) { // insert count * ch at offset - AZSTD_CONTAINER_ASSERT(m_size >= offset, "Invalid offset"); - AZSTD_CONTAINER_ASSERT(npos - m_size > count, "Result is too long"); - size_type num = m_size + count; + AZSTD_CONTAINER_ASSERT(size() >= offset, "Invalid offset"); + AZSTD_CONTAINER_ASSERT(npos - size() > count, "Result is too long"); + size_type num = size() + count; if (count > 0 && grow(num)) { - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); // make room and insert new stuff - Traits::move(data + offset + count /*, m_capacity - offset - count*/, data + offset, m_size - offset); // empty out hole - if (count == 1) - { - Traits::assign(*(data + offset), ch); - } - else - { - Traits::assign(data + offset, count, ch); - } - m_size = num; + Traits::move(data + offset + count, data + offset, size() - offset); // empty out hole + Traits::assign(data + offset, count, ch); + m_storage.first().SetSize(num); Traits::assign(data[num], Element()); // terminate } return *this; } - inline iterator insert(const_iterator insertPos) { return insert(insertPos, Element()); } + inline iterator insert(const_iterator insertPos) { return insert(insertPos, Element()); } iterator insert(const_iterator insertPos, Element ch) { @@ -479,54 +516,89 @@ namespace AZStd const_pointer insertPosPtr = insertPos; #endif - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + const_pointer data = m_storage.first().GetData(); size_type offset = insertPosPtr - data; insert(offset, 1, ch); return iterator(AZSTD_CHECKED_ITERATOR(iterator_impl, data + offset)); } - void insert(const_iterator insertPos, size_type count, Element ch) + iterator insert(const_iterator insertPos, size_type count, Element ch) { // insert count * elem at insertPos #ifdef AZSTD_HAS_CHECKED_ITERATORS const_pointer insertPosPtr = insertPos.get_iterator(); #else const_pointer insertPosPtr = insertPos; #endif - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); size_type offset = insertPosPtr - data; insert(offset, count, ch); + return begin() + offset; } - template - inline void insert(const_iterator insertPos, InputIterator first, InputIterator last) + template + auto insert(const_iterator insertPos, InputIt first, InputIt last) + -> enable_if_t && !is_convertible_v, iterator> { // insert [_First, _Last) at _Where - insert_iter(insertPos, first, last, is_integral()); - } + size_type insertOffset = AZStd::distance(cbegin(), insertPos); + if constexpr (Internal::satisfies_contiguous_iterator_concept_v + && is_same_v::value_type, value_type>) + { + insert(insertOffset, AZStd::to_address(first), AZStd::distance(first, last)); + } + else if constexpr (Internal::is_forward_iterator_v) + { + // Input Iterator pointer type doesn't match the const_pointer type + // So the elements need to be inserted one by one into the buffer + size_type count = AZStd::distance(first, last); + size_type oldSize = size(); + size_type newSize = oldSize + count; + if (grow(newSize)) + { + pointer buffer = m_storage.first().GetData(); + Traits::copy_backward(buffer + insertOffset + count, buffer + insertOffset, oldSize - insertOffset); // empty out hole + for (size_t updateIndex = insertOffset; first != last; ++first, ++updateIndex) + { + Traits::assign(buffer[updateIndex], static_cast(*first)); + } + m_storage.first().SetSize(newSize); + Traits::assign(buffer[newSize], Element()); // terminate + } + } + else + { + // input iterator that aren't forward iterators can only be used in a single pass + // algorithm. Therefore AZStd::distance can't be used + // So the input is copied into a local string and then delegated + // to use the (const_pointer, size_type) overload + basic_string inputCopy; + for (; first != last; ++first) + { + inputCopy.push_back(static_cast(*first)); + } - inline void insert(const_iterator insertPos, const_pointer first, const_pointer last) - { // insert [first, last) at insertPos, const pointers - replace(insertPos, insertPos, first, last); + insert(insertOffset, inputCopy.c_str(), inputCopy.size()); + } + return begin() + insertOffset; } - this_type& erase(size_type offset = 0, size_type count = npos) { // erase elements [offset, offset + count) - AZSTD_CONTAINER_ASSERT(m_size >= offset, "Invalid offset"); - if (m_size - offset < count) + AZSTD_CONTAINER_ASSERT(size() >= offset, "Invalid offset"); + if (size() - offset < count) { - count = m_size - offset; // trim count + count = size() - offset; // trim count } if (count > 0) { // move elements down - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); #ifdef AZSTD_HAS_CHECKED_ITERATORS orphan_range(data + offset, data + offset + count); #endif - Traits::move(data + offset /*, m_capacity - offset*/, data + offset + count, m_size - offset - count); - m_size = m_size - count; - Traits::assign(data[m_size], Element()); // terminate - } + Traits::move(data + offset, data + offset + count, size() - offset - count); + m_storage.first().SetSize(size() - count); + Traits::assign(data[size()], Element()); // terminate + } return *this; } @@ -538,10 +610,10 @@ namespace AZStd const_pointer erasePtr = erasePos; #endif // erase element at insertPos - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + const_pointer data = m_storage.first().GetData(); size_type count = erasePtr - data; erase(count, 1); - data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + data = m_storage.first().GetData(); return iterator(AZSTD_CHECKED_ITERATOR(iterator_impl, data + count)); } @@ -554,159 +626,152 @@ namespace AZStd const_pointer firstPtr = first; const_pointer lastPtr = last; #endif - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); size_type count = firstPtr - data; erase(count, lastPtr - firstPtr); - data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + data = m_storage.first().GetData(); return iterator(AZSTD_CHECKED_ITERATOR(iterator_impl, data + count)); } - inline void clear() { erase(begin(), end()); } - inline this_type& replace(size_type offset, size_type count, const this_type& rhs) + inline void clear() { erase(begin(), end()); } + this_type& replace(size_type offset, size_type count, const this_type& rhs) { - // replace [offset, offset + count) with rhs - return replace(offset, count, rhs, 0, npos); + return replace(offset, count, rhs.c_str(), rhs.size()); } this_type& replace(size_type offset, size_type count, const this_type& rhs, size_type rhsOffset, size_type rhsCount) { - // replace [offset, offset + count) with rhs [rhsOffset, rhsOffset + rhsCount) - AZSTD_CONTAINER_ASSERT(m_size >= offset && rhs.m_size >= rhsOffset, "Invalid offsets"); - if (m_size - offset < count) - { - count = m_size - offset; // trim count to size - } - size_type num = rhs.m_size - rhsOffset; - if (num < rhsCount) - { - rhsCount = num; // trim rhsCount to size - } - AZSTD_CONTAINER_ASSERT(npos - rhsCount > m_size - count, "Result is too long"); - - size_type nm = m_size - count - offset; // length of preserved tail - size_type newSize = m_size + rhsCount - count; - if (m_size < newSize) - { - grow(newSize); - } - - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - -#ifdef AZSTD_HAS_CHECKED_ITERATORS - orphan_range(data + offset, data + offset + count); -#endif - if (this != &rhs) - { // no overlap, just move down and copy in new stuff - Traits::move(data + offset + rhsCount /*, m_capacity - offset - rhsCount*/, data + offset + count, nm); // empty hole - Traits::copy(data + offset /*, m_capacity - offset*/, rhsData + rhsOffset, rhsCount); // fill hole - } - else if (rhsCount <= count) - { // hole doesn't get larger, just copy in substring - Traits::move(data + offset /*, m_capacity - offset*/, data + rhsOffset, rhsCount); // fill hole - Traits::move(data + offset + rhsCount /*, m_capacity - offset - rhsCount*/, data + offset + count, nm); // move tail down - } - else if (rhsOffset <= offset) - { // hole gets larger, substring begins before hole - Traits::move(data + offset + rhsCount /*, m_capacity - offset - rhsCount*/, data + offset + count, nm); // move tail down - Traits::move(data + offset /*, m_capacity - offset*/, data + rhsOffset, rhsCount); // fill hole - } - else if (offset + count <= rhsOffset) - { // hole gets larger, substring begins after hole - Traits::move(data + offset + rhsCount /*, m_capacity - offset - rhsCount*/, data + offset + count, nm); // move tail down - Traits::move(data + offset /*, m_capacity - offset*/, data + (rhsOffset + rhsCount - count), rhsCount); // fill hole - } - else - { // hole gets larger, substring begins in hole - Traits::move(data + offset /*, m_capacity - offset*/, data + rhsOffset, count); // fill old hole - Traits::move(data + offset + rhsCount /*, m_capacity - offset - rhsCount*/, data + offset + count, nm); // move tail down - Traits::move(data + offset + count /*, m_capacity - offset - count*/, data + rhsOffset + rhsCount, rhsCount - count); // fill rest of new hole - } - - m_size = newSize; - Traits::assign(data[newSize], Element()); // terminate - return (*this); + return replace(offset, count, rhs.c_str() + rhsOffset, AZStd::min(rhsCount, rhs.size() - rhsOffset)); } this_type& replace(size_type offset, size_type count, const_pointer ptr, size_type ptrCount) { - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; // replace [offset, offset + count) with [ptr, ptr + ptrCount) - if (ptr != 0 && ptr >= data && (data + m_size) > ptr) - { - return (replace(offset, count, *this, ptr - data, ptrCount)); // substring, replace carefully - } - AZSTD_CONTAINER_ASSERT(m_size >= offset, "Invalid offset"); - if (m_size - offset < count) - { - count = m_size - offset; // trim _N0 to size + AZSTD_CONTAINER_ASSERT(size() >= offset, "Invalid offset"); + // Make sure count is within is no larger than the distance from the offset + // to the end of this string + count = AZStd::min(count, size() - offset); + + size_type newSize = size() + ptrCount - count; + size_type charsAfterCountToMove = size() - count - offset; + pointer inputStringCopy{}; + + if (pointer thisBuffer = m_storage.first().GetData(); + (ptr >= thisBuffer && ptr < thisBuffer + size()) + || (ptr + ptrCount > thisBuffer && ptr + ptrCount <= thisBuffer + size())) + { + // Overlap checks for tring needs if the input pointer is anywhere within the string + // even if it is outside of the range of [offset, offset + count) as a growing + // the string buffer could cause a realloc to occur + if (!fits_in_capacity(newSize)) + { + // If the input string is a sub-string and it would cause + // this string to need to re-allocated as it doesn't fit in the capacity + // Then the input string is needs to be copied into a local buffer + inputStringCopy = reinterpret_cast(get_allocator().allocate(ptrCount * sizeof(value_type), alignof(value_type))); + Traits::copy(inputStringCopy, ptr, ptrCount); + // Updated the input string pointer to point to the local buffer + ptr = inputStringCopy; + // Now this string buffer can now be safely resized and the non-overlapping string logic below can be used + } + else + { + // overlapping string in-place logic + // Ex. this = "ABCDEFG", offset = 1, count=4 + // substring is "CDE" + // The text from offset 1 for 4 chars "BCDE": should be replaced with "CDE" + // making a whole for the bytes results in output = "ABCDFG" + // Afterwards output = "ACDEFG" + // The input string overlaps with this string in this case + // So the string is copied piecewise + if (ptrCount <= count) + { // hole doesn't get larger, just copy in substring + Traits::move(thisBuffer + offset, ptr, ptrCount); // fill hole + Traits::copy(thisBuffer + offset + ptrCount, thisBuffer + offset + count, charsAfterCountToMove); // move tail down + } + else + { + if (ptr <= thisBuffer + offset) + { // hole gets larger, substring begins before hole + Traits::copy_backward(thisBuffer + offset + ptrCount, thisBuffer + offset + count, charsAfterCountToMove); // move tail down + Traits::copy(thisBuffer + offset, ptr, ptrCount); // fill hole + } + else if (thisBuffer + offset + count <= ptr) + { // hole gets larger, substring begins after hole + Traits::copy_backward(thisBuffer + offset + ptrCount, thisBuffer + offset + count, charsAfterCountToMove); // move tail down + Traits::copy(thisBuffer + offset, ptr + (ptrCount - count), ptrCount); // fill hole + } + else + { // hole gets larger, substring begins in hole + Traits::copy(thisBuffer + offset, ptr, count); // fill old hole + Traits::copy_backward(thisBuffer + offset + ptrCount, thisBuffer + offset + count, charsAfterCountToMove); // move tail down + Traits::copy(thisBuffer + offset + count, ptr + ptrCount, ptrCount - count); // fill rest of new hole + } + } + m_storage.first().SetSize(newSize); + Traits::assign(thisBuffer[newSize], Element()); // terminate + return *this; + } } - AZSTD_CONTAINER_ASSERT(npos - ptrCount > m_size - count, "Result too long"); -#ifdef AZSTD_HAS_CHECKED_ITERATORS - orphan_range(data + offset, data + offset + count); -#endif - size_type nm = m_size - count - offset; - if (ptrCount < count) - { - Traits::move(data + offset + ptrCount, data + offset + count, nm); // smaller hole, move tail up - } - size_type num = m_size + ptrCount - count; - if ((0 < ptrCount || 0 < count) && grow(num)) + // input string doesn't overlap, so this string can be re-allocated safely + if (grow(newSize)) { - data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - // make room and rearrange - if (count < ptrCount) + // Need to regrab the memory address for the storage buffer + // in case the grow re-allocated memory + pointer thisBuffer = m_storage.first().GetData(); + if (count != ptrCount) { - Traits::move(data + offset + ptrCount /*, m_capacity - offset - ptrCount*/, data + offset + count, nm); // move tail down + Traits::move(thisBuffer + offset + ptrCount, thisBuffer + offset + count, charsAfterCountToMove); } if (ptrCount > 0) { - Traits::copy(data + offset /*, m_capacity - offset*/, ptr, ptrCount); // fill hole + // Copy bytes up to the minimum of this string count and input string count + Traits::copy(thisBuffer + offset, ptr, ptrCount); } + // input string doesn't overlap, so this string can be re-allocated safely + m_storage.first().SetSize(newSize); + Traits::assign(thisBuffer[newSize], Element()); // terminate + } - m_size = num; - Traits::assign(data[num], Element()); // terminate + // If a local string was allocated, then de-allocate its memory + if (inputStringCopy != nullptr) + { + get_allocator().deallocate(inputStringCopy, 0, alignof(value_type)); } + return *this; } inline this_type& replace(size_type offset, size_type count, const_pointer ptr) { return replace(offset, count, ptr, Traits::length(ptr)); } this_type& replace(size_type offset, size_type count, size_type num, Element ch) { // replace [offset, offset + count) with num * ch - AZSTD_CONTAINER_ASSERT(m_size > offset, "Invalid offset"); - if (m_size - offset < count) + AZSTD_CONTAINER_ASSERT(size() > offset, "Invalid offset"); + if (size() - offset < count) { - count = m_size - offset; // trim count to size + count = size() - offset; // trim count to size } - AZSTD_CONTAINER_ASSERT(npos - num > m_size - count, "Result is too long"); - size_type nm = m_size - count - offset; + AZSTD_CONTAINER_ASSERT(npos - num > size() - count, "Result is too long"); + size_type nm = size() - count - offset; - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); #ifdef AZSTD_HAS_CHECKED_ITERATORS orphan_range(data + offset, data + offset + count); #endif if (num < count) { - Traits::move(data + offset + num /*, m_capacity - offset - num*/, data + offset + count, nm); // smaller hole, move tail up + Traits::move(data + offset + num, data + offset + count, nm); // smaller hole, move tail up } - size_type numToGrow = m_size + num - count; + size_type numToGrow = size() + num - count; if ((0 < num || 0 < count) && grow(numToGrow)) { // make room and rearrange - data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + data = m_storage.first().GetData(); if (count < num) { - Traits::move(data + offset + num /*, m_capacity - offset - num*/, data + offset + count, nm); // move tail down + Traits::move(data + offset + num, data + offset + count, nm); // move tail down } - if (count == 1) - { - Traits::assign(*(data + offset), ch); - } - else - { - Traits::assign(data + offset, num, ch); - } - m_size = numToGrow; + Traits::assign(data + offset, num, ch); + m_storage.first().SetSize(numToGrow); Traits::assign(data[numToGrow], Element()); // terminate } return *this; @@ -722,7 +787,7 @@ namespace AZStd const_pointer firstPtr = first; const_pointer lastPtr = last; #endif - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); return replace(firstPtr - data, lastPtr - firstPtr, rhs); } @@ -735,7 +800,7 @@ namespace AZStd const_pointer firstPtr = first; const_pointer lastPtr = last; #endif - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); return replace(firstPtr - data, lastPtr - firstPtr, ptr, count); } @@ -748,7 +813,7 @@ namespace AZStd const_pointer firstPtr = first; const_pointer lastPtr = last; #endif - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); return replace(firstPtr - data, lastPtr - firstPtr, ptr); } @@ -761,113 +826,133 @@ namespace AZStd const_pointer firstPtr = first; const_pointer lastPtr = last; #endif - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); return replace(firstPtr - data, lastPtr - firstPtr, count, ch); } - template - inline this_type& replace(const_iterator first, const_iterator last, InputIterator first2, InputIterator last2) - { // replace [first, last) with [first2,last2) - return replace_iter(first, last, first2, last2, is_integral()); - } - - this_type& replace(const_iterator first, const_iterator last, const_pointer first2, const_pointer last2) + template + inline auto replace(const_iterator first, const_iterator last, InputIt replaceFirst, InputIt replaceLast) + -> enable_if_t && !is_convertible_v, this_type&> { -#ifdef AZSTD_HAS_CHECKED_ITERATORS - const_pointer first1 = first.get_iterator(); - const_pointer last1 = last.get_iterator(); -#else - const_pointer first1 = first; - const_pointer last1 = last; -#endif - // replace [first, last) with [first2, last2), const pointers - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - if (first2 == last2) + if constexpr (Internal::satisfies_contiguous_iterator_concept_v + && is_same_v::value_type, value_type>) { - erase(first1 - data, last1 - first1); + return replace(first, last, AZStd::to_address(replaceFirst), AZStd::distance(replaceFirst, replaceLast)); + } + else if constexpr (Internal::is_forward_iterator_v) + { + // Input Iterator pointer type doesn't match the const_pointer type + // So the elements need to be appended one by one into the buffer + + size_type insertOffset = AZStd::distance(cbegin(), first); + size_type postInsertOffset = AZStd::distance(cbegin(), last); + size_type count = AZStd::distance(replaceFirst, replaceLast); + size_type oldSize = size(); + size_type newSize = oldSize + count - AZStd::distance(first, last); + if (grow(newSize)) + { + pointer buffer = data(); + Traits::move(first + count, last, oldSize - postInsertOffset); // empty out hole + for (size_t updateIndex = insertOffset; replaceFirst != replaceLast; ++replaceFirst, ++updateIndex) + { + Traits::assign(buffer[updateIndex], static_cast(*replaceFirst)); + } + m_storage.first().SetSize(newSize); + Traits::assign(buffer[newSize], Element()); // terminate + } + return *this; } else { - replace(first1 - data, last1 - first1, &*first2, last2 - first2); + // input iterator that aren't forward iterators can only be used in a single pass + // algorithm. Therefore AZStd::distance can't be used + // So the input is copied into a local string and then delegated + // to use the (const_pointer, size_type) overload + basic_string inputCopy; + for (; replaceFirst != replaceLast; ++replaceFirst) + { + inputCopy.push_back(static_cast(*replaceFirst)); + } + + return replace(first, last, inputCopy.c_str(), inputCopy.size()); } - return *this; } inline reference at(size_type offset) { // subscript mutable sequence with checking - AZSTD_CONTAINER_ASSERT(m_size > offset, "Invalid offset"); - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + AZSTD_CONTAINER_ASSERT(size() > offset, "Invalid offset"); + pointer data = m_storage.first().GetData(); return data[offset]; } inline const_reference at(size_type offset) const { // subscript nonmutable sequence with checking - AZSTD_CONTAINER_ASSERT(m_size > offset, "Invalid offset"); - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + AZSTD_CONTAINER_ASSERT(size() > offset, "Invalid offset"); + const_pointer data = m_storage.first().GetData(); return data[offset]; } inline reference operator[](size_type offset) { // subscript mutable sequence with checking - AZSTD_CONTAINER_ASSERT(m_size > offset, "Invalid offset"); - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + AZSTD_CONTAINER_ASSERT(size() > offset, "Invalid offset"); + pointer data = m_storage.first().GetData(); return data[offset]; } inline const_reference operator[](size_type offset) const { // subscript nonmutable sequence with checking - AZSTD_CONTAINER_ASSERT(m_size > offset, "Invalid offset"); - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + AZSTD_CONTAINER_ASSERT(size() > offset, "Invalid offset"); + const_pointer data = m_storage.first().GetData(); return data[offset]; } inline reference front() { - AZSTD_CONTAINER_ASSERT(m_size != 0, "AZStd::string::front - string is empty!"); - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + AZSTD_CONTAINER_ASSERT(size() != 0, "AZStd::string::front - string is empty!"); + pointer data = m_storage.first().GetData(); return data[0]; } inline const_reference front() const { - AZSTD_CONTAINER_ASSERT(m_size != 0, "AZStd::string::front - string is empty!"); - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + AZSTD_CONTAINER_ASSERT(size() != 0, "AZStd::string::front - string is empty!"); + const_pointer data = m_storage.first().GetData(); return data[0]; } inline reference back() { - AZSTD_CONTAINER_ASSERT(m_size != 0, "AZStd::string::back - string is empty!"); - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - return data[m_size - 1]; + AZSTD_CONTAINER_ASSERT(size() != 0, "AZStd::string::back - string is empty!"); + pointer data = m_storage.first().GetData(); + return data[size() - 1]; } inline const_reference back() const { - AZSTD_CONTAINER_ASSERT(m_size != 0, "AZStd::string::back - string is empty!"); - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - return data[m_size - 1]; + AZSTD_CONTAINER_ASSERT(size() != 0, "AZStd::string::back - string is empty!"); + const_pointer data = m_storage.first().GetData(); + return data[size() - 1]; } inline void push_back(Element ch) { - const_pointer end = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - end += m_size; + const_pointer end = data(); + end += size(); insert(end, ch); } - inline const_pointer c_str() const { return (SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer); } - inline size_type length() const { return m_size; } - inline size_type size() const { return m_size; } - inline size_type capacity() const { return m_capacity; } + inline const_pointer c_str() const { return (data()); } + inline size_type length() const { return m_storage.first().GetSize(); } + inline size_type size() const { return m_storage.first().GetSize(); } + inline size_type capacity() const { return m_storage.first().GetCapacity(); } inline size_type max_size() const { // return maximum possible length of sequence - return AZStd::allocator_traits::max_size(m_allocator) / sizeof(value_type); + return AZStd::allocator_traits::max_size(m_storage.second()) / sizeof(value_type); } inline void resize(size_type newSize) @@ -877,58 +962,58 @@ namespace AZStd inline void resize_no_construct(size_type newSize) { - if (newSize <= m_size) + if (newSize <= size()) { erase(newSize); } else { reserve(newSize); - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - m_size = newSize; - Traits::assign(data[m_size], Element()); // terminate + pointer data = m_storage.first().GetData(); + m_storage.first().SetSize(newSize); + Traits::assign(data[newSize], Element()); // terminate } } inline void resize(size_type newSize, Element ch) { // determine new length, padding with ch elements as needed - if (newSize <= m_size) + if (newSize <= size()) { erase(newSize); } else { - append(newSize - m_size, ch); + append(newSize - size(), ch); } } void reserve(size_type newCapacity = 0) { // determine new minimum length of allocated storage - if (m_size <= newCapacity && m_capacity != newCapacity) + if (size() <= newCapacity && capacity() != newCapacity) { // change reservation - size_type size = m_size; + size_type curSize = size(); if (grow(newCapacity)) { - m_size = size; - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - Traits::assign(data[size], Element()); // terminate + m_storage.first().SetSize(curSize); + pointer data = m_storage.first().GetData(); + Traits::assign(data[curSize], Element()); // terminate } } } - inline bool empty() const { return (m_size == 0); } - size_type copy(Element* dest /*, size_type destSize */, size_type count, size_type offset = 0) const + inline bool empty() const { return size() == 0; } + size_type copy(Element* dest, size_type count, size_type offset = 0) const { // copy [offset, offset + count) to [dest, dest + count) // assume there is enough space in _Ptr - AZSTD_CONTAINER_ASSERT(m_size >= offset, "Invalid offset"); - if (m_size - offset < count) + AZSTD_CONTAINER_ASSERT(size() >= offset, "Invalid offset"); + if (size() - offset < count) { - count = m_size - offset; + count = size() - offset; } - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - Traits::copy(dest /*, destSize*/, data + offset, count); + const_pointer data = m_storage.first().GetData(); + Traits::copy(dest, data + offset, count); return count; } @@ -939,19 +1024,10 @@ namespace AZStd return; } - if (m_allocator == rhs.m_allocator) + if (m_storage.second() == rhs.m_storage.second()) { - // same allocator, swap control information -#ifdef AZSTD_HAS_CHECKED_ITERATORS - swap_all(rhs); -#endif - Element temp[SSO_BUF_SIZE]; - ::memcpy(temp, rhs.m_buffer, sizeof(m_buffer)); - ::memcpy(rhs.m_buffer, m_buffer, sizeof(m_buffer)); - ::memcpy(m_buffer, temp, sizeof(m_buffer)); - - AZStd::swap(m_size, rhs.m_size); - AZStd::swap(m_capacity, rhs.m_capacity); + // same allocator, swap storage + m_storage.first().swap(rhs.m_storage.first()); } else { @@ -980,174 +1056,76 @@ namespace AZStd inline size_type find(const this_type& rhs, size_type offset = 0) const { - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - return find(rhsData, offset, rhs.m_size); + const_pointer rhsData = rhs.data(); + return find(rhsData, offset, rhs.size()); } size_type find(const_pointer ptr, size_type offset, size_type count) const { - AZ_Assert(ptr != NULL, "Invalid input!"); - - // look for [ptr, ptr + count) beginning at or after offset - if (count == 0 && offset <= m_size) - { - return offset; // null string always matches (if inside string) - } - size_type nm; - if (offset < m_size && count <= (nm = m_size - offset)) - { // room for match, look for it - const_pointer uptr, vptr; - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - for (nm -= count - 1, vptr = data + offset; (uptr = Traits::find(vptr, nm, *ptr)) != 0; nm -= uptr - vptr + 1, vptr = uptr + 1) - { - if (Traits::compare(uptr, ptr, count) == 0) - { - return (uptr - data); // found a match - } - } - } - - return (npos); // no match + return StringInternal::find(data(), size(), ptr, offset, count, npos); } inline size_type find(const_pointer ptr, size_type offset = 0) const { return find(ptr, offset, Traits::length(ptr)); } inline size_type find(Element ch, size_type offset = 0) const { return find((const_pointer) & ch, offset, 1); } inline size_type rfind(const this_type& rhs, size_type offset = npos) const { - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - return rfind(rhsData, offset, rhs.m_size); + const_pointer rhsData = rhs.data(); + return rfind(rhsData, offset, rhs.size()); } size_type rfind(const_pointer ptr, size_type offset, size_type count) const - { // look for [ptr, ptr + count) beginning before offset - if (count == 0) - { - return (offset < m_size ? offset : m_size); // null always matches - } - if (count <= m_size) - { // room for match, look for it - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - const_pointer uptr = data + (offset < m_size - count ? offset : m_size - count); - for (;; --uptr) - { - if (Traits::eq(*uptr, *ptr) && Traits::compare(uptr, ptr, count) == 0) - { - return (uptr - data); // found a match - } - else if (uptr == data) - { - break; // at beginning, no more chance for match - } - } - } - - return npos; // no match + { + return StringInternal::rfind(data(), size(), ptr, offset, count, npos); } inline size_type rfind(const_pointer ptr, size_type offset = npos) const { return rfind(ptr, offset, Traits::length(ptr)); } inline size_type rfind(Element ch, size_type offset = npos) const { return rfind((const_pointer) & ch, offset, 1); } inline size_type find_first_of(const this_type& rhs, size_type offset = 0) const { - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - return find_first_of(rhsData, offset, rhs.m_size); + const_pointer rhsData = rhs.data(); + return find_first_of(rhsData, offset, rhs.size()); } size_type find_first_of(const_pointer ptr, size_type offset, size_type count) const - { // look for one of [ptr, ptr + count) at or after offset - if (0 < count && offset < m_size) - { // room for match, look for it - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - const Element* const vptr = data + m_size; - for (const_pointer uptr = data + offset; uptr < vptr; ++uptr) - { - if (Traits::find(ptr, count, *uptr) != 0) - { - return uptr - data; // found a match - } - } - } - return npos; // no match + { + return StringInternal::find_first_of(data(), size(), ptr, offset, count, npos); } inline size_type find_first_of(const_pointer ptr, size_type offset = 0) const { return find_first_of(ptr, offset, Traits::length(ptr)); } inline size_type find_first_of(Element ch, size_type offset = 0) const { return find((const_pointer) & ch, offset, 1); } inline size_type find_last_of(const this_type& rhs, size_type offset = npos) const { - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - return find_last_of(rhsData, offset, rhs.m_size); + const_pointer rhsData = rhs.data(); + return find_last_of(rhsData, offset, rhs.size()); } size_type find_last_of(const_pointer ptr, size_type offset, size_type count) const - { // look for one of [ptr, ptr + count) before offset - if (0 < count && 0 < m_size) - { - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - for (const_pointer uptr = data + (offset < m_size ? offset : m_size - 1);; --uptr) - { - if (Traits::find(ptr, count, *uptr) != 0) - { - return uptr - data; // found a match - } - else if (uptr == data) - { - break; // at beginning, no more chance for match - } - } - } - - return npos; // no match + { + return StringInternal::find_last_of(data(), size(), ptr, offset, count, npos); } inline size_type find_last_of(const_pointer ptr, size_type offset = npos) const { return find_last_of(ptr, offset, Traits::length(ptr)); } inline size_type find_last_of(Element ch, size_type offset = npos) const { return rfind((const_pointer) & ch, offset, 1); } inline size_type find_first_not_of(const this_type& rhs, size_type offset = 0) const { // look for none of rhs at or after offset - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - return find_first_not_of(rhsData, offset, rhs.m_size); + const_pointer rhsData = rhs.data(); + return find_first_not_of(rhsData, offset, rhs.size()); } size_type find_first_not_of(const_pointer ptr, size_type offset, size_type count) const { - // look for none of [ptr, ptr + count) at or after offset - if (offset < m_size) - { // room for match, look for it - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - const Element* const vptr = data + m_size; - for (const_pointer uptr = data + offset; uptr < vptr; ++uptr) - { - if (Traits::find(ptr, count, *uptr) == 0) - { - return uptr - data; - } - } - } - return npos; + return StringInternal::find_first_not_of(data(), size(), ptr, offset, count, npos); } inline size_type find_first_not_of(const_pointer ptr, size_type offset = 0) const { return find_first_not_of(ptr, offset, Traits::length(ptr)); } inline size_type find_first_not_of(Element ch, size_type offset = 0) const { return find_first_not_of((const_pointer) & ch, offset, 1); } inline size_type find_last_not_of(const this_type& rhs, size_type offset = npos) const { // look for none of rhs before offset - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - return find_last_not_of(rhsData, offset, rhs.m_size); + const_pointer rhsData = rhs.data(); + return find_last_not_of(rhsData, offset, rhs.size()); } size_type find_last_not_of(const_pointer ptr, size_type offset, size_type count) const - { // look for none of [ptr, ptr + count) before offset - if (0 < m_size) - { - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - for (const_pointer uptr = data + (offset < m_size ? offset : m_size - 1);; --uptr) - { - if (Traits::find(ptr, count, *uptr) == 0) - { - return uptr - data; - } - else if (uptr == data) - { - break; - } - } - } - return npos; + { + return StringInternal::find_last_not_of(data(), size(), ptr, offset, count, npos); } inline size_type find_last_not_of(const_pointer ptr, size_type offset = npos) const { return find_last_not_of(ptr, offset, Traits::length(ptr)); } @@ -1161,8 +1139,8 @@ namespace AZStd inline int compare(const this_type& rhs) const { - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - return compare(0, m_size, rhsData, rhs.m_size); + const_pointer rhsData = rhs.data(); + return compare(0, size(), rhsData, rhs.size()); } inline int compare(size_type offset, size_type count, const this_type& rhs) const @@ -1173,26 +1151,26 @@ namespace AZStd int compare(size_type offset, size_type count, const this_type& rhs, size_type rhsOffset, size_type rhsCount) const { // compare [offset, offset + count) with rhs [rhsOffset, rhsOffset + rhsCount) - AZSTD_CONTAINER_ASSERT(rhs.m_size >= rhsOffset, "Invalid offset"); - if (rhs.m_size - rhsOffset < rhsCount) + AZSTD_CONTAINER_ASSERT(rhs.size() >= rhsOffset, "Invalid offset"); + if (rhs.size() - rhsOffset < rhsCount) { - rhsCount = rhs.m_size - rhsOffset; // trim rhsCount to size + rhsCount = rhs.size() - rhsOffset; // trim rhsCount to size } - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; + const_pointer rhsData = rhs.data(); return compare(offset, count, rhsData + rhsOffset, rhsCount); } - inline int compare(const_pointer ptr) const { return compare(0, m_size, ptr, Traits::length(ptr)); } + inline int compare(const_pointer ptr) const { return compare(0, size(), ptr, Traits::length(ptr)); } inline int compare(size_type offset, size_type count, const_pointer ptr) const { return compare(offset, count, ptr, Traits::length(ptr)); } int compare(size_type offset, size_type count, const_pointer ptr, size_type ptrCount) const { // compare [offset, offset + _N0) with [_Ptr, _Ptr + _Count) - AZSTD_CONTAINER_ASSERT(m_size >= offset, "Invalid offset"); - if (m_size - offset < count) + AZSTD_CONTAINER_ASSERT(size() >= offset, "Invalid offset"); + if (size() - offset < count) { - count = m_size - offset; // trim count to size + count = size() - offset; // trim count to size } - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + const_pointer data = m_storage.first().GetData(); size_type ans = Traits::compare(data + offset, ptr, count < ptrCount ? count : ptrCount); return (ans != 0 ? (int)ans : count < ptrCount ? -1 : count == ptrCount ? 0 : +1); } @@ -1231,11 +1209,11 @@ namespace AZStd inline void pop_back() { - if (m_size > 0) + if (!empty()) { - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - --m_size; - Traits::assign(data[m_size], Element()); // terminate + pointer data = m_storage.first().GetData(); + m_storage.first().SetSize(m_storage.first().GetSize() - 1); + Traits::assign(data[size()], Element()); // terminate } } @@ -1245,39 +1223,35 @@ namespace AZStd * @{ */ /// TR1 Extension. Return pointer to the vector data. The vector data is guaranteed to be stored as an array. - inline pointer data() { return (SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer); } - inline const_pointer data() const { return (SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer); } + inline pointer data() { return m_storage.first().GetData(); } + inline const_pointer data() const { return m_storage.first().GetData(); } /// /// The only difference from the standard is that we return the allocator instance, not a copy. - inline allocator_type& get_allocator() { return m_allocator; } - inline const allocator_type& get_allocator() const { return m_allocator; } + inline allocator_type& get_allocator() { return m_storage.second(); } + inline const allocator_type& get_allocator() const { return m_storage.second(); } /// Set the vector allocator. If different than then current all elements will be reallocated. void set_allocator(const allocator_type& allocator) { - if (m_allocator != allocator) + if (m_storage.second() != allocator) { - if (m_size > 0 && SSO_BUF_SIZE <= m_capacity) + if (!empty() && !m_storage.first().ShortStringOptimizationActive()) { allocator_type newAllocator = allocator; - pointer data = m_data; + pointer data = m_storage.first().GetData(); - pointer newData = reinterpret_cast(newAllocator.allocate(sizeof(node_type) * (m_capacity + 1), alignment_of::value)); + pointer newData = reinterpret_cast(newAllocator.allocate(sizeof(node_type) * (capacity() + 1), alignof(node_type))); - Traits::copy(newData, data, m_size + 1); // copy elements and terminator + Traits::copy(newData, data, size() + 1); // copy elements and terminator // Free memory (if needed). deallocate_memory(data, 0, typename allocator_type::allow_memory_leaks()); - m_allocator = newAllocator; - -#ifdef AZSTD_HAS_CHECKED_ITERATORS - orphan_all(); -#endif + m_storage.second() = newAllocator; } else { - m_allocator = allocator; + m_storage.second() = allocator; } } } @@ -1296,12 +1270,12 @@ namespace AZStd #else pointer iterPtr = iter; #endif - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - if (iterPtr < data || iterPtr > (data + m_size)) + const_pointer data = m_storage.first().GetData(); + if (iterPtr < data || iterPtr > (data + size())) { return isf_none; } - else if (iterPtr == (data + m_size)) + else if (iterPtr == (data + size())) { return isf_valid; } @@ -1316,12 +1290,12 @@ namespace AZStd #else const_pointer iterPtr = iter; #endif - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - if (iterPtr < data || iterPtr > (data + m_size)) + const_pointer data = m_storage.first().GetData(); + if (iterPtr < data || iterPtr > (data + size())) { return isf_none; } - else if (iterPtr == (data + m_size)) + else if (iterPtr == (data + size())) { return isf_valid; } @@ -1337,86 +1311,74 @@ namespace AZStd * \note This function is added to the vector for consistency. In the vector case we have only one allocation, and if the allocator allows memory leaks * it can just leave deallocate function empty, which performance wise will be the same. For more complex containers this will make big difference. */ - void leak_and_reset() + void leak_and_reset() { - m_size = 0; - m_capacity = SSO_BUF_SIZE - 1; - Traits::assign(m_buffer[0], Element()); - -#ifdef AZSTD_HAS_CHECKED_ITERATORS - orphan_all(); -#endif + m_storage.first() = {}; } /** * Set the capacity, if necessary it will erase elements at the end of the container to match the new capacity. */ - void set_capacity(size_type numElements) + void set_capacity(size_type numElements) { // sets the new capacity of the vector, can be smaller than size() - if (m_capacity != numElements) + if (capacity() != numElements) { - if (numElements < SSO_BUF_SIZE) + if (numElements < ShortStringData::Capacity) { - if (m_capacity >= SSO_BUF_SIZE) + if (!m_storage.first().ShortStringOptimizationActive()) { // copy any leftovers to small buffer and deallocate - pointer ptr = m_data; - numElements = numElements < m_size ? numElements : m_size; + pointer ptr = m_storage.first().GetData(); + numElements = numElements < size() ? numElements : size(); + m_storage.first().SetCapacity(ShortStringData::Capacity); if (0 < numElements) { - Traits::copy(m_buffer /*, SSO_BUF_SIZE*/, ptr, numElements); + Traits::copy(m_storage.first().GetData(), ptr, numElements); } - deallocate_memory(ptr, 0, typename allocator_type::allow_memory_leaks()); - m_capacity = SSO_BUF_SIZE - 1; + // deallocate_memory functione examines the current + // m_storage short string optimization state was changed to true + // by the SetCapacity call above. Therefore m_storage.second().deallocate + // is used directly + m_storage.second().deallocate(ptr, 0, alignof(node_type)); } - m_size = numElements; - Traits::assign(m_buffer[numElements], Element()); // terminate + m_storage.first().SetSize(numElements); + Traits::assign(m_storage.first().GetData()[numElements], Element()); // terminate } else { size_type expandedSize = 0; - if (m_capacity >= SSO_BUF_SIZE) + if (!m_storage.first().ShortStringOptimizationActive()) { - expandedSize = m_allocator.resize(m_data, sizeof(node_type) * (numElements + 1)); + expandedSize = m_storage.second().resize(m_storage.first().GetData(), sizeof(node_type) * (numElements + 1)); // our memory managers allocate on 8+ bytes boundary and our node type should be less than that in general, otherwise // we need to take care when we compute the size on deallocate. AZ_Assert(expandedSize % sizeof(node_type) == 0, "Expanded size not a multiply of node type. This should not happen"); size_type expandedCapacity = expandedSize / sizeof(node_type); if (expandedCapacity > numElements) { - m_capacity = expandedCapacity - 1; + m_storage.first().SetCapacity(expandedCapacity - 1); return; } } - pointer newData = reinterpret_cast(m_allocator.allocate(sizeof(node_type) * (numElements + 1), alignment_of::value)); - AZSTD_CONTAINER_ASSERT(newData != 0, "AZStd::string allocation failed!"); + pointer newData = reinterpret_cast(m_storage.second().allocate(sizeof(node_type) * (numElements + 1), alignof(node_type))); + AZSTD_CONTAINER_ASSERT(newData != nullptr, "AZStd::string allocation failed!"); - size_type newSize = numElements < m_size ? numElements : m_size; - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + size_type newSize = numElements < m_storage.first().GetSize() ? numElements : m_storage.first().GetSize(); + pointer data = m_storage.first().GetData(); if (newSize > 0) { - Traits::copy(newData /*, newSize + 1*/, data, newSize); // copy existing elements - } - if (m_capacity >= SSO_BUF_SIZE) - { - deallocate_memory(m_data, expandedSize, typename allocator_type::allow_memory_leaks()); + Traits::copy(newData, data, newSize); // copy existing elements } + deallocate_memory(data, expandedSize, typename allocator_type::allow_memory_leaks()); - m_data = newData; - m_capacity = numElements; - m_size = newSize; - Traits::assign(m_data[newSize], Element()); // terminate + Traits::assign(newData[newSize], Element()); // terminate + m_storage.first().SetCapacity(numElements); + m_storage.first().SetData(newData); + m_storage.first().SetSize(newSize); } - -#ifdef AZSTD_HAS_CHECKED_ITERATORS - // when we move data in the buffer we don't really need to make invalid all iterators, but it's - // very important that we are consistent, so people don't have different behavior when they have - // short strings - orphan_all(); -#endif } } @@ -1521,9 +1483,9 @@ namespace AZStd } }; -// Clang supports compile-time check for printf-like signatures -// On MSVC, *only* if /analyze flag is enabled(defines _PREFAST_) we can also do a compile-time check -// For not affecting final release binary size, we don't use the templated version on Release configuration either + // Clang supports compile-time check for printf-like signatures + // On MSVC, *only* if /analyze flag is enabled(defines _PREFAST_) we can also do a compile-time check + // For not affecting final release binary size, we don't use the templated version on Release configuration either #if AZ_COMPILER_CLANG || defined(_PREFAST_) || defined(_RELEASE) # if AZ_COMPILER_CLANG # define FORMAT_FUNC __attribute__((format(printf, 1, 2))) @@ -1597,137 +1559,70 @@ namespace AZStd template inline basic_string(const basic_string& rhs) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) { assign(rhs.c_str()); } template inline this_type& operator=(const basic_string& rhs) { return assign(rhs.c_str()); } template - inline this_type& append(const basic_string& rhs) { return append(rhs.c_str()); } + inline this_type& append(const basic_string& rhs) { return append(rhs.c_str()); } template inline this_type& insert(size_type offset, const basic_string& rhs) { return insert(offset, rhs.c_str()); } template inline this_type& replace(size_type offset, size_type count, const basic_string& rhs) { return replace(offset, count, rhs.c_str()); } template - inline int compare(const basic_string& rhs) { return compare(rhs.c_str()); } + inline int compare(const basic_string& rhs) { return compare(rhs.c_str()); } // @} protected: - enum - { // length of internal buffer, [1, 16] - SSO_BUF_SIZE = 16 / sizeof (Element) < 1 ? 1 : 16 / sizeof(Element) - }; enum { // roundup mask for allocated buffers, [0, 15] - _ALLOC_MASK = sizeof (Element) <= 1 ? 15 : sizeof (Element) <= 2 ? 7 : sizeof (Element) <= 4 ? 3 : sizeof (Element) <= 8 ? 1 : 0 + _ALLOC_MASK = sizeof(Element) <= 1 ? 15 + : sizeof(Element) <= 2 ? 7 + : sizeof(Element) <= 4 ? 3 + : sizeof(Element) <= 8 ? 1 : 0 }; - template - inline this_type& append_iter(InputIterator count, InputIterator ch, const true_type& /* is_integral */) - { // append count * ch - return append((size_type)count, (Element)ch); - } - - template - inline void construct_iter(InputIterator count, InputIterator ch, const true_type& /* is_integral */) - { // initialize from count * ch - assign((size_type)count, (Element)ch); - } - - template - inline void construct_iter(InputIterator first, InputIterator last, const false_type& /*, const input_iterator_tag&*/) - { - // initialize from [first, last), input iterators - // \todo use insert ? - for (; first != last; ++first) - { - append((size_type)1, (Element) * first); - } - } - - - template - inline this_type& append_iter(InputIterator first, InputIterator last, const false_type& /* !is_integral */) - { // append [first, last), input iterators - return replace(end(), end(), first, last); - } - - - template - inline this_type& assign_iter(InputIterator count, InputIterator ch, const true_type&) { return assign((size_type)count, (Element)ch); } - template - inline this_type& assign_iter(InputIterator first, InputIterator last, const false_type&){ return replace(begin(), end(), first, last); } - - template - inline void insert_iter(const_iterator insertPos, InputIterator count, InputIterator ch, const true_type& /* is_integral() */) - { // insert count * ch at insertPos - insert(insertPos, (size_type)count, (Element)ch); - } - - template - inline void insert_iter(const_iterator insertPos, InputIterator first, InputIterator last, const false_type& /* is_integral() */) - { // insert [first, last) at insertPos, input iterators - replace(insertPos, insertPos, first, last); - } - - - template - inline this_type& replace_iter(const_iterator first, const_iterator last, InputIterator count, InputIterator ch, const true_type& /* is_intergral */) - { // replace [first, last) with count * ch - return replace(first, last, (size_type)count, (Element)ch); - } - - template - inline this_type& replace_iter(const_iterator first, const_iterator last, InputIterator first2, InputIterator last2, const false_type& /* !is_intergral */) - { // replace [first, last) with [first2, last2), input iterators - this_type rhs(first2, last2); - replace(first, last, rhs); - return *this; - } - void copy(size_type newSize, size_type oldLength) { size_type newCapacity = newSize | _ALLOC_MASK; - if (newCapacity / 3 < m_capacity / 2) + size_type currentCapacity = capacity(); + if (newCapacity / 3 < currentCapacity / 2) { - newCapacity = m_capacity + m_capacity / 2; // grow exponentially if possible + newCapacity = currentCapacity + currentCapacity / 2; // grow exponentially if possible } - if (newCapacity >= SSO_BUF_SIZE) + if (newCapacity >= ShortStringData::Capacity) { size_type expandedSize = 0; - if (m_capacity >= SSO_BUF_SIZE) + if (!m_storage.first().ShortStringOptimizationActive()) { - expandedSize = m_allocator.resize(m_data, sizeof(node_type) * (newCapacity + 1)); + expandedSize = m_storage.second().resize(m_storage.first().GetData(), sizeof(node_type) * (newCapacity + 1)); // our memory managers allocate on 8+ bytes boundary and our node type should be less than that in general, otherwise // we need to take care when we compute the size on deallocate. - AZ_Assert(expandedSize % sizeof(node_type) == 0, "Expanded size not a multiply of node type. This should not happen"); + AZ_Assert(expandedSize % sizeof(node_type) == 0, "Expanded size not a multiple of node type. This should not happen"); size_type expandedCapacity = expandedSize / sizeof(node_type); if (expandedCapacity > newCapacity) { - m_capacity = expandedCapacity - 1; + m_storage.first().SetCapacity(expandedCapacity - 1); return; } } - pointer newData = reinterpret_cast(m_allocator.allocate(sizeof(node_type) * (newCapacity + 1), alignment_of::value)); - AZSTD_CONTAINER_ASSERT(newData != 0, "AZStd::string allocation failed!"); + pointer newData = reinterpret_cast(m_storage.second().allocate(sizeof(node_type) * (newCapacity + 1), alignof(node_type))); + AZSTD_CONTAINER_ASSERT(newData != nullptr, "AZStd::string allocation failed!"); if (newData) { - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); if (0 < oldLength) { - Traits::copy(newData /*, newSize + 1*/, data, oldLength); // copy existing elements - } - if (m_capacity >= SSO_BUF_SIZE) - { - deallocate_memory(m_data, expandedSize, typename allocator_type::allow_memory_leaks()); + Traits::copy(newData, data, oldLength); // copy existing elements } + deallocate_memory(data, expandedSize, typename allocator_type::allow_memory_leaks()); - m_data = newData; - m_capacity = newCapacity; - Traits::assign(m_data[newSize], Element()); // terminate + Traits::assign(newData[oldLength], Element()); // terminate + m_storage.first().SetCapacity(newCapacity); + m_storage.first().SetSize(oldLength); + m_storage.first().SetData(newData); } } } @@ -1735,40 +1630,209 @@ namespace AZStd bool grow(size_type newSize) { // ensure buffer is big enough, trim to size if _Trim is true - if (m_capacity < newSize) + if (capacity() < newSize) { - copy(newSize, m_size); // reallocate to grow + copy(newSize, size()); // reallocate to grow } else if (newSize == 0) { - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - m_size = 0; + pointer data = m_storage.first().GetData(); + m_storage.first().SetSize(0); Traits::assign(data[0], Element()); // terminate } return (0 < newSize); // return true only if more work to do } + bool fits_in_capacity(size_type newSize) + { + return newSize <= capacity(); + } + inline void deallocate_memory(pointer, size_type, const true_type& /* allocator::allow_memory_leaks */) {} inline void deallocate_memory(pointer data, size_type expandedSize, const false_type& /* !allocator::allow_memory_leaks */) { - if (m_capacity >= SSO_BUF_SIZE) + if (!m_storage.first().ShortStringOptimizationActive()) { - size_type byteSize = (expandedSize == 0) ? (sizeof(node_type) * (m_capacity + 1)) : expandedSize; - m_allocator.deallocate(data, byteSize, alignment_of::value); + size_type byteSize = (expandedSize == 0) ? (sizeof(node_type) * (m_storage.first().GetCapacity() + 1)) : expandedSize; + m_storage.second().deallocate(data, byteSize, alignof(node_type)); } } - union //Storage + //! Assuming 64-bit for pointer and size_t size + //! The offset and sizes of each structure are marked below + + //! dynamically allocated data + struct AllocatedStringData { - Element m_buffer[SSO_BUF_SIZE]; //< small buffer used for small string optimization - pointer m_data; //< dynamically allocated data + AllocatedStringData() + { + m_capacity = 0; + m_ssoActive = false; + } + // bit offset: 0, bits: 64 + pointer m_data{}; + + // bit offset: 64, bit: 64 + size_type m_size{}; + + // Use all but the top bit of a size_t for the string capacity + // This allows the short string optimization to be used + // with no additional space at the cost of cutting the max_size in half + // to 2^63-1 + // offset: 128, bits: 63 + size_type m_capacity : AZStd::numeric_limits::digits - 1; + + // bit offset: 191, bits: 1 + size_type m_ssoActive : 1; + + // Total size 192 bits(24 bytes) }; - size_type m_size; // current length of string - size_type m_capacity; // current storage reserved for string - allocator_type m_allocator; + static_assert(sizeof(AllocatedStringData) <= 24, "The AllocatedStringData structure" + " should be an 8-byte pointer, 8 byte size, 63-bit capacity and 1-bit SSO flag for" + " a total of 24 bytes"); + + //! small buffer used for small string optimization + struct ShortStringData + { + //! The size can be stored within 7 bits since the buffer will be no larger + //! than 23 bytes(22 characters + 1 null-terminating character) + inline static constexpr size_type BufferMaxSize = sizeof(AllocatedStringData) - sizeof(AZ::u8); + static_assert(sizeof(Element) < BufferMaxSize, "The size of Element type must be less than the size of " + " the AllocatedStringData struct in order to use it with the basic_string class"); + inline static constexpr size_type BufferCapacityPlusNull = BufferMaxSize / sizeof(Element); + + inline static constexpr size_type Capacity = BufferCapacityPlusNull - 1; + + ShortStringData() + { + // Make sure the short string buffer is null-terminated + m_buffer[0] = Element{}; + m_size = 0; + m_ssoActive = true; + } + + // bit offset: 0, bits: 184 + Element m_buffer[BufferCapacityPlusNull]; + + // Padding to make sure for Element types with a size >1 + // such as wchar_t, that the `m_size` member starts at the bit 164 + // NOTE: Uses the anonymous struct extension + // supported by MSVC, Clang and GCC + // Takes advantage of the empty base optimization + // to have the StringInternal::Padding struct + // take 0 bytes when the Element type is 1-byte type like `char` + // When C++20 support is added, this can be changed to use [[no_unique_address]] + struct + : StringInternal::Padding + { + + // bit offset: 184, bits: 7 + AZ::u8 m_size : AZStd::numeric_limits::digits - 1; + + // bit offset: 191, bits: 1 + AZ::u8 m_ssoActive : 1; + }; + // Total size 192 bits(24 bytes) + }; + + struct PointerAlignedData + { + uintptr_t m_alignedValues[sizeof(ShortStringData) / sizeof(uintptr_t)]; + }; + + static_assert(sizeof(AllocatedStringData) == sizeof(ShortStringData) && "Short string struct must be the same size" + " as the regular allocated string struct"); + + static_assert(sizeof(PointerAlignedData) == sizeof(ShortStringData) && "Pointer aligned struct must be the same size" + " as the short string struct "); + + // The top-bit in the last byte of the AllocatedStringData and ShortStringData is used to determine if the short string optimization is being used + union Storage + { + Storage() {}; + + bool ShortStringOptimizationActive() const + { + return m_shortData.m_ssoActive; + } + const_pointer GetData() const + { + return ShortStringOptimizationActive() ? m_shortData.m_buffer + : reinterpret_cast(m_shortData).m_data; + } + pointer GetData() + { + return ShortStringOptimizationActive() ? m_shortData.m_buffer + : reinterpret_cast(m_shortData).m_data; + } + void SetData(pointer address) + { + if (!ShortStringOptimizationActive()) + { + reinterpret_cast(m_shortData).m_data = address; + } + else + { + AZSTD_CONTAINER_ASSERT(false, "Programming Error: string class is invoking SetData when the Short Optimization" + " is active. Make sure SetCapacity() is invoked" + " before calling this function."); + } + } + size_type GetSize() const + { + return ShortStringOptimizationActive() ? m_shortData.m_size + : reinterpret_cast(m_shortData).m_size; + } + void SetSize(size_type size) + { + if (ShortStringOptimizationActive()) + { + m_shortData.m_size = size; + } + else + { + reinterpret_cast(m_shortData).m_size = size; + } + } + size_type GetCapacity() const + { + return ShortStringOptimizationActive() ? m_shortData.Capacity + : reinterpret_cast(m_shortData).m_capacity; + } + void SetCapacity(size_type capacity) + { + if (capacity <= ShortStringData::Capacity) + { + m_shortData.m_ssoActive = true; + } + else + { + m_shortData.m_ssoActive = false; + reinterpret_cast(m_shortData).m_capacity = capacity; + } + } + void swap(Storage& rhs) + { + // Use pointer sized swaps to swap the string storage + AZStd::aligned_storage_for_t tempStorage; + ::memcpy(&tempStorage, this, sizeof(Storage)); + ::memcpy(this, &rhs, sizeof(Storage)); + ::memcpy(&rhs, &tempStorage, sizeof(Storage)); + } + private: + ShortStringData m_shortData{}; + AllocatedStringData m_allocatedData; + PointerAlignedData m_pointerData; + }; + + AZStd::compressed_pair m_storage; + +#if defined(HAVE_BENCHMARK) + friend class Benchmark::StringBenchmarkFixture; +#endif #ifdef AZSTD_HAS_CHECKED_ITERATORS void orphan_range(pointer first, pointer last) const @@ -1809,18 +1873,7 @@ namespace AZStd }; template - const typename basic_string::size_type basic_string::npos; - - // basic_string implements a performant swap - /*template - class move_operation_category > - { - public: - typedef swap_move_tag move_cat; - };*/ - - template - inline void swap(basic_string& left, basic_string& right) + inline void swap(basic_string& left, basic_string& right) { left.swap(right); } @@ -2027,6 +2080,3 @@ namespace AZStd }; } // namespace AZStd - -#endif // AZSTD_STRING_H -#pragma once diff --git a/Code/Framework/AzCore/AzCore/std/string/string_view.h b/Code/Framework/AzCore/AzCore/std/string/string_view.h index 30e61f95ce..841044dd16 100644 --- a/Code/Framework/AzCore/AzCore/std/string/string_view.h +++ b/Code/Framework/AzCore/AzCore/std/string/string_view.h @@ -280,18 +280,36 @@ namespace AZStd static constexpr char_type* assign(char_type* dest, size_t count, char_type ch) noexcept { AZ_Assert(dest, "Invalid input!"); - for (char_type* iter = dest; count; --count, ++iter) + + if constexpr (AZStd::is_same_v) { - assign(*iter, ch); + // Use builtin_memset if available for char type + if (az_builtin_is_constant_evaluated()) + { + for (char_type* iter = dest; count; --count, ++iter) + { + assign(*iter, ch); + } + } + else + { + ::memset(dest, ch, count); + } + } + else + { + for (char_type* iter = dest; count; --count, ++iter) + { + assign(*iter, ch); + } } + return dest; } static constexpr bool eq(char_type left, char_type right) noexcept { return left == right; } static constexpr bool lt(char_type left, char_type right) noexcept { return left < right; } static constexpr int compare(const char_type* s1, const char_type* s2, size_t count) noexcept { - // Regression in VS2017 15.8 and 15.9 where __builtin_memcmp fails in valid checks in constexpr evaluation -#if !defined(AZ_COMPILER_MSVC) || AZ_COMPILER_MSVC < 1915 || AZ_COMPILER_MSVC > 1916 if constexpr (AZStd::is_same_v) { return __builtin_memcmp(s1, s2, count); @@ -301,7 +319,6 @@ namespace AZStd return __builtin_wmemcmp(s1, s2, count); } else -#endif { for (; count; --count, ++s1, ++s2) { @@ -339,10 +356,6 @@ namespace AZStd } static constexpr const char_type* find(const char_type* s, size_t count, const char_type& ch) noexcept { - // There is a bug with the __builtin_char_memchr intrinsic in Visual Studio 2017 15.8.x and 15.9.x - // It reads in one more additional character than the value of count. - // This is probably due to assuming null-termination -#if !defined(AZ_COMPILER_MSVC) || AZ_COMPILER_MSVC < 1915 || AZ_COMPILER_MSVC > 1916 if constexpr (AZStd::is_same_v) { return __builtin_char_memchr(s, ch, count); @@ -353,7 +366,6 @@ namespace AZStd } else -#endif { for (; count; --count, ++s) { @@ -368,64 +380,112 @@ namespace AZStd static constexpr char_type* move(char_type* dest, const char_type* src, size_t count) noexcept { AZ_Assert(dest != nullptr && src != nullptr, "Invalid input!"); - if (count == 0) + if (count == 0 || src == dest) { return dest; } - char_type* result = dest; - // The less than(<), greater than(>) and other variants(<=, >=) - // Cannot be compare pointers within a constexpr due to the potential for undefined behavior - // per the bullet linked in the C++ standard at http://eel.is/c++draft/expr.compound#expr.rel-5 - // Now clang and gcc compilers allow the use of this relation operators in a constexpr, but - // msvc is not so forgiving - // So a workaround of iterating the src pointer, checking for equality with the dest pointer - // is used to check for overlap - auto should_copy_forward = [](const char_type* dest1, const char_type* src2, size_t count2) constexpr -> bool - { - bool dest_less_than_src{ true }; - for(const char_type* src_iter = src2; src_iter != src2 + count2; ++src_iter) + + #if az_has_builtin_memmove + __builtin_memmove(dest, src, count * sizeof(char_type)); + #else + auto NonBuiltinMove = [](char_type* dest1, const char_type* src1, size_t count1) constexpr + -> char_type* + { + if (az_builtin_is_constant_evaluated()) { - if (src_iter == dest1) + // The less than(<), greater than(>) and other variants(<=, >=) + // Cannot be compare pointers within a constexpr due to the potential for undefined behavior + // per the bullet linked in the C++ standard at http://eel.is/c++draft/expr.compound#expr.rel-5 + // Now clang and gcc compilers allow the use of this relation operators in a constexpr, but + // msvc is not so forgiving + // So a workaround of iterating the src pointer, checking for equality with the dest pointer + // is used to check for overlap + auto should_copy_forward = [](const char_type* dest2, const char_type* src2, size_t count2) constexpr -> bool + { + bool dest_less_than_src{ true }; + for (const char_type* src_iter = src2; src_iter != src2 + count2; ++src_iter) + { + if (src_iter == dest2) + { + dest_less_than_src = false; + break; + } + } + return dest_less_than_src; + }; + + if (should_copy_forward(dest1, src1, count1)) { - dest_less_than_src = false; - break; + copy(dest1, src1, count1); + } + else + { + copy_backward(dest1, src1, count1); } } - return dest_less_than_src; - }; + else + { + // Use the faster ::memmove operation at runtime + ::memmove(dest1, src1, count1 * sizeof(char_type)); + } - if (should_copy_forward(dest, src, count)) - { - copy(dest, src, count); - } - else - { - copy_backward(dest, src, count); - } + return dest1; + }; + NonBuiltinMove(dest, src, count); + #endif - return result; + return dest; } static constexpr char_type* copy(char_type* dest, const char_type* src, size_t count) noexcept { AZ_Assert(dest != nullptr && src != nullptr, "Invalid input!"); - char_type* result = dest; - for(; count; --count, ++dest, ++src) + + #if az_has_builtin_memcpy + __builtin_memcpy(dest, src, count * sizeof(char_type)); + #else + auto NonBuiltinCopy = [](char_type* dest1, const char_type* src1, size_t count1) constexpr + -> char_type* { - assign(*dest, *src); - } - return result; + if (az_builtin_is_constant_evaluated()) + { + for (; count1; --count1, ++dest1, ++src1) + { + assign(*dest1, *src1); + } + } + else + { + ::memcpy(dest1, src1, count1 * sizeof(char_type)); + } + return dest1; + }; + NonBuiltinCopy(dest, src, count); + #endif + + return dest; } // Extension for constexpr workarounds: Addresses of a string literal cannot be compared at compile time and MSVC and clang will just refuse to compile the constexpr // Adding a copy_backwards overload that always copies backwards. - static constexpr char_type* copy_backward(char_type* dest, const char_type*src, size_t count) noexcept + static constexpr char_type* copy_backward(char_type* dest, const char_type* src, size_t count) noexcept { char_type* result = dest; - dest += count; - src += count; - for (; count; --count) + #if az_has_builtin_memmove + __builtin_memmove(dest, src, count * sizeof(char_type)); + #else + if (az_builtin_is_constant_evaluated()) + { + dest += count; + src += count; + for (; count; --count) + { + assign(*--dest, *--src); + } + } + else { - assign(*--dest, *--src); + ::memmove(dest, src, count); } + #endif return result; } diff --git a/Code/Framework/AzCore/Platform/Common/VisualStudio/AzCore/Natvis/azcore.natvis b/Code/Framework/AzCore/Platform/Common/VisualStudio/AzCore/Natvis/azcore.natvis index 3730b8a4f9..dca82e2439 100644 --- a/Code/Framework/AzCore/Platform/Common/VisualStudio/AzCore/Natvis/azcore.natvis +++ b/Code/Framework/AzCore/Platform/Common/VisualStudio/AzCore/Natvis/azcore.natvis @@ -10,6 +10,13 @@ + + {m_element} + + + {$T1} is empty + + reverse_iterator base() {m_current} @@ -388,35 +395,41 @@ - - {m_buffer,s} - {m_data,s} - m_buffer,s - m_data,s + + {((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_buffer,s} + {((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_data,s} + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_buffer,s + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_data,s - m_size - m_capacity + (size_t)((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_size + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_size + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.Capacity + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_capacity - m_size - m_buffer - m_data + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_size,u + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_size + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_buffer + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_data - {m_buffer,su} - {m_data,su} - m_buffer,su - m_data,su - - m_size - m_capacity + {((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_buffer,su} + {((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_data,su} + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_buffer,su + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_data,su + + (size_t)((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_size + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_size + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.Capacity + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_capacity - m_size - m_buffer - m_data + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_size,u + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_size + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_buffer + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_data diff --git a/Code/Framework/AzCore/Tests/AZStd/String.cpp b/Code/Framework/AzCore/Tests/AZStd/String.cpp index 356310a94d..0f84ad0970 100644 --- a/Code/Framework/AzCore/Tests/AZStd/String.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/String.cpp @@ -8,11 +8,11 @@ #include "UserTypes.h" #include -#include #include #include #include #include +#include #include #include #include @@ -21,13 +21,10 @@ #include // we need this for AZ_TEST_FLOAT compare -#include #include #include #include -using namespace AZStd; - // Because of the SSO (small string optimization) we always shoule have capacity != 0 and data != 0 #define AZ_TEST_VALIDATE_EMPTY_STRING(_String) \ EXPECT_TRUE(_String.validate()); \ @@ -81,8 +78,6 @@ namespace UnitTest va_end(mark); } -#if !AZ_UNIT_TEST_SKIP_STD_STRING_TESTS - TEST(StringC, VSNPrintf) { char buffer32[32]; @@ -168,75 +163,75 @@ namespace UnitTest { const char* sChar = "SSO string"; // 10 characters const char* sCharLong = "This is a long string test that will allocate"; // 45 characters - array aChar = { + AZStd::array aChar = { { 'a', 'b', 'c', 'd', 'e', 'f' } }; // short string (should use SSO) - string str1; + AZStd::string str1; AZ_TEST_VALIDATE_EMPTY_STRING(str1); // short char* - string str2(sChar); + AZStd::string str2(sChar); AZ_TEST_VALIDATE_STRING(str2, 10); - string str2_1(""); + AZStd::string str2_1(""); AZ_TEST_VALIDATE_EMPTY_STRING(str2_1); - string str3(sChar, 5); + AZStd::string str3(sChar, 5); AZ_TEST_VALIDATE_STRING(str3, 5); // long char* - string str4(sCharLong); + AZStd::string str4(sCharLong); AZ_TEST_VALIDATE_STRING(str4, 45); - string str5(sCharLong, 35); + AZStd::string str5(sCharLong, 35); AZ_TEST_VALIDATE_STRING(str5, 35); // element - string str6(13, 'a'); + AZStd::string str6(13, 'a'); AZ_TEST_VALIDATE_STRING(str6, 13); - string str6_1(0, 'a'); + AZStd::string str6_1(0, 'a'); AZ_TEST_VALIDATE_EMPTY_STRING(str6_1); - string str7(aChar.begin(), aChar.end()); + AZStd::string str7(aChar.begin(), aChar.end()); AZ_TEST_VALIDATE_STRING(str7, 6); - string str7_1(aChar.begin(), aChar.begin()); + AZStd::string str7_1(aChar.begin(), aChar.begin()); AZ_TEST_VALIDATE_EMPTY_STRING(str7_1); - string str8(sChar, sChar + 3); + AZStd::string str8(sChar, sChar + 3); AZ_TEST_VALIDATE_STRING(str8, 3); - string str8_1(sChar, sChar); + AZStd::string str8_1(sChar, sChar); AZ_TEST_VALIDATE_EMPTY_STRING(str8_1); // - string str9(str2); + AZStd::string str9(str2); AZ_TEST_VALIDATE_STRING(str9, 10); - string str9_1(str1); + AZStd::string str9_1(str1); AZ_TEST_VALIDATE_EMPTY_STRING(str9_1); - string str10(str2, 4); + AZStd::string str10(str2, 4); AZ_TEST_VALIDATE_STRING(str10, 6); - string str11(str2, 4, 3); + AZStd::string str11(str2, 4, 3); AZ_TEST_VALIDATE_STRING(str11, 3); - string str12(sChar); - string large = sCharLong; + AZStd::string str12(sChar); + AZStd::string large = sCharLong; // move ctor - string strSm = AZStd::move(str12); + AZStd::string strSm = AZStd::move(str12); AZ_TEST_VALIDATE_STRING(strSm, 10); AZ_TEST_VALIDATE_EMPTY_STRING(str12); - string strLg(AZStd::move(large)); + AZStd::string strLg(AZStd::move(large)); AZ_TEST_VALIDATE_STRING(strLg, 45); AZ_TEST_VALIDATE_EMPTY_STRING(large); - string strEmpty(AZStd::move(str1)); + AZStd::string strEmpty(AZStd::move(str1)); AZ_TEST_VALIDATE_EMPTY_STRING(strEmpty); AZ_TEST_VALIDATE_EMPTY_STRING(str1); @@ -369,7 +364,7 @@ namespace UnitTest AZ_TEST_VALIDATE_STRING(str2, 28); AZ_TEST_ASSERT(str2[0] == 'b'); - str2.erase(str2.begin(), next(str2.begin(), 4)); + str2.erase(str2.begin(), AZStd::next(str2.begin(), 4)); AZ_TEST_VALIDATE_STRING(str2, 24); AZ_TEST_ASSERT(str2[0] == 'f'); @@ -400,33 +395,33 @@ namespace UnitTest AZ_TEST_ASSERT(str2[3] == 'g'); AZ_TEST_ASSERT(str2[4] == 'g'); - str2.replace(str2.begin(), next(str2.begin(), str1.length()), str1); + str2.replace(str2.begin(), AZStd::next(str2.begin(), str1.length()), str1); AZ_TEST_VALIDATE_STRING(str2, 24); AZ_TEST_ASSERT(str2[0] == 'a'); AZ_TEST_ASSERT(str2[1] == 'b'); - str2.replace(str2.begin(), next(str2.begin(), 10), sChar); + str2.replace(str2.begin(), AZStd::next(str2.begin(), 10), sChar); AZ_TEST_VALIDATE_STRING(str2, 24); AZ_TEST_ASSERT(str2[0] == 'S'); AZ_TEST_ASSERT(str2[1] == 'S'); - str2.replace(str2.begin(), next(str2.begin(), 3), sChar, 3); + str2.replace(str2.begin(), AZStd::next(str2.begin(), 3), sChar, 3); AZ_TEST_VALIDATE_STRING(str2, 24); AZ_TEST_ASSERT(str2[0] == 'S'); AZ_TEST_ASSERT(str2[1] == 'S'); AZ_TEST_ASSERT(str2[2] == 'O'); - str2.replace(str2.begin(), next(str2.begin(), 2), 2, 'h'); + str2.replace(str2.begin(), AZStd::next(str2.begin(), 2), 2, 'h'); AZ_TEST_VALIDATE_STRING(str2, 24); AZ_TEST_ASSERT(str2[0] == 'h'); AZ_TEST_ASSERT(str2[1] == 'h'); - str2.replace(str2.begin(), next(str2.begin(), 2), aChar.begin(), next(aChar.begin(), 2)); + str2.replace(str2.begin(), AZStd::next(str2.begin(), 2), aChar.begin(), AZStd::next(aChar.begin(), 2)); AZ_TEST_VALIDATE_STRING(str2, 24); AZ_TEST_ASSERT(str2[0] == 'a'); AZ_TEST_ASSERT(str2[1] == 'b'); - str2.replace(str2.begin(), next(str2.begin(), 2), sChar, sChar + 5); + str2.replace(str2.begin(), AZStd::next(str2.begin(), 2), sChar, sChar + 5); AZ_TEST_VALIDATE_STRING(str2, 27); AZ_TEST_ASSERT(str2[0] == 'S'); AZ_TEST_ASSERT(str2[1] == 'S'); @@ -489,7 +484,7 @@ namespace UnitTest AZ_TEST_ASSERT(pos == 2); pos = str1.find('Z'); - AZ_TEST_ASSERT(pos == string::npos); + AZ_TEST_ASSERT(pos == AZStd::string::npos); pos = str1.rfind(str2); AZ_TEST_ASSERT(pos == 12); @@ -510,7 +505,7 @@ namespace UnitTest AZ_TEST_ASSERT(pos == 12); pos = str1.rfind('Z'); - AZ_TEST_ASSERT(pos == string::npos); + AZ_TEST_ASSERT(pos == AZStd::string::npos); pos = str1.find_first_of(str2); AZ_TEST_ASSERT(pos == 2); @@ -535,7 +530,7 @@ namespace UnitTest AZ_TEST_ASSERT(pos == 12); pos = str1.find_first_of('Z'); - AZ_TEST_ASSERT(pos == string::npos); + AZ_TEST_ASSERT(pos == AZStd::string::npos); pos = str1.find_last_of(str2); AZ_TEST_ASSERT(pos == 14); @@ -550,7 +545,7 @@ namespace UnitTest AZ_TEST_ASSERT(pos == 12); pos = str1.find_last_of('Z'); - AZ_TEST_ASSERT(pos == string::npos); + AZ_TEST_ASSERT(pos == AZStd::string::npos); pos = str1.find_first_not_of(str2, 3); AZ_TEST_ASSERT(pos == 5); @@ -559,13 +554,13 @@ namespace UnitTest AZ_TEST_ASSERT(pos == 0); pos = str1.find_last_not_of(sChar); - AZ_TEST_ASSERT(pos == string::npos); + AZ_TEST_ASSERT(pos == AZStd::string::npos); pos = str1.find_last_not_of('Z'); AZ_TEST_ASSERT(pos == 19); - string sub = str1.substr(0, 10); + AZStd::string sub = str1.substr(0, 10); AZ_TEST_VALIDATE_STRING(sub, 10); AZ_TEST_ASSERT(sub[0] == 'S'); AZ_TEST_ASSERT(sub[9] == 'g'); @@ -594,13 +589,13 @@ namespace UnitTest using iteratorType = char; auto testValue = str4; - reverse_iterator rend = testValue.rend(); - reverse_iterator crend1 = testValue.rend(); - reverse_iterator crend2 = testValue.crend(); + AZStd::reverse_iterator rend = testValue.rend(); + AZStd::reverse_iterator crend1 = testValue.rend(); + AZStd::reverse_iterator crend2 = testValue.crend(); - reverse_iterator rbegin = testValue.rbegin(); - reverse_iterator crbegin1 = testValue.rbegin(); - reverse_iterator crbegin2 = testValue.crbegin(); + AZStd::reverse_iterator rbegin = testValue.rbegin(); + AZStd::reverse_iterator crbegin1 = testValue.rbegin(); + AZStd::reverse_iterator crbegin2 = testValue.crbegin(); AZ_TEST_ASSERT(rend == crend1); AZ_TEST_ASSERT(crend1 == crend2); @@ -630,128 +625,128 @@ namespace UnitTest TEST_F(String, Algorithms) { - string str = string::format("%s %d", "BlaBla", 5); + AZStd::string str = AZStd::string::format("%s %d", "BlaBla", 5); AZ_TEST_VALIDATE_STRING(str, 8); - wstring wstr = wstring::format(L"%ls %d", L"BlaBla", 5); + AZStd::wstring wstr = AZStd::wstring::format(L"%ls %d", L"BlaBla", 5); AZ_TEST_VALIDATE_WSTRING(wstr, 8); - to_lower(str.begin(), str.end()); + AZStd::to_lower(str.begin(), str.end()); AZ_TEST_ASSERT(str[0] == 'b'); AZ_TEST_ASSERT(str[3] == 'b'); - to_upper(str.begin(), str.end()); + AZStd::to_upper(str.begin(), str.end()); AZ_TEST_ASSERT(str[1] == 'L'); AZ_TEST_ASSERT(str[2] == 'A'); - string intStr("10"); + AZStd::string intStr("10"); int ival = AZStd::stoi(intStr); AZ_TEST_ASSERT(ival == 10); - wstring wintStr(L"10"); + AZStd::wstring wintStr(L"10"); ival = AZStd::stoi(wintStr); AZ_TEST_ASSERT(ival == 10); - string floatStr("2.32"); + AZStd::string floatStr("2.32"); float fval = AZStd::stof(floatStr); AZ_TEST_ASSERT_FLOAT_CLOSE(fval, 2.32f); - wstring wfloatStr(L"2.32"); + AZStd::wstring wfloatStr(L"2.32"); fval = AZStd::stof(wfloatStr); AZ_TEST_ASSERT_FLOAT_CLOSE(fval, 2.32f); - to_string(intStr, 20); + AZStd::to_string(intStr, 20); AZ_TEST_ASSERT(intStr == "20"); - AZ_TEST_ASSERT(to_string(static_cast(20)) == "20"); - AZ_TEST_ASSERT(to_string(static_cast(20)) == "20"); - AZ_TEST_ASSERT(to_string(static_cast(20)) == "20"); - AZ_TEST_ASSERT(to_string(static_cast(20)) == "20"); - AZ_TEST_ASSERT(to_string(static_cast(20)) == "20"); - AZ_TEST_ASSERT(to_string(static_cast(20)) == "20"); + EXPECT_EQ("20", AZStd::to_string(static_cast(20))); + EXPECT_EQ("20", AZStd::to_string(static_cast(20))); + EXPECT_EQ("20", AZStd::to_string(static_cast(20))); + EXPECT_EQ("20", AZStd::to_string(static_cast(20))); + EXPECT_EQ("20", AZStd::to_string(static_cast(20))); + EXPECT_EQ("20", AZStd::to_string(static_cast(20))); // wstring to string - string str1; - to_string(str1, wstr); + AZStd::string str1; + AZStd::to_string(str1, wstr); AZ_TEST_ASSERT(str1 == "BlaBla 5"); EXPECT_EQ(8, to_string_length(wstr)); - str1 = string::format("%ls", wstr.c_str()); + str1 = AZStd::string::format("%ls", wstr.c_str()); AZ_TEST_ASSERT(str1 == "BlaBla 5"); // string to wstring - wstring wstr1; - to_wstring(wstr1, str); + AZStd::wstring wstr1; + AZStd::to_wstring(wstr1, str); AZ_TEST_ASSERT(wstr1 == L"BLABLA 5"); - wstr1 = wstring::format(L"%hs", str.c_str()); + wstr1 = AZStd::wstring::format(L"%hs", str.c_str()); AZ_TEST_ASSERT(wstr1 == L"BLABLA 5"); // wstring to char buffer char strBuffer[9]; - to_string(strBuffer, 9, wstr1.c_str()); + AZStd::to_string(strBuffer, 9, wstr1.c_str()); AZ_TEST_ASSERT(0 == azstricmp(strBuffer, "BLABLA 5")); EXPECT_EQ(8, to_string_length(wstr1)); // wstring to char with unicode - wstring ws1InfinityEscaped = L"Infinity: \u221E"; // escaped + AZStd::wstring ws1InfinityEscaped = L"Infinity: \u221E"; // escaped EXPECT_EQ(13, to_string_length(ws1InfinityEscaped)); // wchar_t buffer to char buffer wchar_t wstrBuffer[9] = L"BLABLA 5"; memset(strBuffer, 0, AZ_ARRAY_SIZE(strBuffer)); - to_string(strBuffer, 9, wstrBuffer); + AZStd::to_string(strBuffer, 9, wstrBuffer); AZ_TEST_ASSERT(0 == azstricmp(strBuffer, "BLABLA 5")); // string to wchar_t buffer memset(wstrBuffer, 0, AZ_ARRAY_SIZE(wstrBuffer)); - to_wstring(wstrBuffer, 9, str1.c_str()); + AZStd::to_wstring(wstrBuffer, 9, str1.c_str()); AZ_TEST_ASSERT(0 == azwcsicmp(wstrBuffer, L"BlaBla 5")); // char buffer to wchar_t buffer memset(wstrBuffer, L' ', AZ_ARRAY_SIZE(wstrBuffer)); // to check that the null terminator is properly placed - to_wstring(wstrBuffer, 9, strBuffer); + AZStd::to_wstring(wstrBuffer, 9, strBuffer); AZ_TEST_ASSERT(0 == azwcsicmp(wstrBuffer, L"BLABLA 5")); // wchar UTF16/UTF32 to/from Utf8 wstr1 = L"this is a \u20AC \u00A3 test"; // that's a euro and a pound sterling AZStd::to_string(str, wstr1); - wstring wstr2; + AZStd::wstring wstr2; AZStd::to_wstring(wstr2, str); AZ_TEST_ASSERT(wstr1 == wstr2); // tokenize - vector tokens; - tokenize(string("one, two, three"), string(", "), tokens); + AZStd::vector tokens; + AZStd::tokenize(AZStd::string("one, two, three"), AZStd::string(", "), tokens); AZ_TEST_ASSERT(tokens.size() == 3); AZ_TEST_ASSERT(tokens[0] == "one"); AZ_TEST_ASSERT(tokens[1] == "two"); AZ_TEST_ASSERT(tokens[2] == "three"); - tokenize(string("one, ,, two, ,, three"), string(", "), tokens); + AZStd::tokenize(AZStd::string("one, ,, two, ,, three"), AZStd::string(", "), tokens); AZ_TEST_ASSERT(tokens.size() == 3); AZ_TEST_ASSERT(tokens[0] == "one"); AZ_TEST_ASSERT(tokens[1] == "two"); AZ_TEST_ASSERT(tokens[2] == "three"); - tokenize(string("thequickbrownfox"), string("ABC"), tokens); + AZStd::tokenize(AZStd::string("thequickbrownfox"), AZStd::string("ABC"), tokens); AZ_TEST_ASSERT(tokens.size() == 1); AZ_TEST_ASSERT(tokens[0] == "thequickbrownfox"); - tokenize(string(""), string(""), tokens); + AZStd::tokenize(AZStd::string{}, AZStd::string{}, tokens); AZ_TEST_ASSERT(tokens.empty()); - tokenize(string("ABC"), string("ABC"), tokens); + AZStd::tokenize(AZStd::string("ABC"), AZStd::string("ABC"), tokens); AZ_TEST_ASSERT(tokens.empty()); - tokenize(string(" foo bar "), string(" "), tokens); + AZStd::tokenize(AZStd::string(" foo bar "), AZStd::string(" "), tokens); AZ_TEST_ASSERT(tokens.size() == 2); AZ_TEST_ASSERT(tokens[0] == "foo"); AZ_TEST_ASSERT(tokens[1] == "bar"); - tokenize_keep_empty(string(" foo , bar "), string(","), tokens); + AZStd::tokenize_keep_empty(AZStd::string(" foo , bar "), AZStd::string(","), tokens); AZ_TEST_ASSERT(tokens.size() == 2); AZ_TEST_ASSERT(tokens[0] == " foo "); AZ_TEST_ASSERT(tokens[1] == " bar "); // Sort - AZStd::vector toSort; + AZStd::vector toSort; toSort.push_back("z2"); toSort.push_back("z100"); toSort.push_back("z1"); @@ -761,39 +756,39 @@ namespace UnitTest AZ_TEST_ASSERT(toSort[2] == "z2"); // Natural sort - AZ_TEST_ASSERT(alphanum_comp("", "") == 0); - AZ_TEST_ASSERT(alphanum_comp("", "a") < 0); - AZ_TEST_ASSERT(alphanum_comp("a", "") > 0); - AZ_TEST_ASSERT(alphanum_comp("a", "a") == 0); - AZ_TEST_ASSERT(alphanum_comp("", "9") < 0); - AZ_TEST_ASSERT(alphanum_comp("9", "") > 0); - AZ_TEST_ASSERT(alphanum_comp("1", "1") == 0); - AZ_TEST_ASSERT(alphanum_comp("1", "2") < 0); - AZ_TEST_ASSERT(alphanum_comp("3", "2") > 0); - AZ_TEST_ASSERT(alphanum_comp("a1", "a1") == 0); - AZ_TEST_ASSERT(alphanum_comp("a1", "a2") < 0); - AZ_TEST_ASSERT(alphanum_comp("a2", "a1") > 0); - AZ_TEST_ASSERT(alphanum_comp("a1a2", "a1a3") < 0); - AZ_TEST_ASSERT(alphanum_comp("a1a2", "a1a0") > 0); - AZ_TEST_ASSERT(alphanum_comp("134", "122") > 0); - AZ_TEST_ASSERT(alphanum_comp("12a3", "12a3") == 0); - AZ_TEST_ASSERT(alphanum_comp("12a1", "12a0") > 0); - AZ_TEST_ASSERT(alphanum_comp("12a1", "12a2") < 0); - AZ_TEST_ASSERT(alphanum_comp("a", "aa") < 0); - AZ_TEST_ASSERT(alphanum_comp("aaa", "aa") > 0); - AZ_TEST_ASSERT(alphanum_comp("Alpha 2", "Alpha 2") == 0); - AZ_TEST_ASSERT(alphanum_comp("Alpha 2", "Alpha 2A") < 0); - AZ_TEST_ASSERT(alphanum_comp("Alpha 2 B", "Alpha 2") > 0); - string strA("Alpha 2"); - AZ_TEST_ASSERT(alphanum_comp(strA, "Alpha 2") == 0); - AZ_TEST_ASSERT(alphanum_comp(strA, "Alpha 2A") < 0); - AZ_TEST_ASSERT(alphanum_comp("Alpha 2 B", strA) > 0); - AZ_TEST_ASSERT(alphanum_comp(strA, strdup("Alpha 2")) == 0); - AZ_TEST_ASSERT(alphanum_comp(strA, strdup("Alpha 2A")) < 0); - AZ_TEST_ASSERT(alphanum_comp(strdup("Alpha 2 B"), strA) > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("", "") == 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("", "a") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("a", "") > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("a", "a") == 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("", "9") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("9", "") > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("1", "1") == 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("1", "2") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("3", "2") > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("a1", "a1") == 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("a1", "a2") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("a2", "a1") > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("a1a2", "a1a3") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("a1a2", "a1a0") > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("134", "122") > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("12a3", "12a3") == 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("12a1", "12a0") > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("12a1", "12a2") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("a", "aa") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("aaa", "aa") > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("Alpha 2", "Alpha 2") == 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("Alpha 2", "Alpha 2A") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("Alpha 2 B", "Alpha 2") > 0); + AZStd::string strA("Alpha 2"); + AZ_TEST_ASSERT(AZStd::alphanum_comp(strA, "Alpha 2") == 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp(strA, "Alpha 2A") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("Alpha 2 B", strA) > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp(strA, strdup("Alpha 2")) == 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp(strA, strdup("Alpha 2A")) < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp(strdup("Alpha 2 B"), strA) > 0); // show usage of the comparison functor with a set - using StringSetType = set>; + using StringSetType = AZStd::set>; StringSetType s; s.insert("Xiph Xlater 58"); s.insert("Xiph Xlater 5000"); @@ -879,7 +874,7 @@ namespace UnitTest AZ_TEST_ASSERT(*setIt++ == "Xiph Xlater 10000"); // show usage of comparison functor with a map - using StringIntMapType = map>; + using StringIntMapType = AZStd::map>; StringIntMapType m; m["z1.doc"] = 1; m["z10.doc"] = 2; @@ -931,13 +926,13 @@ namespace UnitTest AZ_TEST_ASSERT((mapIt++)->second == 5); // show usage of comparison functor with an STL algorithm on a vector - vector v; + AZStd::vector v; // vector contents are reversed sorted contents of the old set - AZStd::copy(s.rbegin(), s.rend(), back_inserter(v)); + AZStd::copy(s.rbegin(), s.rend(), AZStd::back_inserter(v)); // now sort the vector with the algorithm - AZStd::sort(v.begin(), v.end(), alphanum_less()); + AZStd::sort(v.begin(), v.end(), AZStd::alphanum_less()); // check values - vector::const_iterator vecIt = v.begin(); + AZStd::vector::const_iterator vecIt = v.begin(); AZ_TEST_ASSERT(*vecIt++ == "10X Radonius"); AZ_TEST_ASSERT(*vecIt++ == "20X Radonius"); AZ_TEST_ASSERT(*vecIt++ == "20X Radonius Prime"); @@ -988,52 +983,52 @@ namespace UnitTest TEST_F(Regex, Regex_IPAddressSubnetPattern_Success) { // Error case for LY-43888 - regex txt_regex("^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/([0-9]|[1-2][0-9]|3[0-2]))?$"); - string sample_input("10.85.22.92/24"); - bool match = regex_match(sample_input, txt_regex); + AZStd::regex txt_regex("^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/([0-9]|[1-2][0-9]|3[0-2]))?$"); + AZStd::string sample_input("10.85.22.92/24"); + bool match = AZStd::regex_match(sample_input, txt_regex); AZ_TEST_ASSERT(match); } TEST_F(Regex, MatchConstChar) { //regex - AZ_TEST_ASSERT(regex_match("subject", regex("(sub)(.*)"))); + AZ_TEST_ASSERT(AZStd::regex_match("subject", AZStd::regex("(sub)(.*)"))); } TEST_F(Regex, MatchString) { - string reStr("subject"); - regex re("(sub)(.*)"); - AZ_TEST_ASSERT(regex_match(reStr, re)); - AZ_TEST_ASSERT(regex_match(reStr.begin(), reStr.end(), re)) + AZStd::string reStr("subject"); + AZStd::regex re("(sub)(.*)"); + AZ_TEST_ASSERT(AZStd::regex_match(reStr, re)); + AZ_TEST_ASSERT(AZStd::regex_match(reStr.begin(), reStr.end(), re)) } TEST_F(Regex, CMatch) { - regex re("(sub)(.*)"); - cmatch cm; // same as match_results cm; - regex_match("subject", cm, re); + AZStd::regex re("(sub)(.*)"); + AZStd::cmatch cm; // same as match_results cm; + AZStd::regex_match("subject", cm, re); AZ_TEST_ASSERT(cm.size() == 3); } TEST_F(Regex, SMatch) { - string reStr("subject"); - regex re("(sub)(.*)"); - smatch sm; // same as std::match_results sm; - regex_match(reStr, sm, re); + AZStd::string reStr("subject"); + AZStd::regex re("(sub)(.*)"); + AZStd::smatch sm; // same as std::match_results sm; + AZStd::regex_match(reStr, sm, re); AZ_TEST_ASSERT(sm.size() == 3); - regex_match(reStr.cbegin(), reStr.cend(), sm, re); + AZStd::regex_match(reStr.cbegin(), reStr.cend(), sm, re); AZ_TEST_ASSERT(sm.size() == 3); } TEST_F(Regex, CMatchWithFlags) { - regex re("(sub)(.*)"); - cmatch cm; // same as match_results cm; + AZStd::regex re("(sub)(.*)"); + AZStd::cmatch cm; // same as match_results cm; // using explicit flags: - regex_match("subject", cm, re, regex_constants::match_default); + AZStd::regex_match("subject", cm, re, AZStd::regex_constants::match_default); AZ_TEST_ASSERT(cm[0] == "subject"); AZ_TEST_ASSERT(cm[1] == "sub"); AZ_TEST_ASSERT(cm[2] == "ject"); @@ -1042,18 +1037,18 @@ namespace UnitTest TEST_F(Regex, PatternMatchFiles) { // Simple regular expression matching - string fnames[] = { "foo.txt", "bar.txt", "baz.dat", "zoidberg" }; - regex txt_regex("[a-z]+\\.txt"); + AZStd::string fnames[] = { "foo.txt", "bar.txt", "baz.dat", "zoidberg" }; + AZStd::regex txt_regex("[a-z]+\\.txt"); for (size_t i = 0; i < AZ_ARRAY_SIZE(fnames); ++i) { if (i < 2) { - AZ_TEST_ASSERT(regex_match(fnames[i], txt_regex) == true); + AZ_TEST_ASSERT(AZStd::regex_match(fnames[i], txt_regex) == true); } else { - AZ_TEST_ASSERT(regex_match(fnames[i], txt_regex) == false); + AZ_TEST_ASSERT(AZStd::regex_match(fnames[i], txt_regex) == false); } } } @@ -1061,13 +1056,13 @@ namespace UnitTest TEST_F(Regex, PatternWithSingleCaptureGroup) { // Extraction of a sub-match - string fnames[] = { "foo.txt", "bar.txt", "baz.dat", "zoidberg" }; - regex base_regex("([a-z]+)\\.txt"); - smatch base_match; + AZStd::string fnames[] = { "foo.txt", "bar.txt", "baz.dat", "zoidberg" }; + AZStd::regex base_regex("([a-z]+)\\.txt"); + AZStd::smatch base_match; for (size_t i = 0; i < AZ_ARRAY_SIZE(fnames); ++i) { - if (regex_match(fnames[i], base_match, base_regex)) + if (AZStd::regex_match(fnames[i], base_match, base_regex)) { AZ_TEST_ASSERT(base_match.size() == 2); AZ_TEST_ASSERT(base_match[1] == "foo" || base_match[1] == "bar") @@ -1078,12 +1073,12 @@ namespace UnitTest TEST_F(Regex, PatternWithMultipleCaptureGroups) { // Extraction of several sub-matches - string fnames[] = { "foo.txt", "bar.txt", "baz.dat", "zoidberg" }; - regex pieces_regex("([a-z]+)\\.([a-z]+)"); - smatch pieces_match; + AZStd::string fnames[] = { "foo.txt", "bar.txt", "baz.dat", "zoidberg" }; + AZStd::regex pieces_regex("([a-z]+)\\.([a-z]+)"); + AZStd::smatch pieces_match; for (size_t i = 0; i < AZ_ARRAY_SIZE(fnames); ++i) { - if (regex_match(fnames[i], pieces_match, pieces_regex)) + if (AZStd::regex_match(fnames[i], pieces_match, pieces_regex)) { AZ_TEST_ASSERT(pieces_match.size() == 3); AZ_TEST_ASSERT(pieces_match[0] == "foo.txt" || pieces_match[0] == "bar.txt" || pieces_match[0] == "baz.dat"); @@ -1096,40 +1091,40 @@ namespace UnitTest TEST_F(Regex, WideCharTests) { //wchar_t - AZ_TEST_ASSERT(regex_match(L"subject", wregex(L"(sub)(.*)"))); - wstring reWStr(L"subject"); - wregex reW(L"(sub)(.*)"); - AZ_TEST_ASSERT(regex_match(reWStr, reW)); - AZ_TEST_ASSERT(regex_match(reWStr.begin(), reWStr.end(), reW)) + AZ_TEST_ASSERT(AZStd::regex_match(L"subject", AZStd::wregex(L"(sub)(.*)"))); + AZStd::wstring reWStr(L"subject"); + AZStd::wregex reW(L"(sub)(.*)"); + AZ_TEST_ASSERT(AZStd::regex_match(reWStr, reW)); + AZ_TEST_ASSERT(AZStd::regex_match(reWStr.begin(), reWStr.end(), reW)) } TEST_F(Regex, LongPatterns) { // test construction and destruction of a regex with a pattern long enough to require reallocation of buffers - regex longerThan16(".*\\/Presets\\/GeomCache\\/.*", regex::flag_type::icase | regex::flag_type::ECMAScript); - regex longerThan32(".*\\/Presets\\/GeomCache\\/Whatever\\/Much\\/Test\\/Very\\/Memory\\/.*", regex::flag_type::icase); + AZStd::regex longerThan16(".*\\/Presets\\/GeomCache\\/.*", AZStd::regex::flag_type::icase | AZStd::regex::flag_type::ECMAScript); + AZStd::regex longerThan32(".*\\/Presets\\/GeomCache\\/Whatever\\/Much\\/Test\\/Very\\/Memory\\/.*", AZStd::regex::flag_type::icase); } TEST_F(Regex, SmileyFaceParseRegression) { - regex smiley(":)"); + AZStd::regex smiley(":)"); EXPECT_TRUE(smiley.Empty()); EXPECT_TRUE(smiley.GetError() != nullptr); - EXPECT_FALSE(regex_match("wut", smiley)); - EXPECT_FALSE(regex_match(":)", smiley)); + EXPECT_FALSE(AZStd::regex_match("wut", smiley)); + EXPECT_FALSE(AZStd::regex_match(":)", smiley)); } TEST_F(Regex, ParseFailure) { - regex failed(")))/?!\\$"); + AZStd::regex failed(")))/?!\\$"); EXPECT_FALSE(failed.Valid()); - regex other = AZStd::move(failed); + AZStd::regex other = AZStd::move(failed); EXPECT_FALSE(other.Valid()); - regex other2; + AZStd::regex other2; other2.swap(other); EXPECT_TRUE(other.Empty()); EXPECT_TRUE(other.GetError() == nullptr); @@ -1139,69 +1134,69 @@ namespace UnitTest TEST_F(String, ConstString) { - string_view cstr1; - AZ_TEST_ASSERT(cstr1.data()==nullptr); - AZ_TEST_ASSERT(cstr1.size() == 0); - AZ_TEST_ASSERT(cstr1.length() == 0); - AZ_TEST_ASSERT(cstr1.begin() == cstr1.end()); - AZ_TEST_ASSERT(cstr1 == string_view()); - AZ_TEST_ASSERT(cstr1.empty()); - - string_view cstr2("Test"); - AZ_TEST_ASSERT(cstr2.data() != nullptr); - AZ_TEST_ASSERT(cstr2.size() == 4); - AZ_TEST_ASSERT(cstr2.length() == 4); - AZ_TEST_ASSERT(cstr2.begin() != cstr2.end()); - AZ_TEST_ASSERT(cstr2 != cstr1); - AZ_TEST_ASSERT(cstr2 == string_view("Test")); - AZ_TEST_ASSERT(cstr2 == "Test"); - AZ_TEST_ASSERT(cstr2 != "test"); - AZ_TEST_ASSERT(cstr2[2] == 's'); - AZ_TEST_ASSERT(cstr2.at(2) == 's'); + AZStd::string_view cstr1; + EXPECT_EQ(nullptr, cstr1.data()); + EXPECT_EQ(0, cstr1.size()); + EXPECT_EQ(0, cstr1.length()); + EXPECT_EQ(cstr1.begin(), cstr1.end()); + EXPECT_EQ(cstr1, AZStd::string_view()); + EXPECT_TRUE(cstr1.empty()); + + AZStd::string_view cstr2("Test"); + EXPECT_NE(nullptr, cstr2.data()); + EXPECT_EQ(4, cstr2.size()); + EXPECT_EQ(4, cstr2.length()); + EXPECT_NE(cstr2.begin(), cstr2.end()); + EXPECT_NE(cstr2, cstr1); + EXPECT_EQ(cstr2, AZStd::string_view("Test")); + EXPECT_EQ(cstr2, "Test"); + EXPECT_NE(cstr2, "test"); + EXPECT_EQ(cstr2[2], 's'); + EXPECT_EQ(cstr2.at(2), 's'); AZ_TEST_START_TRACE_SUPPRESSION; - AZ_TEST_ASSERT(cstr2.at(7) == 0); + EXPECT_EQ(0, cstr2.at(7)); AZ_TEST_STOP_TRACE_SUPPRESSION(1); - AZ_TEST_ASSERT(!cstr2.empty()); - AZ_TEST_ASSERT(cstr2.data() == string("Test")); - AZ_TEST_ASSERT((string)cstr2 == string("Test")); + EXPECT_FALSE(cstr2.empty()); + EXPECT_EQ(cstr2.data(), AZStd::string("Test")); + EXPECT_EQ(cstr2, AZStd::string("Test")); - string_view cstr3 = cstr2; - AZ_TEST_ASSERT(cstr3 == cstr2); + AZStd::string_view cstr3 = cstr2; + EXPECT_EQ(cstr3, cstr2); cstr3.swap(cstr1); - AZ_TEST_ASSERT(cstr3 == string_view()); - AZ_TEST_ASSERT(cstr1 == cstr2); + EXPECT_EQ(cstr3, AZStd::string_view()); + EXPECT_EQ(cstr1, cstr2); cstr1 = {}; - AZ_TEST_ASSERT(cstr1 == string_view()); - AZ_TEST_ASSERT(cstr1.size() == 0); - AZ_TEST_ASSERT(cstr1.length() == 0); + EXPECT_EQ(cstr1, AZStd::string_view()); + EXPECT_EQ(0, cstr1.size()); + EXPECT_EQ(0, cstr1.length()); AZStd::string str1("Test"); - AZ_TEST_ASSERT(cstr2 == str1); + EXPECT_EQ(cstr2, str1); cstr1 = str1; - AZ_TEST_ASSERT(cstr1 == cstr2); + EXPECT_EQ(cstr1, cstr2); // check hashing - AZStd::hash h; + AZStd::hash h; AZStd::size_t value = h(cstr1); - AZ_TEST_ASSERT(value != 0); + EXPECT_NE(0, value); // testing empty string AZStd::string emptyString; - string_view cstr4; + AZStd::string_view cstr4; cstr4 = emptyString; - AZ_TEST_ASSERT(cstr4.data() != nullptr); - AZ_TEST_ASSERT(cstr4.size() == 0); - AZ_TEST_ASSERT(cstr4.length() == 0); - AZ_TEST_ASSERT(cstr4.begin() == cstr4.end()); - AZ_TEST_ASSERT(cstr4.empty()); + EXPECT_NE(nullptr, cstr4.data()); + EXPECT_EQ(0, cstr4.size()); + EXPECT_EQ(0, cstr4.length()); + EXPECT_EQ(cstr4.begin(), cstr4.end()); + EXPECT_TRUE(cstr4.empty()); } TEST_F(String, StringViewModifierTest) { - string_view emptyView1; - string_view view2("Needle in Haystack"); + AZStd::string_view emptyView1; + AZStd::string_view view2("Needle in Haystack"); // front EXPECT_EQ('N', view2.front()); @@ -1209,7 +1204,7 @@ namespace UnitTest EXPECT_EQ('k', view2.back()); AZStd::string findStr("Hay"); - string_view view3(findStr); + AZStd::string_view view3(findStr); // copy const size_t destBufferSize = 32; @@ -1223,17 +1218,17 @@ namespace UnitTest AZ_TEST_STOP_TRACE_SUPPRESSION(1); // substr - string_view subView2 = view2.substr(10); + AZStd::string_view subView2 = view2.substr(10); EXPECT_EQ("Haystack", subView2); AZ_TEST_START_TRACE_SUPPRESSION; - [[maybe_unused]] string_view assertSubView = view2.substr(view2.size() + 1); + [[maybe_unused]] AZStd::string_view assertSubView = view2.substr(view2.size() + 1); AZ_TEST_STOP_TRACE_SUPPRESSION(1); // compare AZStd::size_t compareResult = view2.compare(1, view2.size() - 1, dest, copyResult); EXPECT_EQ(0, compareResult); - string_view compareView = "Stackhay in Needle"; + AZStd::string_view compareView = "Stackhay in Needle"; compareResult = compareView.compare(view2); EXPECT_NE(0, compareResult); @@ -1252,7 +1247,7 @@ namespace UnitTest EXPECT_EQ(10, findResult); findResult = compareView.find("Random String"); - EXPECT_EQ(string_view::npos, findResult); + EXPECT_EQ(AZStd::string_view::npos, findResult); findResult = view3.find('y', 2); EXPECT_EQ(2, findResult); @@ -1262,13 +1257,13 @@ namespace UnitTest EXPECT_EQ(1, rfindResult); rfindResult = emptyView1.rfind(""); - EXPECT_EQ(string_view::npos, rfindResult); + EXPECT_EQ(AZStd::string_view::npos, rfindResult); rfindResult = view2.rfind("z"); - EXPECT_EQ(string_view::npos, rfindResult); + EXPECT_EQ(AZStd::string_view::npos, rfindResult); // find_first_of - string_view repeatString = "abcdefabcfedghiabcdef"; + AZStd::string_view repeatString = "abcdefabcfedghiabcdef"; AZStd::size_t findFirstOfResult = repeatString.find_first_of('f'); EXPECT_EQ(5, findFirstOfResult); @@ -1281,7 +1276,7 @@ namespace UnitTest AZStd::string notFoundStr = "zzz"; AZStd::string foundStr = "ghi"; findFirstOfResult = repeatString.find_first_of(notFoundStr); - EXPECT_EQ(string_view::npos, findFirstOfResult); + EXPECT_EQ(AZStd::string_view::npos, findFirstOfResult); findFirstOfResult = repeatString.find_first_of(foundStr); EXPECT_EQ(12, findFirstOfResult); @@ -1297,7 +1292,7 @@ namespace UnitTest EXPECT_EQ(3, findLastOfResult); findLastOfResult = repeatString.find_last_of(notFoundStr); - EXPECT_EQ(string_view::npos, findLastOfResult); + EXPECT_EQ(AZStd::string_view::npos, findLastOfResult); findLastOfResult = repeatString.find_last_of(foundStr); EXPECT_EQ(14, findLastOfResult); @@ -1335,12 +1330,12 @@ namespace UnitTest EXPECT_EQ(11, findLastNotOfResult); // remove_prefix - string_view prefixRemovalView = view2; + AZStd::string_view prefixRemovalView = view2; prefixRemovalView.remove_prefix(6); EXPECT_EQ(" in Haystack", prefixRemovalView); // remove_suffix - string_view suffixRemovalView = view2; + AZStd::string_view suffixRemovalView = view2; suffixRemovalView.remove_suffix(8); EXPECT_EQ("Needle in ", suffixRemovalView); @@ -1365,10 +1360,10 @@ namespace UnitTest TEST_F(String, StringViewCmpOperatorTest) { - string_view view1("The quick brown fox jumped over the lazy dog"); - string_view view2("Needle in Haystack"); - string_view emptyBeaverView; - string_view superEmptyBeaverView(""); + AZStd::string_view view1("The quick brown fox jumped over the lazy dog"); + AZStd::string_view view2("Needle in Haystack"); + AZStd::string_view emptyBeaverView; + AZStd::string_view superEmptyBeaverView(""); EXPECT_EQ("", emptyBeaverView); EXPECT_EQ("", superEmptyBeaverView); @@ -1378,13 +1373,13 @@ namespace UnitTest EXPECT_EQ(view2, "Needle in Haystack"); EXPECT_NE(view2, "Needle in Hayqueue"); - string_view compareView(view2); + AZStd::string_view compareView(view2); EXPECT_EQ(view2, compareView); EXPECT_NE(view2, view1); AZStd::string compareStr("Busy Beaver"); - string_view notBeaverView("Lumber Beaver"); - string_view beaverView("Busy Beaver"); + AZStd::string_view notBeaverView("Lumber Beaver"); + AZStd::string_view beaverView("Busy Beaver"); EXPECT_EQ(compareStr, beaverView); EXPECT_NE(compareStr, notBeaverView); @@ -1528,8 +1523,8 @@ namespace UnitTest TYPED_TEST_CASE(BasicStringViewConstexprFixture, StringViewElementTypes); TYPED_TEST(BasicStringViewConstexprFixture, StringView_DefaultConstructorsIsConstexpr) { - constexpr basic_string_view defaultView1; - constexpr basic_string_view defaultView2; + constexpr AZStd::basic_string_view defaultView1; + constexpr AZStd::basic_string_view defaultView2; static_assert(defaultView1 == defaultView2, "string_view constructor should be constexpr"); } @@ -1549,7 +1544,7 @@ namespace UnitTest return {}; }(); - constexpr basic_string_view charTView1(compileTimeString); + constexpr AZStd::basic_string_view charTView1(compileTimeString); static_assert(charTView1.size() == 10, "string_view constructor should be constexpr"); // non-null terminated compile time string constexpr const TypeParam* compileTimeString2 = []() constexpr -> const TypeParam* @@ -1565,7 +1560,7 @@ namespace UnitTest return {}; }(); - constexpr basic_string_view charTViewWithLength(compileTimeString2, 7); + constexpr AZStd::basic_string_view charTViewWithLength(compileTimeString2, 7); static_assert(charTViewWithLength.size() == 7, "string_view constructor should be constexpr"); } @@ -1585,8 +1580,8 @@ namespace UnitTest return {}; }(); - constexpr basic_string_view copyView1(compileTimeString); - constexpr basic_string_view copyView2(copyView1); + constexpr AZStd::basic_string_view copyView1(compileTimeString); + constexpr AZStd::basic_string_view copyView2(copyView1); static_assert(copyView1 == copyView2, "string_view constructor should be constexpr"); } @@ -1606,8 +1601,8 @@ namespace UnitTest return {}; }(); - constexpr basic_string_view assignView1(compileTimeString1); - auto assignment_test_func = [](basic_string_view sourceView) constexpr -> basic_string_view + constexpr AZStd::basic_string_view assignView1(compileTimeString1); + auto assignment_test_func = [](AZStd::basic_string_view sourceView) constexpr -> AZStd::basic_string_view { constexpr const TypeParam* const compileTimeString2 = []() constexpr-> const TypeParam* { @@ -1622,7 +1617,7 @@ namespace UnitTest return {}; }(); - basic_string_view assignView2(compileTimeString2); + AZStd::basic_string_view assignView2(compileTimeString2); assignView2 = sourceView; return assignView2; }; @@ -1646,15 +1641,15 @@ namespace UnitTest return {}; }(); - constexpr basic_string_view iteratorView(compileTimeString1); - constexpr typename basic_string_view::iterator beginIt = iteratorView.begin(); - constexpr typename basic_string_view::const_iterator cbeginIt = iteratorView.cbegin(); - constexpr typename basic_string_view::iterator endIt = iteratorView.end(); - constexpr typename basic_string_view::const_iterator cendIt = iteratorView.cend(); - constexpr typename basic_string_view::reverse_iterator rbeginIt = iteratorView.rbegin(); - constexpr typename basic_string_view::const_reverse_iterator crbeginIt = iteratorView.crbegin(); - constexpr typename basic_string_view::reverse_iterator rendIt = iteratorView.rend(); - constexpr typename basic_string_view::const_reverse_iterator crendIt = iteratorView.crend(); + constexpr AZStd::basic_string_view iteratorView(compileTimeString1); + constexpr typename AZStd::basic_string_view::iterator beginIt = iteratorView.begin(); + constexpr typename AZStd::basic_string_view::const_iterator cbeginIt = iteratorView.cbegin(); + constexpr typename AZStd::basic_string_view::iterator endIt = iteratorView.end(); + constexpr typename AZStd::basic_string_view::const_iterator cendIt = iteratorView.cend(); + constexpr typename AZStd::basic_string_view::reverse_iterator rbeginIt = iteratorView.rbegin(); + constexpr typename AZStd::basic_string_view::const_reverse_iterator crbeginIt = iteratorView.crbegin(); + constexpr typename AZStd::basic_string_view::reverse_iterator rendIt = iteratorView.rend(); + constexpr typename AZStd::basic_string_view::const_reverse_iterator crendIt = iteratorView.crend(); static_assert(beginIt != endIt, "begin and iterators should be different"); static_assert(cbeginIt != cendIt, "begin and iterators should be different"); static_assert(rbeginIt != rendIt, "begin and iterators should be different"); @@ -1679,7 +1674,7 @@ namespace UnitTest return {}; }(); - constexpr basic_string_view elementView1(compileTimeString1); + constexpr AZStd::basic_string_view elementView1(compileTimeString1); static_assert(elementView1[4] == 'o', "character at index 4 in string_view should be 'o'"); static_assert(elementView1.at(5) == 'W', "character at index 5 in string_view should be 'W'"); } @@ -1700,7 +1695,7 @@ namespace UnitTest return {}; }(); - constexpr basic_string_view elementView1(compileTimeString1); + constexpr AZStd::basic_string_view elementView1(compileTimeString1); static_assert(elementView1.front() == 'H', "Fourth character in string_view should be 'H'"); static_assert(elementView1.back() == 'd', "Fifth character in string_view should be 'd'"); } @@ -1734,8 +1729,8 @@ namespace UnitTest return {}; }(); - static constexpr basic_string_view elementView1(compileTimeString1); - static constexpr basic_string_view elementView2(compileTimeString2); + static constexpr AZStd::basic_string_view elementView1(compileTimeString1); + static constexpr AZStd::basic_string_view elementView2(compileTimeString2); static_assert(elementView1.data(), "string_view.data() should be non-nullptr"); static_assert(elementView2.data(), "string_view.data() should be non-nullptr"); } @@ -1756,7 +1751,7 @@ namespace UnitTest return {}; }(); - constexpr basic_string_view sizeView1(compileTimeString1); + constexpr AZStd::basic_string_view sizeView1(compileTimeString1); static_assert(sizeView1.size() == sizeView1.length(), "string_views size and length function should return the same value"); static_assert(!sizeView1.empty(), "string_views should not be empty"); static_assert(sizeView1.max_size() != 0, "string_views max_size should be greater than 0"); @@ -1770,21 +1765,21 @@ namespace UnitTest { return "HelloWorld"; }; - constexpr basic_string_view modifierView("HelloWorld"); + constexpr AZStd::basic_string_view modifierView("HelloWorld"); // A constexpr lambda is used to evaluate non constexpr string_view instances' member functions which // have been marked as constexpr at compile time // The google test function being run is not a constexpr function and therefore will evaulate // non-constexpr string_view variables at runtime. This would cause static_assert to state // that the expression is evaluated at runtime - auto remove_prefix_test_func = [](basic_string_view sourceView) constexpr -> basic_string_view + auto remove_prefix_test_func = [](AZStd::basic_string_view sourceView) constexpr -> AZStd::basic_string_view { - basic_string_view lstripView(sourceView); + AZStd::basic_string_view lstripView(sourceView); lstripView.remove_prefix(5); return lstripView; }; - auto remove_suffix_test_func = [](basic_string_view sourceView) constexpr -> basic_string_view + auto remove_suffix_test_func = [](AZStd::basic_string_view sourceView) constexpr -> AZStd::basic_string_view { - basic_string_view rstripView(sourceView); + AZStd::basic_string_view rstripView(sourceView); rstripView.remove_suffix(5); return rstripView; }; @@ -1801,8 +1796,8 @@ namespace UnitTest return "HelloWorld"; }; constexpr const TypeParam* compileTimeString1 = MakeCompileTimeString1();; - constexpr basic_string_view fullView(compileTimeString1); - auto substr_test_func = [](basic_string_view sourceView) constexpr -> basic_string_view + constexpr AZStd::basic_string_view fullView(compileTimeString1); + auto substr_test_func = [](AZStd::basic_string_view sourceView) constexpr -> AZStd::basic_string_view { return sourceView.substr(3, 5); }; @@ -1818,7 +1813,7 @@ namespace UnitTest return "elloGovernor"; }; constexpr const TypeParam* compileTimeString1 = MakeCompileTimeString1(); - constexpr basic_string_view withView(compileTimeString1); + constexpr AZStd::basic_string_view withView(compileTimeString1); static_assert(withView.starts_with("ello"), "string_view should start with \"ello\""); // Regression in VS2017 15.8 and 15.9 where __builtin_memcmp fails in valid checks #if AZ_COMPILER_MSVC < 1915 && AZ_COMPILER_MSVC > 1916 @@ -1854,9 +1849,9 @@ namespace UnitTest TYPED_TEST(BasicStringViewConstexprFixture, StringView_FindOperationsAreConstexpr) { constexpr const TypeParam* compileTimeString1 = MakeCompileTimeString1; - constexpr basic_string_view quickFoxView(compileTimeString1); + constexpr AZStd::basic_string_view quickFoxView(compileTimeString1); constexpr const TypeParam* searchString = MakeSearchString; - constexpr basic_string_view searchView(searchString); + constexpr AZStd::basic_string_view searchView(searchString); constexpr const TypeParam* testString1 = MakeTestString1; constexpr const TypeParam* testString2 = MakeTestString2; @@ -1893,10 +1888,10 @@ namespace UnitTest static_assert(quickFoxView.find_last_of('o') == 42, "string_view find_last_of should result in index 42"); static_assert(quickFoxView.find_last_of(testString6) == 40, "string_view find_last_of should result in index 40"); static_assert(quickFoxView.find_last_of(testString7, 31) == 29, "string_view find_last_of should result in index 29"); - static_assert(quickFoxView.find_last_of(testString8, basic_string_view::npos, 1) == 7, "string_view find_last_of should result in index 7"); + static_assert(quickFoxView.find_last_of(testString8, AZStd::basic_string_view::npos, 1) == 7, "string_view find_last_of should result in index 7"); // find_first_not_of test - constexpr basic_string_view firstNotOfView(testString9); + constexpr AZStd::basic_string_view firstNotOfView(testString9); static_assert(quickFoxView.find_first_not_of(firstNotOfView) == 4, "string_view find_first_not_of should result in index 0"); static_assert(quickFoxView.find_first_not_of('t') == 1, "string_view find_first_not_of should result in index 1"); static_assert(quickFoxView.find_first_not_of(testString9) == 4, "string_view find_first_not_of should result in index 4"); @@ -1904,12 +1899,12 @@ namespace UnitTest static_assert(quickFoxView.find_first_not_of(testString9, 0, 1) == 1, "string_view find_first_not_of should result in index 1"); // find_last_not_of test - constexpr basic_string_view lastNotOfView(testString10); + constexpr AZStd::basic_string_view lastNotOfView(testString10); static_assert(quickFoxView.find_last_not_of(lastNotOfView) == 39, "string_view find_last_not_of should result in index 39"); static_assert(quickFoxView.find_last_not_of('g') == 42, "string_view find_last_not_of should result in index 42"); static_assert(quickFoxView.find_last_not_of(testString10) == 39, "string_view find_last_not_of should result in index 39"); static_assert(quickFoxView.find_last_not_of(testString10, 27) == 24, "string_view find_last_not_of should result in index 24"); - static_assert(quickFoxView.find_last_not_of(testString10, basic_string_view::npos, 1) == 43, "string_view find_last_not_of should result in index 43"); + static_assert(quickFoxView.find_last_not_of(testString10, AZStd::basic_string_view::npos, 1) == 43, "string_view find_last_not_of should result in index 43"); } TEST_F(String, StringView_CompareIsConstexpr) @@ -1925,8 +1920,8 @@ namespace UnitTest }; constexpr const TypeParam* compileTimeString1 = ThisTestMakeCompileTimeString1(); constexpr const TypeParam* compileTimeString2 = MakeCompileTimeString2(); - constexpr basic_string_view lhsView(compileTimeString1); - constexpr basic_string_view rhsView(compileTimeString2); + constexpr AZStd::basic_string_view lhsView(compileTimeString1); + constexpr AZStd::basic_string_view rhsView(compileTimeString2); static_assert(lhsView.compare(rhsView) > 0, R"("HelloWorld" > "HelloPearl")"); static_assert(lhsView.compare(0, 5, rhsView) < 0, R"("Hello" < HelloPearl")"); static_assert(lhsView.compare(2, 3, rhsView, 2, 3) == 0, R"("llo" == llo")"); @@ -1943,7 +1938,7 @@ namespace UnitTest return "HelloWorld"; }; constexpr const TypeParam* compileTimeString1 = TestMakeCompileTimeString1(); - constexpr basic_string_view compareView(compileTimeString1); + constexpr AZStd::basic_string_view compareView(compileTimeString1); static_assert(compareView == "HelloWorld", "string_view operator== comparison has failed"); static_assert(compareView != "MadWorld", "string_view operator!= comparison has failed"); static_assert(compareView < "JelloWorld", "string_view operator< comparison has failed"); @@ -1954,7 +1949,7 @@ namespace UnitTest TYPED_TEST(BasicStringViewConstexprFixture, StringView_SwapIsConstexpr) { - auto swap_test_func = []() constexpr -> basic_string_view + auto swap_test_func = []() constexpr -> AZStd::basic_string_view { constexpr auto ThisTestMakeCompileTimeString1 = []() constexpr -> const TypeParam* { @@ -1980,8 +1975,8 @@ namespace UnitTest }; constexpr const TypeParam* compileTimeString1 = ThisTestMakeCompileTimeString1(); constexpr const TypeParam* compileTimeString2 = MakeCompileTimeString2(); - basic_string_view lhsView(compileTimeString1); - basic_string_view rhsView(compileTimeString2); + AZStd::basic_string_view lhsView(compileTimeString1); + AZStd::basic_string_view rhsView(compileTimeString2); lhsView.swap(rhsView); return lhsView; }; @@ -2014,13 +2009,14 @@ namespace UnitTest } }; constexpr const TypeParam* compileTimeString1 = ThisTestMakeCompileTimeString1(); - constexpr basic_string_view hashView(compileTimeString1); - constexpr size_t compileHash = AZStd::hash>{}(hashView); + constexpr AZStd::basic_string_view hashView(compileTimeString1); + constexpr size_t compileHash = AZStd::hash>{}(hashView); static_assert(compileHash != 0, "Hash of \"HelloWorld\" should not be 0"); } TEST_F(String, StringView_UserLiteralsSucceed) { + using namespace AZStd::string_view_literals; constexpr auto charView{ "Test"_sv }; constexpr auto wcharView{ L"Super Test"_sv }; static_assert(charView == "Test", "char string literal should be \"Test\""); @@ -2291,21 +2287,21 @@ namespace UnitTest { AZStd::fixed_string<32> filter1; AZStd::string testValue{ "test" }; - EXPECT_FALSE(wildcard_match(filter1, testValue)); + EXPECT_FALSE(AZStd::wildcard_match(filter1, testValue)); } TEST_F(String, WildcardMatch_EmptyFilterWithEmptyValue_Succeeds) { AZStd::fixed_string<32> filter1; AZStd::fixed_string<32> emptyValue; - EXPECT_TRUE(wildcard_match(filter1, emptyValue)); + EXPECT_TRUE(AZStd::wildcard_match(filter1, emptyValue)); } TEST_F(String, WildcardMatch_AsteriskOnlyFilterWithEmptyValue_Succeeds) { const char* filter1{ "*" }; const char* filter2{ "**" }; const char* emptyValue{ "" }; - EXPECT_TRUE(wildcard_match(filter1, emptyValue)); - EXPECT_TRUE(wildcard_match(filter2, emptyValue)); + EXPECT_TRUE(AZStd::wildcard_match(filter1, emptyValue)); + EXPECT_TRUE(AZStd::wildcard_match(filter2, emptyValue)); } TEST_F(String, WildcardMatch_AsteriskQuestionMarkFilterWithEmptyValue_Failes) { @@ -2313,60 +2309,60 @@ namespace UnitTest const char* filter1{ "*?" }; const char* filter2{ "?*" }; const char* emptyValue{ "" }; - EXPECT_FALSE(wildcard_match(filter1, emptyValue)); - EXPECT_FALSE(wildcard_match(filter2, emptyValue)); + EXPECT_FALSE(AZStd::wildcard_match(filter1, emptyValue)); + EXPECT_FALSE(AZStd::wildcard_match(filter2, emptyValue)); } TEST_F(String, WildcardMatch_DotValue_Succeeds) { const char* filter1{ "?" }; const char* dotValue{ "." }; - EXPECT_TRUE(wildcard_match(filter1, dotValue)); + EXPECT_TRUE(AZStd::wildcard_match(filter1, dotValue)); } TEST_F(String, WildcardMatch_DoubleDotValue_Succeeds) { const char* filter1{ "??" }; const char* dotValue{ ".." }; - EXPECT_TRUE(wildcard_match(filter1, dotValue)); + EXPECT_TRUE(AZStd::wildcard_match(filter1, dotValue)); } TEST_F(String, WildcardMatch_GlobFilters_Succeeds) { const char* filter1{ "*" }; const char* filter2{ "*?" }; const char* filter3{ "?*" }; - EXPECT_TRUE(wildcard_match(filter1, "Hello")); - EXPECT_TRUE(wildcard_match(filter1, "?")); - EXPECT_TRUE(wildcard_match(filter1, "*")); - EXPECT_TRUE(wildcard_match(filter1, "Q")); + EXPECT_TRUE(AZStd::wildcard_match(filter1, "Hello")); + EXPECT_TRUE(AZStd::wildcard_match(filter1, "?")); + EXPECT_TRUE(AZStd::wildcard_match(filter1, "*")); + EXPECT_TRUE(AZStd::wildcard_match(filter1, "Q")); - EXPECT_TRUE(wildcard_match(filter2, "Hello")); - EXPECT_TRUE(wildcard_match(filter2, "?")); - EXPECT_TRUE(wildcard_match(filter2, "*")); - EXPECT_TRUE(wildcard_match(filter2, "Q")); + EXPECT_TRUE(AZStd::wildcard_match(filter2, "Hello")); + EXPECT_TRUE(AZStd::wildcard_match(filter2, "?")); + EXPECT_TRUE(AZStd::wildcard_match(filter2, "*")); + EXPECT_TRUE(AZStd::wildcard_match(filter2, "Q")); - EXPECT_TRUE(wildcard_match(filter3, "Hello")); - EXPECT_TRUE(wildcard_match(filter3, "?")); - EXPECT_TRUE(wildcard_match(filter3, "*")); - EXPECT_TRUE(wildcard_match(filter3, "Q")); + EXPECT_TRUE(AZStd::wildcard_match(filter3, "Hello")); + EXPECT_TRUE(AZStd::wildcard_match(filter3, "?")); + EXPECT_TRUE(AZStd::wildcard_match(filter3, "*")); + EXPECT_TRUE(AZStd::wildcard_match(filter3, "Q")); } TEST_F(String, WildcardMatch_NormalString_Succeeds) { constexpr AZStd::string_view jpgFilter{ "**/*.jpg" }; - EXPECT_FALSE(wildcard_match(jpgFilter, "Test.jpg")); - EXPECT_FALSE(wildcard_match(jpgFilter, "Test.jpfg")); - EXPECT_TRUE(wildcard_match(jpgFilter, "Images/Other.jpg")); - EXPECT_FALSE(wildcard_match(jpgFilter, "Pictures/Other.gif")); + EXPECT_FALSE(AZStd::wildcard_match(jpgFilter, "Test.jpg")); + EXPECT_FALSE(AZStd::wildcard_match(jpgFilter, "Test.jpfg")); + EXPECT_TRUE(AZStd::wildcard_match(jpgFilter, "Images/Other.jpg")); + EXPECT_FALSE(AZStd::wildcard_match(jpgFilter, "Pictures/Other.gif")); constexpr AZStd::string_view tempDirFilter{ "temp/*" }; - EXPECT_TRUE(wildcard_match(tempDirFilter, "temp/")); - EXPECT_TRUE(wildcard_match(tempDirFilter, "temp/f")); - EXPECT_FALSE(wildcard_match(tempDirFilter, "tem1/")); + EXPECT_TRUE(AZStd::wildcard_match(tempDirFilter, "temp/")); + EXPECT_TRUE(AZStd::wildcard_match(tempDirFilter, "temp/f")); + EXPECT_FALSE(AZStd::wildcard_match(tempDirFilter, "tem1/")); constexpr AZStd::string_view xmlFilter{ "test.xml" }; - EXPECT_TRUE(wildcard_match(xmlFilter, "Test.xml")); - EXPECT_TRUE(wildcard_match(xmlFilter, "test.xml")); - EXPECT_FALSE(wildcard_match(xmlFilter, "test.xmlschema")); - EXPECT_FALSE(wildcard_match(xmlFilter, "Xtest.xml")); + EXPECT_TRUE(AZStd::wildcard_match(xmlFilter, "Test.xml")); + EXPECT_TRUE(AZStd::wildcard_match(xmlFilter, "test.xml")); + EXPECT_FALSE(AZStd::wildcard_match(xmlFilter, "test.xmlschema")); + EXPECT_FALSE(AZStd::wildcard_match(xmlFilter, "Xtest.xml")); } TEST_F(String, WildcardMatchCase_CanBeCompileTimeEvaluated_Succeeds) @@ -2424,6 +2420,31 @@ namespace UnitTest EXPECT_EQ("oWord", eraseIfTest); } + TEST_F(String, StringWithStatelessAllocator_HasSizeOf_PointerPlus2IntTypes_Compiles) + { + // The expected size of a basic_string with a stateless allocator + // Is the size of the pointer (used for storing the memory address of the string) + // + the size of the string "size" member used to store the size of the string + // + the size of the string "capacity" member used to store the capacity of the string + size_t constexpr ExpectedBasicStringSize = sizeof(void*) + 2 * sizeof(size_t); + using StringStatelessAllocator = AZStd::basic_string, AZStd::stateless_allocator>; + static_assert(ExpectedBasicStringSize == sizeof(StringStatelessAllocator), + "Stateless allocator is counting against the size of the basic_string class" + " A change has made to break the empty base optimization of the basic_string class"); + } + + TEST_F(String, StringWithStatefulAllocator_HasSizeOf_PointerPlus2IntTypesPlusAllocator_Compiles) + { + // The expected size of a basic_string with a stateless allocator + // Is the size of the pointer (used for storing the memory address of the string) + // + the size of the string "size" member used to store the size of the string + // + the size of the string "capacity" member used to store the capacity of the string + size_t constexpr ExpectedBasicStringSize = sizeof(void*) + 2 * sizeof(size_t) + sizeof(AZStd::allocator); + static_assert(ExpectedBasicStringSize == sizeof(AZStd::string), + "Using Stateful allocator with basic_string class should result in a 32-byte string class" + " on 64-bit platforms "); + } + template class ImmutableStringFunctionsFixture : public ScopedAllocatorSetupFixture @@ -2473,5 +2494,296 @@ namespace UnitTest EXPECT_EQ(str, formatted); } -#endif // AZ_UNIT_TEST_SKIP_STD_STRING_TESTS } + +#if defined(HAVE_BENCHMARK) +namespace Benchmark +{ + class StringBenchmarkFixture + : public ::UnitTest::AllocatorsBenchmarkFixture + { + protected: + template + void SwapStringViaMemcpy(AZStd::basic_string& left, + AZStd::basic_string& right) + { + // Test Swapping the storage container for the string class + // Use aligned_storage to prevent constructors from slowing operation + AZStd::aligned_storage_for_t tempStorage; + ::memcpy(&tempStorage, &left.m_storage.first(), sizeof(left.m_storage.first())); + ::memcpy(&left.m_storage.first(), &right.m_storage.first(), sizeof(right.m_storage.first())); + ::memcpy(&right.m_storage.first(), &tempStorage, sizeof(tempStorage)); + } + + + template + void SwapStringViaPointerSizedSwaps(AZStd::basic_string& left, + AZStd::basic_string& right) + { + using String = AZStd::basic_string; + using PointerAlignedData = typename String::PointerAlignedData; + // Use pointer sized swaps to swap the string storage + auto& leftAlignedPointers = reinterpret_cast(left.m_storage.first()); + auto& rightAlignedPointers = reinterpret_cast(right.m_storage.first()); + constexpr size_t alignedPointerCount{ AZStd::size(PointerAlignedData{}.m_alignedValues) }; + for (size_t i = 0; i < alignedPointerCount; ++i) + { + AZStd::swap(leftAlignedPointers.m_alignedValues[i], rightAlignedPointers.m_alignedValues[i]); + } + } + }; + + BENCHMARK_F(StringBenchmarkFixture, BM_StringPointerSwapShortString)(benchmark::State& state) + { + AZStd::string test1{ "foo bar"}; + AZStd::string test2{ "bar foo" }; + for (auto _ : state) + { + SwapStringViaPointerSizedSwaps(test1, test2); + } + } + + BENCHMARK_F(StringBenchmarkFixture, BM_StringPointerSwapLongString)(benchmark::State& state) + { + AZStd::string test1{ "The brown quick wolf jumped over the hyperactive cat" }; + AZStd::string test2{ "The quick brown fox jumped over the lazy dog" }; + for (auto _ : state) + { + SwapStringViaPointerSizedSwaps(test1, test2); + } + } + + BENCHMARK_F(StringBenchmarkFixture, BM_StringMemcpySwapShortString)(benchmark::State& state) + { + AZStd::string test1{ "foo bar" }; + AZStd::string test2{ "bar foo" }; + for (auto _ : state) + { + SwapStringViaMemcpy(test1, test2); + } + } + + BENCHMARK_F(StringBenchmarkFixture, BM_StringMemcpySwapLongString)(benchmark::State& state) + { + AZStd::string test1{ "The brown quick wolf jumped over the hyperactive cat" }; + AZStd::string test2{ "The quick brown fox jumped over the lazy dog" }; + for (auto _ : state) + { + SwapStringViaMemcpy(test1, test2); + } + } + + template + class StringTemplateBenchmarkFixture + : public ::UnitTest::AllocatorsBenchmarkFixture + {}; + + // AZStd::string assign benchmarks + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_StringAssignConstPointer_NullDelimited, AZStd::string)(benchmark::State& state) + { + AZStd::string sourceString(state.range(0), 'a'); + const char* sourceAddress = sourceString.c_str(); + + for (auto _ : state) + { + AZStd::string assignString; + assignString.assign(sourceAddress); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_StringAssignConstPointer_NullDelimited) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_StringAssignConstPointer_WithSize, AZStd::string)(benchmark::State& state) + { + AZStd::string sourceString(state.range(0), 'a'); + const char* sourceAddress = sourceString.c_str(); + const size_t sourceSize = sourceString.size(); + + for (auto _ : state) + { + AZStd::string assignString; + assignString.assign(sourceAddress, sourceSize); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_StringAssignConstPointer_WithSize) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_StringAssignFromIterators, AZStd::string)(benchmark::State& state) + { + AZStd::string sourceString(state.range(0), 'a'); + auto sourceBegin = sourceString.begin(); + auto sourceEnd = sourceString.end(); + + for (auto _ : state) + { + AZStd::string assignString; + assignString.assign(sourceBegin, sourceEnd); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_StringAssignFromIterators) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_StringAssignFromStringView, AZStd::string)(benchmark::State& state) + { + AZStd::string sourceString(state.range(0), 'a'); + AZStd::string_view sourceView(sourceString); + + for (auto _ : state) + { + AZStd::string assignString; + assignString.assign(sourceView); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_StringAssignFromStringView) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_StringAssignFromString_LValue, AZStd::string)(benchmark::State& state) + { + AZStd::string sourceString(state.range(0), 'a'); + + for (auto _ : state) + { + AZStd::string assignString; + assignString.assign(sourceString); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_StringAssignFromString_LValue) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_StringAssignFromString_RValue, AZStd::string)(benchmark::State& state) + { + AZStd::string sourceString(state.range(0), 'a'); + + for (auto _ : state) + { + AZStd::string assignString; + assignString.assign(AZStd::move(sourceString)); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_StringAssignFromString_RValue) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_StringAssignFromSingleCharacter, AZStd::string)(benchmark::State& state) + { + for (auto _ : state) + { + AZStd::string assignString; + assignString.assign(state.range(0), 'a'); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_StringAssignFromSingleCharacter) + ->RangeMultiplier(2)->Range(8, 32); + + // AZStd::fixed_string assign benchmarks + // NOTE: This is a copy-and-paste of above because Google Benchmark doesn't support real templated benchmarks like Googletest + // https://github.com/google/benchmark/issues/541 + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignConstPointer_NullDelimited, AZStd::fixed_string<1024>)(benchmark::State& state) + { + AZStd::fixed_string<1024> sourceString(state.range(0), 'a'); + const char* sourceAddress = sourceString.c_str(); + + for (auto _ : state) + { + AZStd::fixed_string<1024> assignString; + assignString.assign(sourceAddress); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignConstPointer_NullDelimited) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignConstPointer_WithSize, AZStd::fixed_string<1024>)(benchmark::State& state) + { + AZStd::fixed_string<1024> sourceString(state.range(0), 'a'); + const char* sourceAddress = sourceString.c_str(); + const size_t sourceSize = sourceString.size(); + + for (auto _ : state) + { + AZStd::fixed_string<1024> assignString; + assignString.assign(sourceAddress, sourceSize); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignConstPointer_WithSize) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromIterators, AZStd::fixed_string<1024>)(benchmark::State& state) + { + AZStd::fixed_string<1024> sourceString(state.range(0), 'a'); + auto sourceBegin = sourceString.begin(); + auto sourceEnd = sourceString.end(); + + for (auto _ : state) + { + AZStd::fixed_string<1024> assignString; + assignString.assign(sourceBegin, sourceEnd); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromIterators) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromStringView, AZStd::fixed_string<1024>)(benchmark::State& state) + { + AZStd::fixed_string<1024> sourceString(state.range(0), 'a'); + AZStd::string_view sourceView(sourceString); + + for (auto _ : state) + { + AZStd::fixed_string<1024> assignString; + assignString.assign(sourceView); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromStringView) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromString_LValue, AZStd::fixed_string<1024>)(benchmark::State& state) + { + AZStd::fixed_string<1024> sourceString(state.range(0), 'a'); + + for (auto _ : state) + { + AZStd::fixed_string<1024> assignString; + assignString.assign(sourceString); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromString_LValue) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromString_RValue, AZStd::fixed_string<1024>)(benchmark::State& state) + { + AZStd::fixed_string<1024> sourceString(state.range(0), 'a'); + + for (auto _ : state) + { + AZStd::fixed_string<1024> assignString; + assignString.assign(AZStd::move(sourceString)); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromString_RValue) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromSingleCharacter, AZStd::fixed_string<1024>)(benchmark::State& state) + { + for (auto _ : state) + { + AZStd::fixed_string<1024> assignString; + assignString.assign(state.range(0), 'a'); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromSingleCharacter) + ->RangeMultiplier(2)->Range(8, 32); +} +#endif diff --git a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSAttributionServiceApiTest.cpp b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSAttributionServiceApiTest.cpp index 7ce0290ea3..e17d5c1fbf 100644 --- a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSAttributionServiceApiTest.cpp +++ b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSAttributionServiceApiTest.cpp @@ -72,12 +72,11 @@ namespace AWSCoreUnitTest AWSCore::RequestBuilder requestBuilder{}; EXPECT_TRUE(request.parameters.BuildRequest(requestBuilder)); std::shared_ptr bodyContent = requestBuilder.GetBodyContent(); - EXPECT_TRUE(bodyContent != nullptr); + EXPECT_NE(nullptr, bodyContent); - AZStd::string bodyString; std::istreambuf_iterator eos; - bodyString = AZStd::string{ std::istreambuf_iterator(*bodyContent), eos }; - AZ_Printf("AWSAttributionServiceApiTest", bodyString.c_str()); - EXPECT_TRUE(bodyString.find(AZStd::string::format("{\"%s\":\"1.1\"", AwsAttributionAttributeKeyVersion)) != AZStd::string::npos); + AZStd::string bodyString{ std::istreambuf_iterator(*bodyContent), eos }; + AZ_Printf("AWSAttributionServiceApiTest", "%s", bodyString.c_str()); + EXPECT_TRUE(bodyString.contains(AZStd::string::format("{\"%s\":\"1.1\"", AwsAttributionAttributeKeyVersion))); } } diff --git a/Gems/AWSMetrics/Code/Tests/AWSMetricsServiceApiTest.cpp b/Gems/AWSMetrics/Code/Tests/AWSMetricsServiceApiTest.cpp index 8844e727b6..b7e7527b20 100644 --- a/Gems/AWSMetrics/Code/Tests/AWSMetricsServiceApiTest.cpp +++ b/Gems/AWSMetrics/Code/Tests/AWSMetricsServiceApiTest.cpp @@ -100,11 +100,10 @@ namespace AWSMetrics AWSCore::RequestBuilder requestBuilder{}; EXPECT_TRUE(request.parameters.BuildRequest(requestBuilder)); std::shared_ptr bodyContent = requestBuilder.GetBodyContent(); - EXPECT_TRUE(bodyContent != nullptr); + ASSERT_NE(nullptr, bodyContent); - AZStd::string bodyString; std::istreambuf_iterator eos; - bodyString = AZStd::string{ std::istreambuf_iterator(*bodyContent), eos }; - EXPECT_TRUE(bodyString.find(AZStd::string::format("{\"%s\":[{\"event_timestamp\":", AwsMetricsRequestParameterKeyEvents)) != AZStd::string::npos); + AZStd::string bodyString{ std::istreambuf_iterator(*bodyContent), eos }; + EXPECT_TRUE(bodyString.contains(AZStd::string::format("{\"%s\":[{\"event_timestamp\":", AwsMetricsRequestParameterKeyEvents))); } } diff --git a/Gems/EMotionFX/Code/Tests/AnimGraphEventTests.cpp b/Gems/EMotionFX/Code/Tests/AnimGraphEventTests.cpp index bd3fa10b24..11865674c8 100644 --- a/Gems/EMotionFX/Code/Tests/AnimGraphEventTests.cpp +++ b/Gems/EMotionFX/Code/Tests/AnimGraphEventTests.cpp @@ -49,7 +49,7 @@ namespace EMotionFX for (int i = 0; i < params.m_numStates; ++i) { AnimGraphNode* state = aznew AnimGraphMotionNode(); - state->SetName(AZStd::string(1, startChar + i).c_str()); + state->SetName(AZStd::string(1, static_cast(startChar + i)).c_str()); m_rootStateMachine->AddChildNode(state); AddTransitionWithTimeCondition(prevState, state, /*blendTime*/params.m_transitionBlendTime, /*countDownTime*/params.m_conditionCountDownTime); prevState = state; diff --git a/Gems/EMotionFX/Code/Tests/AnimGraphRefCountTests.cpp b/Gems/EMotionFX/Code/Tests/AnimGraphRefCountTests.cpp index 54f945d95f..c4e6462fff 100644 --- a/Gems/EMotionFX/Code/Tests/AnimGraphRefCountTests.cpp +++ b/Gems/EMotionFX/Code/Tests/AnimGraphRefCountTests.cpp @@ -90,7 +90,7 @@ namespace EMotionFX for (int i = 0; i < param.m_numStates; ++i) { AnimGraphBindPoseNode* state = aznew AnimGraphBindPoseNode(); - state->SetName(AZStd::string(1, startChar + i).c_str()); + state->SetName(AZStd::string(1, static_cast(startChar + i)).c_str()); m_rootStateMachine->AddChildNode(state); AddTransitionWithTimeCondition(prevState, state, /*blendTime*/param.m_blendTime, /*countDownTime*/param.m_countDownTime); prevState = state; From 93996bfb3fc97de17f9127686114ac4fece3fb55 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 10 Jan 2022 09:59:35 -0800 Subject: [PATCH 329/399] Moves LmbrCentral Test targets into a different folder to prevent MSB8028 (#6742) * Moves Test targets into a different folder to prevent MSB8028 Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Simplifies an if that was affecting the whole file Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/LmbrCentral/Code/CMakeLists.txt | 73 +---------------- Gems/LmbrCentral/Code/Tests/CMakeLists.txt | 79 +++++++++++++++++++ .../lmbrcentral_editor_tests_files.cmake | 28 +++++++ .../{ => Tests}/lmbrcentral_mocks_files.cmake | 2 +- .../Code/Tests/lmbrcentral_tests_files.cmake | 32 ++++++++ .../Code/lmbrcentral_editor_tests_files.cmake | 28 ------- .../Code/lmbrcentral_tests_files.cmake | 29 ------- 7 files changed, 141 insertions(+), 130 deletions(-) create mode 100644 Gems/LmbrCentral/Code/Tests/CMakeLists.txt create mode 100644 Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake rename Gems/LmbrCentral/Code/{ => Tests}/lmbrcentral_mocks_files.cmake (83%) create mode 100644 Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake delete mode 100644 Gems/LmbrCentral/Code/lmbrcentral_editor_tests_files.cmake delete mode 100644 Gems/LmbrCentral/Code/lmbrcentral_tests_files.cmake diff --git a/Gems/LmbrCentral/Code/CMakeLists.txt b/Gems/LmbrCentral/Code/CMakeLists.txt index 2df0bd0632..4401d3b752 100644 --- a/Gems/LmbrCentral/Code/CMakeLists.txt +++ b/Gems/LmbrCentral/Code/CMakeLists.txt @@ -121,75 +121,4 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) endif() -################################################################################ -# Tests -################################################################################ -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) - ly_add_target( - NAME LmbrCentral.Mocks HEADERONLY - NAMESPACE Gem - FILES_CMAKE - lmbrcentral_mocks_files.cmake - INCLUDE_DIRECTORIES - INTERFACE - Mocks - ) - - ly_add_target( - NAME LmbrCentral.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} - NAMESPACE Gem - FILES_CMAKE - lmbrcentral_tests_files.cmake - lmbrcentral_shared_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - Source - Tests - BUILD_DEPENDENCIES - PRIVATE - AZ::AzTest - AZ::AzTestShared - Legacy::CryCommon - AZ::AzFramework - Gem::LmbrCentral.Static - Gem::LmbrCentral.Mocks - ) - ly_add_googletest( - NAME Gem::LmbrCentral.Tests - ) - - if (PAL_TRAIT_BUILD_HOST_TOOLS) - ly_add_target( - NAME LmbrCentral.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} - NAMESPACE Gem - FILES_CMAKE - lmbrcentral_editor_tests_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - . - Source - Tests - COMPILE_DEFINITIONS - PRIVATE - LMBR_CENTRAL_EDITOR - BUILD_DEPENDENCIES - PRIVATE - 3rdParty::Qt::Gui - 3rdParty::Qt::Widgets - Legacy::CryCommon - Legacy::Editor.Headers - AZ::AzTest - AZ::AzCore - AZ::AzTestShared - AZ::AzToolsFramework - AZ::AzToolsFrameworkTestCommon - AZ::AssetBuilderSDK - AZ::AzManipulatorTestFramework.Static - Gem::LmbrCentral.Static - Gem::LmbrCentral.Editor.Static - ) - ly_add_googletest( - NAME Gem::LmbrCentral.Editor.Tests - ) - endif() -endif() +add_subdirectory(Tests) diff --git a/Gems/LmbrCentral/Code/Tests/CMakeLists.txt b/Gems/LmbrCentral/Code/Tests/CMakeLists.txt new file mode 100644 index 0000000000..52928cc5db --- /dev/null +++ b/Gems/LmbrCentral/Code/Tests/CMakeLists.txt @@ -0,0 +1,79 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +if(NOT PAL_TRAIT_BUILD_TESTS_SUPPORTED) + return() +endif() + +ly_add_target( + NAME LmbrCentral.Mocks HEADERONLY + NAMESPACE Gem + FILES_CMAKE + lmbrcentral_mocks_files.cmake + INCLUDE_DIRECTORIES + INTERFACE + ../Mocks +) + +ly_add_target( + NAME LmbrCentral.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} + NAMESPACE Gem + FILES_CMAKE + lmbrcentral_tests_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + ../Source + . + BUILD_DEPENDENCIES + PRIVATE + AZ::AzTest + AZ::AzTestShared + Legacy::CryCommon + AZ::AzFramework + Gem::LmbrCentral.Static + Gem::LmbrCentral.Mocks +) +ly_add_googletest( + NAME Gem::LmbrCentral.Tests +) + +if (PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_target( + NAME LmbrCentral.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} + NAMESPACE Gem + FILES_CMAKE + lmbrcentral_editor_tests_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + .. + ../Source + . + COMPILE_DEFINITIONS + PRIVATE + LMBR_CENTRAL_EDITOR + BUILD_DEPENDENCIES + PRIVATE + 3rdParty::Qt::Gui + 3rdParty::Qt::Widgets + Legacy::CryCommon + Legacy::Editor.Headers + AZ::AzTest + AZ::AzCore + AZ::AzTestShared + AZ::AzToolsFramework + AZ::AzToolsFrameworkTestCommon + AZ::AssetBuilderSDK + AZ::AzManipulatorTestFramework.Static + Gem::LmbrCentral.Static + Gem::LmbrCentral.Editor.Static + ) + ly_add_googletest( + NAME Gem::LmbrCentral.Editor.Tests + ) +endif() + diff --git a/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake b/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake new file mode 100644 index 0000000000..72a26c2884 --- /dev/null +++ b/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake @@ -0,0 +1,28 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +set(FILES + LmbrCentralEditorTest.cpp + LmbrCentralReflectionTest.h + LmbrCentralReflectionTest.cpp + EditorBoxShapeComponentTests.cpp + EditorSphereShapeComponentTests.cpp + EditorCapsuleShapeComponentTests.cpp + EditorCompoundShapeComponentTests.cpp + EditorCylinderShapeComponentTests.cpp + EditorPolygonPrismShapeComponentTests.cpp + EditorTubeShapeComponentTests.cpp + SpawnerComponentTest.cpp + Builders/CopyDependencyBuilderTest.cpp + Builders/SliceBuilderTests.cpp + Builders/LevelBuilderTest.cpp + Builders/LuaBuilderTests.cpp + Builders/SeedBuilderTests.cpp + ../Source/LmbrCentral.cpp + ../Source/LmbrCentralEditor.cpp +) diff --git a/Gems/LmbrCentral/Code/lmbrcentral_mocks_files.cmake b/Gems/LmbrCentral/Code/Tests/lmbrcentral_mocks_files.cmake similarity index 83% rename from Gems/LmbrCentral/Code/lmbrcentral_mocks_files.cmake rename to Gems/LmbrCentral/Code/Tests/lmbrcentral_mocks_files.cmake index c3a5cca3f8..1e510747f2 100644 --- a/Gems/LmbrCentral/Code/lmbrcentral_mocks_files.cmake +++ b/Gems/LmbrCentral/Code/Tests/lmbrcentral_mocks_files.cmake @@ -7,5 +7,5 @@ # set(FILES - Mocks/LmbrCentral/Shape/MockShapes.h + ../Mocks/LmbrCentral/Shape/MockShapes.h ) diff --git a/Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake b/Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake new file mode 100644 index 0000000000..1555ff53d8 --- /dev/null +++ b/Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake @@ -0,0 +1,32 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +set(FILES + AudioComponentTests.cpp + AxisAlignedBoxShapeTest.cpp + BoxShapeTest.cpp + BundlingSystemComponentTests.cpp + SphereShapeTest.cpp + CylinderShapeTest.cpp + CapsuleShapeTest.cpp + PolygonPrismShapeTest.cpp + QuadShapeTest.cpp + TubeShapeTest.cpp + LmbrCentralReflectionTest.h + LmbrCentralReflectionTest.cpp + LmbrCentralTest.cpp + ShapeGeometryUtilTest.cpp + SpawnerComponentTest.cpp + SplineComponentTests.cpp + DiskShapeTest.cpp + ReferenceShapeTests.cpp + ../Source/LmbrCentral.cpp + ../Source/Ai/NavigationComponent.cpp + ../Source/Scripting/SpawnerComponent.cpp + ../Source/Shape/TubeShape.cpp +) diff --git a/Gems/LmbrCentral/Code/lmbrcentral_editor_tests_files.cmake b/Gems/LmbrCentral/Code/lmbrcentral_editor_tests_files.cmake deleted file mode 100644 index afba79e566..0000000000 --- a/Gems/LmbrCentral/Code/lmbrcentral_editor_tests_files.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -set(FILES - Tests/LmbrCentralEditorTest.cpp - Tests/LmbrCentralReflectionTest.h - Tests/LmbrCentralReflectionTest.cpp - Tests/EditorBoxShapeComponentTests.cpp - Tests/EditorSphereShapeComponentTests.cpp - Tests/EditorCapsuleShapeComponentTests.cpp - Tests/EditorCompoundShapeComponentTests.cpp - Tests/EditorCylinderShapeComponentTests.cpp - Tests/EditorPolygonPrismShapeComponentTests.cpp - Tests/EditorTubeShapeComponentTests.cpp - Tests/SpawnerComponentTest.cpp - Tests/Builders/CopyDependencyBuilderTest.cpp - Tests/Builders/SliceBuilderTests.cpp - Tests/Builders/LevelBuilderTest.cpp - Tests/Builders/LuaBuilderTests.cpp - Tests/Builders/SeedBuilderTests.cpp - Source/LmbrCentral.cpp - Source/LmbrCentralEditor.cpp -) diff --git a/Gems/LmbrCentral/Code/lmbrcentral_tests_files.cmake b/Gems/LmbrCentral/Code/lmbrcentral_tests_files.cmake deleted file mode 100644 index 97e5d87829..0000000000 --- a/Gems/LmbrCentral/Code/lmbrcentral_tests_files.cmake +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -set(FILES - Tests/AudioComponentTests.cpp - Tests/AxisAlignedBoxShapeTest.cpp - Tests/BoxShapeTest.cpp - Tests/BundlingSystemComponentTests.cpp - Tests/SphereShapeTest.cpp - Tests/CylinderShapeTest.cpp - Tests/CapsuleShapeTest.cpp - Tests/PolygonPrismShapeTest.cpp - Tests/QuadShapeTest.cpp - Tests/TubeShapeTest.cpp - Tests/LmbrCentralReflectionTest.h - Tests/LmbrCentralReflectionTest.cpp - Tests/LmbrCentralTest.cpp - Tests/ShapeGeometryUtilTest.cpp - Tests/SpawnerComponentTest.cpp - Tests/SplineComponentTests.cpp - Tests/DiskShapeTest.cpp - Tests/ReferenceShapeTests.cpp - Source/LmbrCentral.cpp -) From 0f7e55cf59c633249a6e83a675a4334598856044 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 10 Jan 2022 10:00:29 -0800 Subject: [PATCH 330/399] Some fixes for paths with spaces (#6757) * Some fixes for paths with spaces Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * PR comments Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../tests/run_python_tests.bat | 59 ------------------- cmake/CommandExecution.cmake | 10 ++-- .../runtime_dependencies_common.cmake.in | 6 +- .../Linux/runtime_dependencies_linux.cmake.in | 4 +- cmake/Platform/Mac/InstallUtils_mac.cmake.in | 58 +++++++++--------- .../Mac/runtime_dependencies_mac.cmake.in | 50 ++++++++-------- python/python.cmd | 3 +- scripts/build/Platform/Linux/build_linux.sh | 2 +- scripts/build/Platform/Mac/build_mac.sh | 2 +- .../build/Platform/Windows/build_windows.cmd | 5 +- scripts/build/ci_build.py | 2 +- 11 files changed, 71 insertions(+), 130 deletions(-) delete mode 100644 Code/Tools/PythonBindingsExample/tests/run_python_tests.bat diff --git a/Code/Tools/PythonBindingsExample/tests/run_python_tests.bat b/Code/Tools/PythonBindingsExample/tests/run_python_tests.bat deleted file mode 100644 index 216f2dd0da..0000000000 --- a/Code/Tools/PythonBindingsExample/tests/run_python_tests.bat +++ /dev/null @@ -1,59 +0,0 @@ -@echo off - -REM -REM Copyright (c) Contributors to the Open 3D Engine Project. -REM For complete copyright and license terms please see the LICENSE at the root of this distribution. -REM -REM SPDX-License-Identifier: Apache-2.0 OR MIT -REM -REM - -PUSHD "%~dp0" - -SET CWD="%~dp0" -SET EXEPATH141="../../../../Bin64vc141/PythonBindingsExample.exe" -SET EXEPATH142="../../../../Bin64vc142/PythonBindingsExample.exe" -SET EXEPATH="" - -IF EXIST %EXEPATH141% ( - SET EXEPATH=%EXEPATH141% -) ELSE ( - IF EXIST %EXEPATH142% ( - SET EXEPATH=%EXEPATH142% - ) ELSE ( - ECHO PythonBindingsExample.exe not found. - ) -) -IF /I %EXEPATH% EQU "" ( - ECHO [FAILED] Could not run tests since a build of PythonBindingsExample.exe is missing - GOTO exit_app -) - -ECHO Testing basics of tool Python bindings in %CWD% - -%EXEPATH% --file test_hello_tool.py -IF %ERRORLEVEL% EQU 0 ( - ECHO [WORKED] test_hello_tool.py -) ELSE ( - ECHO [FAILED] test_hello_tool.py with %ERRORLEVEL% - GOTO exit_app -) - -%EXEPATH% --file test_framework.py --arg entity -IF %ERRORLEVEL% EQU 0 ( - ECHO [WORKED] test_framework.py --arg entity -) ELSE ( - ECHO [FAILED] test_framework.py --arg entity with %ERRORLEVEL% - GOTO exit_app -) - -%EXEPATH% --file test_framework.py --arg math -IF %ERRORLEVEL% EQU 0 ( - ECHO [WORKED] test_framework.py --arg math -) ELSE ( - ECHO [FAILED] test_framework.py --arg math with %ERRORLEVEL% - GOTO exit_app -) - -:exit_app -POPD diff --git a/cmake/CommandExecution.cmake b/cmake/CommandExecution.cmake index 91f043ee9f..a8c21a22a2 100644 --- a/cmake/CommandExecution.cmake +++ b/cmake/CommandExecution.cmake @@ -38,13 +38,13 @@ endif() # Check for timestamp if(LY_TIMESTAMP_REFERENCE) - if(NOT EXISTS ${LY_TIMESTAMP_REFERENCE}) + if(NOT EXISTS "${LY_TIMESTAMP_REFERENCE}") message(FATAL_ERROR "File LY_TIMESTAMP_REFERENCE=${LY_TIMESTAMP_REFERENCE} does not exists") endif() if(NOT LY_TIMESTAMP_FILE) - set(LY_TIMESTAMP_FILE ${LY_TIMESTAMP_REFERENCE}.stamp) + set(LY_TIMESTAMP_FILE "${LY_TIMESTAMP_REFERENCE}.stamp") endif() - if(EXISTS ${LY_TIMESTAMP_FILE} AND NOT ${LY_TIMESTAMP_REFERENCE} IS_NEWER_THAN ${LY_TIMESTAMP_FILE}) + if(EXISTS "${LY_TIMESTAMP_FILE}" AND NOT "${LY_TIMESTAMP_REFERENCE}" IS_NEWER_THAN "${LY_TIMESTAMP_FILE}") # Stamp newer, nothing to do return() endif() @@ -52,7 +52,7 @@ endif() if(LY_LOCK_FILE) # Lock the file - file(LOCK ${LY_LOCK_FILE} TIMEOUT 1200 RESULT_VARIABLE lock_result) + file(LOCK "${LY_LOCK_FILE}" TIMEOUT 1200 RESULT_VARIABLE lock_result) if(NOT ${lock_result} EQUAL 0) message(FATAL_ERROR "Lock failure ${lock_result}") endif() @@ -83,5 +83,5 @@ endif() if(LY_TIMESTAMP_REFERENCE) # Touch the timestamp file - file(TOUCH ${LY_TIMESTAMP_FILE}) + file(TOUCH "${LY_TIMESTAMP_FILE}") endif() diff --git a/cmake/Platform/Common/runtime_dependencies_common.cmake.in b/cmake/Platform/Common/runtime_dependencies_common.cmake.in index 8717710a3b..a2c3e26ed0 100644 --- a/cmake/Platform/Common/runtime_dependencies_common.cmake.in +++ b/cmake/Platform/Common/runtime_dependencies_common.cmake.in @@ -13,7 +13,7 @@ function(ly_copy source_file target_directory) cmake_path(APPEND target_file "${target_directory}" "${target_filename}") cmake_path(COMPARE "${source_file}" EQUAL "${target_file}" same_location) if(NOT ${same_location}) - file(LOCK ${target_file}.lock GUARD FUNCTION TIMEOUT 300) + file(LOCK "${target_file}.lock" GUARD FUNCTION TIMEOUT 300) file(SIZE "${source_file}" source_file_size) if(EXISTS "${target_file}") file(SIZE "${target_file}" target_file_size) @@ -24,11 +24,11 @@ function(ly_copy source_file target_directory) message(STATUS "Copying \"${source_file}\" to \"${target_directory}\"...") file(MAKE_DIRECTORY "${full_target_directory}") file(COPY "${source_file}" DESTINATION "${target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN) - file(TOUCH_NOCREATE ${target_file}) + file(TOUCH_NOCREATE "${target_file}") endif() endif() endfunction() @LY_COPY_COMMANDS@ -file(TOUCH @STAMP_OUTPUT_FILE@) +file(TOUCH "@STAMP_OUTPUT_FILE@") diff --git a/cmake/Platform/Linux/runtime_dependencies_linux.cmake.in b/cmake/Platform/Linux/runtime_dependencies_linux.cmake.in index 16445ef8d9..e5d56d1b56 100644 --- a/cmake/Platform/Linux/runtime_dependencies_linux.cmake.in +++ b/cmake/Platform/Linux/runtime_dependencies_linux.cmake.in @@ -14,7 +14,7 @@ function(ly_copy source_file target_directory) cmake_path(APPEND target_file "${target_directory}" "${target_filename}") cmake_path(COMPARE "${source_file}" EQUAL "${target_file}" same_location) if(NOT ${same_location}) - file(LOCK ${target_file}.lock GUARD FUNCTION TIMEOUT 300) + file(LOCK "${target_file}.lock" GUARD FUNCTION TIMEOUT 300) file(SIZE "${source_file}" source_file_size) if(EXISTS "${target_file}") file(SIZE "${target_file}" target_file_size) @@ -39,4 +39,4 @@ endfunction() @LY_COPY_COMMANDS@ -file(TOUCH @STAMP_OUTPUT_FILE@) +file(TOUCH "@STAMP_OUTPUT_FILE@") diff --git a/cmake/Platform/Mac/InstallUtils_mac.cmake.in b/cmake/Platform/Mac/InstallUtils_mac.cmake.in index 89ce4a59f2..3db9903e48 100644 --- a/cmake/Platform/Mac/InstallUtils_mac.cmake.in +++ b/cmake/Platform/Mac/InstallUtils_mac.cmake.in @@ -31,36 +31,36 @@ endfunction() function(fixup_python_framework framework_path) file(REMOVE_RECURSE - ${framework_path}/Versions/Current - ${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/Headers - ${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/lib/Python - ${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/lib/python@LY_PYTHON_VERSION_MAJOR_MINOR@/test - ${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/lib/python@LY_PYTHON_VERSION_MAJOR_MINOR@/site-packages/scipy/io/tests - ${framework_path}/Python - ${framework_path}/Resources - ${framework_path}/Headers + "${framework_path}/Versions/Current" + "${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/Headers" + "${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/lib/Python" + "${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/lib/python@LY_PYTHON_VERSION_MAJOR_MINOR@/test" + "${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/lib/python@LY_PYTHON_VERSION_MAJOR_MINOR@/site-packages/scipy/io/tests" + "${framework_path}/Python" + "${framework_path}/Resources" + "${framework_path}/Headers" ) file(GLOB_RECURSE exe_file_list "${framework_path}/**/*.exe") if(exe_file_list) - file(REMOVE_RECURSE ${exe_file_list}) + file(REMOVE_RECURSE "${exe_file_list}") endif() - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink include/python@LY_PYTHON_VERSION_MAJOR_MINOR@m Headers - WORKING_DIRECTORY ${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@ + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink include/python@LY_PYTHON_VERSION_MAJOR_MINOR@m Headers + WORKING_DIRECTORY "${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@" ) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink @LY_PYTHON_VERSION_MAJOR_MINOR@ Current - WORKING_DIRECTORY ${framework_path}/Versions/ + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink @LY_PYTHON_VERSION_MAJOR_MINOR@ Current + WORKING_DIRECTORY "${framework_path}/Versions/" ) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Python Python - WORKING_DIRECTORY ${framework_path} + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink Versions/Current/Python Python + WORKING_DIRECTORY "${framework_path}" ) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers Headers - WORKING_DIRECTORY ${framework_path} + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink Versions/Current/Headers Headers + WORKING_DIRECTORY "${framework_path}" ) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Resources Resources - WORKING_DIRECTORY ${framework_path} + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink Versions/Current/Resources Resources + WORKING_DIRECTORY "${framework_path}" ) - file(CHMOD ${framework_path}/Versions/Current/Python + file(CHMOD "${framework_path}/Versions/Current/Python" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) @@ -72,7 +72,7 @@ function(codesign_file file entitlement_file) return() endif() - if(EXISTS ${entitlement_file}) + if(EXISTS "${entitlement_file}") execute_process(COMMAND "/usr/bin/codesign" "--force" "--sign" "@LY_CODE_SIGN_IDENTITY@" "--deep" "-o" "runtime" "--timestamp" "--entitlements" "${entitlement_file}" "${file}" TIMEOUT 300 @@ -108,8 +108,8 @@ function(codesign_python_framework_binaries framework_path) "${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/Resources/**") foreach(file ${files}) - if(NOT EXISTS ${file}) - file(REMOVE ${file}) + if(NOT EXISTS "${file}") + file(REMOVE "${file}") continue() endif() cmake_path(SET path_var "${file}") @@ -164,16 +164,16 @@ function(ly_copy source_file target_directory) endfunction() function(ly_download_and_codesign_sdk_python) - execute_process(COMMAND ${CMAKE_COMMAND} -DPAL_PLATFORM_NAME=Mac -DLY_3RDPARTY_PATH=${CMAKE_INSTALL_PREFIX}/python -P ${CMAKE_INSTALL_PREFIX}/python/get_python.cmake - WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + execute_process(COMMAND "${CMAKE_COMMAND}" -DPAL_PLATFORM_NAME=Mac "-DLY_3RDPARTY_PATH=${CMAKE_INSTALL_PREFIX}/python" -P "${CMAKE_INSTALL_PREFIX}/python/get_python.cmake" + WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" ) - fixup_python_framework(${CMAKE_INSTALL_PREFIX}/python/runtime/@LY_PYTHON_PACKAGE_NAME@/Python.framework) - codesign_python_framework_binaries(${CMAKE_INSTALL_PREFIX}/python/runtime/@LY_PYTHON_PACKAGE_NAME@/Python.framework) - codesign_file(${CMAKE_INSTALL_PREFIX}/python/runtime/@LY_PYTHON_PACKAGE_NAME@/Python.framework @LY_ROOT_FOLDER@/python/Platform/Mac/PythonEntitlements.plist) + fixup_python_framework("${CMAKE_INSTALL_PREFIX}/python/runtime/@LY_PYTHON_PACKAGE_NAME@/Python.framework") + codesign_python_framework_binaries("${CMAKE_INSTALL_PREFIX}/python/runtime/@LY_PYTHON_PACKAGE_NAME@/Python.framework") + codesign_file("${CMAKE_INSTALL_PREFIX}/python/runtime/@LY_PYTHON_PACKAGE_NAME@/Python.framework" "@LY_ROOT_FOLDER@/python/Platform/Mac/PythonEntitlements.plist") endfunction() function(ly_codesign_sdk) - codesign_file(${LY_INSTALL_PATH_ORIGINAL}/O3DE_SDK.app "none") + codesign_file("${LY_INSTALL_PATH_ORIGINAL}/O3DE_SDK.app" "none") endfunction() diff --git a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in index 892a90640f..51e6e5830c 100644 --- a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in +++ b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in @@ -127,7 +127,7 @@ function(ly_copy source_file target_directory) if(NOT is_framework) # if it is a bundle, there is no contention about the files in the destination, each bundle target will copy everything # we dont want these files to invalidate the bundle and cause a new signature - file(LOCK ${target_file}.lock GUARD FUNCTION TIMEOUT 300) + file(LOCK "${target_file}.lock" GUARD FUNCTION TIMEOUT 300) file(SIZE "${source_file}" source_file_size) if(EXISTS "${target_file}") file(SIZE "${target_file}" target_file_size) @@ -176,35 +176,35 @@ if(@target_file_dir@ MATCHES ".app/Contents/MacOS") message(STATUS "Fixing ${bundle_path}/Contents/Frameworks/Python.framework...") list(APPEND fixup_bundle_ignore Python python3.7m python3.7) file(REMOVE_RECURSE - ${bundle_path}/Contents/Frameworks/Python.framework/Versions/Current - ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/Headers - ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/Python - ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/test - ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scipy/io/tests - ${bundle_path}/Contents/Frameworks/Python.framework/Python - ${bundle_path}/Contents/Frameworks/Python.framework/Resources - ${bundle_path}/Contents/Frameworks/Python.framework/Headers + "${bundle_path}/Contents/Frameworks/Python.framework/Versions/Current" + "${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/Headers" + "${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/Python" + "${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/test" + "${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scipy/io/tests" + "${bundle_path}/Contents/Frameworks/Python.framework/Python" + "${bundle_path}/Contents/Frameworks/Python.framework/Resources" + "${bundle_path}/Contents/Frameworks/Python.framework/Headers" ) file(GLOB_RECURSE exe_file_list "${bundle_path}/Contents/Frameworks/Python.framework/**/*.exe") if(exe_file_list) - file(REMOVE_RECURSE ${exe_file_list}) + file(REMOVE_RECURSE "${exe_file_list}") endif() - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink include/python3.7m Headers - WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7 + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink include/python3.7m Headers + WORKING_DIRECTORY "${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7" ) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink 3.7 Current - WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework/Versions/ + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink 3.7 Current + WORKING_DIRECTORY "${bundle_path}/Contents/Frameworks/Python.framework/Versions/" ) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Python Python - WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink Versions/Current/Python Python + WORKING_DIRECTORY "${bundle_path}/Contents/Frameworks/Python.framework" ) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers Headers - WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink Versions/Current/Headers Headers + WORKING_DIRECTORY "${bundle_path}/Contents/Frameworks/Python.framework" ) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Resources Resources - WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink Versions/Current/Resources Resources + WORKING_DIRECTORY "${bundle_path}/Contents/Frameworks/Python.framework" ) - file(CHMOD ${bundle_path}/Contents/Frameworks/Python.framework/Versions/Current/Python + file(CHMOD "${bundle_path}/Contents/Frameworks/Python.framework/Versions/Current/Python" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) endif() @@ -215,8 +215,8 @@ if(@target_file_dir@ MATCHES ".app/Contents/MacOS") file(TOUCH "${fixup_timestamp_file}") # fixup bundle ends up removing the rpath of dxc (despite we exclude it) - if(EXISTS ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7) - execute_process(COMMAND ${LY_INSTALL_NAME_TOOL} -add_rpath @executable_path/../lib ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7) + if(EXISTS "${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7") + execute_process(COMMAND $"{LY_INSTALL_NAME_TOOL}" -add_rpath @executable_path/../lib ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7) endif() # misplaced .DS_Store files can cause signing to fail @@ -226,7 +226,7 @@ if(@target_file_dir@ MATCHES ".app/Contents/MacOS") "${bundle_path/}**/*.cstemp" ) if(remove_file_list) - file(REMOVE_RECURSE ${remove_file_list}) + file(REMOVE_RECURSE "${remove_file_list}") endif() endif() @@ -235,7 +235,7 @@ else() # Non-bundle case if(depends_on_python) # RPATH fix python - execute_process(COMMAND ${LY_INSTALL_NAME_TOOL} -change @rpath/Python @rpath/Python.framework/Versions/Current/Python @target_file@) + execute_process(COMMAND "${LY_INSTALL_NAME_TOOL}" -change @rpath/Python @rpath/Python.framework/Versions/Current/Python "@target_file@") endif() endif() diff --git a/python/python.cmd b/python/python.cmd index 70c79e6789..28138fd699 100644 --- a/python/python.cmd +++ b/python/python.cmd @@ -21,7 +21,8 @@ SET PYTHONHOME=%CMD_DIR%\runtime\python-3.7.10-rev2-windows\python IF EXIST "%PYTHONHOME%" GOTO PYTHONHOME_EXISTS -ECHO Could not find Python for Windows in %CMD_DIR%\.. +ECHO Python not found in %CMD_DIR% +ECHO Try running %CMD_DIR%\get_python.bat first. exit /B 1 :PYTHONHOME_EXISTS diff --git a/scripts/build/Platform/Linux/build_linux.sh b/scripts/build/Platform/Linux/build_linux.sh index 2f33827c5b..ce84ec1749 100755 --- a/scripts/build/Platform/Linux/build_linux.sh +++ b/scripts/build/Platform/Linux/build_linux.sh @@ -17,7 +17,7 @@ SOURCE_DIRECTORY=${PWD} pushd $OUTPUT_DIRECTORY LAST_CONFIGURE_CMD_FILE=ci_last_configure_cmd.txt -CONFIGURE_CMD="cmake ${SOURCE_DIRECTORY} ${CMAKE_OPTIONS} ${EXTRA_CMAKE_OPTIONS}" +CONFIGURE_CMD="cmake '${SOURCE_DIRECTORY}' ${CMAKE_OPTIONS} ${EXTRA_CMAKE_OPTIONS}" if [[ -n "$CMAKE_LY_PROJECTS" ]]; then CONFIGURE_CMD="${CONFIGURE_CMD} -DLY_PROJECTS='${CMAKE_LY_PROJECTS}'" fi diff --git a/scripts/build/Platform/Mac/build_mac.sh b/scripts/build/Platform/Mac/build_mac.sh index d6a66fc6c6..e0cb1ba889 100755 --- a/scripts/build/Platform/Mac/build_mac.sh +++ b/scripts/build/Platform/Mac/build_mac.sh @@ -17,7 +17,7 @@ SOURCE_DIRECTORY=${PWD} pushd $OUTPUT_DIRECTORY LAST_CONFIGURE_CMD_FILE=ci_last_configure_cmd.txt -CONFIGURE_CMD="cmake ${SOURCE_DIRECTORY} ${CMAKE_OPTIONS} ${EXTRA_CMAKE_OPTIONS}" +CONFIGURE_CMD="cmake '${SOURCE_DIRECTORY}' ${CMAKE_OPTIONS} ${EXTRA_CMAKE_OPTIONS}" if [[ -n "$CMAKE_LY_PROJECTS" ]]; then CONFIGURE_CMD="${CONFIGURE_CMD} -DLY_PROJECTS='${CMAKE_LY_PROJECTS}'" fi diff --git a/scripts/build/Platform/Windows/build_windows.cmd b/scripts/build/Platform/Windows/build_windows.cmd index 9e9b124adb..798550370f 100644 --- a/scripts/build/Platform/Windows/build_windows.cmd +++ b/scripts/build/Platform/Windows/build_windows.cmd @@ -8,8 +8,7 @@ REM REM SETLOCAL EnableDelayedExpansion - -CALL %~dp0env_windows.cmd +CALL "%~dp0env_windows.cmd" IF NOT EXIST "%OUTPUT_DIRECTORY%" ( MKDIR %OUTPUT_DIRECTORY%. @@ -29,7 +28,7 @@ REM Compute half the amount of processors so some jobs can run SET /a HALF_PROCESSORS = NUMBER_OF_PROCESSORS / 2 SET LAST_CONFIGURE_CMD_FILE=ci_last_configure_cmd.txt -SET CONFIGURE_CMD=cmake %SOURCE_DIRECTORY% %CMAKE_OPTIONS% %EXTRA_CMAKE_OPTIONS% +SET CONFIGURE_CMD=cmake "%SOURCE_DIRECTORY%" %CMAKE_OPTIONS% %EXTRA_CMAKE_OPTIONS% IF NOT "%CMAKE_LY_PROJECTS%"=="" ( SET CONFIGURE_CMD=!CONFIGURE_CMD! -DLY_PROJECTS="%CMAKE_LY_PROJECTS%" ) diff --git a/scripts/build/ci_build.py b/scripts/build/ci_build.py index c35a5e9dbf..78978349c3 100755 --- a/scripts/build/ci_build.py +++ b/scripts/build/ci_build.py @@ -88,7 +88,7 @@ def build(build_config_filename, build_platform, build_type): env_params[v] = build_params[v] print(' {} = {} {}'.format(v, env_params[v], '(environment override)' if existing_param else '')) print('--------------------------------------------------------------------------------', flush=True) - process_return = subprocess.run(build_cmd_path, cwd=cwd_dir, env=env_params) + process_return = subprocess.run([build_cmd_path], cwd=cwd_dir, env=env_params) print('--------------------------------------------------------------------------------') if process_return.returncode != 0: print('[ci_build] FAIL: Command {} returned {}'.format(build_cmd_path, process_return.returncode), flush=True) From 5c0ba0253d25a9a12f91d23e36a0dc10f95de0c7 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 10 Jan 2022 10:01:17 -0800 Subject: [PATCH 331/399] git.ignore cleanup (#6760) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .gitignore | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 9012ec7576..2820d1e1c1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,18 +2,14 @@ .vs/ .vscode/ __pycache__ -AssetProcessorTemp/** [Bb]uild/ [Oo]ut/** CMakeUserPresets.json [Cc]ache/ /[Ii]nstall/ -Editor/EditorEventLog.xml -Editor/EditorLayout.xml **/*egg-info/** **/*egg-link **/[Rr]estricted -UserSettings.xml [Uu]ser/ FrameCapture/** .DS_Store @@ -22,9 +18,6 @@ client*.cfg server*.cfg .mayaSwatches/ _savebackup/ -#Output folder for test results when running Automated Tests -TestResults/** *.swatches /imgui.ini -/scripts/project_manager/logs/ -/AutomatedTesting/Gem/PythonTests/scripting/TestResults + From e4c04c1915c05aad3e1305f2b6aeac015de9131e Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Mon, 10 Jan 2022 12:03:32 -0600 Subject: [PATCH 332/399] Removing redundant Editor test Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../Gem/PythonTests/smoke/CMakeLists.txt | 13 -- .../smoke/Editor_NewExistingLevels_Works.py | 143 ------------------ .../test_Editor_NewExistingLevels_Works.py | 34 ----- 3 files changed, 190 deletions(-) delete mode 100644 AutomatedTesting/Gem/PythonTests/smoke/Editor_NewExistingLevels_Works.py delete mode 100644 AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py diff --git a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt index 5d0808adb6..69d411536f 100644 --- a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt @@ -31,19 +31,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) Smoke ) - ly_add_pytest( - NAME AutomatedTesting::EditorTestWithGPU - TEST_REQUIRES gpu - PATH ${CMAKE_CURRENT_LIST_DIR}/test_Editor_NewExistingLevels_Works.py - TIMEOUT 100 - RUNTIME_DEPENDENCIES - AZ::AssetProcessor - AZ::PythonBindingsExample - Legacy::Editor - AutomatedTesting.GameLauncher - AutomatedTesting.Assets - ) - ly_add_pytest( NAME AutomatedTesting::GameLauncherWithGPU TEST_SUITE sandbox diff --git a/AutomatedTesting/Gem/PythonTests/smoke/Editor_NewExistingLevels_Works.py b/AutomatedTesting/Gem/PythonTests/smoke/Editor_NewExistingLevels_Works.py deleted file mode 100644 index 71956488fc..0000000000 --- a/AutomatedTesting/Gem/PythonTests/smoke/Editor_NewExistingLevels_Works.py +++ /dev/null @@ -1,143 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT - - -Test Case Title: Create Test for UI apps- Editor -""" - - -class Tests(): - level_created = ("Level created", "Failed to create level") - entity_found = ("New Entity created in level", "Failed to create New Entity in level") - mesh_added = ("Mesh Component added", "Failed to add Mesh Component") - enter_game_mode = ("Game Mode successfully entered", "Failed to enter in Game Mode") - exit_game_mode = ("Game Mode successfully exited", "Failed to exit in Game Mode") - level_opened = ("Level opened successfully", "Failed to open level") - level_exported = ("Level exported successfully", "Failed to export level") - mesh_removed = ("Mesh Component removed", "Failed to remove Mesh Component") - entity_deleted = ("Entity deleted", "Failed to delete Entity") - level_edits_present = ("Level edits persist after saving", "Failed to save level edits after saving") - - -def Editor_NewExistingLevels_Works(): - """ - Summary: Perform the below operations on Editor - - 1) Launch & Close editor - 2) Create new level - 3) Saving and loading levels - 4) Level edits persist after saving - 5) Export Level - 6) Can switch to play mode (ctrl+g) and exit that - 7) Run editor python bindings test - 8) Create an Entity - 9) Delete an Entity - 10) Add a component to an Entity - - Expected Behavior: - All operations succeed and do not cause a crash - - Test Steps: - 1) Launch editor and Create a new level - 2) Create a new entity - 3) Add Mesh component - 4) Verify enter/exit game mode - 5) Save, Load and Export level - 6) Remove Mesh component - 7) Delete entity - 8) Open an existing level - 9) Create a new entity in an existing level - 10) Save, Load and Export an existing level and close editor - - Note: - - This test file must be called from the O3DE Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. - - :return: None - """ - - import os - import editor_python_test_tools.hydra_editor_utils as hydra - from editor_python_test_tools.utils import TestHelper as helper - from editor_python_test_tools.utils import Report - import azlmbr.bus as bus - import azlmbr.editor as editor - import azlmbr.legacy.general as general - import azlmbr.math as math - - # 1) Launch editor and Create a new level - helper.init_idle() - test_level_name = "temp_level" - general.create_level_no_prompt(test_level_name, 128, 1, 128, False) - helper.wait_for_condition(lambda: general.get_current_level_name() == test_level_name, 2.0) - Report.result(Tests.level_created, general.get_current_level_name() == test_level_name) - - # 2) Create a new entity - entity_position = math.Vector3(200.0, 200.0, 38.0) - new_entity = hydra.Entity("Entity1") - new_entity.create_entity(entity_position, []) - test_entity = hydra.find_entity_by_name("Entity1") - Report.result(Tests.entity_found, test_entity.IsValid()) - - # 3) Add Mesh component - new_entity.add_component("Mesh") - Report.result(Tests.mesh_added, hydra.has_components(new_entity.id, ["Mesh"])) - - # 4) Verify enter/exit game mode - helper.enter_game_mode(Tests.enter_game_mode) - helper.exit_game_mode(Tests.exit_game_mode) - - # 5) Save, Load and Export level - # Save Level - general.save_level() - # Open Level - general.open_level(test_level_name) - Report.result(Tests.level_opened, general.get_current_level_name() == test_level_name) - # Export Level - general.export_to_engine() - level_pak_file = os.path.join("AutomatedTesting", "Levels", test_level_name, "level.pak") - Report.result(Tests.level_exported, os.path.exists(level_pak_file)) - - # 6) Remove Mesh component - new_entity.remove_component("Mesh") - Report.result(Tests.mesh_removed, not hydra.has_components(new_entity.id, ["Mesh"])) - - # 7) Delete entity - editor.ToolsApplicationRequestBus(bus.Broadcast, "DeleteEntityById", new_entity.id) - test_entity = hydra.find_entity_by_name("Entity1") - Report.result(Tests.entity_deleted, len(test_entity) == 0) - - # 8) Open an existing level - general.open_level(test_level_name) - Report.result(Tests.level_opened, general.get_current_level_name() == test_level_name) - - # 9) Create a new entity in an existing level - entity_position = math.Vector3(200.0, 200.0, 38.0) - new_entity_2 = hydra.Entity("Entity2") - new_entity_2.create_entity(entity_position, []) - test_entity = hydra.find_entity_by_name("Entity2") - Report.result(Tests.entity_found, test_entity.IsValid()) - - # 10) Save, Load and Export an existing level - # Save Level - general.save_level() - # Open Level - general.open_level(test_level_name) - Report.result(Tests.level_opened, general.get_current_level_name() == test_level_name) - entity_id = hydra.find_entity_by_name(new_entity_2.name) - Report.result(Tests.level_edits_present, entity_id == new_entity_2.id) - # Export Level - general.export_to_engine() - level_pak_file = os.path.join("AutomatedTesting", "Levels", test_level_name, "level.pak") - Report.result(Tests.level_exported, os.path.exists(level_pak_file)) - - -if __name__ == "__main__": - - from editor_python_test_tools.utils import Report - - Report.start_test(Editor_NewExistingLevels_Works) diff --git a/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py b/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py deleted file mode 100644 index 5caf7744c4..0000000000 --- a/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py +++ /dev/null @@ -1,34 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT - - -Test should run in both gpu and non gpu -""" - -import pytest -import os -from automatedtesting_shared.base import TestAutomationBase - -import ly_test_tools -import ly_test_tools.environment.file_system as file_system - - -@pytest.mark.SUITE_smoke -@pytest.mark.skipif(not ly_test_tools.WINDOWS, reason="Only succeeds on windows https://github.com/o3de/o3de/issues/5539") -@pytest.mark.parametrize("launcher_platform", ["windows_editor"]) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -@pytest.mark.parametrize("level", ["temp_level"]) -class TestAutomation(TestAutomationBase): - def test_Editor_NewExistingLevels_Works(self, request, workspace, editor, level, project, launcher_platform): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - request.addfinalizer(teardown) - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - from . import Editor_NewExistingLevels_Works as test_module - - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) From 5aa7d56f1a75a0f3bdc0fef569d0f421a868d1da Mon Sep 17 00:00:00 2001 From: LesaelR <89800757+LesaelR@users.noreply.github.com> Date: Mon, 10 Jan 2022 10:15:43 -0800 Subject: [PATCH 333/399] LYN-8935 Bundle Mode Test Update (#6606) * Updating Bundle_Mode_Tests to replace level.pak for .spawnable Signed-off-by: Rosario Cox * Removing old TestDependenciesLevel files and replacing for TestDepencenciesLevel.prefab Signed-off-by: Rosario Cox * Adding missing file Signed-off-by: Rosario Cox --- .../bundle_mode_tests.py | 5 +- .../LevelData/Environment.xml | 14 - .../LevelData/TerrainTexture.xml | 7 - .../LevelData/TimeOfDay.xml | 356 ----------- .../LevelData/VegetationMap.dat | 3 - .../TestDependenciesLevel/TerrainTexture.pak | 3 - .../TestDependenciesLevel.ly | 3 - .../TestDependenciesLevel.prefab | 555 ++++++++++++++++++ .../Levels/TestDependenciesLevel/filelist.xml | 6 - .../Levels/TestDependenciesLevel/level.pak | 3 - 10 files changed, 557 insertions(+), 398 deletions(-) delete mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/LevelData/Environment.xml delete mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/LevelData/TerrainTexture.xml delete mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/LevelData/TimeOfDay.xml delete mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/LevelData/VegetationMap.dat delete mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/TerrainTexture.pak delete mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/TestDependenciesLevel.ly create mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/TestDependenciesLevel.prefab delete mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/filelist.xml delete mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/level.pak diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/bundle_mode_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/bundle_mode_tests.py index af92bb1773..b2252567b6 100644 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/bundle_mode_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/bundle_mode_tests.py @@ -23,12 +23,11 @@ from ..ap_fixtures.timeout_option_fixture import timeout_option_fixture as timeo @pytest.mark.SUITE_periodic @pytest.mark.parametrize('launcher_platform', ['windows_editor']) @pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['auto_test']) +@pytest.mark.parametrize('level', ['TestDependenciesLevel']) class TestBundleMode(object): def test_bundle_mode_with_levels_mounts_bundles_correctly(self, request, editor, level, launcher_platform, asset_processor, workspace, bundler_batch_helper): - level_pak = os.path.join("levels", level, "level.pak") - + level_pak = os.path.join("levels", level, "TestDependenciesLevel.spawnable") bundles_folder = os.path.join(workspace.paths.project(), "Bundles") bundle_request_path = os.path.join(bundles_folder, "bundle.pak") bundle_result_path = os.path.join(bundles_folder, diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/Environment.xml b/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/Environment.xml deleted file mode 100644 index 4ba36f66ae..0000000000 --- a/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/Environment.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/TerrainTexture.xml b/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/TerrainTexture.xml deleted file mode 100644 index f43df05b22..0000000000 --- a/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/TerrainTexture.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/TimeOfDay.xml b/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/TimeOfDay.xml deleted file mode 100644 index c5b404318e..0000000000 --- a/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/TimeOfDay.xml +++ /dev/null @@ -1,356 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/VegetationMap.dat b/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/VegetationMap.dat deleted file mode 100644 index dce5631cd0..0000000000 --- a/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/VegetationMap.dat +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e6a5435c928079b27796f6b202bbc2623e7e454244ddc099a3cadf33b7cb9e9 -size 63 diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/TerrainTexture.pak b/AutomatedTesting/Levels/TestDependenciesLevel/TerrainTexture.pak deleted file mode 100644 index fe3604a050..0000000000 --- a/AutomatedTesting/Levels/TestDependenciesLevel/TerrainTexture.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85 -size 22 diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/TestDependenciesLevel.ly b/AutomatedTesting/Levels/TestDependenciesLevel/TestDependenciesLevel.ly deleted file mode 100644 index 95cc91cd6b..0000000000 --- a/AutomatedTesting/Levels/TestDependenciesLevel/TestDependenciesLevel.ly +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:825828fe7c183e765315f933a8b1eb25283739d34d62cb84c34e2dcb56591d6e -size 12415 diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/TestDependenciesLevel.prefab b/AutomatedTesting/Levels/TestDependenciesLevel/TestDependenciesLevel.prefab new file mode 100644 index 0000000000..cf30cb178c --- /dev/null +++ b/AutomatedTesting/Levels/TestDependenciesLevel/TestDependenciesLevel.prefab @@ -0,0 +1,555 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 3342481886060234850 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1172344194419]": { + "Id": "Entity_[1172344194419]", + "Name": "Shader Ball", + "Components": { + "Component_[10789351944715265527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10789351944715265527 + }, + "Component_[12037033284781049225]": { + "$type": "EditorEntitySortComponent", + "Id": 12037033284781049225 + }, + "Component_[13759153306105970079]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13759153306105970079 + }, + "Component_[14135560884830586279]": { + "$type": "EditorInspectorComponent", + "Id": 14135560884830586279 + }, + "Component_[16247165675903986673]": { + "$type": "EditorVisibilityComponent", + "Id": 16247165675903986673 + }, + "Component_[18082433625958885247]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18082433625958885247 + }, + "Component_[6472623349872972660]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6472623349872972660, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Rotate": [ + 0.0, + 0.10000000149011612, + 180.0 + ] + } + }, + "Component_[6495255223970673916]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 6495255223970673916, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}", + "subId": 281415304 + }, + "assetHint": "objects/shaderball/shaderball_default_1m.azmodel" + } + } + } + }, + "Component_[8056625192494070973]": { + "$type": "SelectionComponent", + "Id": 8056625192494070973 + }, + "Component_[8550141614185782969]": { + "$type": "EditorEntityIconComponent", + "Id": 8550141614185782969 + }, + "Component_[9439770997198325425]": { + "$type": "EditorLockComponent", + "Id": 9439770997198325425 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1172344194419]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + } + }, + "Instances": { + "Instance_[425258647110]": { + "Source": "assets/simple_pot_fbx.procprefab" + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/filelist.xml b/AutomatedTesting/Levels/TestDependenciesLevel/filelist.xml deleted file mode 100644 index b5164a4aee..0000000000 --- a/AutomatedTesting/Levels/TestDependenciesLevel/filelist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/level.pak b/AutomatedTesting/Levels/TestDependenciesLevel/level.pak deleted file mode 100644 index dfba7fb4e3..0000000000 --- a/AutomatedTesting/Levels/TestDependenciesLevel/level.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2611b691998640a0e802461f47b5b876f6832fbece62d34cc25da53e135e1c38 -size 44525 From 8e2e2d96c50bca2a9210f13df1fdd910193e80be Mon Sep 17 00:00:00 2001 From: LesaelR <89800757+LesaelR@users.noreply.github.com> Date: Mon, 10 Jan 2022 10:15:51 -0800 Subject: [PATCH 334/399] Updating asset_bundler_batch_tests to Prefab/Spawnables instead of Level.pak (#6679) * Replaced TestDependenciesLevel's level.pak for TestDependenciesLevel.prefab to fix asset_bundler_batch_tests failure Updated asset_bundler_batch_tests to reflect the update. Signed-off-by: Rosario Cox * Missed one of the .spawnables changes Signed-off-by: Rosario Cox --- .../asset_processor_tests/asset_bundler_batch_tests.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py index f5e5642573..f64427f6df 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py @@ -108,7 +108,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): """ helper = bundler_batch_helper seed_list = os.path.join(workspace.paths.engine_root(), "Assets", "Engine", "SeedAssetList.seed") # Engine seed list - asset = r"levels\testdependencieslevel\level.pak" + asset = r"levels\testdependencieslevel\testdependencieslevel.spawnable" # Create Asset list helper.call_assetLists( @@ -191,7 +191,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): """ helper = bundler_batch_helper seed_list = os.path.join(workspace.paths.engine_root(), "Assets", "Engine", "SeedAssetList.seed") # Engine seed list - asset = r"levels\testdependencieslevel\level.pak" + asset = r"levels\testdependencieslevel\testdependencieslevel.spawnable" # Useful bundle locations / names (2 for comparing contents) # fmt:off @@ -924,7 +924,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): # Create a seed file helper.call_seeds( seedListFile=helper["seed_list_file"], - addSeed=r"levels\testdependencieslevel\level.pak", + addSeed=r"levels\testdependencieslevel\testdependencieslevel.spawnable", platform="pc", ) @@ -947,9 +947,9 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): # Specifying platform but not "add" or "remove" should fail result, _ = helper.call_assetLists( assetListFile=helper["asset_info_file_request"], + allowOverwrites="", seedListFile=helper["seed_list_file"], platform="pc", - allowOverwrites="", ) assert result, "Overwriting with override threw an error" @@ -982,7 +982,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): request.addfinalizer(lambda: fs.delete([bundle_result_path], True, False)) bundles_folder = os.path.join(workspace.paths.project(), "Bundles") - level_pak = r"levels\testdependencieslevel\level.pak" + level_pak = r"levels\testdependencieslevel\testdependencieslevel.spawnable" bundle_request_path = os.path.join(bundles_folder, "bundle.pak") bundle_result_path = os.path.join(bundles_folder, helper.platform_file_name("bundle.pak", workspace.asset_processor_platform)) From df7a2fbd9d8e07f2d6786c1927eeddab2f05513e Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Mon, 10 Jan 2022 12:11:15 -0800 Subject: [PATCH 335/399] Add better error handling for failed loading of the LyShine shader (#6761) Signed-off-by: abrmich --- .../DynamicDraw/DynamicDrawContext.cpp | 6 ++- Gems/LyShine/Code/Source/Draw2d.cpp | 49 +++++++++++-------- Gems/LyShine/Code/Source/UiRenderer.cpp | 4 +- 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/DynamicDraw/DynamicDrawContext.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/DynamicDraw/DynamicDrawContext.cpp index 3b3473a2da..47791d3002 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/DynamicDraw/DynamicDrawContext.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/DynamicDraw/DynamicDrawContext.cpp @@ -141,6 +141,7 @@ namespace AZ void DynamicDrawContext::InitVertexFormat(const AZStd::vector& vertexChannels) { AZ_Assert(!m_initialized, "Can't call InitVertexFormat after context was initialized (EndInit was called)"); + AZ_Assert(m_pipelineState, "Can't call InitVertexFormat before InitShader is called with a valid shader"); m_perVertexDataSize = 0; RHI::InputStreamLayoutBuilder layoutBuilder; @@ -150,7 +151,10 @@ namespace AZ bufferBuilder->Channel(channel.m_channel, channel.m_format); m_perVertexDataSize += RHI::GetFormatSize(channel.m_format); } - m_pipelineState->InputStreamLayout() = layoutBuilder.End(); + if (m_pipelineState) + { + m_pipelineState->InputStreamLayout() = layoutBuilder.End(); + } } void DynamicDrawContext::InitDrawListTag(RHI::DrawListTag drawListTag) diff --git a/Gems/LyShine/Code/Source/Draw2d.cpp b/Gems/LyShine/Code/Source/Draw2d.cpp index 917c1bb168..2838ed4877 100644 --- a/Gems/LyShine/Code/Source/Draw2d.cpp +++ b/Gems/LyShine/Code/Source/Draw2d.cpp @@ -122,27 +122,34 @@ void CDraw2d::OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene) } m_dynamicDraw->EndInit(); - // Cache draw srg input indices for later use - static const char textureIndexName[] = "m_texture"; - static const char worldToProjIndexName[] = "m_worldToProj"; - AZ::Data::Instance drawSrg = m_dynamicDraw->NewDrawSrg(); - const AZ::RHI::ShaderResourceGroupLayout* layout = drawSrg->GetLayout(); - m_shaderData.m_imageInputIndex = layout->FindShaderInputImageIndex(AZ::Name(textureIndexName)); - AZ_Error("Draw2d", m_shaderData.m_imageInputIndex.IsValid(), "Failed to find shader input constant %s.", - textureIndexName); - m_shaderData.m_viewProjInputIndex = layout->FindShaderInputConstantIndex(AZ::Name(worldToProjIndexName)); - AZ_Error("Draw2d", m_shaderData.m_viewProjInputIndex.IsValid(), "Failed to find shader input constant %s.", - worldToProjIndexName); - - // Cache shader variants that will be used - AZ::RPI::ShaderOptionList shaderOptionsClamp; - shaderOptionsClamp.push_back(AZ::RPI::ShaderOption(AZ::Name("o_clamp"), AZ::Name("true"))); - shaderOptionsClamp.push_back(AZ::RPI::ShaderOption(AZ::Name("o_useColorChannels"), AZ::Name("true"))); - m_shaderData.m_shaderOptionsClamp = m_dynamicDraw->UseShaderVariant(shaderOptionsClamp); - AZ::RPI::ShaderOptionList shaderOptionsWrap; - shaderOptionsWrap.push_back(AZ::RPI::ShaderOption(AZ::Name("o_clamp"), AZ::Name("false"))); - shaderOptionsWrap.push_back(AZ::RPI::ShaderOption(AZ::Name("o_useColorChannels"), AZ::Name("true"))); - m_shaderData.m_shaderOptionsWrap = m_dynamicDraw->UseShaderVariant(shaderOptionsWrap); + // Check that the dynamic draw context has been initialized appropriately + if (m_dynamicDraw->IsReady()) + { + // Cache draw srg input indices for later use + static const char textureIndexName[] = "m_texture"; + static const char worldToProjIndexName[] = "m_worldToProj"; + AZ::Data::Instance drawSrg = m_dynamicDraw->NewDrawSrg(); + if (drawSrg) + { + const AZ::RHI::ShaderResourceGroupLayout* layout = drawSrg->GetLayout(); + m_shaderData.m_imageInputIndex = layout->FindShaderInputImageIndex(AZ::Name(textureIndexName)); + AZ_Error("Draw2d", m_shaderData.m_imageInputIndex.IsValid(), "Failed to find shader input constant %s.", + textureIndexName); + m_shaderData.m_viewProjInputIndex = layout->FindShaderInputConstantIndex(AZ::Name(worldToProjIndexName)); + AZ_Error("Draw2d", m_shaderData.m_viewProjInputIndex.IsValid(), "Failed to find shader input constant %s.", + worldToProjIndexName); + } + + // Cache shader variants that will be used + AZ::RPI::ShaderOptionList shaderOptionsClamp; + shaderOptionsClamp.push_back(AZ::RPI::ShaderOption(AZ::Name("o_clamp"), AZ::Name("true"))); + shaderOptionsClamp.push_back(AZ::RPI::ShaderOption(AZ::Name("o_useColorChannels"), AZ::Name("true"))); + m_shaderData.m_shaderOptionsClamp = m_dynamicDraw->UseShaderVariant(shaderOptionsClamp); + AZ::RPI::ShaderOptionList shaderOptionsWrap; + shaderOptionsWrap.push_back(AZ::RPI::ShaderOption(AZ::Name("o_clamp"), AZ::Name("false"))); + shaderOptionsWrap.push_back(AZ::RPI::ShaderOption(AZ::Name("o_useColorChannels"), AZ::Name("true"))); + m_shaderData.m_shaderOptionsWrap = m_dynamicDraw->UseShaderVariant(shaderOptionsWrap); + } } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Gems/LyShine/Code/Source/UiRenderer.cpp b/Gems/LyShine/Code/Source/UiRenderer.cpp index acf17049ad..3b835dec92 100644 --- a/Gems/LyShine/Code/Source/UiRenderer.cpp +++ b/Gems/LyShine/Code/Source/UiRenderer.cpp @@ -76,7 +76,7 @@ void UiRenderer::OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene) // Create a dynamic draw context for UI Canvas drawing for the scene m_dynamicDraw = CreateDynamicDrawContext(uiShader); - if (m_dynamicDraw) + if (m_dynamicDraw && m_dynamicDraw->IsReady()) { // Cache shader data such as input indices for later use CacheShaderData(m_dynamicDraw); @@ -85,7 +85,7 @@ void UiRenderer::OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene) } else { - AZ_Error(LogName, false, "Failed to create a dynamic draw context for LyShine. \ + AZ_Error(LogName, false, "Failed to create or initialize a dynamic draw context for LyShine. \ This can happen if the LyShine pass hasn't been added to the main render pipeline."); } } From 10497fe92c89486dd8ccd0a391aef624ed5abac3 Mon Sep 17 00:00:00 2001 From: Sergey Pereslavtsev Date: Mon, 10 Jan 2022 20:43:33 +0000 Subject: [PATCH 336/399] LYN-9183 Fix Terrain Heightfield Collider component to list physics materials from the library Signed-off-by: Sergey Pereslavtsev --- .../TerrainPhysicsColliderComponent.cpp | 15 +++++++++++++++ .../Components/TerrainPhysicsColliderComponent.h | 1 + 2 files changed, 16 insertions(+) diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp index 8c2c0e80b6..916dd800e2 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp @@ -17,6 +17,7 @@ #include #include +#include #include namespace Terrain @@ -43,11 +44,25 @@ namespace Terrain AZ::Edit::UIHandlers::ComboBox, &TerrainPhysicsSurfaceMaterialMapping::m_surfaceTag, "Surface Tag", "Surface type to map to a physics material.") ->DataElement(AZ::Edit::UIHandlers::Default, &TerrainPhysicsSurfaceMaterialMapping::m_materialId, "Material ID", "") + ->ElementAttribute(Physics::Attributes::MaterialLibraryAssetId, &TerrainPhysicsSurfaceMaterialMapping::GetMaterialLibraryId) ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ->Attribute(AZ::Edit::Attributes::ShowProductAssetFileName, true); } } } + + AZ::Data::AssetId TerrainPhysicsSurfaceMaterialMapping::GetMaterialLibraryId() + { + if (auto* physicsSystem = AZ::Interface::Get()) + { + if (const auto* physicsConfiguration = physicsSystem->GetConfiguration()) + { + return physicsConfiguration->m_materialLibraryAsset.GetId(); + } + } + return {}; + } + void TerrainPhysicsColliderConfig::Reflect(AZ::ReflectContext* context) { TerrainPhysicsSurfaceMaterialMapping::Reflect(context); diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h index 1a7fbf9c72..284bc74d88 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h @@ -33,6 +33,7 @@ namespace Terrain AZ_CLASS_ALLOCATOR(TerrainPhysicsSurfaceMaterialMapping, AZ::SystemAllocator, 0); AZ_RTTI(TerrainPhysicsSurfaceMaterialMapping, "{A88B5289-DFCD-4564-8395-E2177DFE5B18}"); static void Reflect(AZ::ReflectContext* context); + static AZ::Data::AssetId GetMaterialLibraryId(); SurfaceData::SurfaceTag m_surfaceTag; Physics::MaterialId m_materialId; From 18ea4ba6a8c2646b074f236eb03feab3ec037777 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Mon, 10 Jan 2022 15:21:04 -0600 Subject: [PATCH 337/399] Added a CriticalAssetsCompiled Lifecycle event (#6469) The CriticalAssetsCompiled event can be handled to detect when the AssetProcessor has finished processing Critical Assets Also with the new event, an audit has been performed over all the locations where the AssetCatalogEventBus OnCatalogLoaded event was being handle to make sure it was the proper event to use. If the handler was actually examing the enumerating over the full catalog or querying all assets within the catalog, then it was a proper use. For handlers that were interested in a particular asset it was not Moreover added implementations of `OnCatalogAssetChanged` and `OnCatalogAssetAdded` to the FileTagComponent and the MaterialViewportComponent. Any applications which uses the AtomToolsApplication class(MaterialEditor, AtomSampleViewerStandalone, ShaderMangementConsole) now signals a "CriticalAssetsCompiled" lifecycle event as well as loads the "assetcatalog.xml" if it exists. The Launcher application signals the "CrticalAssetsCompiled" event and reloads the "assetcatalog.xml" for the ${project}.GameLauncher and ${project}.ServerLauncher in Launcher.cpp Finally the Editor signals the "CriticalAssetsCompiled" and reloads the "assetcatalog.xml" in CryEdit.cpp resolves #6093 Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Code/Editor/CryEdit.cpp | 23 ++++- .../AzFramework/FileTag/FileTagComponent.cpp | 33 +++++-- .../AzFramework/FileTag/FileTagComponent.h | 2 + .../Spawnable/SpawnableSystemComponent.cpp | 38 ++++---- .../Spawnable/SpawnableSystemComponent.h | 10 +- Code/LauncherUnified/Launcher.cpp | 96 ++++++++++++------- .../SerializeContextTools/SliceConverter.cpp | 4 - .../Code/Source/BootstrapSystemComponent.cpp | 2 +- .../Atom/RPI.Public/RPISystemInterface.h | 3 +- .../Application/AtomToolsApplication.cpp | 19 +++- .../Viewport/MaterialViewportComponent.cpp | 53 +++++++++- .../Viewport/MaterialViewportComponent.h | 3 + .../EditorCommonFeaturesSystemComponent.cpp | 20 ++-- .../EditorCommonFeaturesSystemComponent.h | 5 +- .../Editor/MultiplayerEditorConnection.cpp | 2 +- .../NetworkEntity/NetworkSpawnableLibrary.cpp | 18 ++-- .../NetworkEntity/NetworkSpawnableLibrary.h | 6 +- Gems/PhysX/Code/Source/System/PhysXSystem.cpp | 4 +- Registry/application_lifecycle_events.setreg | 3 +- 19 files changed, 232 insertions(+), 112 deletions(-) diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp index 77099761c1..1c4e22b99e 100644 --- a/Code/Editor/CryEdit.cpp +++ b/Code/Editor/CryEdit.cpp @@ -1352,8 +1352,27 @@ void CCryEditApp::CompileCriticalAssets() const } } assetsInQueueNotifcation.BusDisconnect(); - CCryEditApp::OutputStartupMessage(QString("Asset Processor is now ready.")); + // Signal the "CriticalAssetsCompiled" lifecycle event + // Also reload the "assetcatalog.xml" if it exists + if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr) + { + AZ::ComponentApplicationLifecycle::SignalEvent(*settingsRegistry, "CriticalAssetsCompiled", R"({})"); + // Reload the assetcatalog.xml at this point again + // Start Monitoring Asset changes over the network and load the AssetCatalog + auto LoadCatalog = [settingsRegistry](AZ::Data::AssetCatalogRequests* assetCatalogRequests) + { + if (AZ::IO::FixedMaxPath assetCatalogPath; + settingsRegistry->Get(assetCatalogPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_CacheRootFolder)) + { + assetCatalogPath /= "assetcatalog.xml"; + assetCatalogRequests->LoadCatalog(assetCatalogPath.c_str()); + } + }; + AZ::Data::AssetCatalogRequestBus::Broadcast(AZStd::move(LoadCatalog)); + } + + CCryEditApp::OutputStartupMessage(QString("Asset Processor is now ready.")); } bool CCryEditApp::ConnectToAssetProcessor() const @@ -1669,7 +1688,7 @@ bool CCryEditApp::InitInstance() return false; } - if (AZ::SettingsRegistryInterface* settingsRegistry = AZ::SettingsRegistry::Get()) + if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr) { AZ::ComponentApplicationLifecycle::SignalEvent(*settingsRegistry, "LegacySystemInterfaceCreated", R"({})"); } diff --git a/Code/Framework/AzFramework/AzFramework/FileTag/FileTagComponent.cpp b/Code/Framework/AzFramework/AzFramework/FileTag/FileTagComponent.cpp index 1d09500415..f4831d1f8b 100644 --- a/Code/Framework/AzFramework/AzFramework/FileTag/FileTagComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/FileTag/FileTagComponent.cpp @@ -97,19 +97,38 @@ namespace AzFramework AZStd::vector registeredAssetPaths; AZ::Data::AssetCatalogRequestBus::BroadcastResult(registeredAssetPaths, &AZ::Data::AssetCatalogRequests::GetRegisteredAssetPaths); - const char* dependencyXmlPattern = "*_dependencies.xml"; + constexpr const char* dependencyXmlPattern = "_dependencies.xml"; for (const AZStd::string& assetPath : registeredAssetPaths) { - if (!AZStd::wildcard_match(dependencyXmlPattern, assetPath.c_str())) + if (assetPath.ends_with(dependencyXmlPattern)) { - continue; + AZ_VerifyError("ExcludeFileComponent", m_excludeFileQueryManager.get()->LoadEngineDependencies(assetPath), + "Failed to add assets referenced from %s to the blocked list", assetPath.c_str()); } + } + } - if (!m_excludeFileQueryManager.get()->LoadEngineDependencies(assetPath)) - { - AZ_Error("ExcludeFileComponent", false, "Failed to add assets referenced from %s to the blocked list", assetPath.c_str()); - } + void ExcludeFileComponent::OnCatalogAssetChanged(const AZ::Data::AssetId& assetId) + { + // Reload any modified "_dependencies.xml" files + AZ::IO::Path assetPath; + auto GetAssetPath = [&assetId, &assetPath](AZ::Data::AssetCatalogRequests* assetCatalogRequests) + { + assetPath = assetCatalogRequests->GetAssetPathById(assetId); + }; + + AZ::Data::AssetCatalogRequestBus::Broadcast(AZStd::move(GetAssetPath)); + constexpr const char* dependencyXmlPattern = "_dependencies.xml"; + if (assetPath.Native().ends_with(dependencyXmlPattern)) + { + AZ_VerifyError("ExcludeFileComponent", m_excludeFileQueryManager.get()->LoadEngineDependencies(assetPath.Native()), + "Failed to add assets referenced from %s to the blocked list", assetPath.c_str()); } } + + void ExcludeFileComponent::OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) + { + OnCatalogAssetChanged(assetId); + } } } diff --git a/Code/Framework/AzFramework/AzFramework/FileTag/FileTagComponent.h b/Code/Framework/AzFramework/AzFramework/FileTag/FileTagComponent.h index d53e4e7a89..1bd0f46aa0 100644 --- a/Code/Framework/AzFramework/AzFramework/FileTag/FileTagComponent.h +++ b/Code/Framework/AzFramework/AzFramework/FileTag/FileTagComponent.h @@ -65,6 +65,8 @@ namespace AzFramework void Deactivate() override; void OnCatalogLoaded(const char* catalogFile) override; + void OnCatalogAssetChanged(const AZ::Data::AssetId& assetId) override; + void OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) override; static void Reflect(AZ::ReflectContext* context); diff --git a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableSystemComponent.cpp b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableSystemComponent.cpp index 6ca2f3a53a..4ba9c45a98 100644 --- a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableSystemComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableSystemComponent.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -61,15 +62,6 @@ namespace AzFramework m_entitiesManager.ProcessQueue(SpawnableEntitiesManager::CommandQueuePriority::High); } - void SpawnableSystemComponent::OnCatalogLoaded([[maybe_unused]] const char* catalogFile) - { - if (!m_catalogAvailable) - { - m_catalogAvailable = true; - LoadRootSpawnableFromSettingsRegistry(); - } - } - uint64_t SpawnableSystemComponent::AssignRootSpawnable(AZ::Data::Asset rootSpawnable) { uint32_t generation = 0; @@ -157,20 +149,29 @@ namespace AzFramework // Register with AssetDatabase AZ_Assert(AZ::Data::AssetManager::IsReady(), "Spawnables can't be registered because the Asset Manager is not ready yet."); AZ::Data::AssetManager::Instance().RegisterHandler(&m_assetHandler, AZ::AzTypeInfo::Uuid()); - + // Register with AssetCatalog AZ::Data::AssetCatalogRequestBus::Broadcast( &AZ::Data::AssetCatalogRequestBus::Events::EnableCatalogForAsset, AZ::AzTypeInfo::Uuid()); AZ::Data::AssetCatalogRequestBus::Broadcast( &AZ::Data::AssetCatalogRequestBus::Events::AddExtension, Spawnable::FileExtension); - AssetCatalogEventBus::Handler::BusConnect(); + // Register for the CriticalAssetsCompiled lifecycle event to trigger the loading of the root spawnable + auto settingsRegistry = AZ::SettingsRegistry::Get(); + AZ_Assert(settingsRegistry, "Unable to change root spawnable callback because Settings Registry is not available."); + + auto LifecycleCallback = [this](AZStd::string_view, AZ::SettingsRegistryInterface::Type) + { + LoadRootSpawnableFromSettingsRegistry(); + }; + AZ::ComponentApplicationLifecycle::RegisterHandler(*settingsRegistry, m_criticalAssetsHandler, + AZStd::move(LifecycleCallback), "CriticalAssetsCompiled"); + + RootSpawnableNotificationBus::Handler::BusConnect(); AZ::TickBus::Handler::BusConnect(); - auto registry = AZ::SettingsRegistry::Get(); - AZ_Assert(registry, "Unable to change root spawnable callback because Settings Registry is not available."); - m_registryChangeHandler = registry->RegisterNotifier([this](AZStd::string_view path, AZ::SettingsRegistryInterface::Type /*type*/) + m_registryChangeHandler = settingsRegistry->RegisterNotifier([this](AZStd::string_view path, AZ::SettingsRegistryInterface::Type /*type*/) { if (path.starts_with(RootSpawnableRegistryKey)) { @@ -187,13 +188,14 @@ namespace AzFramework AZ::TickBus::Handler::BusDisconnect(); RootSpawnableNotificationBus::Handler::BusDisconnect(); - AssetCatalogEventBus::Handler::BusDisconnect(); + // Unregister Lifecycle event handler + m_criticalAssetsHandler = {}; - if (m_catalogAvailable) + if (m_rootSpawnableId.IsValid()) { ReleaseRootSpawnable(); - // The SpawnalbleSystemComponent needs to guarantee there's no more processing left to do by the + // The SpawnableSystemComponent needs to guarantee there's no more processing left to do by the // entity manager before it can safely destroy it on shutdown, but also to make sure that are no // more calls to the callback registered to the root spawnable as that accesses this component. m_rootSpawnableContainer.Clear(); @@ -210,8 +212,6 @@ namespace AzFramework void SpawnableSystemComponent::LoadRootSpawnableFromSettingsRegistry() { - AZ_Assert(m_catalogAvailable, "Attempting to load root spawnable while the catalog is not available yet."); - auto registry = AZ::SettingsRegistry::Get(); AZ_Assert(registry, "Unable to check for root spawnable because the Settings Registry is not available."); diff --git a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableSystemComponent.h b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableSystemComponent.h index ecd2a9b728..712cd1529d 100644 --- a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableSystemComponent.h +++ b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableSystemComponent.h @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -25,7 +24,6 @@ namespace AzFramework : public AZ::Component , public AZ::TickBus::Handler , public AZ::SystemTickBus::Handler - , public AssetCatalogEventBus::Handler , public RootSpawnableInterface::Registrar , public RootSpawnableNotificationBus::Handler { @@ -63,12 +61,6 @@ namespace AzFramework void OnSystemTick() override; - // - // AssetCatalogEventBus - // - - void OnCatalogLoaded(const char* catalogFile) override; - // // RootSpawnableInterface // @@ -97,6 +89,6 @@ namespace AzFramework AZ::SettingsRegistryInterface::NotifyEventHandler m_registryChangeHandler; AZ::Data::AssetId m_rootSpawnableId; - bool m_catalogAvailable{ false }; + AZ::SettingsRegistryInterface::NotifyEventHandler m_criticalAssetsHandler; }; } // namespace AzFramework diff --git a/Code/LauncherUnified/Launcher.cpp b/Code/LauncherUnified/Launcher.cpp index ed01a67f39..9dfd6213c4 100644 --- a/Code/LauncherUnified/Launcher.cpp +++ b/Code/LauncherUnified/Launcher.cpp @@ -229,33 +229,65 @@ namespace O3DELauncher void CreateRemoteFileIO(); - bool ConnectToAssetProcessor() + // This function make sure the launcher has signaled the "CriticalAssetsCompiled" + // lifecycle event as well as to load the "assetcatalog.xml" file if it exists + void CompileCriticalAssets() { - bool connectedToAssetProcessor{}; - // When the AssetProcessor is already launched it should take less than a second to perform a connection - // but when the AssetProcessor needs to be launch it could take up to 15 seconds to have the AssetProcessor initialize - // and able to negotiate a connection when running a debug build - // and to negotiate a connection - // Setting the connectTimeout to 3 seconds if not set within the settings registry - - AzFramework::AssetSystem::ConnectionSettings connectionSettings; - AzFramework::AssetSystem::ReadConnectionSettingsFromSettingsRegistry(connectionSettings); - - connectionSettings.m_launchAssetProcessorOnFailedConnection = true; - connectionSettings.m_connectionIdentifier = AzFramework::AssetSystem::ConnectionIdentifiers::Game; - connectionSettings.m_loggingCallback = []([[maybe_unused]] AZStd::string_view logData) + if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr) { - AZ_TracePrintf("Launcher", "%.*s", aznumeric_cast(logData.size()), logData.data()); - }; - - AzFramework::AssetSystemRequestBus::BroadcastResult(connectedToAssetProcessor, &AzFramework::AssetSystemRequestBus::Events::EstablishAssetProcessorConnection, connectionSettings); + AZ::ComponentApplicationLifecycle::SignalEvent(*settingsRegistry, "CriticalAssetsCompiled", R"({})"); + // Reload the assetcatalog.xml at this point again + // Start Monitoring Asset changes over the network and load the AssetCatalog + auto LoadCatalog = [settingsRegistry](AZ::Data::AssetCatalogRequests* assetCatalogRequests) + { + if (AZ::IO::FixedMaxPath assetCatalogPath; + settingsRegistry->Get(assetCatalogPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_CacheRootFolder)) + { + assetCatalogPath /= "assetcatalog.xml"; + assetCatalogRequests->LoadCatalog(assetCatalogPath.c_str()); + } + }; + AZ::Data::AssetCatalogRequestBus::Broadcast(AZStd::move(LoadCatalog)); + } + } - if (connectedToAssetProcessor) + // If the connect option is false, this function will return true + // to make sure the Launcher passes the connected to AP check + // If REMOTE_ASSET_PROCESSOR is not defined, then the launcher doesn't need + // to connect to the AssetProcessor and therefore this function returns true + bool ConnectToAssetProcessor([[maybe_unused]] bool connect) + { + bool connectedToAssetProcessor = true; +#if defined(REMOTE_ASSET_PROCESSOR) + if (connect) { - AZ_TracePrintf("Launcher", "Connected to Asset Processor\n"); - CreateRemoteFileIO(); + // When the AssetProcessor is already launched it should take less than a second to perform a connection + // but when the AssetProcessor needs to be launch it could take up to 15 seconds to have the AssetProcessor initialize + // and able to negotiate a connection when running a debug build + // and to negotiate a connection + // Setting the connectTimeout to 3 seconds if not set within the settings registry + + AzFramework::AssetSystem::ConnectionSettings connectionSettings; + AzFramework::AssetSystem::ReadConnectionSettingsFromSettingsRegistry(connectionSettings); + + connectionSettings.m_launchAssetProcessorOnFailedConnection = true; + connectionSettings.m_connectionIdentifier = AzFramework::AssetSystem::ConnectionIdentifiers::Game; + connectionSettings.m_loggingCallback = []([[maybe_unused]] AZStd::string_view logData) + { + AZ_TracePrintf("Launcher", "%.*s", aznumeric_cast(logData.size()), logData.data()); + }; + + AzFramework::AssetSystemRequestBus::BroadcastResult(connectedToAssetProcessor, &AzFramework::AssetSystemRequestBus::Events::EstablishAssetProcessorConnection, connectionSettings); + + if (connectedToAssetProcessor) + { + AZ_TracePrintf("Launcher", "Connected to Asset Processor\n"); + CreateRemoteFileIO(); + } } +#endif + CompileCriticalAssets(); return connectedToAssetProcessor; } @@ -403,25 +435,21 @@ namespace O3DELauncher gameApplication.Start({}, gameApplicationStartupParams); -#if defined(REMOTE_ASSET_PROCESSOR) - bool allowedEngineConnection = !systemInitParams.bToolMode && !systemInitParams.bTestMode && bg_ConnectToAssetProcessor; //connect to the asset processor using the bootstrap values - if (allowedEngineConnection) + const bool allowedEngineConnection = !systemInitParams.bToolMode && !systemInitParams.bTestMode && bg_ConnectToAssetProcessor; + if (!ConnectToAssetProcessor(allowedEngineConnection)) { - if (!ConnectToAssetProcessor()) + AZ::s64 waitForConnect{}; + AZ::SettingsRegistryMergeUtils::PlatformGet(*settingsRegistry, waitForConnect, + AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey, "wait_for_connect"); + if (waitForConnect != 0) { - AZ::s64 waitForConnect{}; - AZ::SettingsRegistryMergeUtils::PlatformGet(*settingsRegistry, waitForConnect, - AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey, "wait_for_connect"); - if (waitForConnect != 0) - { - AZ_Error("Launcher", false, "Failed to connect to AssetProcessor."); - return ReturnCode::ErrAssetProccessor; - } + AZ_Error("Launcher", false, "Failed to connect to AssetProcessor."); + return ReturnCode::ErrAssetProccessor; } } -#endif + AZ_Assert(AZ::AllocatorInstance::IsReady(), "System allocator was not created or creation failed."); //Initialize the Debug trace instance to create necessary environment variables AZ::Debug::Trace::Instance().Init(); diff --git a/Code/Tools/SerializeContextTools/SliceConverter.cpp b/Code/Tools/SerializeContextTools/SliceConverter.cpp index d0528a9cad..cfb1998f48 100644 --- a/Code/Tools/SerializeContextTools/SliceConverter.cpp +++ b/Code/Tools/SerializeContextTools/SliceConverter.cpp @@ -79,10 +79,6 @@ namespace AZ return false; } - // Load the asset catalog so that we can find any nested assets successfully. We also need to tick the tick bus - // so that the OnCatalogLoaded event gets processed now, instead of during application shutdown. - application.Tick(); - AZStd::string logggingScratchBuffer; SetupLogging(logggingScratchBuffer, convertSettings.m_reporting, *commandLine); diff --git a/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.cpp b/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.cpp index 84fc58718c..ef03a839d7 100644 --- a/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.cpp +++ b/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.cpp @@ -155,7 +155,7 @@ namespace AZ { Initialize(); }, - "LegacySystemInterfaceCreated"); + "CriticalAssetsCompiled"); } } diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPISystemInterface.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPISystemInterface.h index 3f30d498cf..693185b6d2 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPISystemInterface.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPISystemInterface.h @@ -34,8 +34,7 @@ namespace AZ RPISystemInterface() = default; virtual ~RPISystemInterface() = default; - //! Pre-load some system assets. This should be called once the asset catalog is ready and before create any RPI instances. - //! Note: can't rely on the AzFramework::AssetCatalogEventBus's OnCatalogLoaded since the order of calling handlers is undefined. + //! Pre-load some system assets. This should be called once Critical Asset have compiled ready and before create any RPI instances. virtual void InitializeSystemAssets() = 0; //! Was the RPI system initialized properly diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp index ec365d7a6a..02248fffd4 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -295,10 +296,24 @@ namespace AtomToolsFramework QMessageBox::critical( activeWindow(), QString("Failed to compile critical assets"), QString("Failed to compile the following critical assets:\n%1\n%2") - .arg(failedAssets.join(",\n")) - .arg("Make sure this is an Atom project.")); + .arg(failedAssets.join(",\n")) + .arg("Make sure this is an Atom project.")); ExitMainLoop(); } + + AZ::ComponentApplicationLifecycle::SignalEvent(*m_settingsRegistry, "CriticalAssetsCompiled", R"({})"); + // Reload the assetcatalog.xml at this point again + // Start Monitoring Asset changes over the network and load the AssetCatalog + auto LoadCatalog = [settingsRegistry = m_settingsRegistry.get()](AZ::Data::AssetCatalogRequests* assetCatalogRequests) + { + if (AZ::IO::FixedMaxPath assetCatalogPath; + settingsRegistry->Get(assetCatalogPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_CacheRootFolder)) + { + assetCatalogPath /= "assetcatalog.xml"; + assetCatalogRequests->LoadCatalog(assetCatalogPath.c_str()); + } + }; + AZ::Data::AssetCatalogRequestBus::Broadcast(AZStd::move(LoadCatalog)); } void AtomToolsApplication::SaveSettings() diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp index 35f5067cd0..9cf714b40e 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -165,12 +165,12 @@ namespace MaterialEditor // AssetCatalogRequestBus::EnumerateAssets can lead to deadlocked) AZ::Data::AssetCatalogRequests::AssetEnumerationCB enumerateCB = [this]([[maybe_unused]] const AZ::Data::AssetId id, const AZ::Data::AssetInfo& info) { - if (AzFramework::StringFunc::EndsWith(info.m_relativePath.c_str(), ".lightingpreset.azasset")) + if (AZ::StringFunc::EndsWith(info.m_relativePath.c_str(), ".lightingpreset.azasset")) { m_lightingPresetAssets[info.m_assetId] = { info.m_assetId, info.m_assetType }; AZ::Data::AssetBus::MultiHandler::BusConnect(info.m_assetId); } - else if (AzFramework::StringFunc::EndsWith(info.m_relativePath.c_str(), ".modelpreset.azasset")) + else if (AZ::StringFunc::EndsWith(info.m_relativePath.c_str(), ".modelpreset.azasset")) { m_modelPresetAssets[info.m_assetId] = { info.m_assetId, info.m_assetType }; AZ::Data::AssetBus::MultiHandler::BusConnect(info.m_assetId); @@ -429,4 +429,51 @@ namespace MaterialEditor ReloadContent(); }); } + + void MaterialViewportComponent::OnCatalogAssetChanged(const AZ::Data::AssetId& assetId) + { + auto ReloadLightingAndModelPresets = [this, &assetId](AZ::Data::AssetCatalogRequests* assetCatalogRequests) + { + AZ::Data::AssetInfo assetInfo = assetCatalogRequests->GetAssetInfoById(assetId); + AZ::Data::Asset* modifiedPresetAsset{}; + if (AZ::StringFunc::EndsWith(assetInfo.m_relativePath.c_str(), ".lightingpreset.azasset")) + { + m_lightingPresetAssets[assetInfo.m_assetId] = { assetInfo.m_assetId, assetInfo.m_assetType }; + AZ::Data::AssetBus::MultiHandler::BusConnect(assetInfo.m_assetId); + modifiedPresetAsset = &m_lightingPresetAssets[assetInfo.m_assetId]; + } + else if (AzFramework::StringFunc::EndsWith(assetInfo.m_relativePath.c_str(), ".modelpreset.azasset")) + { + m_modelPresetAssets[assetInfo.m_assetId] = { assetInfo.m_assetId, assetInfo.m_assetType }; + AZ::Data::AssetBus::MultiHandler::BusConnect(assetInfo.m_assetId); + modifiedPresetAsset = &m_modelPresetAssets[assetInfo.m_assetId]; + } + + // Queue a load on the changed asset + if (modifiedPresetAsset != nullptr) + { + modifiedPresetAsset->QueueLoad(); + } + }; + AZ::Data::AssetCatalogRequestBus::Broadcast(AZStd::move(ReloadLightingAndModelPresets)); + } + + void MaterialViewportComponent::OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) + { + OnCatalogAssetChanged(assetId); + } + + void MaterialViewportComponent::OnCatalogAssetRemoved(const AZ::Data::AssetId& assetId, const AZ::Data::AssetInfo& assetInfo) + { + if (AZ::StringFunc::EndsWith(assetInfo.m_relativePath.c_str(), ".lightingpreset.azasset")) + { + AZ::Data::AssetBus::MultiHandler::BusDisconnect(assetInfo.m_assetId); + m_lightingPresetAssets.erase(assetId); + } + if (AZ::StringFunc::EndsWith(assetInfo.m_relativePath.c_str(), ".modelpreset.azasset")) + { + AZ::Data::AssetBus::MultiHandler::BusDisconnect(assetInfo.m_assetId); + m_modelPresetAssets.erase(assetId); + } + } } diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.h index 07385d842d..68668bd804 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.h @@ -95,6 +95,9 @@ namespace MaterialEditor //////////////////////////////////////////////////////////////////////// // AzFramework::AssetCatalogEventBus::Handler overrides ... void OnCatalogLoaded(const char* catalogFile) override; + void OnCatalogAssetChanged(const AZ::Data::AssetId& assetId) override; + void OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) override; + void OnCatalogAssetRemoved(const AZ::Data::AssetId& assetId, const AZ::Data::AssetInfo& assetInfo) override; //////////////////////////////////////////////////////////////////////// AZStd::unordered_map> m_lightingPresetAssets; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/EditorCommonFeaturesSystemComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/EditorCommonFeaturesSystemComponent.cpp index 2bf428bd2d..0250640d65 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/EditorCommonFeaturesSystemComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/EditorCommonFeaturesSystemComponent.cpp @@ -6,6 +6,7 @@ * */ +#include #include #include #include @@ -88,14 +89,22 @@ namespace AZ AzToolsFramework::EditorLevelNotificationBus::Handler::BusConnect(); AzToolsFramework::AssetBrowser::PreviewerRequestBus::Handler::BusConnect(); - AzFramework::AssetCatalogEventBus::Handler::BusConnect(); + if (auto settingsRegistry{ AZ::SettingsRegistry::Get() }; settingsRegistry != nullptr) + { + auto LifecycleCallback = [this](AZStd::string_view, AZ::SettingsRegistryInterface::Type) + { + SetupThumbnails(); + }; + AZ::ComponentApplicationLifecycle::RegisterHandler(*settingsRegistry, m_criticalAssetsHandler, + AZStd::move(LifecycleCallback), "CriticalAssetsCompiled"); + } AzFramework::ApplicationLifecycleEvents::Bus::Handler::BusConnect(); } void EditorCommonFeaturesSystemComponent::Deactivate() { AzFramework::ApplicationLifecycleEvents::Bus::Handler::BusDisconnect(); - AzFramework::AssetCatalogEventBus::Handler::BusDisconnect(); + m_criticalAssetsHandler = {}; AzToolsFramework::EditorLevelNotificationBus::Handler::BusDisconnect(); AzToolsFramework::AssetBrowser::PreviewerRequestBus::Handler::BusDisconnect(); @@ -192,13 +201,6 @@ namespace AZ } } - void EditorCommonFeaturesSystemComponent::OnCatalogLoaded([[maybe_unused]] const char* catalogFile) - { - AZ::TickBus::QueueFunction([this](){ - SetupThumbnails(); - }); - } - const AzToolsFramework::AssetBrowser::PreviewerFactory* EditorCommonFeaturesSystemComponent::GetPreviewerFactory( const AzToolsFramework::AssetBrowser::AssetBrowserEntry* entry) const { diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/EditorCommonFeaturesSystemComponent.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/EditorCommonFeaturesSystemComponent.h index 82bb93a808..dff9e68814 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/EditorCommonFeaturesSystemComponent.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/EditorCommonFeaturesSystemComponent.h @@ -28,7 +28,6 @@ namespace AZ , public AzToolsFramework::EditorLevelNotificationBus::Handler , public AzToolsFramework::SliceEditorEntityOwnershipServiceNotificationBus::Handler , public AzToolsFramework::AssetBrowser::PreviewerRequestBus::Handler - , public AzFramework::AssetCatalogEventBus::Handler , public AzFramework::ApplicationLifecycleEvents::Bus::Handler { public: @@ -58,9 +57,6 @@ namespace AZ const AZ::Data::AssetId&, AZ::SliceComponent::SliceInstanceAddress&, const AzFramework::SliceInstantiationTicket&) override; void OnSliceInstantiationFailed(const AZ::Data::AssetId&, const AzFramework::SliceInstantiationTicket&) override; - // AzFramework::AssetCatalogEventBus::Handler overrides ... - void OnCatalogLoaded(const char* catalogFile) override; - // AzToolsFramework::AssetBrowser::PreviewerRequestBus::Handler overrides... const AzToolsFramework::AssetBrowser::PreviewerFactory* GetPreviewerFactory( const AzToolsFramework::AssetBrowser::AssetBrowserEntry* entry) const override; @@ -80,6 +76,7 @@ namespace AZ AZStd::unique_ptr m_thumbnailRenderer; AZStd::unique_ptr m_previewerFactory; + AZ::SettingsRegistryInterface::NotifyEventHandler m_criticalAssetsHandler; }; } // namespace Render } // namespace AZ diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp index f112098eae..c8c1ed15bd 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp @@ -58,7 +58,7 @@ namespace Multiplayer { ActivateDedicatedEditorServer(); }, - "LegacySystemInterfaceCreated"); + "CriticalAssetsCompiled"); } } } diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp index ba8836b6e6..f60778dbb4 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -17,12 +18,20 @@ namespace Multiplayer NetworkSpawnableLibrary::NetworkSpawnableLibrary() { AZ::Interface::Register(this); - AzFramework::AssetCatalogEventBus::Handler::BusConnect(); + if (auto settingsRegistry{ AZ::SettingsRegistry::Get() }; settingsRegistry != nullptr) + { + auto LifecycleCallback = [this](AZStd::string_view, AZ::SettingsRegistryInterface::Type) + { + BuildSpawnablesList(); + }; + AZ::ComponentApplicationLifecycle::RegisterHandler(*settingsRegistry, m_criticalAssetsHandler, + AZStd::move(LifecycleCallback), "CriticalAssetsCompiled"); + } } NetworkSpawnableLibrary::~NetworkSpawnableLibrary() { - AzFramework::AssetCatalogEventBus::Handler::BusDisconnect(); + m_criticalAssetsHandler = {}; AZ::Interface::Unregister(this); } @@ -50,11 +59,6 @@ namespace Multiplayer m_spawnablesReverseLookup[id] = name; } - void NetworkSpawnableLibrary::OnCatalogLoaded([[maybe_unused]] const char* catalogFile) - { - BuildSpawnablesList(); - } - AZ::Name NetworkSpawnableLibrary::GetSpawnableNameFromAssetId(AZ::Data::AssetId assetId) { if (assetId.IsValid()) diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h index 1cec63f81d..0fc3ae07cc 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h @@ -9,14 +9,13 @@ #pragma once #include -#include +#include namespace Multiplayer { /// Implementation of the network prefab library interface. class NetworkSpawnableLibrary final : public INetworkSpawnableLibrary - , private AzFramework::AssetCatalogEventBus::Handler { public: AZ_RTTI(NetworkSpawnableLibrary, "{65E15F33-E893-49C2-A8E2-B6A8A6EF31E0}", INetworkSpawnableLibrary); @@ -30,11 +29,10 @@ namespace Multiplayer AZ::Name GetSpawnableNameFromAssetId(AZ::Data::AssetId assetId) override; AZ::Data::AssetId GetAssetIdByName(AZ::Name name) override; - /// AssetCatalogEventBus overrides. - void OnCatalogLoaded(const char* catalogFile) override; private: AZStd::unordered_map m_spawnables; AZStd::unordered_map m_spawnablesReverseLookup; + AZ::SettingsRegistryInterface::NotifyEventHandler m_criticalAssetsHandler; }; } diff --git a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp index 168adc8910..39c0dfc686 100644 --- a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp +++ b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp @@ -103,15 +103,13 @@ namespace PhysX if (auto* settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr) { - // Automatically register the event if it's not registered, because - // this system is initialized before the settings registry has loaded the event list. AZ::ComponentApplicationLifecycle::RegisterHandler( *settingsRegistry, m_componentApplicationLifecycleHandler, [this]([[maybe_unused]] AZStd::string_view path, [[maybe_unused]] AZ::SettingsRegistryInterface::Type type) { InitializeMaterialLibrary(); }, - "LegacySystemInterfaceCreated"); // LegacySystemInterfaceCreated is signaled after critical assets have been processed + "CriticalAssetsCompiled"); } m_state = State::Initialized; diff --git a/Registry/application_lifecycle_events.setreg b/Registry/application_lifecycle_events.setreg index 0d9cd0f170..c52c93c0c0 100644 --- a/Registry/application_lifecycle_events.setreg +++ b/Registry/application_lifecycle_events.setreg @@ -23,7 +23,8 @@ "GemsUnloaded": {}, "FileIOAvailable": {}, "FileIOUnavailable": {}, - "LegacySystemInterfaceCreated": {} + "LegacySystemInterfaceCreated": {}, + "CriticalAssetsCompiled": {} } } } From bcc83aaaf2473ff1ee8fd9f9629e830df48ae222 Mon Sep 17 00:00:00 2001 From: evanchia Date: Mon, 10 Jan 2022 16:04:21 -0800 Subject: [PATCH 338/399] Found actual issue where the logs were being routed to the artifact folder Signed-off-by: evanchia --- .../LyTestTools/ly_test_tools/o3de/editor_test.py | 13 +++++++++++-- .../ly_test_tools/o3de/editor_test_utils.py | 14 ++++---------- .../tests/unit/test_editor_test_utils.py | 7 +++++-- .../tests/unit/test_o3de_editor_test.py | 13 +++++++++++++ 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py b/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py index fd2157d1cc..c97298573e 100644 --- a/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py @@ -771,7 +771,8 @@ class EditorTestSuite(): output = editor.get_output() return_code = editor.get_returncode() editor_log_content = editor_utils.retrieve_editor_log_content(run_id, log_name, workspace) - + # Save the editor log + workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(), log_name)) if return_code == 0: test_result = Result.Pass.create(test_spec, output, editor_log_content) else: @@ -779,6 +780,9 @@ class EditorTestSuite(): if has_crashed: test_result = Result.Crash.create(test_spec, output, return_code, editor_utils.retrieve_crash_output (run_id, workspace, self._TIMEOUT_CRASH_LOG), None) + # Save the crash log + crash_file_name = os.path.basename(workspace.paths.crash_log()) + workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(), crash_file_name)) editor_utils.cycle_crash_report(run_id, workspace) else: test_result = Result.Fail.create(test_spec, output, editor_log_content) @@ -842,7 +846,8 @@ class EditorTestSuite(): output = editor.get_output() return_code = editor.get_returncode() editor_log_content = editor_utils.retrieve_editor_log_content(run_id, log_name, workspace) - + # Save the editor log + workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(), log_name)) if return_code == 0: # No need to scrap the output, as all the tests have passed for test_spec in test_spec_list: @@ -863,6 +868,10 @@ class EditorTestSuite(): # The first test with "Unknown" result (no data in output) is likely the one that crashed crash_error = editor_utils.retrieve_crash_output(run_id, workspace, self._TIMEOUT_CRASH_LOG) + # Save the crash log + crash_file_name = os.path.basename(workspace.paths.crash_log()) + workspace.artifact_manager.save_artifact( + os.path.join(editor_utils.retrieve_log_path(), crash_file_name)) editor_utils.cycle_crash_report(run_id, workspace) results[test_spec_name] = Result.Crash.create(result.test_spec, output, return_code, crash_error, result.editor_log) diff --git a/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py b/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py index 69c6eda2ee..246fba16aa 100644 --- a/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py @@ -71,15 +71,9 @@ def retrieve_crash_output(run_id: int, workspace: AbstractWorkspaceManager, time :return str: The contents of the editor crash file (error.log) """ crash_info = "-- No crash log available --" - error_log_regex = "" - log_path = retrieve_log_path(run_id, workspace) - # Gather all of the files in the log directory - dir_files = [f for f in os.listdir(log_path) if os.path.isfile(os.path.join(log_path, f))] - for file_name in dir_files: - # Search for all .log files with either "crash" or "error" because they could be renamed - if ("error" in file_name.lower() or "crash" in file_name.lower()) and (file_name.endswith(".log")): - crash_log = os.path.join(log_path, file_name) - break + # Grab the file name of the crash log which can be different depending on platform + crash_file_name = os.path.basename(workspace.paths.crash_log()) + crash_log = os.path.join(retrieve_log_path(run_id, workspace), crash_file_name) try: waiter.wait_for(lambda: os.path.exists(crash_log), timeout=timeout) except AssertionError: @@ -100,7 +94,7 @@ def cycle_crash_report(run_id: int, workspace: AbstractWorkspaceManager) -> None :param workspace: Workspace fixture """ log_path = retrieve_log_path(run_id, workspace) - files_to_cycle = ['error.log', 'error.dmp'] + files_to_cycle = ['crash.log', 'error.log', 'error.dmp'] for filename in files_to_cycle: filepath = os.path.join(log_path, filename) name, ext = os.path.splitext(filename) diff --git a/Tools/LyTestTools/tests/unit/test_editor_test_utils.py b/Tools/LyTestTools/tests/unit/test_editor_test_utils.py index f7678c44c0..6e2ec59721 100644 --- a/Tools/LyTestTools/tests/unit/test_editor_test_utils.py +++ b/Tools/LyTestTools/tests/unit/test_editor_test_utils.py @@ -61,6 +61,8 @@ class TestEditorTestUtils(unittest.TestCase): @mock.patch('os.listdir') @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') + @mock.patch('os.path.join', mock.MagicMock()) + @mock.patch('os.path.basename', mock.MagicMock()) @mock.patch('os.path.isfile', mock.MagicMock()) @mock.patch('ly_test_tools.environment.waiter.wait_for', mock.MagicMock()) def test_RetrieveCrashOutput_CrashLogExists_ReturnsLogInfo(self, mock_retrieve_log_path, mock_listdir): @@ -79,6 +81,7 @@ class TestEditorTestUtils(unittest.TestCase): def test_RetrieveCrashOutput_CrashLogNotExists_ReturnsError(self, mock_retrieve_log_path, mock_listdir): mock_retrieve_log_path.return_value = 'mock_log_path' mock_workspace = mock.MagicMock() + mock_workspace.paths.crash_log.return_value = 'mock_file.log' error_message = "No crash log available" mock_listdir.return_value = ['mock_file.log'] @@ -91,7 +94,7 @@ class TestEditorTestUtils(unittest.TestCase): @mock.patch('os.path.exists') def test_CycleCrashReport_DmpExists_NamedCorrectly(self, mock_exists, mock_retrieve_log_path, mock_strftime, mock_rename): - mock_exists.side_effect = [False, True] + mock_exists.side_effect = [False, False, True] mock_retrieve_log_path.return_value = 'mock_log_path' mock_workspace = mock.MagicMock() mock_strftime.return_value = 'mock_strftime' @@ -107,7 +110,7 @@ class TestEditorTestUtils(unittest.TestCase): @mock.patch('os.path.exists') def test_CycleCrashReport_LogExists_NamedCorrectly(self, mock_exists, mock_retrieve_log_path, mock_strftime, mock_rename): - mock_exists.side_effect = [True, False] + mock_exists.side_effect = [False, True, False] mock_retrieve_log_path.return_value = 'mock_log_path' mock_workspace = mock.MagicMock() mock_strftime.return_value = 'mock_strftime' diff --git a/Tools/LyTestTools/tests/unit/test_o3de_editor_test.py b/Tools/LyTestTools/tests/unit/test_o3de_editor_test.py index 2b6ae5b471..054159cd16 100644 --- a/Tools/LyTestTools/tests/unit/test_o3de_editor_test.py +++ b/Tools/LyTestTools/tests/unit/test_o3de_editor_test.py @@ -589,6 +589,7 @@ class TestRunningTests(unittest.TestCase): @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') @mock.patch('ly_test_tools.o3de.editor_test_utils.get_testcase_module_filepath') @mock.patch('ly_test_tools.o3de.editor_test_utils.cycle_crash_report') + @mock.patch('os.path.join', mock.MagicMock()) def test_ExecEditorTest_TestSucceeds_ReturnsPass(self, mock_cycle_crash, mock_get_testcase_filepath, mock_retrieve_log, mock_retrieve_editor_log, mock_get_output_results, mock_create): @@ -616,6 +617,7 @@ class TestRunningTests(unittest.TestCase): @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') @mock.patch('ly_test_tools.o3de.editor_test_utils.get_testcase_module_filepath') @mock.patch('ly_test_tools.o3de.editor_test_utils.cycle_crash_report') + @mock.patch('os.path.join', mock.MagicMock()) def test_ExecEditorTest_TestFails_ReturnsFail(self, mock_cycle_crash, mock_get_testcase_filepath, mock_retrieve_log, mock_retrieve_editor_log, mock_get_output_results, mock_create): @@ -644,6 +646,8 @@ class TestRunningTests(unittest.TestCase): @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') @mock.patch('ly_test_tools.o3de.editor_test_utils.get_testcase_module_filepath') @mock.patch('ly_test_tools.o3de.editor_test_utils.cycle_crash_report') + @mock.patch('os.path.join', mock.MagicMock()) + @mock.patch('os.path.basename', mock.MagicMock()) def test_ExecEditorTest_TestCrashes_ReturnsCrash(self, mock_cycle_crash, mock_get_testcase_filepath, mock_retrieve_log, mock_retrieve_editor_log, mock_get_output_results, mock_retrieve_crash, mock_create): @@ -699,10 +703,14 @@ class TestRunningTests(unittest.TestCase): @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') @mock.patch('ly_test_tools.o3de.editor_test_utils.get_testcase_module_filepath') @mock.patch('ly_test_tools.o3de.editor_test_utils.cycle_crash_report') + @mock.patch('os.path.join', mock.MagicMock()) def test_ExecEditorMultitest_AllTestsPass_ReturnsPasses(self, mock_cycle_crash, mock_get_testcase_filepath, mock_retrieve_log, mock_retrieve_editor_log, mock_create): mock_test_suite = ly_test_tools.o3de.editor_test.EditorTestSuite() mock_workspace = mock.MagicMock() + mock_artifact_manager = mock.MagicMock() + mock_artifact_manager.save_artifact.return_value = mock.MagicMock() + mock_workspace.artifact_manager = mock_artifact_manager mock_workspace.paths.engine_root.return_value = "" mock_editor = mock.MagicMock() mock_editor.get_returncode.return_value = 0 @@ -727,6 +735,7 @@ class TestRunningTests(unittest.TestCase): @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') @mock.patch('ly_test_tools.o3de.editor_test_utils.get_testcase_module_filepath') @mock.patch('ly_test_tools.o3de.editor_test_utils.cycle_crash_report') + @mock.patch('os.path.join', mock.MagicMock()) def test_ExecEditorMultitest_OneFailure_CallsCorrectFunc(self, mock_cycle_crash, mock_get_testcase_filepath, mock_retrieve_log, mock_retrieve_editor_log, mock_get_results): mock_test_suite = ly_test_tools.o3de.editor_test.EditorTestSuite() @@ -752,6 +761,8 @@ class TestRunningTests(unittest.TestCase): @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') @mock.patch('ly_test_tools.o3de.editor_test_utils.get_testcase_module_filepath') @mock.patch('ly_test_tools.o3de.editor_test_utils.cycle_crash_report') + @mock.patch('os.path.join', mock.MagicMock()) + @mock.patch('os.path.basename', mock.MagicMock()) def test_ExecEditorMultitest_OneCrash_ReportsOnUnknownResult(self, mock_cycle_crash, mock_get_testcase_filepath, mock_retrieve_log, mock_retrieve_editor_log, mock_get_results, mock_retrieve_crash, mock_create): @@ -787,6 +798,8 @@ class TestRunningTests(unittest.TestCase): @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') @mock.patch('ly_test_tools.o3de.editor_test_utils.get_testcase_module_filepath') @mock.patch('ly_test_tools.o3de.editor_test_utils.cycle_crash_report') + @mock.patch('os.path.join', mock.MagicMock()) + @mock.patch('os.path.basename', mock.MagicMock()) def test_ExecEditorMultitest_ManyUnknown_ReportsUnknownResults(self, mock_cycle_crash, mock_get_testcase_filepath, mock_retrieve_log, mock_retrieve_editor_log, mock_get_results, mock_retrieve_crash, mock_create): From ba9731bec60e084ec5675073ee6dfc3e5daac396 Mon Sep 17 00:00:00 2001 From: evanchia Date: Mon, 10 Jan 2022 16:13:14 -0800 Subject: [PATCH 339/399] added missing params Signed-off-by: evanchia --- Tools/LyTestTools/ly_test_tools/o3de/editor_test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py b/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py index c97298573e..eaa285a81e 100644 --- a/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py @@ -772,7 +772,7 @@ class EditorTestSuite(): return_code = editor.get_returncode() editor_log_content = editor_utils.retrieve_editor_log_content(run_id, log_name, workspace) # Save the editor log - workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(), log_name)) + workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(run_id, workspace), log_name)) if return_code == 0: test_result = Result.Pass.create(test_spec, output, editor_log_content) else: @@ -782,7 +782,7 @@ class EditorTestSuite(): (run_id, workspace, self._TIMEOUT_CRASH_LOG), None) # Save the crash log crash_file_name = os.path.basename(workspace.paths.crash_log()) - workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(), crash_file_name)) + workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(run_id, workspace), crash_file_name)) editor_utils.cycle_crash_report(run_id, workspace) else: test_result = Result.Fail.create(test_spec, output, editor_log_content) @@ -847,7 +847,7 @@ class EditorTestSuite(): return_code = editor.get_returncode() editor_log_content = editor_utils.retrieve_editor_log_content(run_id, log_name, workspace) # Save the editor log - workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(), log_name)) + workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(run_id, workspace), log_name)) if return_code == 0: # No need to scrap the output, as all the tests have passed for test_spec in test_spec_list: @@ -871,7 +871,7 @@ class EditorTestSuite(): # Save the crash log crash_file_name = os.path.basename(workspace.paths.crash_log()) workspace.artifact_manager.save_artifact( - os.path.join(editor_utils.retrieve_log_path(), crash_file_name)) + os.path.join(editor_utils.retrieve_log_path(run_id, workspace), crash_file_name)) editor_utils.cycle_crash_report(run_id, workspace) results[test_spec_name] = Result.Crash.create(result.test_spec, output, return_code, crash_error, result.editor_log) From 8fd6d534b3a7fc486315f7ab7c22578ae38f31d4 Mon Sep 17 00:00:00 2001 From: evanchia Date: Mon, 10 Jan 2022 16:27:07 -0800 Subject: [PATCH 340/399] forgot to change editor command line string Signed-off-by: evanchia --- Tools/LyTestTools/ly_test_tools/o3de/editor_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py b/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py index eaa285a81e..8bd4fbe29a 100644 --- a/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py @@ -762,7 +762,7 @@ class EditorTestSuite(): cmdline = [ "--runpythontest", test_filename, "-logfile", f"@log@/{log_name}", - "-project-log-path", ly_test_tools._internal.pytest_plugin.output_path] + test_cmdline_args + "-project-log-path", editor_utils.retrieve_log_path(run_id, workspace)] + test_cmdline_args editor.args.extend(cmdline) editor.start(backupFiles = False, launch_ap = False, configure_settings=False) @@ -834,7 +834,7 @@ class EditorTestSuite(): cmdline = [ "--runpythontest", test_filenames_str, "-logfile", f"@log@/{log_name}", - "-project-log-path", ly_test_tools._internal.pytest_plugin.output_path] + test_cmdline_args + "-project-log-path", editor_utils.retrieve_log_path(run_id, workspace)] + test_cmdline_args editor.args.extend(cmdline) editor.start(backupFiles = False, launch_ap = False, configure_settings=False) From d3a99235aaa997688baebf3a1432090714f16765 Mon Sep 17 00:00:00 2001 From: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> Date: Mon, 10 Jan 2022 17:01:50 -0800 Subject: [PATCH 341/399] Fix undo for create editor entity (#6785) * Avoid undoing twice when undo is hit for CreateNewEditorEntity Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> * Moved an assert immediately after entity creation Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> --- .../Entity/EditorEntityContextComponent.cpp | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.cpp index 90657132ca..470ca8b9ea 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.cpp @@ -226,7 +226,15 @@ namespace AzToolsFramework AZ::EntityId EditorEntityContextComponent::CreateNewEditorEntity(const char* name) { AZ::Entity* entity = CreateEntity(name); - FinalizeEditorEntity(entity); + AZ_Assert(entity != nullptr, "Entity with name %s couldn't be created.", name); + if (m_isLegacySliceService) + { + FinalizeEditorEntity(entity); + } + else + { + EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::OnEditorEntityCreated, entity->GetId()); + } return entity->GetId(); } @@ -253,8 +261,16 @@ namespace AzToolsFramework return AZ::EntityId(); } entity = aznew AZ::Entity(entityId, name); + AZ_Assert(entity != nullptr, "Entity with name %s couldn't be created.", name); AddEntity(entity); - FinalizeEditorEntity(entity); + if (m_isLegacySliceService) + { + FinalizeEditorEntity(entity); + } + else + { + EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::OnEditorEntityCreated, entity->GetId()); + } return entity->GetId(); } From f09055af42af18dc75f709753da33940ae9c21f5 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Mon, 10 Jan 2022 19:11:00 -0600 Subject: [PATCH 342/399] Fixed CMake use with Android NDK 23 (#6460) * Fixed CMake use with Android NDK 23 This was done by only setting the `ANDROID_ARM_MODE` if the ANDROID_ABI starts with `armeabi`. The Android arm mode setting can't be used using non-`armeabi` ABIs. In O3DE we default to `arm64-v8a` `ANDROID_ABI` So `ANDROID_ARM_MODE` must not be set. The CMake [Android-Determine.cmake](https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/Platform/Android-Determine.cmake#L573-585) which is used to detect platform-wide information when the CMAKE_SYSTEM_NAME is set to android, enforces that if the `CMAKE_ANDROID_ARCH_ABI` doesn't start with `armeabi`, then it will fatal error if the CMAKE_ANDROID_ARM_MODE option is set. In Android NDK 21 the `ANDROID_ARM_MODE` variable is used to set the CMAKE_ANDROID_ARM_MODE variable if the [ANDROID_ABI](https://android.googlesource.com/platform/ndk/+/refs/tags/ndk-r21e/build/cmake/android.toolchain.cmake#700) starts with `armeabi`. This meant when using Android NDK 21, the CMake Android-Determine.cmake module would succeed, due to the CMAKE_ANDROID_ARM_MODE not being set. In Android NDK 23 the `ANDROID_ARM_MODE` now will set the `CMAKE_ANDROID_ARM_MODE` variable to `TRUE` if it isn't defined. Added an `--extra-cmake-configure-args` option to the `generate_android_project.py` script which can be used to append user specified CMake arguments to the cmake configure step (`cmake -B -S -DCMAKE_TOOLCHAIN_FILE= `) Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the O3DE Android toolchain wrapper to fatal error if the 64-bit arm ABI isn't used. Also removed the unneccessary setting of the ANDROID_ARM_MODE and ANDROID_ARM_NEON option option now that the armeabi cannot be specified as an ABI. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- cmake/Platform/Android/Toolchain_android.cmake | 9 ++++----- cmake/Tools/Platform/Android/android_support.py | 9 ++++++++- .../Tools/Platform/Android/generate_android_project.py | 6 +++++- scripts/build/Platform/Android/build_config.json | 10 +++++----- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/cmake/Platform/Android/Toolchain_android.cmake b/cmake/Platform/Android/Toolchain_android.cmake index b5c4a56fd6..75ff4554fd 100644 --- a/cmake/Platform/Android/Toolchain_android.cmake +++ b/cmake/Platform/Android/Toolchain_android.cmake @@ -31,11 +31,10 @@ endif() if(NOT ANDROID_ABI) set(ANDROID_ABI arm64-v8a) endif() -if(NOT ANDROID_ARM_MODE) - set(ANDROID_ARM_MODE arm) -endif() -if(NOT ANDROID_ARM_NEON) - set(ANDROID_ARM_NEON FALSE) + +# Only the 64-bit ANDROID ABIs arm supported +if(NOT ANDROID_ABI MATCHES "^arm64-") + message(FATAL_ERROR "Only the 64-bit ANDROID_ABI's are supported. arm64-v8a can be used if not set") endif() if(NOT ANDROID_NATIVE_API_LEVEL) set(ANDROID_NATIVE_API_LEVEL 21) diff --git a/cmake/Tools/Platform/Android/android_support.py b/cmake/Tools/Platform/Android/android_support.py index f52cc2736c..657ef3b3e4 100755 --- a/cmake/Tools/Platform/Android/android_support.py +++ b/cmake/Tools/Platform/Android/android_support.py @@ -471,7 +471,8 @@ class AndroidProjectGenerator(object): def __init__(self, engine_root, build_dir, android_sdk_path, build_tool, android_sdk_platform, android_native_api_level, android_ndk, project_path, third_party_path, cmake_version, override_cmake_path, override_gradle_path, gradle_version, gradle_plugin_version, - override_ninja_path, include_assets_in_apk, asset_mode, asset_type, signing_config, native_build_path, vulkan_validation_path, is_test_project=False, + override_ninja_path, include_assets_in_apk, asset_mode, asset_type, signing_config, native_build_path, vulkan_validation_path, + extra_cmake_configure_args, is_test_project=False, overwrite_existing=True, unity_build_enabled=False): """ Initialize the object with all the required parameters needed to create an Android Project. The parameters should be verified before initializing this object @@ -497,6 +498,7 @@ class AndroidProjectGenerator(object): :param signing_config: Optional signing configuration arguments :param native_build_path: Override the native build staging path in gradle :param vulkan_validation_path: Override the path to where the Vulkan Validation Layers libraries are (required when using NDK r23+) + :param extra_cmake_configure_args Additional arguments to supply cmake when configuring a project :param is_test_project: Flag to indicate if this is a unit test runner project. (If true, project_path, asset_mode, asset_type, and include_assets_in_apk are ignored) :param overwrite_existing: Flag to overwrite existing project files when being generated, or skip if they already exist. """ @@ -539,6 +541,8 @@ class AndroidProjectGenerator(object): self.vulkan_validation_path = vulkan_validation_path + self.extra_cmake_configure_args = extra_cmake_configure_args + self.asset_mode = asset_mode self.asset_type = asset_type @@ -844,6 +848,9 @@ class AndroidProjectGenerator(object): if self.override_ninja_path: cmake_argument_list.append(f'"-DCMAKE_MAKE_PROGRAM={common.normalize_path_for_settings(self.override_ninja_path)}"') + if self.extra_cmake_configure_args: + cmake_argument_list.extend(map(json.dumps, self.extra_cmake_configure_args)) + # Query the project_path from the project.json file project_name = common.read_project_name_from_project_json(self.project_path) # Prepare the config-specific section to place the cmake argument list in the build.gradle for the app diff --git a/cmake/Tools/Platform/Android/generate_android_project.py b/cmake/Tools/Platform/Android/generate_android_project.py index fe0d787d38..5e414e7738 100755 --- a/cmake/Tools/Platform/Android/generate_android_project.py +++ b/cmake/Tools/Platform/Android/generate_android_project.py @@ -227,6 +227,9 @@ def main(args): help='Override path to where the Vulkan Validation Layers libraries are. Required for use with NDK r23+', default=None, required=False) + parser.add_argument('--extra-cmake-configure-args', + help='Extra arguments to supply to the cmake configure step', + nargs='*') # Asset Options parser.add_argument(INCLUDE_APK_ASSETS_ARGUMENT_NAME, @@ -415,7 +418,8 @@ def main(args): overwrite_existing=parsed_args.overwrite_existing, unity_build_enabled=parsed_args.enable_unity_build, native_build_path=parsed_args.native_build_path, - vulkan_validation_path=parsed_args.vulkan_validation_path) + vulkan_validation_path=parsed_args.vulkan_validation_path, + extra_cmake_configure_args=parsed_args.extra_cmake_configure_args) generator.execute() diff --git a/scripts/build/Platform/Android/build_config.json b/scripts/build/Platform/Android/build_config.json index 7a7e90c0b0..c505d8e940 100644 --- a/scripts/build/Platform/Android/build_config.json +++ b/scripts/build/Platform/Android/build_config.json @@ -35,7 +35,7 @@ "PARAMETERS": { "CONFIGURATION":"debug", "OUTPUT_DIRECTORY":"build\\android", - "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_ABI=arm64-v8a -DANDROID_ARM_MODE=arm -DANDROID_ARM_NEON=FALSE -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", + "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" @@ -50,7 +50,7 @@ "PARAMETERS": { "CONFIGURATION":"profile", "OUTPUT_DIRECTORY":"build\\android", - "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_ABI=arm64-v8a -DANDROID_ARM_MODE=arm -DANDROID_ARM_NEON=FALSE -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", + "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" @@ -66,7 +66,7 @@ "PARAMETERS": { "CONFIGURATION":"profile", "OUTPUT_DIRECTORY":"build\\android", - "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_ABI=arm64-v8a -DANDROID_ARM_MODE=arm -DANDROID_ARM_NEON=FALSE -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\" -DLY_UNITY_BUILD=FALSE", + "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\" -DLY_UNITY_BUILD=FALSE", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" @@ -102,7 +102,7 @@ "PARAMETERS": { "CONFIGURATION":"release", "OUTPUT_DIRECTORY":"build\\android", - "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_ABI=arm64-v8a -DANDROID_ARM_MODE=arm -DANDROID_ARM_NEON=FALSE -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", + "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" @@ -118,7 +118,7 @@ "PARAMETERS": { "CONFIGURATION":"release", "OUTPUT_DIRECTORY":"build\\mono_android", - "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_ABI=arm64-v8a -DANDROID_ARM_MODE=arm -DANDROID_ARM_NEON=FALSE -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\" -DLY_MONOLITHIC_GAME=TRUE", + "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\" -DLY_MONOLITHIC_GAME=TRUE", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" From 0e0ca7585ce348d5079f34eae371d97295cf6d61 Mon Sep 17 00:00:00 2001 From: sphrose <82213493+sphrose@users.noreply.github.com> Date: Tue, 11 Jan 2022 11:32:17 +0000 Subject: [PATCH 343/399] change default input color space to SRGB Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com> --- .../Source/Utils/EditorLightingPreset.cpp | 2 +- .../Include/Atom/RPI.Edit/Common/ColorUtils.h | 2 ++ .../Source/RPI.Edit/Common/ColorUtils.cpp | 21 +++++++++++++------ .../DynamicProperty/DynamicProperty.cpp | 2 +- .../CoreLights/EditorAreaLightComponent.cpp | 2 +- .../EditorDirectionalLightComponent.cpp | 2 +- 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/Utils/EditorLightingPreset.cpp b/Gems/Atom/Feature/Common/Code/Source/Utils/EditorLightingPreset.cpp index e2a99668eb..120eaa84dc 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Utils/EditorLightingPreset.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Utils/EditorLightingPreset.cpp @@ -72,7 +72,7 @@ namespace AZ ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ->DataElement(AZ::Edit::UIHandlers::Default, &LightConfig::m_direction, "Direction", "") ->DataElement(Edit::UIHandlers::Color, &LightConfig::m_color, "Color", "Color of the light") - ->Attribute("ColorEditorConfiguration", AZ::RPI::ColorUtils::GetLinearRgbEditorConfig()) + ->Attribute("ColorEditorConfiguration", AZ::RPI::ColorUtils::GetRgbEditorConfig()) ->DataElement(Edit::UIHandlers::Default, &LightConfig::m_intensity, "Intensity", "Intensity of the light in the set photometric unit.") ->ClassElement(AZ::Edit::ClassElements::Group, "Shadow") diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/ColorUtils.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/ColorUtils.h index 393cae6ca2..38b6a0bb80 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/ColorUtils.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/ColorUtils.h @@ -19,6 +19,8 @@ namespace AZ //[GFX TODO][ATOM-4462] Replace this to use data driven color management system //! Return a ColorEditorConfiguration for editing a Linear sRGB color in sRGB space. AzToolsFramework::ColorEditorConfiguration GetLinearRgbEditorConfig(); + //! Return a ColorEditorConfiguration for editing a sRGB color in sRGB space. + AzToolsFramework::ColorEditorConfiguration GetRgbEditorConfig(); } // namespace PropertyColorConfigs } // namespace RPI diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Common/ColorUtils.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Common/ColorUtils.cpp index a6baa38a72..df88a530b9 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Common/ColorUtils.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Common/ColorUtils.cpp @@ -14,14 +14,14 @@ namespace AZ { namespace ColorUtils { + enum ColorSpace : uint32_t + { + LinearSRGB, + SRGB + }; + AzToolsFramework::ColorEditorConfiguration GetLinearRgbEditorConfig() { - enum ColorSpace : uint32_t - { - LinearSRGB, - SRGB - }; - AzToolsFramework::ColorEditorConfiguration configuration; configuration.m_colorPickerDialogConfiguration = AzQtComponents::ColorPicker::Configuration::RGB; @@ -59,6 +59,15 @@ namespace AZ return configuration; } + AzToolsFramework::ColorEditorConfiguration GetRgbEditorConfig() + { + AzToolsFramework::ColorEditorConfiguration configuration = GetLinearRgbEditorConfig(); + + configuration.m_propertyColorSpaceId = ColorSpace::SRGB; + + return configuration; + } + } // namespace ColorPropertyEditorConfigurations } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/DynamicProperty/DynamicProperty.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/DynamicProperty/DynamicProperty.cpp index 2054858726..d4599b68b7 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/DynamicProperty/DynamicProperty.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/DynamicProperty/DynamicProperty.cpp @@ -160,7 +160,7 @@ namespace AtomToolsFramework ApplyRangeEditDataAttributes(); break; case DynamicPropertyType::Color: - AddEditDataAttribute(AZ_CRC("ColorEditorConfiguration", 0xc8b9510e), AZ::RPI::ColorUtils::GetLinearRgbEditorConfig()); + AddEditDataAttribute(AZ_CRC("ColorEditorConfiguration", 0xc8b9510e), AZ::RPI::ColorUtils::GetRgbEditorConfig()); break; case DynamicPropertyType::Enum: m_editData.m_elementId = AZ::Edit::UIHandlers::ComboBox; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp index 02c9f77436..d15862451a 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp @@ -75,7 +75,7 @@ namespace AZ ->DataElement(Edit::UIHandlers::Color, &AreaLightComponentConfig::m_color, "Color", "Color of the light") ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::LightTypeIsSelected) - ->Attribute("ColorEditorConfiguration", RPI::ColorUtils::GetLinearRgbEditorConfig()) + ->Attribute("ColorEditorConfiguration", RPI::ColorUtils::GetRgbEditorConfig()) ->DataElement(Edit::UIHandlers::ComboBox, &AreaLightComponentConfig::m_intensityMode, "Intensity mode", "Allows specifying which photometric unit to work in.") ->Attribute(AZ::Edit::Attributes::EnumValues, &AreaLightComponentConfig::GetValidPhotometricUnits) ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::LightTypeIsSelected) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp index 2b1510b861..1759b830d2 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp @@ -59,7 +59,7 @@ namespace AZ ->ClassElement(Edit::ClassElements::EditorData, "") ->DataElement(Edit::UIHandlers::Color, &DirectionalLightComponentConfig::m_color, "Color", "Color of the light") ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->Attribute("ColorEditorConfiguration", AZ::RPI::ColorUtils::GetLinearRgbEditorConfig()) + ->Attribute("ColorEditorConfiguration", AZ::RPI::ColorUtils::GetRgbEditorConfig()) ->DataElement(Edit::UIHandlers::ComboBox, &DirectionalLightComponentConfig::m_intensityMode, "Intensity mode", "Allows specifying light values in lux or Ev100") ->EnumAttribute(PhotometricUnit::Lux, "Lux") ->EnumAttribute(PhotometricUnit::Ev100Illuminance, "Ev100") From 2e577a8b14ddbd4b67ceed5311e8caf509b821df Mon Sep 17 00:00:00 2001 From: Sergey Pereslavtsev Date: Tue, 11 Jan 2022 12:11:51 +0000 Subject: [PATCH 344/399] PR feedback Signed-off-by: Sergey Pereslavtsev --- .../Source/Components/TerrainPhysicsColliderComponent.cpp | 2 +- .../Code/Source/Components/TerrainPhysicsColliderComponent.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp index 916dd800e2..c51728a5c3 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp @@ -53,7 +53,7 @@ namespace Terrain AZ::Data::AssetId TerrainPhysicsSurfaceMaterialMapping::GetMaterialLibraryId() { - if (auto* physicsSystem = AZ::Interface::Get()) + if (const auto* physicsSystem = AZ::Interface::Get()) { if (const auto* physicsConfiguration = physicsSystem->GetConfiguration()) { diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h index 284bc74d88..8a70f282d0 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h @@ -33,10 +33,12 @@ namespace Terrain AZ_CLASS_ALLOCATOR(TerrainPhysicsSurfaceMaterialMapping, AZ::SystemAllocator, 0); AZ_RTTI(TerrainPhysicsSurfaceMaterialMapping, "{A88B5289-DFCD-4564-8395-E2177DFE5B18}"); static void Reflect(AZ::ReflectContext* context); - static AZ::Data::AssetId GetMaterialLibraryId(); SurfaceData::SurfaceTag m_surfaceTag; Physics::MaterialId m_materialId; + + private: + static AZ::Data::AssetId GetMaterialLibraryId(); }; class TerrainPhysicsColliderConfig From 751caf5f7ccdddcf16f3ba63cbf1d21349ce3191 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Tue, 11 Jan 2022 10:01:02 -0600 Subject: [PATCH 345/399] Updated the Windows ScopedAutoTempDirectory creation logic to use a Uuid. (#6789) Previously it was using `GetTickCount()` for the creation of the directory which can collide if0 there are multiple processes creating a temporary directory via teh ScopedAutoTempDirectory constructor. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- .../ScopedAutoTempDirectory_Windows.cpp | 66 +++++++------------ 1 file changed, 25 insertions(+), 41 deletions(-) diff --git a/Code/Framework/AzTest/AzTest/Platform/Windows/ScopedAutoTempDirectory_Windows.cpp b/Code/Framework/AzTest/AzTest/Platform/Windows/ScopedAutoTempDirectory_Windows.cpp index fcda5d351a..b5314eda14 100644 --- a/Code/Framework/AzTest/AzTest/Platform/Windows/ScopedAutoTempDirectory_Windows.cpp +++ b/Code/Framework/AzTest/AzTest/Platform/Windows/ScopedAutoTempDirectory_Windows.cpp @@ -8,57 +8,41 @@ #include +#include #include #include #include -#include +#include -namespace AZ +namespace AZ::Test { - namespace Test + ScopedAutoTempDirectory::ScopedAutoTempDirectory() { - ScopedAutoTempDirectory::ScopedAutoTempDirectory() - { - constexpr const DWORD bufferSize = static_cast(AZ::IO::MaxPathLength); + using UuidString = AZStd::fixed_string; + constexpr DWORD bufferSize = static_cast(AZ::IO::MaxPathLength); - char tempDir[bufferSize] = {0}; - GetTempPathA(bufferSize, tempDir); + wchar_t tempDirW[AZ::IO::MaxPathLength]{}; + GetTempPathW(bufferSize, tempDirW); - char workingTempPathBuffer[bufferSize] = {'\0'}; + AZ::IO::FixedMaxPath tempDirectoryRoot; + AZStd::to_string(tempDirectoryRoot.Native(), tempDirW); - int maxAttempts = 2000; // Prevent an infinite loop by setting an arbitrary maximum attempts at finding an available temp folder name - while (maxAttempts > 0) + constexpr int MaxAttempts = 255; + for (int i = 0; i < MaxAttempts; ++i) + { + AZ::IO::FixedMaxPath testPath = tempDirectoryRoot / + AZ::IO::FixedMaxPathString::format("UnitTest-%s", + AZ::Uuid::CreateRandom().ToString().c_str()); + // Try to create the temp directory if it doesn't exist + if (!AZ::IO::SystemFile::Exists(testPath.c_str()) && AZ::IO::SystemFile::CreateDir(testPath.c_str())) { - // Use the system's tick count to base the folder name - ULONGLONG currentTick = GetTickCount64(); - azsnprintf(workingTempPathBuffer, bufferSize, "%sUnitTest-%X", tempDir, aznumeric_cast(currentTick)); - - // Check if the requested directory name is available and re-generate if it already exists - bool exists = AZ::IO::SystemFile::Exists(workingTempPathBuffer); - if (exists) - { - Sleep(1); - maxAttempts--; - continue; - } + azstrncpy(AZStd::data(m_tempDirectory), AZStd::size(m_tempDirectory), + testPath.c_str(), testPath.Native().size()); break; } - - AZ_Error("AzTest", maxAttempts > 0, "Unable to determine a temp directory"); - - if (maxAttempts > 0) - { - // Create the temp directory and track it for deletion - bool tempDirectoryCreated = AZ::IO::SystemFile::CreateDir(workingTempPathBuffer); - if (tempDirectoryCreated) - { - azstrncpy(m_tempDirectory, AZ::IO::MaxPathLength, workingTempPathBuffer, AZ::IO::MaxPathLength); - } - else - { - AZ_Error("AzTest", false, "Unable to create temp directory %s", workingTempPathBuffer); - } - } } - } // Test -} // AZ + + AZ_Error("AzTest", m_tempDirectory[0] != '\0', "Unable to create temp path within directory %s after %d attempts", + tempDirectoryRoot.c_str(), MaxAttempts); + } +} // AZ::Test From df511c1ae863f0854eff9fabaf04d4c0d21299dd Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 11 Jan 2022 10:05:05 -0600 Subject: [PATCH 346/399] Fixed tab order for default input focus on new level dialog Signed-off-by: Chris Galvan --- Code/Editor/NewLevelDialog.cpp | 1 - Code/Editor/NewLevelDialog.ui | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Code/Editor/NewLevelDialog.cpp b/Code/Editor/NewLevelDialog.cpp index c773acdb6f..a97eb30f57 100644 --- a/Code/Editor/NewLevelDialog.cpp +++ b/Code/Editor/NewLevelDialog.cpp @@ -115,7 +115,6 @@ CNewLevelDialog::~CNewLevelDialog() void CNewLevelDialog::OnStartup() { UpdateData(false); - setFocus(); } void CNewLevelDialog::UpdateData(bool fromUi) diff --git a/Code/Editor/NewLevelDialog.ui b/Code/Editor/NewLevelDialog.ui index 14227fbb53..93a88dc897 100644 --- a/Code/Editor/NewLevelDialog.ui +++ b/Code/Editor/NewLevelDialog.ui @@ -133,6 +133,9 @@ 1 + + LEVEL + From 384e8aa863aa8f16b871f650a7b85c1046a30c38 Mon Sep 17 00:00:00 2001 From: smurly Date: Tue, 11 Jan 2022 09:47:04 -0800 Subject: [PATCH 347/399] Move Material Editor Basic test from sandbox to main suite (#6794) * moving material editor test from sandbox to main suite Signed-off-by: Scott Murray * define TEST_DIRECTORY and add logging Signed-off-by: Scott Murray --- .../Gem/PythonTests/Atom/TestSuite_Main.py | 78 +++++++++++++++++++ .../Gem/PythonTests/Atom/TestSuite_Sandbox.py | 71 ----------------- .../Atom/atom_utils/material_editor_utils.py | 7 ++ .../hydra_AtomMaterialEditor_BasicTests.py | 5 ++ 4 files changed, 90 insertions(+), 71 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py index 905722d103..7051b9983c 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py @@ -4,10 +4,18 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ +import logging +import os import pytest +import ly_test_tools.environment.file_system as file_system +import editor_python_test_tools.hydra_test_utils as hydra + from ly_test_tools.o3de.editor_test import EditorSharedTest, EditorTestSuite +logger = logging.getLogger(__name__) +TEST_DIRECTORY = os.path.join(os.path.dirname(__file__), "tests") + @pytest.mark.parametrize("project", ["AutomatedTesting"]) @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @@ -114,3 +122,73 @@ class TestAutomation(EditorTestSuite): class ShaderAssetBuilder_RecompilesShaderAsChainOfDependenciesChanges(EditorSharedTest): from Atom.tests import hydra_ShaderAssetBuilder_RecompilesShaderAsChainOfDependenciesChanges as test_module + + +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +@pytest.mark.parametrize("launcher_platform", ['windows_generic']) +class TestMaterialEditorBasicTests(object): + @pytest.fixture(autouse=True) + def setup_teardown(self, request, workspace, project): + def delete_files(): + file_system.delete( + [ + os.path.join(workspace.paths.project(), "Materials", "test_material.material"), + os.path.join(workspace.paths.project(), "Materials", "test_material_1.material"), + os.path.join(workspace.paths.project(), "Materials", "test_material_2.material"), + ], + True, + True, + ) + # Cleanup our newly created materials + delete_files() + + def teardown(): + # Cleanup our newly created materials + delete_files() + + request.addfinalizer(teardown) + + @pytest.mark.parametrize("exe_file_name", ["MaterialEditor"]) + @pytest.mark.test_case_id("C34448113") # Creating a New Asset. + @pytest.mark.test_case_id("C34448114") # Opening an Existing Asset. + @pytest.mark.test_case_id("C34448115") # Closing Selected Material. + @pytest.mark.test_case_id("C34448116") # Closing All Materials. + @pytest.mark.test_case_id("C34448117") # Closing all but Selected Material. + @pytest.mark.test_case_id("C34448118") # Saving Material. + @pytest.mark.test_case_id("C34448119") # Saving as a New Material. + @pytest.mark.test_case_id("C34448120") # Saving as a Child Material. + @pytest.mark.test_case_id("C34448121") # Saving all Open Materials. + def test_MaterialEditorBasicTests( + self, request, workspace, project, launcher_platform, generic_launcher, exe_file_name): + + expected_lines = [ + "Material opened: True", + "Test asset doesn't exist initially: True", + "New asset created: True", + "New Material opened: True", + "Material closed: True", + "All documents closed: True", + "Close All Except Selected worked as expected: True", + "Actual Document saved with changes: True", + "Document saved as copy is saved with changes: True", + "Document saved as child is saved with changes: True", + "Save All worked as expected: True", + ] + unexpected_lines = [ + "Traceback (most recent call last):" + ] + + hydra.launch_and_validate_results( + request, + TEST_DIRECTORY, + generic_launcher, + "hydra_AtomMaterialEditor_BasicTests.py", + run_python="--runpython", + timeout=43, + expected_lines=expected_lines, + unexpected_lines=unexpected_lines, + halt_on_unexpected=True, + null_renderer=True, + log_file_name="MaterialEditor.log", + enable_prefab_system=False, + ) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py index 29f90e6807..c9182070f6 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py @@ -83,77 +83,6 @@ class TestAtomEditorComponentsMain(object): ) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -@pytest.mark.parametrize("launcher_platform", ['windows_generic']) -@pytest.mark.system -class TestMaterialEditorBasicTests(object): - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project): - def delete_files(): - file_system.delete( - [ - os.path.join(workspace.paths.project(), "Materials", "test_material.material"), - os.path.join(workspace.paths.project(), "Materials", "test_material_1.material"), - os.path.join(workspace.paths.project(), "Materials", "test_material_2.material"), - ], - True, - True, - ) - # Cleanup our newly created materials - delete_files() - - def teardown(): - # Cleanup our newly created materials - delete_files() - - request.addfinalizer(teardown) - - @pytest.mark.parametrize("exe_file_name", ["MaterialEditor"]) - @pytest.mark.test_case_id("C34448113") # Creating a New Asset. - @pytest.mark.test_case_id("C34448114") # Opening an Existing Asset. - @pytest.mark.test_case_id("C34448115") # Closing Selected Material. - @pytest.mark.test_case_id("C34448116") # Closing All Materials. - @pytest.mark.test_case_id("C34448117") # Closing all but Selected Material. - @pytest.mark.test_case_id("C34448118") # Saving Material. - @pytest.mark.test_case_id("C34448119") # Saving as a New Material. - @pytest.mark.test_case_id("C34448120") # Saving as a Child Material. - @pytest.mark.test_case_id("C34448121") # Saving all Open Materials. - def test_MaterialEditorBasicTests( - self, request, workspace, project, launcher_platform, generic_launcher, exe_file_name): - - expected_lines = [ - "Material opened: True", - "Test asset doesn't exist initially: True", - "New asset created: True", - "New Material opened: True", - "Material closed: True", - "All documents closed: True", - "Close All Except Selected worked as expected: True", - "Actual Document saved with changes: True", - "Document saved as copy is saved with changes: True", - "Document saved as child is saved with changes: True", - "Save All worked as expected: True", - ] - unexpected_lines = [ - "Traceback (most recent call last):" - ] - - hydra.launch_and_validate_results( - request, - TEST_DIRECTORY, - generic_launcher, - "hydra_AtomMaterialEditor_BasicTests.py", - run_python="--runpython", - timeout=120, - expected_lines=expected_lines, - unexpected_lines=unexpected_lines, - halt_on_unexpected=True, - null_renderer=True, - log_file_name="MaterialEditor.log", - enable_prefab_system=False, - ) - - @pytest.mark.parametrize("project", ["AutomatedTesting"]) @pytest.mark.parametrize("launcher_platform", ['windows_editor']) class TestAutomation(EditorTestSuite): diff --git a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/material_editor_utils.py b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/material_editor_utils.py index b21c74de19..f7ff970541 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/material_editor_utils.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/material_editor_utils.py @@ -162,6 +162,13 @@ def select_model_config(configname): azlmbr.materialeditor.MaterialViewportRequestBus(azlmbr.bus.Broadcast, "SelectModelPresetByName", configname) +def destroy_main_window(): + """ + Closes the Material Editor window + """ + azlmbr.atomtools.AtomToolsMainWindowFactoryRequestBus(azlmbr.bus.Broadcast, "DestroyMainWindow") + + def wait_for_condition(function, timeout_in_seconds=1.0): # type: (function, float) -> bool """ diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomMaterialEditor_BasicTests.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomMaterialEditor_BasicTests.py index 9f8f6c44b2..baad02318d 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomMaterialEditor_BasicTests.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomMaterialEditor_BasicTests.py @@ -186,6 +186,11 @@ def run(): material_editor.set_property(document2_id, property2_name, initial_color) material_editor.save_all() material_editor.close_all_documents() + material_editor.wait_for_condition(lambda: + (not material_editor.is_open(document1_id)) and + (not material_editor.is_open(document2_id)) and + (not material_editor.is_open(document3_id)), 2.0) + material_editor.destroy_main_window() if __name__ == "__main__": From d09da902d660fa164620b1c72ef981a635adadbe Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Tue, 11 Jan 2022 11:26:44 -0800 Subject: [PATCH 348/399] Fixed test materials since all the "lucy" stuff was renamed to "hermanubis". Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../SkinTestCases/001_lucy_regression_test.material | 8 ++++---- .../SkinTestCases/002_wrinkle_regression_test.material | 4 ++-- .../101_DetailMaps_LucyBaseNoDetailMaps.material | 8 ++++---- .../StandardPbrTestCases/102_DetailMaps_All.material | 10 +++++----- .../105_DetailMaps_BlendMaskUsingDetailUVs.material | 8 ++++---- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_lucy_regression_test.material b/Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_lucy_regression_test.material index bafb047be9..e6c032b0f9 100644 --- a/Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_lucy_regression_test.material +++ b/Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_lucy_regression_test.material @@ -11,7 +11,7 @@ 0.29372090101242068, 1.0 ], - "textureMap": "Objects/Lucy/Lucy_bronze_BaseColor.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_BaseColor.png", "useTexture": false }, "detailLayerGroup": { @@ -30,14 +30,14 @@ }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_Normal.png" + "textureMap": "Objects/Hermanubis/Hermanubis_Normal.png" }, "subsurfaceScattering": { "enableSubsurfaceScattering": true, - "influenceMap": "Objects/Lucy/Lucy_thickness.tif", + "influenceMap": "Objects/Hermanubis/Hermanubis_thickness.tif", "scatterDistance": 15.0, "subsurfaceScatterFactor": 0.4300000071525574, - "thicknessMap": "Objects/Lucy/Lucy_thickness.tif", + "thicknessMap": "Objects/Hermanubis/Hermanubis_thickness.tif", "transmissionAttenuation": 15.0, "transmissionDistortion": 0.3499999940395355, "transmissionMode": "ThickObject", diff --git a/Gems/Atom/TestData/TestData/Materials/SkinTestCases/002_wrinkle_regression_test.material b/Gems/Atom/TestData/TestData/Materials/SkinTestCases/002_wrinkle_regression_test.material index 78f597b14f..9b955ddb1d 100644 --- a/Gems/Atom/TestData/TestData/Materials/SkinTestCases/002_wrinkle_regression_test.material +++ b/Gems/Atom/TestData/TestData/Materials/SkinTestCases/002_wrinkle_regression_test.material @@ -29,14 +29,14 @@ }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_Normal.png" + "textureMap": "Objects/Hermanubis/Hermanubis_Normal.png" }, "subsurfaceScattering": { "enableSubsurfaceScattering": true, "influenceMap": "TestData/Textures/checker8x8_gray_512.png", "scatterDistance": 15.0, "subsurfaceScatterFactor": 0.4300000071525574, - "thicknessMap": "Objects/Lucy/Lucy_thickness.tif", + "thicknessMap": "Objects/Hermanubis/Hermanubis_thickness.tif", "transmissionAttenuation": 15.0, "transmissionDistortion": 0.3499999940395355, "transmissionMode": "ThickObject", diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material index 6d77be5a49..82192bac41 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material @@ -5,7 +5,7 @@ "propertyLayoutVersion": 3, "properties": { "baseColor": { - "textureMap": "Objects/Lucy/Lucy_bronze_BaseColor.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_BaseColor.png", "textureMapUv": "Unwrapped" }, "detailUV": { @@ -15,16 +15,16 @@ ] }, "metallic": { - "textureMap": "Objects/Lucy/Lucy_bronze_Metallic.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_Metallic.png", "textureMapUv": "Unwrapped" }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_Normal.png", + "textureMap": "Objects/Hermanubis/Hermanubis_Normal.png", "textureMapUv": "Unwrapped" }, "roughness": { - "textureMap": "Objects/Lucy/Lucy_bronze_Roughness.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_Roughness.png", "textureMapUv": "Unwrapped" } } diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/102_DetailMaps_All.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/102_DetailMaps_All.material index 1a29f392c8..dd31d00db0 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/102_DetailMaps_All.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/102_DetailMaps_All.material @@ -5,12 +5,12 @@ "propertyLayoutVersion": 3, "properties": { "baseColor": { - "textureMap": "Objects/Lucy/Lucy_bronze_BaseColor.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_BaseColor.png", "textureMapUv": "Unwrapped" }, "detailLayerGroup": { "baseColorDetailMap": "TestData/Textures/cc0/Concrete019_1K_Color.jpg", - "blendDetailMask": "Objects/Lucy/Lucy_ao.tif", + "blendDetailMask": "Objects/Hermanubis/Hermanubis_ao.tif", "blendDetailMaskUv": "Unwrapped", "enableBaseColor": true, "enableDetailLayer": true, @@ -26,16 +26,16 @@ "scale": 10.0 }, "metallic": { - "textureMap": "Objects/Lucy/Lucy_bronze_Metallic.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_Metallic.png", "textureMapUv": "Unwrapped" }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_Normal.png", + "textureMap": "Objects/Hermanubis/Hermanubis_Normal.png", "textureMapUv": "Unwrapped" }, "roughness": { - "textureMap": "Objects/Lucy/Lucy_bronze_Roughness.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_Roughness.png", "textureMapUv": "Unwrapped" } } diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/105_DetailMaps_BlendMaskUsingDetailUVs.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/105_DetailMaps_BlendMaskUsingDetailUVs.material index a69b72b623..6964342447 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/105_DetailMaps_BlendMaskUsingDetailUVs.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/105_DetailMaps_BlendMaskUsingDetailUVs.material @@ -5,7 +5,7 @@ "propertyLayoutVersion": 3, "properties": { "baseColor": { - "textureMap": "Objects/Lucy/Lucy_bronze_BaseColor.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_BaseColor.png", "textureMapUv": "Unwrapped" }, "detailLayerGroup": { @@ -25,16 +25,16 @@ "scale": 10.0 }, "metallic": { - "textureMap": "Objects/Lucy/Lucy_bronze_Metallic.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_Metallic.png", "textureMapUv": "Unwrapped" }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_Normal.png", + "textureMap": "Objects/Hermanubis/Hermanubis_Normal.png", "textureMapUv": "Unwrapped" }, "roughness": { - "textureMap": "Objects/Lucy/Lucy_bronze_Roughness.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_Roughness.png", "textureMapUv": "Unwrapped" } } From 48a90e0668feb42328d775b5b57f4df48eb1b6b3 Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Tue, 11 Jan 2022 13:37:55 -0600 Subject: [PATCH 349/399] Adding wait_for_condition checks for level save/export, and extending wait for slice creation test Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py | 3 ++- .../EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py | 3 ++- .../dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py | 3 ++- .../SpawnerSlices_SliceCreationAndVisibilityToggleWorks.py | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py index 86035bfbae..b4650c782e 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py @@ -110,7 +110,8 @@ def DynamicSliceInstanceSpawner_Embedded_E2E(): general.save_level() general.export_to_engine() pak_path = os.path.join(paths.products, "levels", lvl_name, "level.pak") - Report.result(Tests.saved_and_exported, os.path.exists(pak_path)) + success = helper.wait_for_condition(lambda: os.path.exists(pak_path), 10.0) + Report.result(Tests.saved_and_exported, success) if __name__ == "__main__": diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py index 2353095849..a5e7e90ce2 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py @@ -132,7 +132,8 @@ def DynamicSliceInstanceSpawner_External_E2E(): general.save_level() general.export_to_engine() pak_path = os.path.join(paths.products, "levels", lvl_name, "level.pak") - Report.result(Tests.saved_and_exported, os.path.exists(pak_path)) + success = helper.wait_for_condition(lambda: os.path.exists(pak_path), 10.0) + Report.result(Tests.saved_and_exported, success) if __name__ == "__main__": diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py index f2c7faae8a..6b5a80ee8e 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py @@ -156,7 +156,8 @@ def LayerBlender_E2E_Editor(): general.save_level() general.export_to_engine() pak_path = os.path.join(paths.products, "levels", lvl_name, "level.pak") - Report.result(Tests.saved_and_exported, os.path.exists(pak_path)) + success = helper.wait_for_condition(lambda: os.path.exists(pak_path), 10.0) + Report.result(Tests.saved_and_exported, success) if __name__ == "__main__": diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SpawnerSlices_SliceCreationAndVisibilityToggleWorks.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SpawnerSlices_SliceCreationAndVisibilityToggleWorks.py index c36d1b5bc9..fc55080cec 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SpawnerSlices_SliceCreationAndVisibilityToggleWorks.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SpawnerSlices_SliceCreationAndVisibilityToggleWorks.py @@ -73,7 +73,7 @@ def SpawnerSlices_SliceCreationAndVisibilityToggleWorks(): slice.SliceRequestBus(bus.Broadcast, "CreateNewSlice", veg_1.id, slice_path) # 2.3) Verify if the slice has been created successfully - spawner_slice_success = helper.wait_for_condition(lambda: path_is_valid_asset(slice_path), 5.0) + spawner_slice_success = helper.wait_for_condition(lambda: path_is_valid_asset(slice_path), 10.0) Report.result(Tests.spawner_slice_created, spawner_slice_success) # 3) C2627904: Hiding a slice containing the component clears any visuals from the Viewport From f03c2885f0347aaa2d64a03e51d63727e84b2de2 Mon Sep 17 00:00:00 2001 From: SWMasterson Date: Tue, 11 Jan 2022 12:21:45 -0800 Subject: [PATCH 350/399] Moving AutomatedTesting Atom levels into the Graphics subfolder (#6791) Signed-off-by: Sean Masterson --- .../PbrMaterialChart/PbrMaterialChart.prefab | 88 +++++++++---------- .../PbrMaterialChart/materials/basic.material | 0 .../materials/basic_m00_r00.material | 0 .../materials/basic_m00_r01.material | 0 .../materials/basic_m00_r02.material | 0 .../materials/basic_m00_r03.material | 0 .../materials/basic_m00_r04.material | 0 .../materials/basic_m00_r05.material | 0 .../materials/basic_m00_r06.material | 0 .../materials/basic_m00_r07.material | 0 .../materials/basic_m00_r08.material | 0 .../materials/basic_m00_r09.material | 0 .../materials/basic_m00_r10.material | 0 .../materials/basic_m10_r00.material | 0 .../materials/basic_m10_r01.material | 0 .../materials/basic_m10_r02.material | 0 .../materials/basic_m10_r03.material | 0 .../materials/basic_m10_r04.material | 0 .../materials/basic_m10_r05.material | 0 .../materials/basic_m10_r06.material | 0 .../materials/basic_m10_r07.material | 0 .../materials/basic_m10_r08.material | 0 .../materials/basic_m10_r09.material | 0 .../materials/basic_m10_r10.material | 0 .../{ => Graphics}/PbrMaterialChart/tags.txt | 0 .../{ => Graphics}/Sponza/Sponza.prefab | 0 .../Levels/{ => Graphics}/Sponza/tags.txt | 0 .../macbeth_shaderballs.prefab | 0 .../macbeth_shaderballs/tags.txt | 0 29 files changed, 44 insertions(+), 44 deletions(-) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/PbrMaterialChart.prefab (97%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r00.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r01.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r02.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r03.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r04.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r05.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r06.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r07.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r08.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r09.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r10.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r00.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r01.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r02.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r03.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r04.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r05.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r06.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r07.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r08.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r09.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r10.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/tags.txt (100%) rename AutomatedTesting/Levels/{ => Graphics}/Sponza/Sponza.prefab (100%) rename AutomatedTesting/Levels/{ => Graphics}/Sponza/tags.txt (100%) rename AutomatedTesting/Levels/{ => Graphics}/macbeth_shaderballs/macbeth_shaderballs.prefab (100%) rename AutomatedTesting/Levels/{ => Graphics}/macbeth_shaderballs/tags.txt (100%) diff --git a/AutomatedTesting/Levels/PbrMaterialChart/PbrMaterialChart.prefab b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/PbrMaterialChart.prefab similarity index 97% rename from AutomatedTesting/Levels/PbrMaterialChart/PbrMaterialChart.prefab rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/PbrMaterialChart.prefab index faa93597de..2c0ee5cb1a 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/PbrMaterialChart.prefab +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/PbrMaterialChart.prefab @@ -1474,9 +1474,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{1FD47684-2E9E-5525-BBCA-251795F9033C}" + "guid": "{12B5A321-3D64-5DF6-9E15-D8F447229EC1}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r00.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r00.azmaterial" } } } @@ -1569,9 +1569,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{B5660D78-818E-5273-AF3D-EC8189E2E6CB}" + "guid": "{EB8B9C49-D6F4-5098-AC97-543381E2554A}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r01.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r01.azmaterial" } } } @@ -1824,9 +1824,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{512443BD-9511-5F13-A84A-3ED5DB9E9B5A}" + "guid": "{CAA9CAFC-8A48-5406-BE26-448E5AA1A5B0}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r02.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r02.azmaterial" } } } @@ -1926,9 +1926,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{E28A5CC5-4B8B-5B90-877A-3D92C75DC75A}" + "guid": "{2F338C0B-EF86-5AC4-AEE6-28A26BB9E97E}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r03.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r03.azmaterial" } } } @@ -2028,9 +2028,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{1495BCCF-3F96-5D0B-8176-228DB22CEC82}" + "guid": "{9BF4E656-0D4F-5746-A256-32740742712B}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r04.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r04.azmaterial" } } } @@ -2130,9 +2130,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{40494612-0ABF-55B5-9C56-E968763FCFDE}" + "guid": "{850398D7-386A-56C6-AEB2-95E4F64368B1}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r05.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r05.azmaterial" } } } @@ -2232,9 +2232,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{76CF9D4A-009F-5494-83AB-6E3D4D1B4A36}" + "guid": "{74784C2A-A713-5C6A-8B3D-B66CAE3DD055}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r06.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r06.azmaterial" } } } @@ -2334,9 +2334,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{8431B792-E6CC-51DD-B82E-F3E4A12FCB4A}" + "guid": "{4F9F91F7-7E22-5A14-856D-194CC258E70D}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r07.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r07.azmaterial" } } } @@ -2436,9 +2436,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{4B1F29FF-7971-5524-AA1B-0DC2392A33C4}" + "guid": "{842AE870-802B-5934-997F-0965F960ECB9}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r08.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r08.azmaterial" } } } @@ -2538,9 +2538,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{785BE6DE-C0EB-5B47-9438-4F9ECFC34A96}" + "guid": "{0184CF10-E675-5C33-B1B9-009C383AB463}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r09.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r09.azmaterial" } } } @@ -2640,9 +2640,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{C40DE9AE-6756-57E7-B3B4-FB0542B5CD0F}" + "guid": "{6DDA0761-C165-58CC-B45E-03C29F0CF598}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r10.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r10.azmaterial" } } } @@ -2896,9 +2896,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{251C4C29-4ECD-5763-AF4F-20675EAC048B}" + "guid": "{101AB53A-3B3E-5ACF-841C-65DB2BFBF305}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r04.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r04.azmaterial" } } } @@ -2998,9 +2998,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{02D082C4-5032-57CC-A081-BC4D8518BCF0}" + "guid": "{B82B96D6-7511-5E22-A36E-FFF682B3236B}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r05.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r05.azmaterial" } } } @@ -3100,9 +3100,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{FA9D8842-95B2-5371-8352-CBEEEAABE676}" + "guid": "{DBED5292-3E17-5038-9974-80A8BB1F79E8}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r06.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r06.azmaterial" } } } @@ -3202,9 +3202,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{522A9626-FF4C-561A-A44A-64B68F7274D2}" + "guid": "{25F07733-365C-5826-AEE3-E92FBE807555}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r07.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r07.azmaterial" } } } @@ -3304,9 +3304,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{06DDFD66-D7F5-5D55-8972-6D61276E88F6}" + "guid": "{C9A7B916-CF71-5A34-B9B9-54FE8CB058DC}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r00.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r00.azmaterial" } } } @@ -3399,9 +3399,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{060EF1B7-1029-5227-B03B-1415C74E9D65}" + "guid": "{85C8DFC5-358D-579D-B922-14FA1B401571}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r08.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r08.azmaterial" } } } @@ -3501,9 +3501,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{7B7BC6F8-150A-518F-816E-2F7DBE786461}" + "guid": "{51924281-7A06-5654-B783-A4F5759063ED}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r01.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r01.azmaterial" } } } @@ -3603,9 +3603,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{270881B6-21E9-509D-A6CD-1046674FB0BE}" + "guid": "{7877F64E-26E3-558C-B6D9-B609ED6E43BF}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r09.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r09.azmaterial" } } } @@ -3705,9 +3705,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{C0538953-C56E-5C1A-BBE2-E6BE04764C20}" + "guid": "{6CC3C6B9-EE05-5A77-A12D-7085D93D89DB}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r02.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r02.azmaterial" } } } @@ -3874,9 +3874,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{5EA26E09-E3D6-5181-8E7A-F2E98A24247C}" + "guid": "{E6E15876-EEF3-555D-BD80-1B9D5A7ECC7D}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r10.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r10.azmaterial" } } } @@ -3976,9 +3976,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{E1A5D708-7A49-5CCA-81C3-4CB337C47703}" + "guid": "{83179EEC-BAC7-5D39-9788-37D33E9584B1}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r03.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r03.azmaterial" } } } diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r00.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r00.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r00.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r00.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r01.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r01.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r01.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r01.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r02.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r02.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r02.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r02.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r03.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r03.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r03.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r03.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r04.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r04.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r04.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r04.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r05.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r05.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r05.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r05.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r06.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r06.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r06.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r06.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r07.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r07.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r07.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r07.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r08.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r08.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r08.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r08.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r09.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r09.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r09.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r09.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r10.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r10.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r10.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r10.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r00.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r00.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r00.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r00.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r01.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r01.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r01.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r01.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r02.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r02.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r02.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r02.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r03.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r03.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r03.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r03.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r04.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r04.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r04.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r04.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r05.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r05.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r05.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r05.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r06.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r06.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r06.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r06.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r07.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r07.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r07.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r07.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r08.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r08.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r08.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r08.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r09.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r09.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r09.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r09.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r10.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r10.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r10.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r10.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/tags.txt b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/tags.txt similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/tags.txt rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/tags.txt diff --git a/AutomatedTesting/Levels/Sponza/Sponza.prefab b/AutomatedTesting/Levels/Graphics/Sponza/Sponza.prefab similarity index 100% rename from AutomatedTesting/Levels/Sponza/Sponza.prefab rename to AutomatedTesting/Levels/Graphics/Sponza/Sponza.prefab diff --git a/AutomatedTesting/Levels/Sponza/tags.txt b/AutomatedTesting/Levels/Graphics/Sponza/tags.txt similarity index 100% rename from AutomatedTesting/Levels/Sponza/tags.txt rename to AutomatedTesting/Levels/Graphics/Sponza/tags.txt diff --git a/AutomatedTesting/Levels/macbeth_shaderballs/macbeth_shaderballs.prefab b/AutomatedTesting/Levels/Graphics/macbeth_shaderballs/macbeth_shaderballs.prefab similarity index 100% rename from AutomatedTesting/Levels/macbeth_shaderballs/macbeth_shaderballs.prefab rename to AutomatedTesting/Levels/Graphics/macbeth_shaderballs/macbeth_shaderballs.prefab diff --git a/AutomatedTesting/Levels/macbeth_shaderballs/tags.txt b/AutomatedTesting/Levels/Graphics/macbeth_shaderballs/tags.txt similarity index 100% rename from AutomatedTesting/Levels/macbeth_shaderballs/tags.txt rename to AutomatedTesting/Levels/Graphics/macbeth_shaderballs/tags.txt From faf3255ea64ccd6524e7be0f048bfa6721a7eacd Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Tue, 11 Jan 2022 14:27:09 -0800 Subject: [PATCH 351/399] Renamed more files from "lucy" to "hermanubis" Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- ...sion_test.material => 001_hermanubis_regression_test.material} | 0 ...tailMaps.material => 101_DetailMaps_BaseNoDetailMaps.material} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Gems/Atom/TestData/TestData/Materials/SkinTestCases/{001_lucy_regression_test.material => 001_hermanubis_regression_test.material} (100%) rename Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/{101_DetailMaps_LucyBaseNoDetailMaps.material => 101_DetailMaps_BaseNoDetailMaps.material} (100%) diff --git a/Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_lucy_regression_test.material b/Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_hermanubis_regression_test.material similarity index 100% rename from Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_lucy_regression_test.material rename to Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_hermanubis_regression_test.material diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_BaseNoDetailMaps.material similarity index 100% rename from Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material rename to Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_BaseNoDetailMaps.material From 5cd8b0e1724eb93ad5c85cf2c34b414d9059ba75 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Tue, 11 Jan 2022 14:55:44 -0800 Subject: [PATCH 352/399] Renamed more files from "lucy" to "hermanubis" Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../StandardPbrTestCases/103_DetailMaps_BaseColor.material | 2 +- .../StandardPbrTestCases/104_DetailMaps_Normal.material | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/103_DetailMaps_BaseColor.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/103_DetailMaps_BaseColor.material index 5bddeaa7e5..eda8ef12de 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/103_DetailMaps_BaseColor.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/103_DetailMaps_BaseColor.material @@ -1,7 +1,7 @@ { "description": "", "materialType": "Materials/Types/EnhancedPBR.materialtype", - "parentMaterial": "TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material", + "parentMaterial": "TestData/Materials/StandardPbrTestCases/101_DetailMaps_BaseNoDetailMaps.material", "propertyLayoutVersion": 3, "properties": { "detailLayerGroup": { diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/104_DetailMaps_Normal.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/104_DetailMaps_Normal.material index 4c64a696d2..291f0fc828 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/104_DetailMaps_Normal.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/104_DetailMaps_Normal.material @@ -1,7 +1,7 @@ { "description": "", "materialType": "Materials/Types/EnhancedPBR.materialtype", - "parentMaterial": "TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material", + "parentMaterial": "TestData/Materials/StandardPbrTestCases/101_DetailMaps_BaseNoDetailMaps.material", "propertyLayoutVersion": 3, "properties": { "detailLayerGroup": { From 07e6b54ca5c76c95524563c8873a2948934b7f67 Mon Sep 17 00:00:00 2001 From: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> Date: Tue, 11 Jan 2022 16:49:16 -0800 Subject: [PATCH 353/399] Fix names display index and scripting dev gem (#6822) * Fix input/output params not being zero-based * Expose missing Dump Database developer command * Fix issue where developer gem name is not the same as the target * Let the user specify folder to write to Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> --- .../Code/Editor/Nodes/NodeDisplayUtils.cpp | 77 +++++++------------ .../Code/Editor/Source/TSGenerateAction.cpp | 23 ++++++ Gems/ScriptCanvasDeveloper/gem.json | 2 +- 3 files changed, 52 insertions(+), 50 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp index 31d012fd4a..60eaba24f8 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp @@ -376,60 +376,60 @@ namespace ScriptCanvasEditor::Nodes int paramIndex = 0; int outputIndex = 0; + int slotIndex = 0; auto busId = methodNode->GetBusSlotId(); for (const auto& slot : methodNode->GetSlots()) { GraphCanvas::TranslationKey slotKey = key; - int& index = (slot.IsData() && slot.IsInput()) ? paramIndex : outputIndex; + int& inputOutputIndex = slot.IsInput() ? paramIndex : outputIndex; + const bool isBusIdSlot = + methodNode->HasBusID() && busId == slot.GetId() && slot.GetDescriptor() == ScriptCanvas::SlotDescriptors::DataIn(); if (slot.IsVisible()) { - AZ::EntityId graphCanvasSlotId = DisplayScriptCanvasSlot(graphCanvasNodeId, slot, index); + AZ::EntityId graphCanvasSlotId = DisplayScriptCanvasSlot(graphCanvasNodeId, slot, slotIndex); details.m_name = slot.GetName(); details.m_tooltip = slot.GetToolTip(); - if (methodNode->HasBusID() && busId == slot.GetId() && slot.GetDescriptor() == ScriptCanvas::SlotDescriptors::DataIn()) + if (isBusIdSlot) { key = ::Translation::GlobalKeys::EBusSenderIDKey; - GraphCanvas::TranslationRequestBus::BroadcastResult(details, &GraphCanvas::TranslationRequests::GetDetails, key + ".details", details); + GraphCanvas::TranslationRequestBus::BroadcastResult( + details, &GraphCanvas::TranslationRequests::GetDetails, key + ".details", details); } - else + else if (slot.IsData()) { - - - if (slot.IsData()) + key.clear(); + key << context << className << "methods" << updatedMethodName; + if (slot.IsInput()) { - key.clear(); - key << context << className << "methods" << updatedMethodName; - if (slot.IsData() && slot.IsInput()) - { - key << "params"; - } - else - { - key << "results"; - } - key << index; - - GraphCanvas::TranslationRequestBus::BroadcastResult(details, &GraphCanvas::TranslationRequests::GetDetails, key + ".details", details); + key << "params"; } - - if (slot.IsData()) - { - index++; + else + { + key << "results"; } + key << inputOutputIndex; + + GraphCanvas::TranslationRequestBus::BroadcastResult( + details, &GraphCanvas::TranslationRequests::GetDetails, key + ".details", details); } - GraphCanvas::SlotRequestBus::Event(graphCanvasSlotId, &GraphCanvas::SlotRequests::SetDetails, details.m_name, details.m_tooltip); + GraphCanvas::SlotRequestBus::Event( + graphCanvasSlotId, &GraphCanvas::SlotRequests::SetDetails, details.m_name, details.m_tooltip); UpdateSlotDatumLabel(graphCanvasNodeId, slot.GetId(), details.m_name); - } - ++index; + ++slotIndex; + + if (!isBusIdSlot && slot.IsData()) + { + ++inputOutputIndex; + } } // Set the name @@ -485,9 +485,6 @@ namespace ScriptCanvasEditor::Nodes AZStd::vector< ScriptCanvas::SlotId > scriptCanvasSlots = busNode->GetNonEventSlotIds(); - int paramIndex = 0; - int outputIndex = 0; - for (const auto& slotId : scriptCanvasSlots) { ScriptCanvas::Slot* slot = busNode->GetSlot(slotId); @@ -501,8 +498,6 @@ namespace ScriptCanvasEditor::Nodes if (slot->IsVisible()) { - int& index = (slot->IsData() && slot->IsInput()) ? paramIndex : outputIndex; - AZ::EntityId gcSlotId = DisplayScriptCanvasSlot(graphCanvasNodeId, (*slot), group); if (busNode->IsIDRequired() && slot->GetDescriptor() == ScriptCanvas::SlotDescriptors::DataIn()) @@ -516,8 +511,6 @@ namespace ScriptCanvasEditor::Nodes GraphCanvas::SlotRequestBus::Event(gcSlotId, &GraphCanvas::SlotRequests::SetDetails, details.m_name, details.m_tooltip); } - - ++index; } } @@ -615,17 +608,12 @@ namespace ScriptCanvasEditor::Nodes *graphCanvasUserData = azEventNode->GetEntityId(); } - int paramIndex = 0; - int outputIndex = 0; - for (const ScriptCanvas::Slot& slot: azEventNode->GetSlots()) { GraphCanvas::SlotGroup group = GraphCanvas::SlotGroups::Invalid; if (slot.IsVisible()) { - int& index = (slot.IsData() && slot.IsInput()) ? paramIndex : outputIndex; - AZ::EntityId gcSlotId = DisplayScriptCanvasSlot(graphCanvasNodeId, slot, group); GraphCanvas::TranslationKey key; @@ -636,8 +624,6 @@ namespace ScriptCanvasEditor::Nodes GraphCanvas::SlotRequestBus::Event(gcSlotId, &GraphCanvas::SlotRequests::SetName, details.m_name); GraphCanvas::SlotRequestBus::Event(gcSlotId, &GraphCanvas::SlotRequests::SetTooltip, details.m_tooltip);; - - ++index; } } @@ -703,9 +689,6 @@ namespace ScriptCanvasEditor::Nodes AZStd::vector< ScriptCanvas::SlotId > scriptCanvasSlots = busNode->GetNonEventSlotIds(); - int paramIndex = 0; - int outputIndex = 0; - for (const auto& slotId : scriptCanvasSlots) { ScriptCanvas::Slot* slot = busNode->GetSlot(slotId); @@ -719,8 +702,6 @@ namespace ScriptCanvasEditor::Nodes if (slot->IsVisible()) { - int& index = (slot->IsData() && slot->IsInput()) ? paramIndex : outputIndex; - AZ::EntityId gcSlotId = DisplayScriptCanvasSlot(graphCanvasNodeId, (*slot), group); if (busNode->IsIDRequired() && slot->GetDescriptor() == ScriptCanvas::SlotDescriptors::DataIn()) @@ -731,8 +712,6 @@ namespace ScriptCanvasEditor::Nodes GraphCanvas::TranslationRequestBus::BroadcastResult(details, &GraphCanvas::TranslationRequests::GetDetails, key, details); GraphCanvas::SlotRequestBus::Event(gcSlotId, &GraphCanvas::SlotRequests::SetDetails, details.m_name, details.m_tooltip); } - - ++index; } } diff --git a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/TSGenerateAction.cpp b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/TSGenerateAction.cpp index 56168f6f56..75cf7e5392 100644 --- a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/TSGenerateAction.cpp +++ b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/TSGenerateAction.cpp @@ -11,6 +11,9 @@ #include #include #include +#include +#include +#include #endif #include @@ -34,6 +37,26 @@ namespace ScriptCanvasDeveloperEditor qAction->setShortcut(QAction::tr("Ctrl+Alt+R", "Developer|Reload Text")); QObject::connect(qAction, &QAction::triggered, [mainWindow]() { ReloadText(mainWindow); }); + qAction = mainMenu->addAction(QAction::tr("Dump Translation Database")); + qAction->setAutoRepeat(false); + qAction->setShortcut(QAction::tr("Ctrl+Alt+L", "Developer|Dump Translation Database")); + QObject::connect( + qAction, &QAction::triggered, + [mainWindow]() + { + QString defaultPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); + QString directory = QFileDialog::getExistingDirectory(mainWindow, + QObject::tr("Select output folder for sc_translation.log file"), defaultPath); + if (!directory.isEmpty()) + { + const QString path = QDir::toNativeSeparators(directory + "/sc_translation.log"); + GraphCanvas::TranslationRequestBus::Broadcast(&GraphCanvas::TranslationRequests::DumpDatabase, path.toUtf8().constData()); + QMessageBox::information( + mainWindow, QObject::tr("Finished writing translation database"), + QObject::tr("Translation database written to:
%1").arg(path)); + } + }); + } return qAction; diff --git a/Gems/ScriptCanvasDeveloper/gem.json b/Gems/ScriptCanvasDeveloper/gem.json index 51aed9d9fa..fe1fdea0fc 100644 --- a/Gems/ScriptCanvasDeveloper/gem.json +++ b/Gems/ScriptCanvasDeveloper/gem.json @@ -1,5 +1,5 @@ { - "gem_name": "ScriptCanvasDeveloperGem", + "gem_name": "ScriptCanvasDeveloper", "display_name": "Script Canvas Developer", "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", From 73419387c5235eba97ab11f194e6c1049c43f981 Mon Sep 17 00:00:00 2001 From: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> Date: Tue, 11 Jan 2022 16:49:59 -0800 Subject: [PATCH 354/399] Check engines_path in get_registered (#6828) Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> --- scripts/o3de/o3de/manifest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/o3de/o3de/manifest.py b/scripts/o3de/o3de/manifest.py index 7392637c99..a334109e6a 100644 --- a/scripts/o3de/o3de/manifest.py +++ b/scripts/o3de/o3de/manifest.py @@ -624,6 +624,9 @@ def get_registered(engine_name: str = None, this_engines_name = engine_json_data['engine_name'] if this_engines_name == engine_name: return engine_path + engines_path = json_data.get('engines_path', {}) + if engine_name in engines_path: + return pathlib.Path(engines_path[engine_name]).resolve() elif isinstance(project_name, str): projects = get_all_projects() From 13bc91aa77880b46760e088e7ed3f0adfaad8b16 Mon Sep 17 00:00:00 2001 From: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> Date: Tue, 11 Jan 2022 16:53:46 -0800 Subject: [PATCH 355/399] Split editor entity activation from PrefabSystemComponent (#6787) * Split editor entity activation from PrefabSystemComponent Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> * Fixed a small typo Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> * Pass entity activation callback during prefab instantiation for failing tests Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> --- .../PrefabEditorEntityOwnershipService.cpp | 8 ++- .../Prefab/PrefabSystemComponent.cpp | 12 +++-- .../Prefab/PrefabSystemComponent.h | 10 +++- .../Prefab/PrefabSystemComponentInterface.h | 11 ++++- .../Tests/Prefab/PrefabUndoLinkTests.cpp | 49 ++++++++++++++++--- .../Tests/Prefab/PrefabUndoTests.cpp | 9 +++- 6 files changed, 81 insertions(+), 18 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp index 418d176daa..4a1198fdfe 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp @@ -349,8 +349,12 @@ namespace AzToolsFramework instanceToParentUnder = *m_rootInstance; } - AZStd::unique_ptr instantiatedPrefabInstance = - m_prefabSystemComponent->InstantiatePrefab(filePath, instanceToParentUnder); + AZStd::unique_ptr instantiatedPrefabInstance = m_prefabSystemComponent->InstantiatePrefab( + filePath, instanceToParentUnder, + [this](const EntityList& entities) + { + HandleEntitiesAdded(entities); + }); if (instantiatedPrefabInstance) { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp index 9936e466c3..98e0144f22 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp @@ -277,7 +277,7 @@ namespace AzToolsFramework } AZStd::unique_ptr PrefabSystemComponent::InstantiatePrefab( - AZ::IO::PathView filePath, InstanceOptionalReference parent) + AZ::IO::PathView filePath, InstanceOptionalReference parent, const InstantiatedEntitiesCallback& instantiatedEntitiesCallback) { // Retrieve the template id for the source prefab filepath Prefab::TemplateId templateId = GetTemplateIdFromFilePath(filePath); @@ -297,11 +297,11 @@ namespace AzToolsFramework return nullptr; } - return InstantiatePrefab(templateId, parent); + return InstantiatePrefab(templateId, parent, instantiatedEntitiesCallback); } AZStd::unique_ptr PrefabSystemComponent::InstantiatePrefab( - TemplateId templateId, InstanceOptionalReference parent) + TemplateId templateId, InstanceOptionalReference parent, const InstantiatedEntitiesCallback& instantiatedEntitiesCallback) { TemplateReference instantiatingTemplate = FindTemplate(templateId); @@ -324,8 +324,10 @@ namespace AzToolsFramework return nullptr; } - AzToolsFramework::EditorEntityContextRequestBus::Broadcast( - &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, newEntities); + if (instantiatedEntitiesCallback) + { + instantiatedEntitiesCallback(newEntities); + } return newInstance; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.h index d71065f8fc..b547e9bdd2 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.h @@ -124,19 +124,25 @@ namespace AzToolsFramework * Generates a new Prefab Instance based on the Template whose source is stored in filepath. * @param filePath The path to the prefab source file containing the template being instantiated. * @param parent Reference of the target instance the instantiated instance will be placed under. + * @param instantiatedEntitiesCallback An optional callback that can be used to modify the instantiated entities. * @return A unique_ptr to the newly instantiated instance. Null if operation failed. */ AZStd::unique_ptr InstantiatePrefab( - AZ::IO::PathView filePath, InstanceOptionalReference parent = AZStd::nullopt) override; + AZ::IO::PathView filePath, + InstanceOptionalReference parent = AZStd::nullopt, + const InstantiatedEntitiesCallback& instantiatedEntitiesCallback = {}) override; /** * Generates a new Prefab Instance based on the Template referenced by templateId. * @param templateId The id of the template being instantiated. * @param parent Reference of the target instance the instantiated instance will be placed under. + * @param instantiatedEntitiesCallback An optional callback that can be used to modify the instantiated entities. * @return A unique_ptr to the newly instantiated instance. Null if operation failed. */ AZStd::unique_ptr InstantiatePrefab( - TemplateId templateId, InstanceOptionalReference parent = AZStd::nullopt) override; + TemplateId templateId, + InstanceOptionalReference parent = AZStd::nullopt, + const InstantiatedEntitiesCallback& instantiatedEntitiesCallback = {}) override; /** * Add a new Link into Prefab System Component and create a unique id for it. diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponentInterface.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponentInterface.h index ce75930cb6..d39e868ef4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponentInterface.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponentInterface.h @@ -27,6 +27,9 @@ namespace AzToolsFramework class PrefabSystemComponentInterface { public: + + using InstantiatedEntitiesCallback = AZStd::function&)>; + AZ_RTTI(PrefabSystemComponentInterface, "{8E95A029-67F9-4F74-895F-DDBFE29516A0}"); virtual TemplateReference FindTemplate(TemplateId id) = 0; @@ -70,9 +73,13 @@ namespace AzToolsFramework virtual void PropagateTemplateChanges(TemplateId templateId, InstanceOptionalConstReference instanceToExclude = AZStd::nullopt) = 0; virtual AZStd::unique_ptr InstantiatePrefab( - AZ::IO::PathView filePath, InstanceOptionalReference parent = AZStd::nullopt) = 0; + AZ::IO::PathView filePath, + InstanceOptionalReference parent = AZStd::nullopt, + const InstantiatedEntitiesCallback& instantiatedEntitiesCallback = {}) = 0; virtual AZStd::unique_ptr InstantiatePrefab( - TemplateId templateId, InstanceOptionalReference parent = AZStd::nullopt) = 0; + TemplateId templateId, + InstanceOptionalReference parent = AZStd::nullopt, + const InstantiatedEntitiesCallback& instantiatedEntitiesCallback = {}) = 0; virtual AZStd::unique_ptr CreatePrefab(const AZStd::vector& entities, AZStd::vector>&& instancesToConsume, AZ::IO::PathView filePath, AZStd::unique_ptr containerEntity = nullptr, InstanceOptionalReference parent = AZStd::nullopt, diff --git a/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabUndoLinkTests.cpp b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabUndoLinkTests.cpp index 8fafe1f177..442894c101 100644 --- a/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabUndoLinkTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabUndoLinkTests.cpp @@ -170,7 +170,14 @@ namespace UnitTest m_instanceUpdateExecutorInterface->UpdateTemplateInstancesInQueue(); //instantiate a new nested instance - nestedInstance = m_prefabSystemComponent->InstantiatePrefab(nestedTemplateId); + nestedInstance = m_prefabSystemComponent->InstantiatePrefab( + nestedTemplateId, AZStd::nullopt, + [](const AzToolsFramework::EntityList& entities) + { + AzToolsFramework::EditorEntityContextRequestBus::Broadcast( + &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, entities); + }); + nestedContainerEntityId = nestedInstance->GetContainerEntityId(); AZ::ComponentApplicationBus::BroadcastResult(nestedContainerEntity, &AZ::ComponentApplicationBus::Events::FindEntity, nestedContainerEntityId); ASSERT_TRUE(nestedContainerEntity); @@ -198,7 +205,13 @@ namespace UnitTest LinkId linkId = undoInstanceLinkNode.GetLinkId(); - rootInstance = m_prefabSystemComponent->InstantiatePrefab(rootTemplateId); + rootInstance = m_prefabSystemComponent->InstantiatePrefab( + rootTemplateId, AZStd::nullopt, + [](const AzToolsFramework::EntityList& entities) + { + AzToolsFramework::EditorEntityContextRequestBus::Broadcast( + &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, entities); + }); aliases = rootInstance->GetNestedInstanceAliases(nestedTemplateId); //verify the link was created @@ -228,7 +241,13 @@ namespace UnitTest m_instanceUpdateExecutorInterface->UpdateTemplateInstancesInQueue(); //verify the update worked - rootInstance = m_prefabSystemComponent->InstantiatePrefab(rootTemplateId); + rootInstance = m_prefabSystemComponent->InstantiatePrefab( + rootTemplateId, AZStd::nullopt, + [](const AzToolsFramework::EntityList& entities) + { + AzToolsFramework::EditorEntityContextRequestBus::Broadcast( + &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, entities); + }); aliases = rootInstance->GetNestedInstanceAliases(nestedTemplateId); nestedInstanceRef = rootInstance->FindNestedInstance(aliases[0]); nestedContainerEntityId = nestedInstanceRef->get().GetContainerEntityId(); @@ -244,7 +263,13 @@ namespace UnitTest m_instanceUpdateExecutorInterface->UpdateTemplateInstancesInQueue(); //verify the undo update worked - rootInstance = m_prefabSystemComponent->InstantiatePrefab(rootTemplateId); + rootInstance = m_prefabSystemComponent->InstantiatePrefab( + rootTemplateId, AZStd::nullopt, + [](const AzToolsFramework::EntityList& entities) + { + AzToolsFramework::EditorEntityContextRequestBus::Broadcast( + &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, entities); + }); aliases = rootInstance->GetNestedInstanceAliases(nestedTemplateId); nestedInstanceRef = rootInstance->FindNestedInstance(aliases[0]); nestedContainerEntityId = nestedInstanceRef->get().GetContainerEntityId(); @@ -259,7 +284,13 @@ namespace UnitTest undoLinkUpdateNode.Redo(); m_instanceUpdateExecutorInterface->UpdateTemplateInstancesInQueue(); - rootInstance = m_prefabSystemComponent->InstantiatePrefab(rootTemplateId); + rootInstance = m_prefabSystemComponent->InstantiatePrefab( + rootTemplateId, AZStd::nullopt, + [](const AzToolsFramework::EntityList& entities) + { + AzToolsFramework::EditorEntityContextRequestBus::Broadcast( + &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, entities); + }); aliases = rootInstance->GetNestedInstanceAliases(nestedTemplateId); nestedInstanceRef = rootInstance->FindNestedInstance(aliases[0]); nestedContainerEntityId = nestedInstanceRef->get().GetContainerEntityId(); @@ -287,7 +318,13 @@ namespace UnitTest m_instanceUpdateExecutorInterface->UpdateTemplateInstancesInQueue(); //verify the update worked - rootInstance = m_prefabSystemComponent->InstantiatePrefab(rootTemplateId); + rootInstance = m_prefabSystemComponent->InstantiatePrefab( + rootTemplateId, AZStd::nullopt, + [](const AzToolsFramework::EntityList& entities) + { + AzToolsFramework::EditorEntityContextRequestBus::Broadcast( + &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, entities); + }); aliases = rootInstance->GetNestedInstanceAliases(nestedTemplateId); nestedInstanceRef = rootInstance->FindNestedInstance(aliases[0]); nestedContainerEntityId = nestedInstanceRef->get().GetContainerEntityId(); diff --git a/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabUndoTests.cpp b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabUndoTests.cpp index 5c68b30e8f..cfba41696c 100644 --- a/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabUndoTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabUndoTests.cpp @@ -79,7 +79,14 @@ namespace UnitTest // verify template updated correctly //instantiate second instance for checking if propogation works - AZStd::unique_ptr secondInstance = m_prefabSystemComponent->InstantiatePrefab(templateId); + AZStd::unique_ptr secondInstance = m_prefabSystemComponent->InstantiatePrefab( + templateId, AZStd::nullopt, + [](const AzToolsFramework::EntityList& entities) + { + AzToolsFramework::EditorEntityContextRequestBus::Broadcast( + &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, entities); + }); + ASSERT_TRUE(secondInstance); ValidateInstanceEntitiesActive(*secondInstance); From b9787fb2b3141aced65e7d00676b35a6e7ea52de Mon Sep 17 00:00:00 2001 From: Vincent Liu <5900509+onecent1101@users.noreply.github.com> Date: Tue, 11 Jan 2022 17:24:33 -0800 Subject: [PATCH 356/399] [Mac] Update to use AWSNativeSDK 1.9.50 (#6797) --- Gems/AWSCore/Code/Platform/Mac/AWSCore_Traits_Mac.h | 2 +- cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/AWSCore/Code/Platform/Mac/AWSCore_Traits_Mac.h b/Gems/AWSCore/Code/Platform/Mac/AWSCore_Traits_Mac.h index d7b1f32461..2cacfb0d34 100644 --- a/Gems/AWSCore/Code/Platform/Mac/AWSCore_Traits_Mac.h +++ b/Gems/AWSCore/Code/Platform/Mac/AWSCore_Traits_Mac.h @@ -7,4 +7,4 @@ */ #pragma once -#define AWSCORE_BACKWARD_INCOMPATIBLE_CHANGE 0 +#define AWSCORE_BACKWARD_INCOMPATIBLE_CHANGE 1 diff --git a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake index 35a6b87c6c..ea324a5cb7 100644 --- a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake +++ b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake @@ -25,7 +25,7 @@ ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxc-1.6.2104-o3de-rev3-ma ly_associate_package(PACKAGE_NAME SPIRVCross-2021.04.29-rev1-mac TARGETS SPIRVCross PACKAGE_HASH 78c6376ed2fd195b9b1f5fb2b56e5267a32c3aa21fb399e905308de470eb4515) ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-rev3-mac TARGETS TIFF PACKAGE_HASH c2615ccdadcc0e1d6c5ed61e5965c4d3a82193d206591b79b805c3b3ff35a4bf) ly_associate_package(PACKAGE_NAME freetype-2.10.4.16-mac TARGETS freetype PACKAGE_HASH f159b346ac3251fb29cb8dd5f805c99b0015ed7fdb3887f656945ca701a61d0d) -ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev6-mac TARGETS AWSNativeSDK PACKAGE_HASH 9b058376dec042ace98e198e902b399739adeb9e9398a6c210171fb530164577) +ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.9.50-rev1-mac TARGETS AWSNativeSDK PACKAGE_HASH 6c27a49376870c606144e4639e15867f9db7e4a1ee5f1a726f152d3bd8459966) ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev6-mac TARGETS Lua PACKAGE_HASH b9079fd35634774c9269028447562c6b712dbc83b9c64975c095fd423ff04c08) ly_associate_package(PACKAGE_NAME PhysX-4.1.2.29882248-rev5-mac TARGETS PhysX PACKAGE_HASH 83940b3876115db82cd8ffcb9e902278e75846d6ad94a41e135b155cee1ee186) ly_associate_package(PACKAGE_NAME mcpp-2.7.2_az.2-rev1-mac TARGETS mcpp PACKAGE_HASH be9558905c9c49179ef3d7d84f0a5472415acdf7fe2d76eb060d9431723ddf2e) From acec79fe2e3404e31262aa13362eced3eb3ec9b5 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 12 Jan 2022 11:57:54 +0000 Subject: [PATCH 357/399] Node name change cursor missing (#6721) Signed-off-by: T.J. McGrath-Daly --- .../Editor/PropertyWidgets/AnimGraphNodeNameHandler.cpp | 6 ++++++ .../Editor/PropertyWidgets/AnimGraphNodeNameHandler.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphNodeNameHandler.cpp b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphNodeNameHandler.cpp index 754acdaf1c..854825b45c 100644 --- a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphNodeNameHandler.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphNodeNameHandler.cpp @@ -38,6 +38,12 @@ namespace EMotionFX m_node = node; } + void AnimGraphNodeNameLineEdit::focusInEvent([[maybe_unused]] QFocusEvent* event) + { + selectAll(); + QLineEdit::focusInEvent(event); + } + //--------------------------------------------------------------------------------------------------------------------------------------------------------- AnimGraphNodeNameHandler::AnimGraphNodeNameHandler() diff --git a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphNodeNameHandler.h b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphNodeNameHandler.h index ad6f0116ca..8da69f7437 100644 --- a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphNodeNameHandler.h +++ b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphNodeNameHandler.h @@ -29,7 +29,8 @@ namespace EMotionFX ~AnimGraphNodeNameLineEdit() = default; void SetNode(AnimGraphNode* node); - + private: + void focusInEvent(QFocusEvent* event) override; private: AnimGraphNode* m_node; }; From f51c845cbb57c1d46c587ecbd318cd3bb9ee9aac Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 12 Jan 2022 13:42:12 +0000 Subject: [PATCH 358/399] Fix: AnimAudioComponentRequestBus canvas script function failure (#6658) Signed-off-by: T.J. McGrath-Daly Co-authored-by: Tobias Alexander Franke --- .../Code/Source/Integration/Components/AnimAudioComponent.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gems/EMotionFX/Code/Source/Integration/Components/AnimAudioComponent.cpp b/Gems/EMotionFX/Code/Source/Integration/Components/AnimAudioComponent.cpp index eac3705300..7cfea90ae2 100644 --- a/Gems/EMotionFX/Code/Source/Integration/Components/AnimAudioComponent.cpp +++ b/Gems/EMotionFX/Code/Source/Integration/Components/AnimAudioComponent.cpp @@ -405,6 +405,7 @@ namespace EMotionFX ActorNotificationBus::Handler::BusConnect(GetEntityId()); AnimAudioComponentNotificationBus::Handler::BusConnect(GetEntityId()); + AnimAudioComponentRequestBus::Handler::BusConnect(GetEntityId()); } void AnimAudioComponent::Deactivate() @@ -421,6 +422,7 @@ namespace EMotionFX ActorNotificationBus::Handler::BusDisconnect(GetEntityId()); AnimAudioComponentNotificationBus::Handler::BusDisconnect(GetEntityId()); + AnimAudioComponentRequestBus::Handler::BusDisconnect(GetEntityId()); } void AnimAudioComponent::OnTick(float deltaTime, AZ::ScriptTimePoint time) From ffa9cc3a66e7a6df95b18b19d3542370c6eed307 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Wed, 12 Jan 2022 08:46:10 -0600 Subject: [PATCH 359/399] Unit tests and benchmarks for GetValues() (#6823) * Benchmarks and tests for Image and Constant GetValues Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Verify GetValues for Perlin and Random Gradients Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Standardized the assert format for GetValues(). Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * More GetValues unit tests and test cleanup Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed typos Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * GetValues() unit tests for surface gradients. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Benchmarks for ShapeAreaFalloff Gradient Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added benchmarks for all remaining gradients and cleaned up the helper methods. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Renamed class for better report formatting. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added missing Mocks dependencies for the Editor tests. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- Gems/GradientSignal/Code/CMakeLists.txt | 3 + .../Ebuses/GradientRequestBus.h | 27 +- .../Include/GradientSignal/GradientSampler.h | 4 +- .../Code/Tests/GradientSignalBenchmarks.cpp | 389 ++++++++++----- .../Tests/GradientSignalGetValuesTests.cpp | 182 +++++++ .../Code/Tests/GradientSignalImageTests.cpp | 1 - .../Tests/GradientSignalReferencesTests.cpp | 16 +- .../Tests/GradientSignalServicesTests.cpp | 9 +- .../Code/Tests/GradientSignalTestFixtures.cpp | 444 ++++++++++++------ .../Code/Tests/GradientSignalTestFixtures.h | 59 ++- .../Code/gradientsignal_tests_files.cmake | 1 + .../Source/Shape/ReferenceShapeComponent.cpp | 16 +- .../TerrainHeightGradientListComponent.cpp | 2 +- .../Components/AreaBlenderComponent.cpp | 10 +- 14 files changed, 842 insertions(+), 321 deletions(-) create mode 100644 Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index 657a88db47..d4cf666630 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -141,6 +141,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzTestShared Gem::GradientSignal.Static Gem::LmbrCentral + Gem::LmbrCentral.Mocks Gem::GradientSignal.Mocks ) @@ -160,6 +161,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) Gem::GradientSignal.Tests.Static Gem::GradientSignal.Static Gem::LmbrCentral + Gem::LmbrCentral.Mocks Gem::GradientSignal.Mocks ) ly_add_googletest( @@ -190,6 +192,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) Gem::GradientSignal.Static Gem::GradientSignal.Editor.Static Gem::LmbrCentral.Editor + Gem::LmbrCentral.Mocks ) ly_add_googletest( NAME Gem::GradientSignal.Editor.Tests diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h index d0fcabf746..3a215c5b5d 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h @@ -62,22 +62,21 @@ namespace GradientSignal // Reference implementation of GetValues for any gradients that don't have their own optimized implementations. // This is 10%-60% faster than calling GetValue via EBus many times due to the per-call EBus overhead. - AZ_Assert( - positions.size() == outValues.size(), "input and output lists are different sizes (%zu vs %zu).", - positions.size(), outValues.size()); + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } - if (positions.size() == outValues.size()) + GradientSampleParams sampleParams; + for (size_t index = 0; index < positions.size(); index++) { - GradientSampleParams sampleParams; - for (size_t index = 0; index < positions.size(); index++) - { - sampleParams.m_position = positions[index]; - - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); - outValue = GetValue(sampleParams); - } + sampleParams.m_position = positions[index]; + + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + outValue = GetValue(sampleParams); } } diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h index 454be938a5..a2e1849590 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h @@ -120,7 +120,7 @@ namespace GradientSignal if (m_isRequestInProgress) { - AZ_ErrorOnce("GradientSignal", !m_isRequestInProgress, "Detected cyclic dependences with gradient entity references"); + AZ_ErrorOnce("GradientSignal", !m_isRequestInProgress, "Detected cyclic dependencies with gradient entity references"); } else { @@ -197,7 +197,7 @@ namespace GradientSignal if (m_isRequestInProgress) { - AZ_ErrorOnce("GradientSignal", !m_isRequestInProgress, "Detected cyclic dependences with gradient entity references"); + AZ_ErrorOnce("GradientSignal", !m_isRequestInProgress, "Detected cyclic dependencies with gradient entity references"); ClearOutputValues(outValues); return; } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp index 6383b627c1..bd4ccf5205 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp @@ -16,162 +16,337 @@ #include #include -#include -#include -#include -#include - namespace UnitTest { - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientEBusGetValue)(benchmark::State& state) + class GradientGetValues : public GradientSignalBenchmarkFixture { - CreateTestImageGradient(m_testEntity.get()); - RunEBusGetValueBenchmark(state); - } - - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientEBusGetValue) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) + public: + // We use an enum to list out the different types of GetValue() benchmarks to run so that way we can condense our test cases + // to just take the value in as a benchmark argument and switch on it. Otherwise, we would need to write a different benchmark + // function for each test case for each gradient. + enum GetValuePermutation : int64_t + { + EBUS_GET_VALUE, + EBUS_GET_VALUES, + SAMPLER_GET_VALUE, + SAMPLER_GET_VALUES, + }; + + // Create an arbitrary size shape for creating our gradients for benchmark runs. + const float TestShapeHalfBounds = 128.0f; + + void FillQueryPositions(AZStd::vector& positions, float height, float width) + { + size_t index = 0; + for (float y = 0.0f; y < height; y += 1.0f) + { + for (float x = 0.0f; x < width; x += 1.0f) + { + positions[index++] = AZ::Vector3(x, y, 0.0f); + } + } + } + + void RunEBusGetValueBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange) + { + AZ_PROFILE_FUNCTION(Entity); + + GradientSignal::GradientSampleParams params; + + // Get the height and width ranges for querying from our benchmark parameters + const float height = aznumeric_cast(queryRange); + const float width = aznumeric_cast(queryRange); + + // Call GetValue() on the EBus for every height and width in our ranges. + for (auto _ : state) + { + for (float y = 0.0f; y < height; y += 1.0f) + { + for (float x = 0.0f; x < width; x += 1.0f) + { + float value = 0.0f; + params.m_position = AZ::Vector3(x, y, 0.0f); + GradientSignal::GradientRequestBus::EventResult( + value, gradientId, &GradientSignal::GradientRequestBus::Events::GetValue, params); + benchmark::DoNotOptimize(value); + } + } + } + } + + void RunEBusGetValuesBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange) + { + AZ_PROFILE_FUNCTION(Entity); + + // Get the height and width ranges for querying from our benchmark parameters + float height = aznumeric_cast(queryRange); + float width = aznumeric_cast(queryRange); + int64_t totalQueryPoints = queryRange * queryRange; + + // Call GetValues() for every height and width in our ranges. + for (auto _ : state) + { + // Set up our vector of query positions. This is done inside the benchmark timing since we're counting the work to create + // each query position in the single GetValue() call benchmarks, and will make the timing more directly comparable. + AZStd::vector positions(totalQueryPoints); + FillQueryPositions(positions, height, width); + + // Query and get the results. + AZStd::vector results(totalQueryPoints); + GradientSignal::GradientRequestBus::Event( + gradientId, &GradientSignal::GradientRequestBus::Events::GetValues, positions, results); + } + } + + void RunSamplerGetValueBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange) + { + AZ_PROFILE_FUNCTION(Entity); + + // Create a gradient sampler to use for querying our gradient. + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = gradientId; + + // Get the height and width ranges for querying from our benchmark parameters + const float height = aznumeric_cast(queryRange); + const float width = aznumeric_cast(queryRange); + + // Call GetValue() through the GradientSampler for every height and width in our ranges. + for (auto _ : state) + { + for (float y = 0.0f; y < height; y += 1.0f) + { + for (float x = 0.0f; x < width; x += 1.0f) + { + GradientSignal::GradientSampleParams params; + params.m_position = AZ::Vector3(x, y, 0.0f); + float value = gradientSampler.GetValue(params); + benchmark::DoNotOptimize(value); + } + } + } + } + + void RunSamplerGetValuesBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange) + { + AZ_PROFILE_FUNCTION(Entity); + + // Create a gradient sampler to use for querying our gradient. + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = gradientId; + + // Get the height and width ranges for querying from our benchmark parameters + const float height = aznumeric_cast(queryRange); + const float width = aznumeric_cast(queryRange); + const int64_t totalQueryPoints = queryRange * queryRange; + + // Call GetValues() through the GradientSampler for every height and width in our ranges. + for (auto _ : state) + { + // Set up our vector of query positions. This is done inside the benchmark timing since we're counting the work to create + // each query position in the single GetValue() call benchmarks, and will make the timing more directly comparable. + AZStd::vector positions(totalQueryPoints); + FillQueryPositions(positions, height, width); + + // Query and get the results. + AZStd::vector results(totalQueryPoints); + gradientSampler.GetValues(positions, results); + } + } + + void RunGetValueOrGetValuesBenchmark(benchmark::State& state, const AZ::EntityId& gradientId) + { + switch (state.range(0)) + { + case GetValuePermutation::EBUS_GET_VALUE: + RunEBusGetValueBenchmark(state, gradientId, state.range(1)); + break; + case GetValuePermutation::EBUS_GET_VALUES: + RunEBusGetValuesBenchmark(state, gradientId, state.range(1)); + break; + case GetValuePermutation::SAMPLER_GET_VALUE: + RunSamplerGetValueBenchmark(state, gradientId, state.range(1)); + break; + case GetValuePermutation::SAMPLER_GET_VALUES: + RunSamplerGetValuesBenchmark(state, gradientId, state.range(1)); + break; + default: + AZ_Assert(false, "Benchmark permutation type not supported."); + } + } + }; + +// Because there's no good way to label different enums in the output results (they just appear as integer values), we work around it by +// registering one set of benchmark runs for each enum value and use ArgNames() to give it a friendly name in the results. +#define GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(Fixture, Func) \ + BENCHMARK_REGISTER_F(Fixture, Func) \ + ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUE, 1024 }) \ + ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUE, 2048 }) \ + ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUE, 4096 }) \ + ->ArgNames({ "EbusGetValue", "size" }) \ + ->Unit(::benchmark::kMillisecond); \ + BENCHMARK_REGISTER_F(Fixture, Func) \ + ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUES, 1024 }) \ + ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUES, 2048 }) \ + ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUES, 4096 }) \ + ->ArgNames({ "EbusGetValues", "size" }) \ + ->Unit(::benchmark::kMillisecond); \ + BENCHMARK_REGISTER_F(Fixture, Func) \ + ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUE, 1024 }) \ + ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUE, 2048 }) \ + ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUE, 4096 }) \ + ->ArgNames({ "SamplerGetValue", "size" }) \ + ->Unit(::benchmark::kMillisecond); \ + BENCHMARK_REGISTER_F(Fixture, Func) \ + ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUES, 1024 }) \ + ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUES, 2048 }) \ + ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUES, 4096 }) \ + ->ArgNames({ "SamplerGetValues", "size" }) \ ->Unit(::benchmark::kMillisecond); - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientEBusGetValues)(benchmark::State& state) + // -------------------------------------------------------------------------------------- + // Base Gradients + + BENCHMARK_DEFINE_F(GradientGetValues, BM_ConstantGradient)(benchmark::State& state) { - CreateTestImageGradient(m_testEntity.get()); - RunEBusGetValuesBenchmark(state); + auto entity = BuildTestConstantGradient(TestShapeHalfBounds); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientEBusGetValues) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); - - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientSamplerGetValue)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_ImageGradient)(benchmark::State& state) { - CreateTestImageGradient(m_testEntity.get()); - RunSamplerGetValueBenchmark(state); + auto entity = BuildTestImageGradient(TestShapeHalfBounds); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientSamplerGetValue) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientSamplerGetValues)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_PerlinGradient)(benchmark::State& state) { - CreateTestImageGradient(m_testEntity.get()); - RunSamplerGetValuesBenchmark(state); + auto entity = BuildTestPerlinGradient(TestShapeHalfBounds); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientSamplerGetValues) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); - - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientEBusGetValue)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_RandomGradient)(benchmark::State& state) { - CreateTestPerlinGradient(m_testEntity.get()); - RunEBusGetValueBenchmark(state); + auto entity = BuildTestRandomGradient(TestShapeHalfBounds); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientEBusGetValue) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); - - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientEBusGetValues)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_ShapeAreaFalloffGradient)(benchmark::State& state) { - CreateTestPerlinGradient(m_testEntity.get()); - RunEBusGetValuesBenchmark(state); + auto entity = BuildTestShapeAreaFalloffGradient(TestShapeHalfBounds); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientEBusGetValues) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_ConstantGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_ImageGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_PerlinGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_RandomGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_ShapeAreaFalloffGradient); + + // -------------------------------------------------------------------------------------- + // Gradient Modifiers - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientSamplerGetValue)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_DitherGradient)(benchmark::State& state) { - CreateTestPerlinGradient(m_testEntity.get()); - RunSamplerGetValueBenchmark(state); + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestDitherGradient(TestShapeHalfBounds, baseEntity->GetId()); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientSamplerGetValue) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); - - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientSamplerGetValues)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_InvertGradient)(benchmark::State& state) { - CreateTestPerlinGradient(m_testEntity.get()); - RunSamplerGetValuesBenchmark(state); + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestDitherGradient(TestShapeHalfBounds, baseEntity->GetId()); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientSamplerGetValues) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(GradientGetValues, BM_LevelsGradient)(benchmark::State& state) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestLevelsGradient(TestShapeHalfBounds, baseEntity->GetId()); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + } - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientEBusGetValue)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_MixedGradient)(benchmark::State& state) { - CreateTestRandomGradient(m_testEntity.get()); - RunEBusGetValueBenchmark(state); + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto mixedEntity = BuildTestConstantGradient(TestShapeHalfBounds); + auto entity = BuildTestMixedGradient(TestShapeHalfBounds, baseEntity->GetId(), mixedEntity->GetId()); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientEBusGetValue) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(GradientGetValues, BM_PosterizeGradient)(benchmark::State& state) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestPosterizeGradient(TestShapeHalfBounds, baseEntity->GetId()); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + } - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientEBusGetValues)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_ReferenceGradient)(benchmark::State& state) { - CreateTestRandomGradient(m_testEntity.get()); - RunEBusGetValuesBenchmark(state); + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestReferenceGradient(TestShapeHalfBounds, baseEntity->GetId()); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientEBusGetValues) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(GradientGetValues, BM_SmoothStepGradient)(benchmark::State& state) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestSmoothStepGradient(TestShapeHalfBounds, baseEntity->GetId()); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + } - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientSamplerGetValue)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_ThresholdGradient)(benchmark::State& state) { - CreateTestRandomGradient(m_testEntity.get()); - RunSamplerGetValueBenchmark(state); + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestThresholdGradient(TestShapeHalfBounds, baseEntity->GetId()); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientSamplerGetValue) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_DitherGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_InvertGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_LevelsGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_MixedGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_PosterizeGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_ReferenceGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_SmoothStepGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_ThresholdGradient); + + // -------------------------------------------------------------------------------------- + // Surface Gradients - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientSamplerGetValues)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_SurfaceAltitudeGradient)(benchmark::State& state) { - CreateTestRandomGradient(m_testEntity.get()); - RunSamplerGetValuesBenchmark(state); + auto mockSurfaceDataSystem = + CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); + + auto entity = BuildTestSurfaceAltitudeGradient(TestShapeHalfBounds); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientSamplerGetValues) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(GradientGetValues, BM_SurfaceMaskGradient)(benchmark::State& state) + { + auto mockSurfaceDataSystem = + CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); -#endif + auto entity = BuildTestSurfaceMaskGradient(TestShapeHalfBounds); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + } + BENCHMARK_DEFINE_F(GradientGetValues, BM_SurfaceSlopeGradient)(benchmark::State& state) + { + auto mockSurfaceDataSystem = + CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); + auto entity = BuildTestSurfaceSlopeGradient(TestShapeHalfBounds); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + } + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_SurfaceAltitudeGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_SurfaceMaskGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_SurfaceSlopeGradient); +#endif } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp new file mode 100644 index 0000000000..5504fa5b45 --- /dev/null +++ b/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp @@ -0,0 +1,182 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + + +#include +#include + +namespace UnitTest +{ + struct GradientSignalGetValuesTestsFixture + : public GradientSignalTest + { + // Create an arbitrary size shape for comparing values within. It should be large enough that we detect any value anomalies + // but small enough that the tests run quickly. + const float TestShapeHalfBounds = 128.0f; + + void CompareGetValueAndGetValues(AZ::EntityId gradientEntityId) + { + // Create a gradient sampler and run through a series of points to see if they match expectations. + + const AZ::Aabb queryRegion = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds)); + const AZ::Vector2 stepSize(1.0f, 1.0f); + + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = gradientEntityId; + + const size_t numSamplesX = aznumeric_cast(ceil(queryRegion.GetExtents().GetX() / stepSize.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(queryRegion.GetExtents().GetY() / stepSize.GetY())); + + // Build up the list of positions to query. + AZStd::vector positions(numSamplesX * numSamplesY); + size_t index = 0; + for (size_t yIndex = 0; yIndex < numSamplesY; yIndex++) + { + float y = queryRegion.GetMin().GetY() + (stepSize.GetY() * yIndex); + for (size_t xIndex = 0; xIndex < numSamplesX; xIndex++) + { + float x = queryRegion.GetMin().GetX() + (stepSize.GetX() * xIndex); + positions[index++] = AZ::Vector3(x, y, 0.0f); + } + } + + // Get the results from GetValues + AZStd::vector results(numSamplesX * numSamplesY); + gradientSampler.GetValues(positions, results); + + // For each position, call GetValue and verify that the values match. + for (size_t positionIndex = 0; positionIndex < positions.size(); positionIndex++) + { + GradientSignal::GradientSampleParams params; + params.m_position = positions[positionIndex]; + float value = gradientSampler.GetValue(params); + + // We use ASSERT_EQ instead of EXPECT_EQ because if one value doesn't match, they probably all won't, so there's no reason + // to keep running and printing failures for every value. + ASSERT_EQ(value, results[positionIndex]); + } + } + }; + + TEST_F(GradientSignalGetValuesTestsFixture, ImageGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto entity = BuildTestImageGradient(TestShapeHalfBounds); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, PerlinGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto entity = BuildTestPerlinGradient(TestShapeHalfBounds); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, RandomGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto entity = BuildTestRandomGradient(TestShapeHalfBounds); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, ConstantGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto entity = BuildTestConstantGradient(TestShapeHalfBounds); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, ShapeAreaFalloffGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto entity = BuildTestShapeAreaFalloffGradient(TestShapeHalfBounds); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, DitherGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + + auto entity = BuildTestDitherGradient(TestShapeHalfBounds, baseEntity->GetId()); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, InvertGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestInvertGradient(TestShapeHalfBounds, baseEntity->GetId()); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, LevelsGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestLevelsGradient(TestShapeHalfBounds, baseEntity->GetId()); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, MixedGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto mixedEntity = BuildTestConstantGradient(TestShapeHalfBounds); + auto entity = BuildTestMixedGradient(TestShapeHalfBounds, baseEntity->GetId(), mixedEntity->GetId()); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, PosterizeGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestPosterizeGradient(TestShapeHalfBounds, baseEntity->GetId()); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, ReferenceGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestReferenceGradient(TestShapeHalfBounds, baseEntity->GetId()); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, SmoothStepGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestSmoothStepGradient(TestShapeHalfBounds, baseEntity->GetId()); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, ThresholdGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestThresholdGradient(TestShapeHalfBounds, baseEntity->GetId()); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, SurfaceAltitudeGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto mockSurfaceDataSystem = + CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); + + auto entity = BuildTestSurfaceAltitudeGradient(TestShapeHalfBounds); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, SurfaceMaskGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto mockSurfaceDataSystem = + CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); + + auto entity = BuildTestSurfaceMaskGradient(TestShapeHalfBounds); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, SurfaceSlopeGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto mockSurfaceDataSystem = + CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); + + auto entity = BuildTestSurfaceSlopeGradient(TestShapeHalfBounds); + CompareGetValueAndGetValues(entity->GetId()); + } +} + + diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp index e99bf1de5b..5cd3c7edf6 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp @@ -417,7 +417,6 @@ namespace UnitTest TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); } } - } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp index 32cd483c81..cc91c58fce 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp @@ -371,12 +371,9 @@ namespace UnitTest const AZ::EntityId id = mockReference->GetId(); MockGradientArrayRequestsBus mockGradientRequestsBus(id, inputData, dataSize); - GradientSignal::ReferenceGradientConfig config; - config.m_gradientSampler.m_gradientId = mockReference->GetId(); - - auto entity = CreateEntity(); - CreateComponent(entity.get(), config); - ActivateEntity(entity.get()); + // Create a reference gradient with an arbitrary box shape on it. + const float HalfBounds = 64.0f; + auto entity = BuildTestReferenceGradient(HalfBounds, mockReference->GetId()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); } @@ -385,10 +382,9 @@ namespace UnitTest { // Verify that gradient references can validate and disconnect cyclic connections - auto constantGradientEntity = CreateEntity(); - GradientSignal::ConstantGradientConfig constantGradientConfig; - CreateComponent(constantGradientEntity.get(), constantGradientConfig); - ActivateEntity(constantGradientEntity.get()); + // Create a constant gradient with an arbitrary box shape on it. + const float HalfBounds = 64.0f; + auto constantGradientEntity = BuildTestConstantGradient(HalfBounds); // Verify cyclic reference test passes when pointing to gradient generator entity auto referenceGradientEntity1 = CreateEntity(); diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp index dd81c14a09..ec770f038d 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp @@ -212,12 +212,9 @@ namespace UnitTest const AZ::EntityId id = entityMock->GetId(); UnitTest::MockGradientArrayRequestsBus mockGradientRequestsBus(id, inputData, dataSize); - GradientSignal::InvertGradientConfig config; - config.m_gradientSampler.m_gradientId = entityMock->GetId(); - - auto entity = CreateEntity(); - CreateComponent(entity.get(), config); - ActivateEntity(entity.get()); + // Create the entity with an arbitrarily-sized box. + const float HalfBounds = 64.0f; + auto entity = BuildTestInvertGradient(HalfBounds, entityMock->GetId()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp index 77568d3321..154e9032b2 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp @@ -9,10 +9,30 @@ #include +#include #include + +// Base gradient components +#include #include #include #include +#include + +// Gradient modifier components +#include +#include +#include +#include +#include +#include +#include +#include + +// Gradient surface data components +#include +#include +#include namespace UnitTest { @@ -32,12 +52,18 @@ namespace UnitTest AZ::Data::AssetManager::Create(desc); m_mockHandler = new ImageAssetMockAssetHandler(); AZ::Data::AssetManager::Instance().RegisterHandler(m_mockHandler, azrtti_typeid()); + + m_mockShapeHandlers = new AZStd::vector>>(); } void GradientSignalBaseFixture::TearDownCoreSystems() { + // Clear any mock shape handlers that we've created for our test entities. + delete m_mockShapeHandlers; + AZ::Data::AssetManager::Instance().UnregisterHandler(m_mockHandler); delete m_mockHandler; // delete after removing from the asset manager + AzFramework::LegacyAssetEventBus::ClearQueuedEvents(); AZ::Data::AssetManager::Destroy(); AZ::AllocatorInstance::Destroy(); @@ -47,229 +73,357 @@ namespace UnitTest m_systemEntity = nullptr; } - void GradientSignalTest::TestFixedDataSampler(const AZStd::vector& expectedOutput, int size, AZ::EntityId gradientEntityId) + AZStd::unique_ptr> GradientSignalBaseFixture::CreateMockShape( + const AZ::Aabb& spawnerBox, const AZ::EntityId& shapeEntityId) { - GradientSignal::GradientSampler gradientSampler; - gradientSampler.m_gradientId = gradientEntityId; + AZStd::unique_ptr> mockShape = + AZStd::make_unique>(shapeEntityId); - for (int y = 0; y < size; ++y) - { - for (int x = 0; x < size; ++x) - { - GradientSignal::GradientSampleParams params; - params.m_position = AZ::Vector3(static_cast(x), static_cast(y), 0.0f); + ON_CALL(*mockShape, GetEncompassingAabb).WillByDefault(testing::Return(spawnerBox)); + ON_CALL(*mockShape, GetTransformAndLocalBounds) + .WillByDefault( + [spawnerBox](AZ::Transform& transform, AZ::Aabb& bounds) + { + transform = AZ::Transform::CreateTranslation(spawnerBox.GetCenter()); + bounds = spawnerBox.GetTranslated(-spawnerBox.GetCenter()); + }); + ON_CALL(*mockShape, IsPointInside) + .WillByDefault( + [spawnerBox](const AZ::Vector3& point) -> bool + { + return spawnerBox.Contains(point); + }); - const int index = y * size + x; - float actualValue = gradientSampler.GetValue(params); - float expectedValue = expectedOutput[index]; + return mockShape; + } - EXPECT_NEAR(actualValue, expectedValue, 0.01f); + AZStd::unique_ptr GradientSignalBaseFixture::CreateMockSurfaceDataSystem(const AZ::Aabb& spawnerBox) + { + SurfaceData::SurfacePoint point; + AZStd::unique_ptr mockSurfaceDataSystem = AZStd::make_unique(); + + // Give the mock surface data a bunch of fake point values to return. + for (float y = spawnerBox.GetMin().GetY(); y < spawnerBox.GetMax().GetY(); y+= 1.0f) + { + for (float x = spawnerBox.GetMin().GetX(); x < spawnerBox.GetMax().GetX(); x += 1.0f) + { + // Use our x distance into the spawnerBox as an arbitrary percentage value that we'll use to calculate + // our other arbitrary values below. + float arbitraryPercentage = AZStd::abs(x / spawnerBox.GetExtents().GetX()); + + // Create a position that's between min and max Z of the box. + point.m_position = AZ::Vector3(x, y, AZ::Lerp(spawnerBox.GetMin().GetZ(), spawnerBox.GetMax().GetZ(), arbitraryPercentage)); + // Create an arbitrary normal value. + point.m_normal = point.m_position.GetNormalized(); + // Create an arbitrary surface value. + point.m_masks[AZ_CRC_CE("test_mask")] = arbitraryPercentage; + + mockSurfaceDataSystem->m_GetSurfacePoints[AZStd::make_pair(x, y)] = { { point } }; } } + + return mockSurfaceDataSystem; } -#ifdef HAVE_BENCHMARK - void GradientSignalBenchmarkFixture::CreateTestEntity(float shapeHalfBounds) + AZStd::unique_ptr GradientSignalBaseFixture::CreateTestEntity(float shapeHalfBounds) { // Create the base entity - m_testEntity = CreateEntity(); + AZStd::unique_ptr testEntity = CreateEntity(); // Create a mock Shape component that describes the bounds that we're using to map our gradient into world space. - CreateComponent(m_testEntity.get()); - MockShapeComponentHandler mockShapeHandler(m_testEntity->GetId()); - mockShapeHandler.m_GetLocalBounds = AZ::Aabb::CreateCenterRadius(AZ::Vector3(shapeHalfBounds), shapeHalfBounds); - - // Create a mock Transform component that locates our gradient in the center of our desired mock Shape. - MockTransformHandler mockTransformHandler; - mockTransformHandler.m_GetLocalTMOutput = AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds)); - mockTransformHandler.m_GetWorldTMOutput = AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds)); - mockTransformHandler.BusConnect(m_testEntity->GetId()); + CreateComponent(testEntity.get()); + + // Create and keep a reference to a mock shape handler that will respond to shape requests for the mock shape. + auto mockShapeHandler = + CreateMockShape(AZ::Aabb::CreateCenterRadius(AZ::Vector3(shapeHalfBounds), shapeHalfBounds), testEntity->GetId()); + m_mockShapeHandlers->push_back(AZStd::move(mockShapeHandler)); + + // Create a transform that locates our gradient in the center of our desired mock Shape. + auto transform = CreateComponent(testEntity.get()); + transform->SetLocalTM(AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds))); + transform->SetWorldTM(AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds))); + + return testEntity; } - void GradientSignalBenchmarkFixture::DestroyTestEntity() + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestConstantGradient(float shapeHalfBounds) { - m_testEntity.reset(); + // Create a Constant Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::ConstantGradientConfig config; + config.m_value = 0.75f; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; } - void GradientSignalBenchmarkFixture::CreateTestImageGradient(AZ::Entity* entity) + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestImageGradient(float shapeHalfBounds) { - // Create the Image Gradient Component with some default sizes and parameters. + // Create an Image Gradient Component with arbitrary sizes and parameters. + auto entity = CreateTestEntity(shapeHalfBounds); GradientSignal::ImageGradientConfig config; const uint32_t imageSize = 4096; const int32_t imageSeed = 12345; config.m_imageAsset = ImageAssetMockAssetHandler::CreateImageAsset(imageSize, imageSize, imageSeed); config.m_tilingX = 1.0f; config.m_tilingY = 1.0f; - CreateComponent(entity, config); + CreateComponent(entity.get(), config); - // Create the Gradient Transform Component with some default parameters. + // Create a Gradient Transform Component with arbitrary parameters. GradientSignal::GradientTransformConfig gradientTransformConfig; gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(entity, gradientTransformConfig); + CreateComponent(entity.get(), gradientTransformConfig); + + ActivateEntity(entity.get()); + return entity; } - void GradientSignalBenchmarkFixture::CreateTestPerlinGradient(AZ::Entity* entity) + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestPerlinGradient(float shapeHalfBounds) { - // Create the Perlin Gradient Component with some default sizes and parameters. + // Create a Perlin Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); GradientSignal::PerlinGradientConfig config; config.m_amplitude = 1.0f; config.m_frequency = 1.1f; config.m_octave = 4; config.m_randomSeed = 12345; - CreateComponent(entity, config); + CreateComponent(entity.get(), config); - // Create the Gradient Transform Component with some default parameters. + // Create a Gradient Transform Component with arbitrary parameters. GradientSignal::GradientTransformConfig gradientTransformConfig; gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(entity, gradientTransformConfig); + CreateComponent(entity.get(), gradientTransformConfig); + + ActivateEntity(entity.get()); + return entity; } - void GradientSignalBenchmarkFixture::CreateTestRandomGradient(AZ::Entity* entity) + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestRandomGradient(float shapeHalfBounds) { - // Create the Random Gradient Component with some default parameters. + // Create a Random Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); GradientSignal::RandomGradientConfig config; config.m_randomSeed = 12345; - CreateComponent(entity, config); + CreateComponent(entity.get(), config); - // Create the Gradient Transform Component with some default parameters. + // Create a Gradient Transform Component with arbitrary parameters. GradientSignal::GradientTransformConfig gradientTransformConfig; gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(entity, gradientTransformConfig); + CreateComponent(entity.get(), gradientTransformConfig); + + ActivateEntity(entity.get()); + return entity; } - void GradientSignalBenchmarkFixture::RunSamplerGetValueBenchmark(benchmark::State& state) + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestShapeAreaFalloffGradient(float shapeHalfBounds) { - AZ_PROFILE_FUNCTION(Entity); - - // All components are created, so activate the entity - ActivateEntity(m_testEntity.get()); + // Create a Shape Area Falloff Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::ShapeAreaFalloffGradientConfig config; + config.m_shapeEntityId = entity->GetId(); + config.m_falloffWidth = 16.0f; + config.m_falloffType = GradientSignal::FalloffType::InnerOuter; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } - // Create a gradient sampler and run through a series of points to see if they match expectations. - GradientSignal::GradientSampler gradientSampler; - gradientSampler.m_gradientId = m_testEntity->GetId(); + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestDitherGradient( + float shapeHalfBounds, const AZ::EntityId& inputGradientId) + { + // Create a Dither Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::DitherGradientConfig config; + config.m_gradientSampler.m_gradientId = inputGradientId; + config.m_useSystemPointsPerUnit = false; + config.m_pointsPerUnit = 1.0f; + config.m_patternOffset = AZ::Vector3::CreateZero(); + config.m_patternType = GradientSignal::DitherGradientConfig::BayerPatternType::PATTERN_SIZE_4x4; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } - // Get the height and width ranges for querying from our benchmark parameters - float height = aznumeric_cast(state.range(0)); - float width = aznumeric_cast(state.range(1)); + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestInvertGradient( + float shapeHalfBounds, const AZ::EntityId& inputGradientId) + { + // Create an Invert Gradient Component. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::InvertGradientConfig config; + config.m_gradientSampler.m_gradientId = inputGradientId; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } - // Call GetValue() for every height and width in our ranges. - for (auto _ : state) - { - for (float y = 0.0f; y < height; y += 1.0f) - { - for (float x = 0.0f; x < width; x += 1.0f) - { - GradientSignal::GradientSampleParams params; - params.m_position = AZ::Vector3(x, y, 0.0f); - float value = gradientSampler.GetValue(params); - benchmark::DoNotOptimize(value); - } - } - } + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestLevelsGradient( + float shapeHalfBounds, const AZ::EntityId& inputGradientId) + { + // Create a Levels Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::LevelsGradientConfig config; + config.m_gradientSampler.m_gradientId = inputGradientId; + config.m_inputMin = 0.1f; + config.m_inputMid = 0.3f; + config.m_inputMax = 0.9f; + config.m_outputMin = 0.0f; + config.m_outputMax = 1.0f; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; } - void GradientSignalBenchmarkFixture::RunSamplerGetValuesBenchmark(benchmark::State& state) + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestMixedGradient( + float shapeHalfBounds, const AZ::EntityId& baseGradientId, const AZ::EntityId& mixedGradientId) { - AZ_PROFILE_FUNCTION(Entity); + // Create a Mixed Gradient Component that mixes two input gradients together in arbitrary ways. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::MixedGradientConfig config; - // All components are created, so activate the entity - ActivateEntity(m_testEntity.get()); + GradientSignal::MixedGradientLayer layer; + layer.m_enabled = true; - // Create a gradient sampler and run through a series of points to see if they match expectations. - GradientSignal::GradientSampler gradientSampler; - gradientSampler.m_gradientId = m_testEntity->GetId(); + layer.m_operation = GradientSignal::MixedGradientLayer::MixingOperation::Initialize; + layer.m_gradientSampler.m_gradientId = baseGradientId; + layer.m_gradientSampler.m_opacity = 1.0f; + config.m_layers.push_back(layer); - // Get the height and width ranges for querying from our benchmark parameters - float height = aznumeric_cast(state.range(0)); - float width = aznumeric_cast(state.range(1)); - int64_t totalQueryPoints = state.range(0) * state.range(1); + layer.m_operation = GradientSignal::MixedGradientLayer::MixingOperation::Overlay; + layer.m_gradientSampler.m_gradientId = mixedGradientId; + layer.m_gradientSampler.m_opacity = 0.75f; + config.m_layers.push_back(layer); - // Call GetValues() for every height and width in our ranges. - for (auto _ : state) - { - // Set up our vector of query positions. - AZStd::vector positions(totalQueryPoints); - size_t index = 0; - for (float y = 0.0f; y < height; y += 1.0f) - { - for (float x = 0.0f; x < width; x += 1.0f) - { - positions[index++] = AZ::Vector3(x, y, 0.0f); - } - } + CreateComponent(entity.get(), config); - // Query and get the results. - AZStd::vector results(totalQueryPoints); - gradientSampler.GetValues(positions, results); - } + ActivateEntity(entity.get()); + return entity; } - void GradientSignalBenchmarkFixture::RunEBusGetValueBenchmark(benchmark::State& state) + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestPosterizeGradient( + float shapeHalfBounds, const AZ::EntityId& inputGradientId) { - AZ_PROFILE_FUNCTION(Entity); + // Create a Posterize Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::PosterizeGradientConfig config; + config.m_gradientSampler.m_gradientId = inputGradientId; + config.m_mode = GradientSignal::PosterizeGradientConfig::ModeType::Ps; + config.m_bands = 5; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } - // All components are created, so activate the entity - ActivateEntity(m_testEntity.get()); + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestReferenceGradient( + float shapeHalfBounds, const AZ::EntityId& inputGradientId) + { + // Create a Reference Gradient Component. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::ReferenceGradientConfig config; + config.m_gradientSampler.m_gradientId = inputGradientId; + config.m_gradientSampler.m_ownerEntityId = entity->GetId(); + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } - GradientSignal::GradientSampleParams params; + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestSmoothStepGradient( + float shapeHalfBounds, const AZ::EntityId& inputGradientId) + { + // Create a Smooth Step Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::SmoothStepGradientConfig config; + config.m_gradientSampler.m_gradientId = inputGradientId; + config.m_smoothStep.m_falloffMidpoint = 0.75f; + config.m_smoothStep.m_falloffRange = 0.125f; + config.m_smoothStep.m_falloffStrength = 0.25f; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } - // Get the height and width ranges for querying from our benchmark parameters - float height = aznumeric_cast(state.range(0)); - float width = aznumeric_cast(state.range(1)); + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestThresholdGradient( + float shapeHalfBounds, const AZ::EntityId& inputGradientId) + { + // Create a Threshold Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::ThresholdGradientConfig config; + config.m_gradientSampler.m_gradientId = inputGradientId; + config.m_threshold = 0.75f; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } - // Call GetValue() for every height and width in our ranges. - for (auto _ : state) - { - for (float y = 0.0f; y < height; y += 1.0f) - { - for (float x = 0.0f; x < width; x += 1.0f) - { - float value = 0.0f; - params.m_position = AZ::Vector3(x, y, 0.0f); - GradientSignal::GradientRequestBus::EventResult( - value, m_testEntity->GetId(), &GradientSignal::GradientRequestBus::Events::GetValue, params); - benchmark::DoNotOptimize(value); - } - } - } + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestSurfaceAltitudeGradient(float shapeHalfBounds) + { + // Create a Surface Altitude Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::SurfaceAltitudeGradientConfig config; + config.m_altitudeMin = -5.0f; + config.m_altitudeMax = 15.0f; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; } - void GradientSignalBenchmarkFixture::RunEBusGetValuesBenchmark(benchmark::State& state) + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestSurfaceMaskGradient(float shapeHalfBounds) { - AZ_PROFILE_FUNCTION(Entity); + // Create a Surface Mask Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::SurfaceMaskGradientConfig config; + config.m_surfaceTagList.push_back(AZ_CRC_CE("test_mask")); + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } - // All components are created, so activate the entity - ActivateEntity(m_testEntity.get()); + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestSurfaceSlopeGradient(float shapeHalfBounds) + { + // Create a Surface Slope Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::SurfaceSlopeGradientConfig config; + config.m_slopeMin = 5.0f; + config.m_slopeMax = 50.0f; + config.m_rampType = GradientSignal::SurfaceSlopeGradientConfig::RampType::SMOOTH_STEP; + config.m_smoothStep.m_falloffMidpoint = 0.75f; + config.m_smoothStep.m_falloffRange = 0.125f; + config.m_smoothStep.m_falloffStrength = 0.25f; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } + void GradientSignalTest::TestFixedDataSampler(const AZStd::vector& expectedOutput, int size, AZ::EntityId gradientEntityId) + { GradientSignal::GradientSampler gradientSampler; - gradientSampler.m_gradientId = m_testEntity->GetId(); - - // Get the height and width ranges for querying from our benchmark parameters - float height = aznumeric_cast(state.range(0)); - float width = aznumeric_cast(state.range(1)); - int64_t totalQueryPoints = state.range(0) * state.range(1); + gradientSampler.m_gradientId = gradientEntityId; - // Call GetValues() for every height and width in our ranges. - for (auto _ : state) + for (int y = 0; y < size; ++y) { - // Set up our vector of query positions. - AZStd::vector positions(totalQueryPoints); - size_t index = 0; - for (float y = 0.0f; y < height; y += 1.0f) + for (int x = 0; x < size; ++x) { - for (float x = 0.0f; x < width; x += 1.0f) - { - positions[index++] = AZ::Vector3(x, y, 0.0f); - } - } + GradientSignal::GradientSampleParams params; + params.m_position = AZ::Vector3(static_cast(x), static_cast(y), 0.0f); + + const int index = y * size + x; + float actualValue = gradientSampler.GetValue(params); + float expectedValue = expectedOutput[index]; - // Query and get the results. - AZStd::vector results(totalQueryPoints); - GradientSignal::GradientRequestBus::Event( - m_testEntity->GetId(), &GradientSignal::GradientRequestBus::Events::GetValues, positions, results); + EXPECT_NEAR(actualValue, expectedValue, 0.01f); + } } } -#endif - } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h index 13ff69c82d..478f1c1d92 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h @@ -8,6 +8,7 @@ #pragma once #include +#include namespace UnitTest { @@ -30,22 +31,56 @@ namespace UnitTest } template - AZ::Component* CreateComponent(AZ::Entity* entity, const Configuration& config) + Component* CreateComponent(AZ::Entity* entity, const Configuration& config) { m_app->RegisterComponentDescriptor(Component::CreateDescriptor()); return entity->CreateComponent(config); } template - AZ::Component* CreateComponent(AZ::Entity* entity) + Component* CreateComponent(AZ::Entity* entity) { m_app->RegisterComponentDescriptor(Component::CreateDescriptor()); return entity->CreateComponent(); } + // Create a mock shape that will respond to the shape bus with proper responses for the given input box. + AZStd::unique_ptr> CreateMockShape( + const AZ::Aabb& spawnerBox, const AZ::EntityId& shapeEntityId); + + // Create a mock SurfaceDataSystem that will respond to requests for surface points with mock responses for points inside + // the given input box. + AZStd::unique_ptr CreateMockSurfaceDataSystem(const AZ::Aabb& spawnerBox); + + // Create an entity with a mock shape and a transform. It won't be activated yet though, because we expect a gradient component + // to also get added to it first before activation. + AZStd::unique_ptr CreateTestEntity(float shapeHalfBounds); + + // Create and activate an entity with a gradient component of the requested type, initialized with test data. + AZStd::unique_ptr BuildTestConstantGradient(float shapeHalfBounds); + AZStd::unique_ptr BuildTestImageGradient(float shapeHalfBounds); + AZStd::unique_ptr BuildTestPerlinGradient(float shapeHalfBounds); + AZStd::unique_ptr BuildTestRandomGradient(float shapeHalfBounds); + AZStd::unique_ptr BuildTestShapeAreaFalloffGradient(float shapeHalfBounds); + + AZStd::unique_ptr BuildTestDitherGradient(float shapeHalfBounds, const AZ::EntityId& inputGradientId); + AZStd::unique_ptr BuildTestInvertGradient(float shapeHalfBounds, const AZ::EntityId& inputGradientId); + AZStd::unique_ptr BuildTestLevelsGradient(float shapeHalfBounds, const AZ::EntityId& inputGradientId); + AZStd::unique_ptr BuildTestMixedGradient( + float shapeHalfBounds, const AZ::EntityId& baseGradientId, const AZ::EntityId& mixedGradientId); + AZStd::unique_ptr BuildTestPosterizeGradient(float shapeHalfBounds, const AZ::EntityId& inputGradientId); + AZStd::unique_ptr BuildTestReferenceGradient(float shapeHalfBounds, const AZ::EntityId& inputGradientId); + AZStd::unique_ptr BuildTestSmoothStepGradient(float shapeHalfBounds, const AZ::EntityId& inputGradientId); + AZStd::unique_ptr BuildTestThresholdGradient(float shapeHalfBounds, const AZ::EntityId& inputGradientId); + + AZStd::unique_ptr BuildTestSurfaceAltitudeGradient(float shapeHalfBounds); + AZStd::unique_ptr BuildTestSurfaceMaskGradient(float shapeHalfBounds); + AZStd::unique_ptr BuildTestSurfaceSlopeGradient(float shapeHalfBounds); + AZStd::unique_ptr m_app; AZ::Entity* m_systemEntity = nullptr; ImageAssetMockAssetHandler* m_mockHandler = nullptr; + AZStd::vector>>* m_mockShapeHandlers = nullptr; }; struct GradientSignalTest @@ -80,33 +115,15 @@ namespace UnitTest AZ::Debug::TraceMessageBus::Handler::BusConnect(); UnitTest::AllocatorsBenchmarkFixture::SetUp(state); SetupCoreSystems(); - - // Create a default test entity with bounds of 256 m x 256 m x 256 m. - const float shapeHalfBounds = 128.0f; - CreateTestEntity(shapeHalfBounds); } void internalTearDown(const benchmark::State& state) { - DestroyTestEntity(); TearDownCoreSystems(); UnitTest::AllocatorsBenchmarkFixture::TearDown(state); AZ::Debug::TraceMessageBus::Handler::BusDisconnect(); } - void CreateTestEntity(float shapeHalfBounds); - void DestroyTestEntity(); - - void CreateTestImageGradient(AZ::Entity* entity); - void CreateTestPerlinGradient(AZ::Entity* entity); - void CreateTestRandomGradient(AZ::Entity* entity); - - void RunSamplerGetValueBenchmark(benchmark::State& state); - void RunSamplerGetValuesBenchmark(benchmark::State& state); - - void RunEBusGetValueBenchmark(benchmark::State& state); - void RunEBusGetValuesBenchmark(benchmark::State& state); - protected: void SetUp(const benchmark::State& state) override { @@ -125,8 +142,6 @@ namespace UnitTest { internalTearDown(state); } - - AZStd::unique_ptr m_testEntity; }; #endif } diff --git a/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake b/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake index eb799811b7..814347c395 100644 --- a/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake @@ -8,6 +8,7 @@ set(FILES Tests/GradientSignalBenchmarks.cpp + Tests/GradientSignalGetValuesTests.cpp Tests/GradientSignalImageTests.cpp Tests/GradientSignalReferencesTests.cpp Tests/GradientSignalServicesTests.cpp diff --git a/Gems/LmbrCentral/Code/Source/Shape/ReferenceShapeComponent.cpp b/Gems/LmbrCentral/Code/Source/Shape/ReferenceShapeComponent.cpp index 7ed79fe3a3..1fc4bb5107 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/ReferenceShapeComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/ReferenceShapeComponent.cpp @@ -190,7 +190,7 @@ namespace LmbrCentral { AZ::Crc32 result = {}; - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Shape", !m_isRequestInProgress, "Detected cyclic dependencies with shape entity references"); if (AllowRequest()) { m_isRequestInProgress = true; @@ -205,7 +205,7 @@ namespace LmbrCentral { AZ::Aabb result = AZ::Aabb::CreateNull(); - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Shape", !m_isRequestInProgress, "Detected cyclic dependencies with shape entity references"); if (AllowRequest()) { m_isRequestInProgress = true; @@ -221,7 +221,7 @@ namespace LmbrCentral transform = AZ::Transform::CreateIdentity(); bounds = AZ::Aabb::CreateNull(); - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Shape", !m_isRequestInProgress, "Detected cyclic dependencies with shape entity references"); if (AllowRequest()) { m_isRequestInProgress = true; @@ -234,7 +234,7 @@ namespace LmbrCentral { bool result = false; - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Shape", !m_isRequestInProgress, "Detected cyclic dependencies with shape entity references"); if (AllowRequest()) { m_isRequestInProgress = true; @@ -249,7 +249,7 @@ namespace LmbrCentral { float result = FLT_MAX; - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Shape", !m_isRequestInProgress, "Detected cyclic dependencies with shape entity references"); if (AllowRequest()) { m_isRequestInProgress = true; @@ -264,7 +264,7 @@ namespace LmbrCentral { float result = FLT_MAX; - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Shape", !m_isRequestInProgress, "Detected cyclic dependencies with shape entity references"); if (AllowRequest()) { m_isRequestInProgress = true; @@ -279,7 +279,7 @@ namespace LmbrCentral { AZ::Vector3 result = AZ::Vector3::CreateZero(); - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Shape", !m_isRequestInProgress, "Detected cyclic dependencies with shape entity references"); if (AllowRequest()) { m_isRequestInProgress = true; @@ -294,7 +294,7 @@ namespace LmbrCentral { bool result = false; - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Shape", !m_isRequestInProgress, "Detected cyclic dependencies with shape entity references"); if (AllowRequest()) { m_isRequestInProgress = true; diff --git a/Gems/Terrain/Code/Source/Components/TerrainHeightGradientListComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainHeightGradientListComponent.cpp index 108ae70632..b9055375d4 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainHeightGradientListComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainHeightGradientListComponent.cpp @@ -160,7 +160,7 @@ namespace Terrain { float maxSample = 0.0f; terrainExists = false; - AZ_WarningOnce("Terrain", !m_isRequestInProgress, "Detected cyclic dependences with terrain height entity references"); + AZ_WarningOnce("Terrain", !m_isRequestInProgress, "Detected cyclic dependencies with terrain height entity references"); if (!m_isRequestInProgress) { m_isRequestInProgress = true; diff --git a/Gems/Vegetation/Code/Source/Components/AreaBlenderComponent.cpp b/Gems/Vegetation/Code/Source/Components/AreaBlenderComponent.cpp index 8bf48de58e..2025ed059f 100644 --- a/Gems/Vegetation/Code/Source/Components/AreaBlenderComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/AreaBlenderComponent.cpp @@ -224,7 +224,7 @@ namespace Vegetation bool result = true; - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependencies with vegetation entity references"); if (!m_isRequestInProgress) { m_isRequestInProgress = true; @@ -264,7 +264,7 @@ namespace Vegetation return; } - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependencies with vegetation entity references"); if (!m_isRequestInProgress) { m_isRequestInProgress = true; @@ -295,7 +295,7 @@ namespace Vegetation { AZ_PROFILE_FUNCTION(Entity); - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependencies with vegetation entity references"); if (!m_isRequestInProgress) { m_isRequestInProgress = true; @@ -320,7 +320,7 @@ namespace Vegetation LmbrCentral::ShapeComponentRequestsBus::EventResult(bounds, GetEntityId(), &LmbrCentral::ShapeComponentRequestsBus::Events::GetEncompassingAabb); } - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependencies with vegetation entity references"); if (!m_isRequestInProgress) { m_isRequestInProgress = true; @@ -344,7 +344,7 @@ namespace Vegetation AZ::u32 count = 0; - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependencies with vegetation entity references"); if (!m_isRequestInProgress) { m_isRequestInProgress = true; From a690c76ad4716233f726f60277f72636eebaf295 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Wed, 12 Jan 2022 08:54:22 -0800 Subject: [PATCH 360/399] Fixed depth clipping artifacts for parallax PDO. (#6837) The "precise" keyword was recently added to several shader inputs, but one was missed. This led to inconsistency between the depth and forward passes which resulted in artifacts when parallax pixel depth offset was in use. See https://github.com/o3de/o3de/pull/6536 Testing: I used AtomSampleViewer to make a local baseline of all screenshots in _fulltestsuite_.bv.lua. The only change was to the parallax test cases, which were a clear improvement. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl index 264542cd0a..04fd104407 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl @@ -63,7 +63,7 @@ VSDepthOutput MainVS(VSInput IN) struct PSDepthOutput { - float m_depth : SV_Depth; + precise float m_depth : SV_Depth; }; PSDepthOutput MainPS(VSDepthOutput IN, bool isFrontFace : SV_IsFrontFace) From e31fa88c0093219fd3db6bda1918f88d572ebd46 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 12 Jan 2022 11:13:40 -0600 Subject: [PATCH 361/399] Removed unused legacy show icons option Signed-off-by: Chris Galvan --- .../EditorPreferencesPageViewportGeneral.cpp | 10 -- .../EditorPreferencesPageViewportGeneral.h | 2 - Code/Editor/EditorViewportWidget.cpp | 2 - Code/Editor/Objects/BaseObject.cpp | 151 ------------------ Code/Editor/Objects/BaseObject.h | 10 -- .../Objects/ComponentEntityObject.cpp | 91 ----------- .../Objects/ComponentEntityObject.h | 2 - Code/Editor/Settings.cpp | 7 - Code/Editor/Settings.h | 7 - 9 files changed, 282 deletions(-) diff --git a/Code/Editor/EditorPreferencesPageViewportGeneral.cpp b/Code/Editor/EditorPreferencesPageViewportGeneral.cpp index 77560e24f8..f33cc3f725 100644 --- a/Code/Editor/EditorPreferencesPageViewportGeneral.cpp +++ b/Code/Editor/EditorPreferencesPageViewportGeneral.cpp @@ -41,8 +41,6 @@ void CEditorPreferencesPage_ViewportGeneral::Reflect(AZ::SerializeContext& seria ->Field("ShowBBoxes", &Display::m_showBBoxes) ->Field("DrawEntityLabels", &Display::m_drawEntityLabels) ->Field("ShowTriggerBounds", &Display::m_showTriggerBounds) - ->Field("ShowIcons", &Display::m_showIcons) - ->Field("DistanceScaleIcons", &Display::m_distanceScaleIcons) ->Field("ShowFrozenHelpers", &Display::m_showFrozenHelpers) ->Field("FillSelectedShapes", &Display::m_fillSelectedShapes) ->Field("ShowGridGuide", &Display::m_showGridGuide) @@ -118,10 +116,6 @@ void CEditorPreferencesPage_ViewportGeneral::Reflect(AZ::SerializeContext& seria AZ::Edit::UIHandlers::CheckBox, &Display::m_drawEntityLabels, "Always Draw Entity Labels", "Always Draw Entity Labels") ->DataElement( AZ::Edit::UIHandlers::CheckBox, &Display::m_showTriggerBounds, "Always Show Trigger Bounds", "Always Show Trigger Bounds") - ->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_showIcons, "Show Object Icons", "Show Object Icons") - ->DataElement( - AZ::Edit::UIHandlers::CheckBox, &Display::m_distanceScaleIcons, "Scale Object Icons with Distance", - "Scale Object Icons with Distance") ->DataElement( AZ::Edit::UIHandlers::CheckBox, &Display::m_showFrozenHelpers, "Show Helpers of Frozen Objects", "Show Helpers of Frozen Objects") @@ -244,8 +238,6 @@ void CEditorPreferencesPage_ViewportGeneral::OnApply() } gSettings.viewports.bDrawEntityLabels = m_display.m_drawEntityLabels; gSettings.viewports.bShowTriggerBounds = m_display.m_showTriggerBounds; - gSettings.viewports.bShowIcons = m_display.m_showIcons; - gSettings.viewports.bDistanceScaleIcons = m_display.m_distanceScaleIcons; gSettings.viewports.nShowFrozenHelpers = m_display.m_showFrozenHelpers; gSettings.viewports.bFillSelectedShapes = m_display.m_fillSelectedShapes; gSettings.viewports.bShowGridGuide = m_display.m_showGridGuide; @@ -300,8 +292,6 @@ void CEditorPreferencesPage_ViewportGeneral::InitializeSettings() m_display.m_showBBoxes = (ds->GetRenderFlags() & RENDER_FLAG_BBOX) == RENDER_FLAG_BBOX; m_display.m_drawEntityLabels = gSettings.viewports.bDrawEntityLabels; m_display.m_showTriggerBounds = gSettings.viewports.bShowTriggerBounds; - m_display.m_showIcons = gSettings.viewports.bShowIcons; - m_display.m_distanceScaleIcons = gSettings.viewports.bDistanceScaleIcons; m_display.m_showFrozenHelpers = gSettings.viewports.nShowFrozenHelpers; m_display.m_fillSelectedShapes = gSettings.viewports.bFillSelectedShapes; m_display.m_showGridGuide = gSettings.viewports.bShowGridGuide; diff --git a/Code/Editor/EditorPreferencesPageViewportGeneral.h b/Code/Editor/EditorPreferencesPageViewportGeneral.h index be89cc6df4..2d2a207d6c 100644 --- a/Code/Editor/EditorPreferencesPageViewportGeneral.h +++ b/Code/Editor/EditorPreferencesPageViewportGeneral.h @@ -62,8 +62,6 @@ private: bool m_showBBoxes; bool m_drawEntityLabels; bool m_showTriggerBounds; - bool m_showIcons; - bool m_distanceScaleIcons; bool m_showFrozenHelpers; bool m_fillSelectedShapes; bool m_showGridGuide; diff --git a/Code/Editor/EditorViewportWidget.cpp b/Code/Editor/EditorViewportWidget.cpp index 828812fb7e..e9a57dba4f 100644 --- a/Code/Editor/EditorViewportWidget.cpp +++ b/Code/Editor/EditorViewportWidget.cpp @@ -1027,8 +1027,6 @@ void EditorViewportWidget::OnTitleMenu(QMenu* menu) AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Safe Frame"), &gSettings.viewports.bShowSafeFrame); AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Construction Plane"), &gSettings.snap.constructPlaneDisplay); AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Trigger Bounds"), &gSettings.viewports.bShowTriggerBounds); - AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Icons"), &gSettings.viewports.bShowIcons, &gSettings.viewports.bShowSizeBasedIcons); - AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Size-based Icons"), &gSettings.viewports.bShowSizeBasedIcons, &gSettings.viewports.bShowIcons); AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Helpers of Frozen Objects"), &gSettings.viewports.nShowFrozenHelpers); if (!m_predefinedAspectRatios.IsEmpty()) diff --git a/Code/Editor/Objects/BaseObject.cpp b/Code/Editor/Objects/BaseObject.cpp index 86840789dd..5ae68eaad7 100644 --- a/Code/Editor/Objects/BaseObject.cpp +++ b/Code/Editor/Objects/BaseObject.cpp @@ -761,72 +761,6 @@ void CBaseObject::SetModified(bool) { } -void CBaseObject::DrawDefault(DisplayContext& dc, const QColor& labelColor) -{ - Vec3 wp = GetWorldPos(); - - bool bDisplaySelectionHelper = false; - if (!CanBeDrawn(dc, bDisplaySelectionHelper)) - { - return; - } - - // Draw link between parent and child. - if (dc.flags & DISPLAY_LINKS) - { - if (GetParent()) - { - dc.DrawLine(GetParentAttachPointWorldTM().GetTranslation(), wp, IsFrozen() ? kLinkColorGray : kLinkColorParent, IsFrozen() ? kLinkColorGray : kLinkColorChild); - } - size_t nChildCount = GetChildCount(); - for (size_t i = 0; i < nChildCount; ++i) - { - const CBaseObject* pChild = GetChild(i); - dc.DrawLine(pChild->GetParentAttachPointWorldTM().GetTranslation(), pChild->GetWorldPos(), pChild->IsFrozen() ? kLinkColorGray : kLinkColorParent, pChild->IsFrozen() ? kLinkColorGray : kLinkColorChild); - } - } - - // Draw Bounding box - if (dc.flags & DISPLAY_BBOX) - { - AABB box; - GetBoundBox(box); - dc.SetColor(Vec3(1, 1, 1)); - dc.DrawWireBox(box.min, box.max); - } - - if (IsHighlighted()) - { - DrawHighlight(dc); - } - - if (IsSelected()) - { - DrawArea(dc); - - CSelectionGroup* pSelection = GetObjectManager()->GetSelection(); - - // If the number of selected object is over 2, the merged boundbox should be used to render the measurement axis. - if (!pSelection || (pSelection && pSelection->GetCount() == 1)) - { - DrawDimensions(dc); - } - } - - if (bDisplaySelectionHelper) - { - DrawSelectionHelper(dc, wp, labelColor, 1.0f); - } - else if (!(dc.flags & DISPLAY_HIDENAMES)) - { - DrawLabel(dc, wp, labelColor); - } - - SetDrawTextureIconProperties(dc, wp); - DrawTextureIcon(dc, wp); - DrawWarningIcons(dc, wp); -} - ////////////////////////////////////////////////////////////////////////// void CBaseObject::DrawDimensions(DisplayContext&, AABB*) { @@ -850,91 +784,6 @@ void CBaseObject::DrawSelectionHelper(DisplayContext& dc, const Vec3& pos, const dc.SetState(nPrevState); } -////////////////////////////////////////////////////////////////////////// -void CBaseObject::SetDrawTextureIconProperties(DisplayContext& dc, const Vec3& pos, float alpha, int texIconFlags) -{ - if (gSettings.viewports.bShowIcons || gSettings.viewports.bShowSizeBasedIcons) - { - if (IsHighlighted()) - { - dc.SetColor(QColor(255, 120, 0), 0.8f * alpha); - } - else if (IsSelected()) - { - dc.SetSelectedColor(alpha); - } - else if (IsFrozen()) - { - dc.SetFreezeColor(); - } - else - { - dc.SetColor(QColor(255, 255, 255), alpha); - } - - m_vDrawIconPos = pos; - - int nIconFlags = texIconFlags; - if (CheckFlags(OBJFLAG_SHOW_ICONONTOP)) - { - Vec3 objectPos = GetWorldPos(); - - AABB box; - GetBoundBox(box); - m_vDrawIconPos.z = (m_vDrawIconPos.z - objectPos.z) + box.max.z; - nIconFlags |= DisplayContext::TEXICON_ALIGN_BOTTOM; - } - m_nIconFlags = nIconFlags; - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseObject::DrawTextureIcon(DisplayContext& dc, [[maybe_unused]] const Vec3& pos, [[maybe_unused]] float alpha) -{ - if (m_nTextureIcon && (gSettings.viewports.bShowIcons || gSettings.viewports.bShowSizeBasedIcons)) - { - dc.DrawTextureLabel(GetTextureIconDrawPos(), OBJECT_TEXTURE_ICON_SIZEX, OBJECT_TEXTURE_ICON_SIZEY, GetTextureIcon(), GetTextureIconFlags()); - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseObject::DrawWarningIcons(DisplayContext& dc, const Vec3&) -{ - if (gSettings.viewports.bShowIcons || gSettings.viewports.bShowSizeBasedIcons) - { - const int warningIconSizeX = OBJECT_TEXTURE_ICON_SIZEX / 2; - const int warningIconSizeY = OBJECT_TEXTURE_ICON_SIZEY / 2; - - const int iconOffsetX = m_nTextureIcon ? (-OBJECT_TEXTURE_ICON_SIZEX / 2) : 0; - const int iconOffsetY = m_nTextureIcon ? (-OBJECT_TEXTURE_ICON_SIZEY / 2) : 0; - - if (gSettings.viewports.bShowScaleWarnings) - { - const EScaleWarningLevel scaleWarningLevel = GetScaleWarningLevel(); - - if (scaleWarningLevel != eScaleWarningLevel_None) - { - dc.SetColor(QColor(255, scaleWarningLevel == eScaleWarningLevel_RescaledNonUniform ? 50 : 255, 50), 1.0f); - dc.DrawTextureLabel(GetTextureIconDrawPos(), warningIconSizeX, warningIconSizeY, - GetIEditor()->GetIconManager()->GetIconTexture(eIcon_ScaleWarning), GetTextureIconFlags(), - -warningIconSizeX / 2, iconOffsetX - (warningIconSizeY / 2)); - } - } - - if (gSettings.viewports.bShowRotationWarnings) - { - const ERotationWarningLevel rotationWarningLevel = GetRotationWarningLevel(); - if (rotationWarningLevel != eRotationWarningLevel_None) - { - dc.SetColor(QColor(255, rotationWarningLevel == eRotationWarningLevel_RotatedNonRectangular ? 50 : 255, 50), 1.0f); - dc.DrawTextureLabel(GetTextureIconDrawPos(), warningIconSizeX, warningIconSizeY, - GetIEditor()->GetIconManager()->GetIconTexture(eIcon_RotationWarning), GetTextureIconFlags(), - warningIconSizeX / 2, iconOffsetY - (warningIconSizeY / 2)); - } - } - } -} - ////////////////////////////////////////////////////////////////////////// void CBaseObject::DrawLabel(DisplayContext& dc, const Vec3& pos, const QColor& lC, float alpha, float size) { diff --git a/Code/Editor/Objects/BaseObject.h b/Code/Editor/Objects/BaseObject.h index f78755e81d..fea248c7f7 100644 --- a/Code/Editor/Objects/BaseObject.h +++ b/Code/Editor/Objects/BaseObject.h @@ -398,9 +398,6 @@ public: // Interface to be implemented in plugins. ////////////////////////////////////////////////////////////////////////// - //! Draw object to specified viewport. - virtual void Display([[maybe_unused]] DisplayContext& disp) {} - //! Perform intersection testing of this object. //! Return true if was hit. virtual bool HitTest([[maybe_unused]] HitContext& hc) { return false; }; @@ -529,8 +526,6 @@ protected: void ResolveParent(CBaseObject* object); void SetColor(const QColor& color); - //! Draw default object items. - virtual void DrawDefault(DisplayContext& dc, const QColor& labelColor = QColor(255, 255, 255)); //! Draw object label. void DrawLabel(DisplayContext& dc, const Vec3& pos, const QColor& labelColor = QColor(255, 255, 255), float alpha = 1.0f, float size = 1.f); //! Draw 3D Axis at object position. @@ -539,10 +534,6 @@ protected: void DrawArea(DisplayContext& dc); //! Draw selection helper. void DrawSelectionHelper(DisplayContext& dc, const Vec3& pos, const QColor& labelColor = QColor(255, 255, 255), float alpha = 1.0f); - //! Draw helper icon. - virtual void DrawTextureIcon(DisplayContext& dc, const Vec3& pos, float alpha = 1.0f); - //! Draw warning icons - virtual void DrawWarningIcons(DisplayContext& dc, const Vec3& pos); //! Check if dimension's figures can be displayed before draw them. virtual void DrawDimensions(DisplayContext& dc, AABB* pMergedBoundBox = nullptr); @@ -575,7 +566,6 @@ protected: //! Only used by ObjectManager. bool IsPotentiallyVisible() const; - void SetDrawTextureIconProperties(DisplayContext& dc, const Vec3& pos, float alpha = 1.0f, int texIconFlags = 0); const Vec3& GetTextureIconDrawPos(){ return m_vDrawIconPos; }; int GetTextureIconFlags(){ return m_nIconFlags; }; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp index fbb700723b..a70c200417 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp @@ -723,97 +723,6 @@ CComponentEntityObject* CComponentEntityObject::FindObjectForEntity(AZ::EntityId return nullptr; } -void CComponentEntityObject::Display(DisplayContext& dc) -{ - if (!(dc.flags & DISPLAY_2D)) - { - m_entityIconVisible = false; - } - - bool displaySelectionHelper = false; - if (!CanBeDrawn(dc, displaySelectionHelper)) - { - return; - } - - DrawDefault(dc); - - bool showIcons = m_hasIcon; - if (showIcons) - { - SEditorSettings* editorSettings = GetIEditor()->GetEditorSettings(); - if (!editorSettings->viewports.bShowIcons && !editorSettings->viewports.bShowSizeBasedIcons) - { - showIcons = false; - } - } - - if (m_entityId.IsValid()) - { - // Draw link to parent if this or the parent object are selected. - { - AZ::EntityId parentId; - EBUS_EVENT_ID_RESULT(parentId, m_entityId, AZ::TransformBus, GetParentId); - if (parentId.IsValid()) - { - bool isParentVisible = false; - AzToolsFramework::EditorEntityInfoRequestBus::EventResult(isParentVisible, parentId, &AzToolsFramework::EditorEntityInfoRequestBus::Events::IsVisible); - - CComponentEntityObject* parentObject = CComponentEntityObject::FindObjectForEntity(parentId); - if (isParentVisible && (IsSelected() || (parentObject && parentObject->IsSelected()))) - { - const QColor kLinkColorParent(0, 255, 255); - const QColor kLinkColorChild(0, 0, 255); - - AZ::Vector3 parentTranslation; - EBUS_EVENT_ID_RESULT(parentTranslation, parentId, AZ::TransformBus, GetWorldTranslation); - dc.DrawLine(AZVec3ToLYVec3(parentTranslation), GetWorldTM().GetTranslation(), kLinkColorParent, kLinkColorChild); - } - } - } - - // Don't draw icons if we have an ancestor in the same location that has an icon - makes sure - // ancestor icons draw on top and are able to be selected over children. Also check if a descendant - // is selected at the same location. In cases of entity hierarchies where numerous ancestors have - // no position offset, we need this so the ancestors don't draw over us when we're selected - if (showIcons) - { - if ((dc.flags & DISPLAY_2D) || - IsSelected() || - IsAncestorIconDrawingAtSameLocation() || - IsDescendantSelectedAtSameLocation()) - { - showIcons = false; - } - } - - // Allow components to override in-editor visualization. - { - const AzFramework::DisplayContextRequestGuard displayContextGuard(dc); - - AzFramework::DebugDisplayRequestBus::BusPtr debugDisplayBus; - AzFramework::DebugDisplayRequestBus::Bind( - debugDisplayBus, AzFramework::g_defaultSceneEntityDebugDisplayId); - AZ_Assert(debugDisplayBus, "Invalid DebugDisplayRequestBus."); - - AzFramework::DebugDisplayRequests* debugDisplay = - AzFramework::DebugDisplayRequestBus::FindFirstHandler(debugDisplayBus); - - AzFramework::EntityDebugDisplayEventBus::Event( - m_entityId, &AzFramework::EntityDebugDisplayEvents::DisplayEntityViewport, - AzFramework::ViewportInfo{ dc.GetView()->asCViewport()->GetViewportId() }, - *debugDisplay); - } - } -} - -void CComponentEntityObject::DrawDefault(DisplayContext& dc, const QColor& labelColor) -{ - CEntityObject::DrawDefault(dc, labelColor); - - DrawAccent(dc); -} - bool CComponentEntityObject::IsIsolated() const { return m_isIsolated; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h index 7ccea8da84..62209965a5 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h @@ -55,7 +55,6 @@ public: bool SetRotation(const Quat& rotate, int flags) override; bool SetScale(const Vec3& scale, int flags) override; void InvalidateTM(int nWhyFlags) override; - void Display(DisplayContext& disp) override; bool HitTest(HitContext& hc) override; void GetLocalBounds(AABB& box) override; void GetBoundBox(AABB& box) override; @@ -69,7 +68,6 @@ public: void DetachThis(bool bKeepPos = true) override; XmlNodeRef Export(const QString& levelPath, XmlNodeRef& xmlNode) override; void DeleteEntity() override; - void DrawDefault(DisplayContext& dc, const QColor& labelColor = QColor(255, 255, 255)) override; bool IsIsolated() const override; bool IsSelected() const override; diff --git a/Code/Editor/Settings.cpp b/Code/Editor/Settings.cpp index acb48c3545..8561e6dba3 100644 --- a/Code/Editor/Settings.cpp +++ b/Code/Editor/Settings.cpp @@ -142,9 +142,6 @@ SEditorSettings::SEditorSettings() viewports.bShowMeshStatsOnMouseOver = false; viewports.bDrawEntityLabels = false; viewports.bShowTriggerBounds = false; - viewports.bShowIcons = true; - viewports.bDistanceScaleIcons = true; - viewports.bShowSizeBasedIcons = false; viewports.nShowFrozenHelpers = true; viewports.bFillSelectedShapes = false; viewports.nTopMapTextureResolution = 512; @@ -534,8 +531,6 @@ void SEditorSettings::Save(bool isEditorClosing) SaveValue("Settings", "ShowMeshStatsOnMouseOver", viewports.bShowMeshStatsOnMouseOver); SaveValue("Settings", "DrawEntityLabels", viewports.bDrawEntityLabels); SaveValue("Settings", "ShowTriggerBounds", viewports.bShowTriggerBounds); - SaveValue("Settings", "ShowIcons", viewports.bShowIcons); - SaveValue("Settings", "ShowSizeBasedIcons", viewports.bShowSizeBasedIcons); SaveValue("Settings", "ShowFrozenHelpers", viewports.nShowFrozenHelpers); SaveValue("Settings", "FillSelectedShapes", viewports.bFillSelectedShapes); SaveValue("Settings", "MapTextureResolution", viewports.nTopMapTextureResolution); @@ -736,8 +731,6 @@ void SEditorSettings::Load() LoadValue("Settings", "ShowMeshStatsOnMouseOver", viewports.bShowMeshStatsOnMouseOver); LoadValue("Settings", "DrawEntityLabels", viewports.bDrawEntityLabels); LoadValue("Settings", "ShowTriggerBounds", viewports.bShowTriggerBounds); - LoadValue("Settings", "ShowIcons", viewports.bShowIcons); - LoadValue("Settings", "ShowSizeBasedIcons", viewports.bShowSizeBasedIcons); LoadValue("Settings", "ShowFrozenHelpers", viewports.nShowFrozenHelpers); LoadValue("Settings", "FillSelectedShapes", viewports.bFillSelectedShapes); LoadValue("Settings", "MapTextureResolution", viewports.nTopMapTextureResolution); diff --git a/Code/Editor/Settings.h b/Code/Editor/Settings.h index 9276d9b715..0ebb70501d 100644 --- a/Code/Editor/Settings.h +++ b/Code/Editor/Settings.h @@ -136,13 +136,6 @@ struct SViewportsSettings bool bDrawEntityLabels; //! Show Trigger bounds. bool bShowTriggerBounds; - //! Show Icons in viewport. - bool bShowIcons; - //! Scale icons with distance, so they aren't a fixed size no matter how far away you are - bool bDistanceScaleIcons; - - //! Show Size-based Icons in viewport. - bool bShowSizeBasedIcons; //! Show Helpers in viewport for frozen objects. int nShowFrozenHelpers; From bd65da39d0033b504d7da196e86cd9e5a30ec337 Mon Sep 17 00:00:00 2001 From: lsemp3d <58790905+lsemp3d@users.noreply.github.com> Date: Wed, 12 Jan 2022 10:20:04 -0800 Subject: [PATCH 362/399] Updated node subtitle Signed-off-by: lsemp3d <58790905+lsemp3d@users.noreply.github.com> --- .../EBus/Senders/UiFlipbookAnimationBus.names | 75 ++++++++++++------- 1 file changed, 50 insertions(+), 25 deletions(-) diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/UiFlipbookAnimationBus.names b/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/UiFlipbookAnimationBus.names index c0f62a816b..e869048b0c 100644 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/UiFlipbookAnimationBus.names +++ b/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/UiFlipbookAnimationBus.names @@ -21,7 +21,8 @@ }, "details": { "name": "Get Loop Type", - "tooltip": "Gets the type of looping behavior for the animation" + "tooltip": "Gets the type of looping behavior for the animation", + "subtitle": "UI Flipbook" }, "results": [ { @@ -44,7 +45,8 @@ }, "details": { "name": "Get Reverse Delay", - "tooltip": "Gets the delay (in seconds) before playing the reverse loop sequence (PingPong loop types only)" + "tooltip": "Gets the delay (in seconds) before playing the reverse loop sequence (PingPong loop types only)", + "subtitle": "UI Flipbook" }, "results": [ { @@ -67,7 +69,8 @@ }, "details": { "name": "Set Is Auto Play Enabled", - "tooltip": "Sets whether the animation will begin playing as soon as the element is activated" + "tooltip": "Sets whether the animation will begin playing as soon as the element is activated", + "subtitle": "UI Flipbook" }, "params": [ { @@ -91,7 +94,8 @@ }, "details": { "name": "Set Current Frame", - "tooltip": "Sets the frame to immediately display for the animation" + "tooltip": "Sets the frame to immediately display for the animation", + "subtitle": "UI Flipbook" }, "params": [ { @@ -115,7 +119,8 @@ }, "details": { "name": "Get Loop Start Frame", - "tooltip": "Gets the first frame that is displayed within an animation loop. Applicable only when the \"Loop Type\" is set to anything other than \"None\"" + "tooltip": "Gets the first frame that is displayed within an animation loop. Applicable only when the \"Loop Type\" is set to anything other than \"None\"", + "subtitle": "UI Flipbook" }, "results": [ { @@ -138,7 +143,8 @@ }, "details": { "name": "Set Loop Type", - "tooltip": "Sets the type of looping behavior for this animation" + "tooltip": "Sets the type of looping behavior for this animation", + "subtitle": "UI Flipbook" }, "params": [ { @@ -162,7 +168,8 @@ }, "details": { "name": "Get Start Delay", - "tooltip": "Gets the delay (in seconds) before playing the flipbook (applied only once during playback)" + "tooltip": "Gets the delay (in seconds) before playing the flipbook (applied only once during playback)", + "subtitle": "UI Flipbook" }, "results": [ { @@ -185,7 +192,8 @@ }, "details": { "name": "Set Start Delay", - "tooltip": "Sets the delay (in seconds) before playing the flipbook (applied only once during playback)" + "tooltip": "Sets the delay (in seconds) before playing the flipbook (applied only once during playback)", + "subtitle": "UI Flipbook" }, "params": [ { @@ -209,7 +217,8 @@ }, "details": { "name": "Get Current Frame", - "tooltip": "Gets the frame of the animation currently displayed" + "tooltip": "Gets the frame of the animation currently displayed", + "subtitle": "UI Flipbook" }, "results": [ { @@ -232,7 +241,8 @@ }, "details": { "name": "Get Framerate", - "tooltip": "Gets the speed used to determine when to transition to the next frame. Framerate is defined relative to unit of time, specified by FramerateUnits" + "tooltip": "Gets the speed used to determine when to transition to the next frame. Framerate is defined relative to unit of time, specified by FramerateUnits", + "subtitle": "UI Flipbook" }, "results": [ { @@ -255,7 +265,8 @@ }, "details": { "name": "Set Loop Delay", - "tooltip": "Sets the delay (in seconds) before playing the loop sequence" + "tooltip": "Sets the delay (in seconds) before playing the loop sequence", + "subtitle": "UI Flipbook" }, "params": [ { @@ -279,7 +290,8 @@ }, "details": { "name": "Get Start Frame", - "tooltip": "Gets the first frame to display when starting the animation" + "tooltip": "Gets the first frame to display when starting the animation", + "subtitle": "UI Flipbook" }, "results": [ { @@ -302,7 +314,8 @@ }, "details": { "name": "Set Framerate Unit", - "tooltip": "Sets the framerate unit (0 = Frames per second, 1 = Seconds per frame)" + "tooltip": "Sets the framerate unit (0 = Frames per second, 1 = Seconds per frame)", + "subtitle": "UI Flipbook" }, "params": [ { @@ -326,7 +339,8 @@ }, "details": { "name": "Is Playing", - "tooltip": "Returns whether the animation is currently playing" + "tooltip": "Returns whether the animation is currently playing", + "subtitle": "UI Flipbook" }, "results": [ { @@ -349,7 +363,8 @@ }, "details": { "name": "Set End Frame", - "tooltip": "Sets the last frame to display for the animation" + "tooltip": "Sets the last frame to display for the animation", + "subtitle": "UI Flipbook" }, "params": [ { @@ -373,7 +388,8 @@ }, "details": { "name": "Set Loop Start Frame", - "tooltip": "Sets the first frame that is displayed within an animation loop. Applicable only when the \"Loop Type\" is set to anything other than \"None\"" + "tooltip": "Sets the first frame that is displayed within an animation loop. Applicable only when the \"Loop Type\" is set to anything other than \"None\"", + "subtitle": "UI Flipbook" }, "params": [ { @@ -397,7 +413,8 @@ }, "details": { "name": "Set Reverse Delay", - "tooltip": "Sets the delay (in seconds) before playing the reverse loop sequence (PingPong loop types only)" + "tooltip": "Sets the delay (in seconds) before playing the reverse loop sequence (PingPong loop types only)", + "subtitle": "UI Flipbook" }, "params": [ { @@ -421,7 +438,8 @@ }, "details": { "name": "Stop", - "tooltip": "Ends the animation" + "tooltip": "Ends the animation", + "subtitle": "UI Flipbook" } }, { @@ -436,7 +454,8 @@ }, "details": { "name": "Set Framerate", - "tooltip": "Sets the speed used to determine when to transition to the next frame. Framerate is defined relative to unit of time, specified by FramerateUnits" + "tooltip": "Sets the speed used to determine when to transition to the next frame. Framerate is defined relative to unit of time, specified by FramerateUnits", + "subtitle": "UI Flipbook" }, "params": [ { @@ -460,7 +479,8 @@ }, "details": { "name": "Is Auto Play Enabled", - "tooltip": "Returns whether the animation will begin playing as soon as the element is activated" + "tooltip": "Returns whether the animation will begin playing as soon as the element is activated", + "subtitle": "UI Flipbook" }, "results": [ { @@ -483,7 +503,8 @@ }, "details": { "name": "Start", - "tooltip": "Begins playing the flipbook animation" + "tooltip": "Begins playing the flipbook animation", + "subtitle": "UI Flipbook" } }, { @@ -498,7 +519,8 @@ }, "details": { "name": "Set Start Frame", - "tooltip": "Sets the first frame to display when starting the animation" + "tooltip": "Sets the first frame to display when starting the animation", + "subtitle": "UI Flipbook" }, "params": [ { @@ -522,7 +544,8 @@ }, "details": { "name": "Get End Frame", - "tooltip": "Gets the last frame to display for the animation" + "tooltip": "Gets the last frame to display for the animation", + "subtitle": "UI Flipbook" }, "results": [ { @@ -545,7 +568,8 @@ }, "details": { "name": "Get Framerate Unit", - "tooltip": "Gets the framerate unit (0 = Frames per second, 1 = Seconds per frame)" + "tooltip": "Gets the framerate unit (0 = Frames per second, 1 = Seconds per frame)", + "subtitle": "UI Flipbook" }, "results": [ { @@ -568,7 +592,8 @@ }, "details": { "name": "Get Loop Delay", - "tooltip": "Gets the delay (in seconds) before playing the loop sequence" + "tooltip": "Gets the delay (in seconds) before playing the loop sequence", + "subtitle": "UI Flipbook" }, "results": [ { From 5b195cb028781c8738da4d9e7ff587f0f940c0aa Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 12 Jan 2022 12:33:36 -0600 Subject: [PATCH 363/399] Removed some unused variables Signed-off-by: Chris Galvan --- Code/Editor/Objects/BaseObject.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Code/Editor/Objects/BaseObject.cpp b/Code/Editor/Objects/BaseObject.cpp index 5ae68eaad7..c14547407b 100644 --- a/Code/Editor/Objects/BaseObject.cpp +++ b/Code/Editor/Objects/BaseObject.cpp @@ -36,12 +36,6 @@ // To use the Andrew's algorithm in order to make convex hull from the points, this header is needed. #include "Util/GeometryUtil.h" -namespace { - QColor kLinkColorParent = QColor(0, 255, 255); - QColor kLinkColorChild = QColor(0, 0, 255); - QColor kLinkColorGray = QColor(128, 128, 128); -} - extern CObjectManager* g_pObjectManager; ////////////////////////////////////////////////////////////////////////// From 068244b1bb28191758637028864505c2b727b890 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Wed, 12 Jan 2022 12:00:33 -0800 Subject: [PATCH 364/399] Remove quotes around list of paths (#6857) Signed-off-by: amzn-sj --- cmake/Platform/Mac/runtime_dependencies_mac.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in index 51e6e5830c..c27bf1fde4 100644 --- a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in +++ b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in @@ -187,7 +187,7 @@ if(@target_file_dir@ MATCHES ".app/Contents/MacOS") ) file(GLOB_RECURSE exe_file_list "${bundle_path}/Contents/Frameworks/Python.framework/**/*.exe") if(exe_file_list) - file(REMOVE_RECURSE "${exe_file_list}") + file(REMOVE_RECURSE ${exe_file_list}) endif() execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink include/python3.7m Headers WORKING_DIRECTORY "${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7" From 5dc442fcb0f2946cd104849b9bc814be134b9426 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Wed, 12 Jan 2022 12:07:57 -0800 Subject: [PATCH 365/399] [Terrain] First pass of the ProcessList and ProcessRegion APIs for retrieving surface data (#6729) * [Terrain] First pass of the ProcessList and ProcessRegion APIs for retrieving surface data Signed-off-by: amzn-sj * Add a couple of more tests. The expected values were plugged in based on the values generated by the brute force approach. Signed-off-by: amzn-sj * Move some declarations out of loops since they can be reused. Signed-off-by: amzn-sj * Update all the per position callbacks to pass SurfacePoint refs. Construct only one SurfacePoint object outside the loop which can be reused. Signed-off-by: amzn-sj * Update tests to use the new per position callbacks Signed-off-by: amzn-sj * Add ProcessRegion functions to the terrain benchmark. Signed-off-by: amzn-sj * Change C style static casts to aznumeric_cast. Add maybe_unused to unused params in benchmarks. Signed-off-by: amzn-sj * Update the ProcessList API functions to use array_view instead of a vector. This includes some additional changes to satisfy build dependencies. Signed-off-by: amzn-sj * Add ProcessList API functions to benchmarks Signed-off-by: amzn-sj * Update the ProcessList API functions to take Vector2 as input positions Signed-off-by: amzn-sj * Revert changes to AtomCore library split. Add partial implementation of span(mostly just copied over from array_view) to AzCore std containers. Signed-off-by: amzn-sj * Adding some const/non-const overloads that were missing in span Signed-off-by: amzn-sj * Move input position list generation to a function Signed-off-by: amzn-sj * Bring back Vector3 version of ProcessList functions. Rename Vector2 version to follow similar pattern as the Get functions. Signed-off-by: amzn-sj * Split span.h into .h/.inl files Signed-off-by: amzn-sj * Add [mayby_unused] for unused parameters to fix build errors Signed-off-by: amzn-sj --- .../AzCore/AzCore/std/azstd_files.cmake | 2 + .../AzCore/AzCore/std/containers/span.h | 137 ++++++++ .../AzCore/AzCore/std/containers/span.inl | 150 ++++++++ .../Terrain/TerrainDataRequestBus.h | 50 +++ .../Mocks/Terrain/MockTerrainDataRequestBus.h | 24 ++ .../Source/TerrainSystem/TerrainSystem.cpp | 274 +++++++++++++-- .../Code/Source/TerrainSystem/TerrainSystem.h | 47 +++ .../Code/Tests/TerrainSystemBenchmarks.cpp | 262 ++++++++++++++ Gems/Terrain/Code/Tests/TerrainSystemTest.cpp | 330 ++++++++++++++++++ 9 files changed, 1247 insertions(+), 29 deletions(-) create mode 100644 Code/Framework/AzCore/AzCore/std/containers/span.h create mode 100644 Code/Framework/AzCore/AzCore/std/containers/span.inl diff --git a/Code/Framework/AzCore/AzCore/std/azstd_files.cmake b/Code/Framework/AzCore/AzCore/std/azstd_files.cmake index 2746489f8c..d516a56295 100644 --- a/Code/Framework/AzCore/AzCore/std/azstd_files.cmake +++ b/Code/Framework/AzCore/AzCore/std/azstd_files.cmake @@ -64,6 +64,8 @@ set(FILES containers/rbtree.h containers/ring_buffer.h containers/set.h + containers/span.h + containers/span.inl containers/stack.h containers/unordered_map.h containers/unordered_set.h diff --git a/Code/Framework/AzCore/AzCore/std/containers/span.h b/Code/Framework/AzCore/AzCore/std/containers/span.h new file mode 100644 index 0000000000..8f68e921d8 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/std/containers/span.h @@ -0,0 +1,137 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include +#include +#include + +namespace AZStd +{ + /** + * First pass partial implementation of span copied over from array_view. It + * returns non-const iterator/pointers. first(), last(), and subspan() + * are yet to be implemented. It does not maintain storage for the data, + * but just holds pointers to mark the beginning and end of the array. + * It can be conveniently constructed from a variety of other container + * types like array, vector, and fixed_vector. + * + * Example: + * Given "void Func(AZStd::span a) {...}" you can call... + * - Func({1,2,3}); + * - AZStd::array a = {1,2,3}; + * Func(a); + * - AZStd::vector v = {1,2,3}; + * Func(v); + * - AZStd::fixed_vector fv = {1,2,3}; + * Func(fv); + * + * Since the span does not copy and store any data, it is only valid as long as the data used to create it is valid. + */ + template + class span final + { + public: + using value_type = Element; + + using pointer = value_type*; + using const_pointer = const value_type*; + + using reference = value_type&; + using const_reference = const value_type&; + + using size_type = AZStd::size_t; + using difference_type = AZStd::ptrdiff_t; + + using iterator = value_type*; + using const_iterator = const value_type*; + using reverse_iterator = AZStd::reverse_iterator; + using const_reverse_iterator = AZStd::reverse_iterator; + + constexpr span(); + + ~span() = default; + + constexpr span(pointer s, size_type length); + + constexpr span(pointer first, const_pointer last); + + // We explicitly delete this constructor because it's too easy to accidentally + // create a span to just the first element instead of an entire array. + constexpr span(const_pointer s) = delete; + + template + constexpr span(AZStd::array& data); + + constexpr span(AZStd::vector& data); + + template + constexpr span(AZStd::fixed_vector& data); + + template + constexpr span(const AZStd::array& data); + + constexpr span(const AZStd::vector& data); + + template + constexpr span(const AZStd::fixed_vector& data); + + constexpr span(const span&) = default; + + constexpr span(span&& other); + + constexpr span& operator=(const span& other) = default; + + constexpr span& operator=(span&& other); + + constexpr size_type size() const; + + constexpr bool empty() const; + + constexpr pointer data(); + constexpr const_pointer data() const; + + constexpr const_reference operator[](size_type index) const; + constexpr reference operator[](size_type index); + + constexpr void erase(); + + constexpr iterator begin(); + constexpr iterator end(); + constexpr const_iterator begin() const; + constexpr const_iterator end() const; + + constexpr const_iterator cbegin() const; + constexpr const_iterator cend() const; + + constexpr reverse_iterator rbegin(); + constexpr reverse_iterator rend(); + constexpr const_reverse_iterator rbegin() const; + constexpr const_reverse_iterator rend() const; + + constexpr const_reverse_iterator crbegin() const; + constexpr const_reverse_iterator crend() const; + + friend bool operator==(span lhs, span rhs) + { + return lhs.m_begin == rhs.m_begin && lhs.m_end == rhs.m_end; + } + + friend bool operator!=(span lhs, span rhs) { return !(lhs == rhs); } + friend bool operator< (span lhs, span rhs) { return lhs.m_begin < rhs.m_begin || lhs.m_begin == rhs.m_begin && lhs.m_end < rhs.m_end; } + friend bool operator> (span lhs, span rhs) { return lhs.m_begin > rhs.m_begin || lhs.m_begin == rhs.m_begin && lhs.m_end > rhs.m_end; } + friend bool operator<=(span lhs, span rhs) { return lhs == rhs || lhs < rhs; } + friend bool operator>=(span lhs, span rhs) { return lhs == rhs || lhs > rhs; } + + private: + pointer m_begin; + pointer m_end; + }; +} // namespace AZStd + +#include diff --git a/Code/Framework/AzCore/AzCore/std/containers/span.inl b/Code/Framework/AzCore/AzCore/std/containers/span.inl new file mode 100644 index 0000000000..c33e4a7227 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/std/containers/span.inl @@ -0,0 +1,150 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +namespace AZStd +{ + template + inline constexpr span::span() + : m_begin(nullptr) + , m_end(nullptr) + { } + + template + inline constexpr span::span(pointer s, size_type length) + : m_begin(s) + , m_end(m_begin + length) + { + if (length == 0) erase(); + } + + template + inline constexpr span::span(pointer first, const_pointer last) + : m_begin(first) + , m_end(last) + { } + + template + template + inline constexpr span::span(AZStd::array& data) + : m_begin(data.data()) + , m_end(m_begin + data.size()) + { } + + template + inline constexpr span::span(AZStd::vector& data) + : m_begin(data.data()) + , m_end(m_begin + data.size()) + { } + + template + template + inline constexpr span::span(AZStd::fixed_vector& data) + : m_begin(data.data()) + , m_end(m_begin + data.size()) + { } + + template + template + inline constexpr span::span(const AZStd::array& data) + : m_begin(data.data()) + , m_end(m_begin + data.size()) + { } + + template + inline constexpr span::span(const AZStd::vector& data) + : m_begin(data.data()) + , m_end(m_begin + data.size()) + { } + + template + template + inline constexpr span::span(const AZStd::fixed_vector& data) + : m_begin(data.data()) + , m_end(m_begin + data.size()) + { } + + template + inline constexpr span::span(span&& other) + : span(other.m_begin, other.m_end) + { +#if AZ_DEBUG_BUILD // Clearing the original pointers isn't necessary, but is good for debugging + other.m_begin = nullptr; + other.m_end = nullptr; +#endif + } + + template + inline constexpr AZStd::size_t span::size() const { return m_end - m_begin; } + + template + inline constexpr bool span::empty() const { return m_end == m_begin; } + + template + inline constexpr Element* span::data() { return m_begin; } + + template + inline constexpr const Element* span::data() const { return m_begin; } + + template + inline constexpr span& span::operator=(span&& other) + { + m_begin = other.m_begin; + m_end = other.m_end; +#if AZ_DEBUG_BUILD // Clearing the original pointers isn't necessary, but is good for debugging + other.m_begin = nullptr; + other.m_end = nullptr; +#endif + return *this; + } + + template + inline constexpr const Element& span::operator[](AZStd::size_t index) const + { + AZ_Assert(index < size(), "index value is out of range"); + return m_begin[index]; + } + + template + inline constexpr Element& span::operator[](AZStd::size_t index) + { + AZ_Assert(index < size(), "index value is out of range"); + return m_begin[index]; + } + + template + inline constexpr void span::erase() { m_begin = m_end = nullptr; } + + template + inline constexpr Element* span::begin() { return m_begin; } + template + inline constexpr Element* span::end() { return m_end; } + template + inline constexpr const Element* span::begin() const { return m_begin; } + template + inline constexpr const Element* span::end() const { return m_end; } + + template + inline constexpr const Element* span::cbegin() const { return m_begin; } + template + inline constexpr const Element* span::cend() const { return m_end; } + + template + inline constexpr AZStd::reverse_iterator span::rbegin() { return AZStd::reverse_iterator(m_end); } + template + inline constexpr AZStd::reverse_iterator span::rend() { return AZStd::reverse_iterator(m_begin); } + template + inline constexpr AZStd::reverse_iterator span::rbegin() const { return AZStd::reverse_iterator(m_end); } + template + inline constexpr AZStd::reverse_iterator span::rend() const { return AZStd::reverse_iterator(m_begin); } + + template + inline constexpr AZStd::reverse_iterator span::crbegin() const { return AZStd::reverse_iterator(cend()); } + template + inline constexpr AZStd::reverse_iterator span::crend() const { return AZStd::reverse_iterator(cbegin()); } +} // namespace AZStd diff --git a/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h b/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h index 2572a07494..0d16bf3460 100644 --- a/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h +++ b/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h @@ -11,12 +11,15 @@ #include #include #include +#include #include namespace AzFramework { namespace Terrain { + typedef AZStd::function SurfacePointRegionFillCallback; + typedef AZStd::function SurfacePointListFillCallback; //! Shared interface for terrain system implementations class TerrainDataRequests @@ -131,6 +134,53 @@ namespace AzFramework Sampler sampleFilter = Sampler::DEFAULT, bool* terrainExistsPtr = nullptr) const = 0; + //! Given a list of XY coordinates, call the provided callback function with surface data corresponding to each + //! XY coordinate in the list. + virtual void ProcessHeightsFromList(const AZStd::span& inPositions, + SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessNormalsFromList(const AZStd::span& inPositions, + SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessSurfaceWeightsFromList(const AZStd::span& inPositions, + SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessSurfacePointsFromList(const AZStd::span& inPositions, + SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessHeightsFromListOfVector2(const AZStd::span& inPositions, + SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessNormalsFromListOfVector2(const AZStd::span& inPositions, + SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessSurfaceWeightsFromListOfVector2(const AZStd::span& inPositions, + SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessSurfacePointsFromListOfVector2(const AZStd::span& inPositions, + SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + + //! Given a region(aabb) and a step size, call the provided callback function with surface data corresponding to the + //! coordinates in the region. + virtual void ProcessHeightsFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessNormalsFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessSurfaceWeightsFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessSurfacePointsFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + + private: // Private variations of the GetSurfacePoint API exposed to BehaviorContext that returns a value instead of // using an "out" parameter. The "out" parameter is useful for reusing memory allocated in SurfacePoint when diff --git a/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h b/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h index dbce11d639..f3a6cc07b3 100644 --- a/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h +++ b/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h @@ -76,5 +76,29 @@ namespace UnitTest GetSurfacePointFromVector2, void(const AZ::Vector2&, AzFramework::SurfaceData::SurfacePoint&, Sampler, bool*)); MOCK_CONST_METHOD5( GetSurfacePointFromFloats, void(float, float, AzFramework::SurfaceData::SurfacePoint&, Sampler, bool*)); + MOCK_CONST_METHOD3( + ProcessHeightsFromList, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); + MOCK_CONST_METHOD3( + ProcessNormalsFromList, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); + MOCK_CONST_METHOD3( + ProcessSurfaceWeightsFromList, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); + MOCK_CONST_METHOD3( + ProcessSurfacePointsFromList, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); + MOCK_CONST_METHOD3( + ProcessHeightsFromListOfVector2, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); + MOCK_CONST_METHOD3( + ProcessNormalsFromListOfVector2, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); + MOCK_CONST_METHOD3( + ProcessSurfaceWeightsFromListOfVector2, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); + MOCK_CONST_METHOD3( + ProcessSurfacePointsFromListOfVector2, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); + MOCK_CONST_METHOD4( + ProcessHeightsFromRegion, void(const AZ::Aabb&, const AZ::Vector2&, AzFramework::Terrain::SurfacePointRegionFillCallback, Sampler)); + MOCK_CONST_METHOD4( + ProcessNormalsFromRegion, void(const AZ::Aabb&, const AZ::Vector2&, AzFramework::Terrain::SurfacePointRegionFillCallback, Sampler)); + MOCK_CONST_METHOD4( + ProcessSurfaceWeightsFromRegion, void(const AZ::Aabb&, const AZ::Vector2&, AzFramework::Terrain::SurfacePointRegionFillCallback, Sampler)); + MOCK_CONST_METHOD4( + ProcessSurfacePointsFromRegion, void(const AZ::Aabb&, const AZ::Vector2&, AzFramework::Terrain::SurfacePointRegionFillCallback, Sampler)); }; } // namespace UnitTest diff --git a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp index 7c8b6021af..2ecd13b5ad 100644 --- a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp +++ b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp @@ -530,40 +530,201 @@ const char* TerrainSystem::GetMaxSurfaceName( return ""; } -/* +void TerrainSystem::ProcessHeightsFromList( + const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + if (!perPositionCallback) + { + return; + } -void TerrainSystem::ProcessHeightsFromRegion(const AZ::Aabb& inRegion, const AZ::Vector2 stepSize, Sampler sampleFilter, SurfacePointRegionFillCallback perPositionCallback, TerrainDataReadyCallback onComplete) + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (const auto& position : inPositions) + { + bool terrainExists = false; + surfacePoint.m_position = position; + surfacePoint.m_position.SetZ(GetHeight(position, sampleFilter, &terrainExists)); + perPositionCallback(surfacePoint, terrainExists); + } +} + +void TerrainSystem::ProcessNormalsFromList( + const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter) const { - // Don't bother processing if we don't have a callback if (!perPositionCallback) { return; } - uint32_t numSamplesX = static_cast((inRegion.GetMax().GetX() - inRegion.GetMin().GetX()) / stepSize.GetX()); - uint32_t numSamplesY = static_cast((inRegion.GetMax().GetY() - inRegion.GetMin().GetY()) / stepSize.GetY()); + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (const auto& position : inPositions) + { + bool terrainExists = false; + surfacePoint.m_position = position; + surfacePoint.m_normal = GetNormal(position, sampleFilter, &terrainExists); + perPositionCallback(surfacePoint, terrainExists); + } +} + +void TerrainSystem::ProcessSurfaceWeightsFromList( + const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + if (!perPositionCallback) + { + return; + } - for (uint32_t y = 0; y < numSamplesY; y++) + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (const auto& position : inPositions) { - for (uint32_t x = 0; x < numSamplesX; x++) - { - float fx = (float)(inRegion.GetMin().GetX() + (x * stepSize.GetX())); - float fy = (float)(inRegion.GetMin().GetY() + (y * stepSize.GetY())); + bool terrainExists = false; + surfacePoint.m_position = position; + GetSurfaceWeights(position, surfacePoint.m_surfaceTags, sampleFilter, &terrainExists); + perPositionCallback(surfacePoint, terrainExists); + } +} - SurfaceData::SurfacePoint surfacePoint; - GetHeight(AZ::Vector3(fx, fy, 0.0f), sampleFilter, surfacePoint.m_position); - perPositionCallback(surfacePoint, x, y); - } +void TerrainSystem::ProcessSurfacePointsFromList( + const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + if (!perPositionCallback) + { + return; + } + + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (const auto& position : inPositions) + { + bool terrainExists = false; + surfacePoint.m_position = position; + GetSurfacePoint(position, surfacePoint, sampleFilter, &terrainExists); + perPositionCallback(surfacePoint, terrainExists); + } +} + +void TerrainSystem::ProcessHeightsFromListOfVector2( + const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + if (!perPositionCallback) + { + return; + } + + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (const auto& position : inPositions) + { + bool terrainExists = false; + surfacePoint.m_position.Set(position.GetX(), position.GetY(), 0.0f); + surfacePoint.m_position.SetZ(GetHeightFromVector2(position, sampleFilter, &terrainExists)); + perPositionCallback(surfacePoint, terrainExists); + } +} + +void TerrainSystem::ProcessNormalsFromListOfVector2( + const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + if (!perPositionCallback) + { + return; + } + + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (const auto& position : inPositions) + { + bool terrainExists = false; + surfacePoint.m_position.Set(position.GetX(), position.GetY(), 0.0f); + surfacePoint.m_normal = GetNormalFromVector2(position, sampleFilter, &terrainExists); + perPositionCallback(surfacePoint, terrainExists); + } +} + +void TerrainSystem::ProcessSurfaceWeightsFromListOfVector2( + const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + if (!perPositionCallback) + { + return; + } + + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (const auto& position : inPositions) + { + bool terrainExists = false; + surfacePoint.m_position.Set(position.GetX(), position.GetY(), 0.0f); + GetSurfaceWeightsFromVector2(position, surfacePoint.m_surfaceTags, sampleFilter, &terrainExists); + perPositionCallback(surfacePoint, terrainExists); + } +} + +void TerrainSystem::ProcessSurfacePointsFromListOfVector2( + const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + if (!perPositionCallback) + { + return; } - if (onComplete) + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (const auto& position : inPositions) { - onComplete(); + bool terrainExists = false; + surfacePoint.m_position.Set(position.GetX(), position.GetY(), 0.0f); + GetSurfacePointFromVector2(position, surfacePoint, sampleFilter, &terrainExists); + perPositionCallback(surfacePoint, terrainExists); } } +void TerrainSystem::ProcessHeightsFromRegion( + const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + // Don't bother processing if we don't have a callback + if (!perPositionCallback) + { + return; + } + + const size_t numSamplesX = aznumeric_cast(ceil(inRegion.GetExtents().GetX() / stepSize.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(inRegion.GetExtents().GetY() / stepSize.GetY())); + + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (size_t y = 0; y < numSamplesY; y++) + { + float fy = aznumeric_cast(inRegion.GetMin().GetY() + (y * stepSize.GetY())); + for (size_t x = 0; x < numSamplesX; x++) + { + bool terrainExists = false; + float fx = aznumeric_cast(inRegion.GetMin().GetX() + (x * stepSize.GetX())); + surfacePoint.m_position.Set(fx, fy, 0.0f); + surfacePoint.m_position.SetZ(GetHeight(surfacePoint.m_position, sampleFilter, &terrainExists)); + perPositionCallback(x, y, surfacePoint, terrainExists); + } + } +} -void TerrainSystem::ProcessSurfacePointsFromRegion(const AZ::Aabb& inRegion, const AZ::Vector2 stepSize, Sampler sampleFilter, SurfacePointRegionFillCallback perPositionCallback, TerrainDataReadyCallback onComplete) +void TerrainSystem::ProcessNormalsFromRegion( + const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter) const { // Don't bother processing if we don't have a callback if (!perPositionCallback) @@ -571,28 +732,83 @@ void TerrainSystem::ProcessSurfacePointsFromRegion(const AZ::Aabb& inRegion, con return; } - uint32_t numSamplesX = static_cast((inRegion.GetMax().GetX() - inRegion.GetMin().GetX()) / stepSize.GetX()); - uint32_t numSamplesY = static_cast((inRegion.GetMax().GetY() - inRegion.GetMin().GetY()) / stepSize.GetY()); + const size_t numSamplesX = aznumeric_cast(ceil(inRegion.GetExtents().GetX() / stepSize.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(inRegion.GetExtents().GetY() / stepSize.GetY())); - for (uint32_t y = 0; y < numSamplesY; y++) + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (size_t y = 0; y < numSamplesY; y++) { - for (uint32_t x = 0; x < numSamplesX; x++) + float fy = aznumeric_cast(inRegion.GetMin().GetY() + (y * stepSize.GetY())); + for (size_t x = 0; x < numSamplesX; x++) { - float fx = (float)(inRegion.GetMin().GetX() + (x * stepSize.GetX())); - float fy = (float)(inRegion.GetMin().GetY() + (y * stepSize.GetY())); + bool terrainExists = false; + float fx = aznumeric_cast(inRegion.GetMin().GetX() + (x * stepSize.GetX())); + surfacePoint.m_position.Set(fx, fy, 0.0f); + surfacePoint.m_normal = GetNormal(surfacePoint.m_position, sampleFilter, &terrainExists); + perPositionCallback(x, y, surfacePoint, terrainExists); + } + } +} + +void TerrainSystem::ProcessSurfaceWeightsFromRegion( + const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + // Don't bother processing if we don't have a callback + if (!perPositionCallback) + { + return; + } + + const size_t numSamplesX = aznumeric_cast(ceil(inRegion.GetExtents().GetX() / stepSize.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(inRegion.GetExtents().GetY() / stepSize.GetY())); - SurfaceData::SurfacePoint surfacePoint; - GetSurfacePoint(AZ::Vector3(fx, fy, inRegion.GetMin().GetZ()), sampleFilter, surfacePoint); - perPositionCallback(surfacePoint, x, y); + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (size_t y = 0; y < numSamplesY; y++) + { + float fy = aznumeric_cast(inRegion.GetMin().GetY() + (y * stepSize.GetY())); + for (size_t x = 0; x < numSamplesX; x++) + { + bool terrainExists = false; + float fx = aznumeric_cast(inRegion.GetMin().GetX() + (x * stepSize.GetX())); + surfacePoint.m_position.Set(fx, fy, 0.0f); + GetSurfaceWeights(surfacePoint.m_position, surfacePoint.m_surfaceTags, sampleFilter, &terrainExists); + perPositionCallback(x, y, surfacePoint, terrainExists); } } +} - if (onComplete) +void TerrainSystem::ProcessSurfacePointsFromRegion( + const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + // Don't bother processing if we don't have a callback + if (!perPositionCallback) { - onComplete(); + return; + } + + const size_t numSamplesX = aznumeric_cast(ceil(inRegion.GetExtents().GetX() / stepSize.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(inRegion.GetExtents().GetY() / stepSize.GetY())); + + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (size_t y = 0; y < numSamplesY; y++) + { + float fy = aznumeric_cast(inRegion.GetMin().GetY() + (y * stepSize.GetY())); + for (size_t x = 0; x < numSamplesX; x++) + { + bool terrainExists = false; + float fx = aznumeric_cast(inRegion.GetMin().GetX() + (x * stepSize.GetX())); + surfacePoint.m_position.Set(fx, fy, 0.0f); + GetSurfacePoint(surfacePoint.m_position, surfacePoint, sampleFilter, &terrainExists); + perPositionCallback(x, y, surfacePoint, terrainExists); + } } } -*/ void TerrainSystem::RegisterArea(AZ::EntityId areaId) { diff --git a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h index d7267476ed..7c6e0cd91e 100644 --- a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h +++ b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -135,6 +136,52 @@ namespace Terrain Sampler sampleFilter = Sampler::DEFAULT, bool* terrainExistsPtr = nullptr) const override; + //! Given a list of XY coordinates, call the provided callback function with surface data corresponding to each + //! XY coordinate in the list. + virtual void ProcessHeightsFromList(const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessNormalsFromList(const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessSurfaceWeightsFromList(const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessSurfacePointsFromList(const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessHeightsFromListOfVector2(const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessNormalsFromListOfVector2(const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessSurfaceWeightsFromListOfVector2(const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessSurfacePointsFromListOfVector2(const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + + //! Given a region(aabb) and a step size, call the provided callback function with surface data corresponding to the + //! coordinates in the region. + virtual void ProcessHeightsFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessNormalsFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessSurfaceWeightsFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessSurfacePointsFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + private: void ClampPosition(float x, float y, AZ::Vector2& outPosition, AZ::Vector2& normalizedDelta) const; diff --git a/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp b/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp index 3d0cb5222e..85dd5dc0c4 100644 --- a/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp +++ b/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp @@ -281,6 +281,22 @@ namespace UnitTest surfaceGradientShapeRequests.clear(); } + void GenerateInputPositionsList(const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, AZStd::vector& positions) + { + const size_t numSamplesX = aznumeric_cast(ceil(worldBounds.GetExtents().GetX() / queryResolution.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(worldBounds.GetExtents().GetY() / queryResolution.GetY())); + + for (size_t y = 0; y < numSamplesY; y++) + { + float fy = aznumeric_cast(worldBounds.GetMin().GetY() + (y * queryResolution.GetY())); + for (size_t x = 0; x < numSamplesX; x++) + { + float fx = aznumeric_cast(worldBounds.GetMin().GetX() + (x * queryResolution.GetX())); + positions.emplace_back(fx, fy, 0.0f); + } + } + } + protected: AZStd::unique_ptr m_app; }; @@ -322,6 +338,72 @@ namespace UnitTest ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_ProcessHeightsRegion)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + auto perPositionCallback = []([[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, + const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + benchmark::DoNotOptimize(surfacePoint.m_position.GetZ()); + }; + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::ProcessHeightsFromRegion, worldBounds, queryResolution, perPositionCallback, sampler); + } + ); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_ProcessHeightsRegion) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_ProcessHeightsList)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + [this]([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + AZStd::vector inPositions; + GenerateInputPositionsList(queryResolution, worldBounds, inPositions); + + auto perPositionCallback = [](const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + benchmark::DoNotOptimize(surfacePoint.m_position.GetZ()); + }; + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::ProcessHeightsFromList, inPositions, perPositionCallback, sampler); + } + ); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_ProcessHeightsList) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_GetNormal)(benchmark::State& state) { // Run the benchmark @@ -353,6 +435,66 @@ namespace UnitTest ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_ProcessNormalsRegion)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + auto perPositionCallback = []([[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, + const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + benchmark::DoNotOptimize(surfacePoint.m_normal); + }; + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::ProcessNormalsFromRegion, worldBounds, queryResolution, perPositionCallback, sampler); + } + ); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_ProcessNormalsRegion) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_ProcessNormalsList)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + [this]([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + AZStd::vector inPositions; + GenerateInputPositionsList(queryResolution, worldBounds, inPositions); + + auto perPositionCallback = [](const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + benchmark::DoNotOptimize(surfacePoint.m_normal); + }; + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::ProcessNormalsFromList, inPositions, perPositionCallback, sampler); + } + ); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_ProcessNormalsList) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_GetSurfaceWeights)(benchmark::State& state) { // Run the benchmark @@ -385,6 +527,66 @@ namespace UnitTest ->Args({ 2048, 4, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_ProcessSurfaceWeightsRegion)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + auto perPositionCallback = []([[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, + const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + benchmark::DoNotOptimize(surfacePoint.m_surfaceTags); + }; + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::ProcessSurfaceWeightsFromRegion, worldBounds, queryResolution, perPositionCallback, sampler); + } + ); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_ProcessSurfaceWeightsRegion) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 2, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 2, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 4, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 4, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_ProcessSurfaceWeightsList)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + [this]([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + AZStd::vector inPositions; + GenerateInputPositionsList(queryResolution, worldBounds, inPositions); + + auto perPositionCallback = [](const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + benchmark::DoNotOptimize(surfacePoint.m_surfaceTags); + }; + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::ProcessSurfaceWeightsFromList, inPositions, perPositionCallback, sampler); + } + ); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_ProcessSurfaceWeightsList) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 2, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 2, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 4, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 4, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_GetSurfacePoints)(benchmark::State& state) { // Run the benchmark @@ -416,6 +618,66 @@ namespace UnitTest ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_ProcessSurfacePointsRegion)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + auto perPositionCallback = []([[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, + const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + benchmark::DoNotOptimize(surfacePoint); + }; + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::ProcessSurfacePointsFromRegion, worldBounds, queryResolution, perPositionCallback, sampler); + } + ); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_ProcessSurfacePointsRegion) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_ProcessSurfacePointsList)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + [this]([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + AZStd::vector inPositions; + GenerateInputPositionsList(queryResolution, worldBounds, inPositions); + + auto perPositionCallback = [](const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + benchmark::DoNotOptimize(surfacePoint); + }; + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::ProcessSurfacePointsFromList, inPositions, perPositionCallback, sampler); + } + ); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_ProcessSurfacePointsList) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); #endif } diff --git a/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp b/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp index e5434c0a1d..a5798a3dad 100644 --- a/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp +++ b/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp @@ -41,6 +41,28 @@ namespace UnitTest float m_expectedHeight = 0.0f; }; + struct NormalTestPoint + { + AZ::Vector2 m_testLocation = AZ::Vector2::CreateZero(); + AZ::Vector3 m_expectedNormal = AZ::Vector3::CreateZero(); + }; + + struct HeightTestRegionPoints + { + size_t m_xIndex; + size_t m_yIndex; + float m_expectedHeight; + AZ::Vector2 m_testLocation = AZ::Vector2::CreateZero(); + }; + + struct NormalTestRegionPoints + { + size_t m_xIndex; + size_t m_yIndex; + AZ::Vector3 m_expectedNormal = AZ::Vector3::CreateZero(); + AZ::Vector2 m_testLocation = AZ::Vector2::CreateZero(); + }; + AZ::ComponentApplication m_app; AZStd::unique_ptr> m_boxShapeRequests; @@ -572,4 +594,312 @@ namespace UnitTest EXPECT_EQ(tagWeight.m_surfaceType, tagWeight1.m_surfaceType); EXPECT_NEAR(tagWeight.m_weight, tagWeight1.m_weight, 0.01f); } + + TEST_F(TerrainSystemTest, TerrainProcessHeightsFromListWithBilinearSamplers) + { + // This repeats the same test as TerrainHeightQueriesWithBilinearSamplersUseQueryGridToInterpolate + // The difference is that it tests the ProcessHeightsFromList variation. + + const AZ::Aabb spawnerBox = AZ::Aabb::CreateFromMinMaxValues(-10.0f, -10.0f, -5.0f, 10.0f, 10.0f, 15.0f); + const float amplitudeMeters = 10.0f; + const float frequencyMeters = 1.0f; + auto entity = CreateAndActivateMockTerrainLayerSpawner( + spawnerBox, + [amplitudeMeters, frequencyMeters](AZ::Vector3& position, bool& terrainExists) + { + // Our generated height will be X + Y. + float expectedHeight = position.GetX() + position.GetY(); + + // If either X or Y aren't evenly divisible by the query frequency, add a scaled value to our generated height. + // This will show up as an unexpected height "spike" if it gets used in any bilinear filter queries. + float unexpectedVariance = + amplitudeMeters * (fmodf(position.GetX(), frequencyMeters) + fmodf(position.GetY(), frequencyMeters)); + position.SetZ(expectedHeight + unexpectedVariance); + terrainExists = true; + }); + + // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 1 meter intervals. + const AZ::Vector2 queryResolution(frequencyMeters); + auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); + + // Test some points and verify that the results are the expected bilinear filtered result, + // whether they're in positive or negative space. + // (Z contains the the expected result for convenience). + const HeightTestPoint testPoints[] = { + + // Queries directly on grid points. These should return values of X + Y. + { AZ::Vector2(0.0f, 0.0f), 0.0f }, // Should return a height of 0 + 0 + { AZ::Vector2(1.0f, 0.0f), 1.0f }, // Should return a height of 1 + 0 + { AZ::Vector2(0.0f, 1.0f), 1.0f }, // Should return a height of 0 + 1 + { AZ::Vector2(1.0f, 1.0f), 2.0f }, // Should return a height of 1 + 1 + { AZ::Vector2(3.0f, 5.0f), 8.0f }, // Should return a height of 3 + 5 + + { AZ::Vector2(-1.0f, 0.0f), -1.0f }, // Should return a height of -1 + 0 + { AZ::Vector2(0.0f, -1.0f), -1.0f }, // Should return a height of 0 + -1 + { AZ::Vector2(-1.0f, -1.0f), -2.0f }, // Should return a height of -1 + -1 + { AZ::Vector2(-3.0f, -5.0f), -8.0f }, // Should return a height of -3 + -5 + + // Queries that are on a grid edge (one axis on the grid, the other somewhere in-between). + // These should just be a linear interpolation of the points, so it should still be X + Y. + + { AZ::Vector2(0.25f, 0.0f), 0.25f }, // Should return a height of -0.25 + 0 + { AZ::Vector2(3.75f, 0.0f), 3.75f }, // Should return a height of -3.75 + 0 + { AZ::Vector2(0.0f, 0.25f), 0.25f }, // Should return a height of 0 + -0.25 + { AZ::Vector2(0.0f, 3.75f), 3.75f }, // Should return a height of 0 + -3.75 + + { AZ::Vector2(2.0f, 3.75f), 5.75f }, // Should return a height of -2 + -3.75 + { AZ::Vector2(2.25f, 4.0f), 6.25f }, // Should return a height of -2.25 + -4 + + { AZ::Vector2(-0.25f, 0.0f), -0.25f }, // Should return a height of -0.25 + 0 + { AZ::Vector2(-3.75f, 0.0f), -3.75f }, // Should return a height of -3.75 + 0 + { AZ::Vector2(0.0f, -0.25f), -0.25f }, // Should return a height of 0 + -0.25 + { AZ::Vector2(0.0f, -3.75f), -3.75f }, // Should return a height of 0 + -3.75 + + { AZ::Vector2(-2.0f, -3.75f), -5.75f }, // Should return a height of -2 + -3.75 + { AZ::Vector2(-2.25f, -4.0f), -6.25f }, // Should return a height of -2.25 + -4 + + // Queries inside a grid square (both axes are in-between grid points) + // This is a full bilinear interpolation, but because we're using X + Y for our heights, the interpolated values + // should *still* be X + Y assuming the points were sampled correctly from the grid points. + + { AZ::Vector2(3.25f, 5.25f), 8.5f }, // Should return a height of 3.25 + 5.25 + { AZ::Vector2(7.71f, 9.74f), 17.45f }, // Should return a height of 7.71 + 9.74 + + { AZ::Vector2(-3.25f, -5.25f), -8.5f }, // Should return a height of -3.25 + -5.25 + { AZ::Vector2(-7.71f, -9.74f), -17.45f }, // Should return a height of -7.71 + -9.74 + }; + + auto perPositionCallback = [&testPoints](const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists){ + bool found = false; + for (auto& testPoint : testPoints) + { + if (testPoint.m_testLocation.GetX() == surfacePoint.m_position.GetX() && testPoint.m_testLocation.GetY() == surfacePoint.m_position.GetY()) + { + constexpr float epsilon = 0.0001f; + EXPECT_NEAR(surfacePoint.m_position.GetZ(), testPoint.m_expectedHeight, epsilon); + found = true; + break; + } + } + EXPECT_EQ(found, true); + }; + + AZStd::vector inPositions; + for (auto& testPoint : testPoints) + { + AZ::Vector3 position(testPoint.m_testLocation.GetX(), testPoint.m_testLocation.GetY(), 0.0f); + inPositions.push_back(position); + } + + terrainSystem->ProcessHeightsFromList(inPositions, perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR); + } + + TEST_F(TerrainSystemTest, TerrainProcessNormalsFromListWithBilinearSamplers) + { + // Similar to TerrainProcessHeightsFromListWithBilinearSamplers but for normals + + const AZ::Aabb spawnerBox = AZ::Aabb::CreateFromMinMaxValues(-10.0f, -10.0f, -5.0f, 10.0f, 10.0f, 15.0f); + const float amplitudeMeters = 10.0f; + const float frequencyMeters = 1.0f; + auto entity = CreateAndActivateMockTerrainLayerSpawner( + spawnerBox, + [amplitudeMeters, frequencyMeters](AZ::Vector3& position, bool& terrainExists) + { + // Our generated height will be X + Y. + float expectedHeight = position.GetX() + position.GetY(); + + // If either X or Y aren't evenly divisible by the query frequency, add a scaled value to our generated height. + // This will show up as an unexpected height "spike" if it gets used in any bilinear filter queries. + float unexpectedVariance = + amplitudeMeters * (fmodf(position.GetX(), frequencyMeters) + fmodf(position.GetY(), frequencyMeters)); + position.SetZ(expectedHeight + unexpectedVariance); + terrainExists = true; + }); + + // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 1 meter intervals. + const AZ::Vector2 queryResolution(frequencyMeters); + auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); + + const NormalTestPoint testPoints[] = { + + { AZ::Vector2(0.0f, 0.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(1.0f, 0.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(0.0f, 1.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(1.0f, 1.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(3.0f, 5.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + + { AZ::Vector2(-1.0f, 0.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(0.0f, -1.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(-1.0f, -1.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(-3.0f, -5.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + + { AZ::Vector2(0.25f, 0.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(3.75f, 0.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(0.0f, 0.25f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(0.0f, 3.75f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + + { AZ::Vector2(2.0f, 3.75f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(2.25f, 4.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + + { AZ::Vector2(-0.25f, 0.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(-3.75f, 0.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(0.0f, -0.25f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(0.0f, -3.75f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + + { AZ::Vector2(-2.0f, -3.75f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(-2.25f, -4.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + + { AZ::Vector2(3.25f, 5.25f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(7.71f, 9.74f), AZ::Vector3(-0.0292f, 0.9991f, 0.0292f) }, + + { AZ::Vector2(-3.25f, -5.25f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(-7.71f, -9.74f), AZ::Vector3(-0.0366f, -0.9986f, 0.0366f) }, + }; + + auto perPositionCallback = [&testPoints](const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists){ + bool found = false; + for (auto& testPoint : testPoints) + { + if (testPoint.m_testLocation.GetX() == surfacePoint.m_position.GetX() && testPoint.m_testLocation.GetY() == surfacePoint.m_position.GetY()) + { + constexpr float epsilon = 0.0001f; + EXPECT_NEAR(surfacePoint.m_normal.GetX(), testPoint.m_expectedNormal.GetX(), epsilon); + EXPECT_NEAR(surfacePoint.m_normal.GetY(), testPoint.m_expectedNormal.GetY(), epsilon); + EXPECT_NEAR(surfacePoint.m_normal.GetZ(), testPoint.m_expectedNormal.GetZ(), epsilon); + found = true; + break; + } + } + EXPECT_EQ(found, true); + }; + + AZStd::vector inPositions; + for (auto& testPoint : testPoints) + { + AZ::Vector3 position(testPoint.m_testLocation.GetX(), testPoint.m_testLocation.GetY(), 0.0f); + inPositions.push_back(position); + } + + terrainSystem->ProcessNormalsFromList(inPositions, perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR); + } + + TEST_F(TerrainSystemTest, TerrainProcessHeightsFromRegionWithBilinearSamplers) + { + // This repeats the same test as TerrainHeightQueriesWithBilinearSamplersUseQueryGridToInterpolate + // The difference is that it tests the ProcessHeightsFromList variation. + + const AZ::Aabb spawnerBox = AZ::Aabb::CreateFromMinMaxValues(-10.0f, -10.0f, -5.0f, 10.0f, 10.0f, 15.0f); + const float amplitudeMeters = 10.0f; + const float frequencyMeters = 1.0f; + auto entity = CreateAndActivateMockTerrainLayerSpawner( + spawnerBox, + [amplitudeMeters, frequencyMeters](AZ::Vector3& position, bool& terrainExists) + { + // Our generated height will be X + Y. + float expectedHeight = position.GetX() + position.GetY(); + + // If either X or Y aren't evenly divisible by the query frequency, add a scaled value to our generated height. + // This will show up as an unexpected height "spike" if it gets used in any bilinear filter queries. + float unexpectedVariance = + amplitudeMeters * (fmodf(position.GetX(), frequencyMeters) + fmodf(position.GetY(), frequencyMeters)); + position.SetZ(expectedHeight + unexpectedVariance); + terrainExists = true; + }); + + // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 1 meter intervals. + const AZ::Vector2 queryResolution(frequencyMeters); + auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); + + const AZ::Aabb testRegionBox = AZ::Aabb::CreateFromMinMaxValues(-1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f); + const AZ::Vector2 stepSize(1.0f); + + const HeightTestRegionPoints testPoints[] = { + { 0, 0, -2.0f, AZ::Vector2(-1.0f, -1.0f) }, + { 1, 0, -1.0f, AZ::Vector2(0.0f, -1.0f) }, + { 0, 1, -1.0f, AZ::Vector2(-1.0f, 0.0f) }, + { 1, 1, 0.0f, AZ::Vector2(0.0f, 0.0f) }, + }; + + auto perPositionCallback = [&testPoints](size_t xIndex, size_t yIndex, + const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + bool found = false; + for (auto& testPoint : testPoints) + { + if (testPoint.m_xIndex == xIndex && testPoint.m_yIndex == yIndex + && testPoint.m_testLocation.GetX() == surfacePoint.m_position.GetX() + && testPoint.m_testLocation.GetY() == surfacePoint.m_position.GetY()) + { + constexpr float epsilon = 0.0001f; + EXPECT_NEAR(surfacePoint.m_position.GetZ(), testPoint.m_expectedHeight, epsilon); + found = true; + break; + } + } + EXPECT_EQ(found, true); + }; + + terrainSystem->ProcessHeightsFromRegion(testRegionBox, stepSize, perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR); + } + + TEST_F(TerrainSystemTest, TerrainProcessNormalsFromRegionWithBilinearSamplers) + { + // This repeats the same test as TerrainHeightQueriesWithBilinearSamplersUseQueryGridToInterpolate + // The difference is that it tests the ProcessHeightsFromList variation. + + const AZ::Aabb spawnerBox = AZ::Aabb::CreateFromMinMaxValues(-10.0f, -10.0f, -5.0f, 10.0f, 10.0f, 15.0f); + const float amplitudeMeters = 10.0f; + const float frequencyMeters = 1.0f; + auto entity = CreateAndActivateMockTerrainLayerSpawner( + spawnerBox, + [amplitudeMeters, frequencyMeters](AZ::Vector3& position, bool& terrainExists) + { + // Our generated height will be X + Y. + float expectedHeight = position.GetX() + position.GetY(); + + // If either X or Y aren't evenly divisible by the query frequency, add a scaled value to our generated height. + // This will show up as an unexpected height "spike" if it gets used in any bilinear filter queries. + float unexpectedVariance = + amplitudeMeters * (fmodf(position.GetX(), frequencyMeters) + fmodf(position.GetY(), frequencyMeters)); + position.SetZ(expectedHeight + unexpectedVariance); + terrainExists = true; + }); + + // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 1 meter intervals. + const AZ::Vector2 queryResolution(frequencyMeters); + auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); + + const AZ::Aabb testRegionBox = AZ::Aabb::CreateFromMinMaxValues(-1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f); + const AZ::Vector2 stepSize(1.0f); + + const NormalTestRegionPoints testPoints[] = { + { 0, 0, AZ::Vector3(-0.5773f, -0.5773f, 0.5773f), AZ::Vector2(-1.0f, -1.0f) }, + { 1, 0, AZ::Vector3(-0.5773f, -0.5773f, 0.5773f), AZ::Vector2(0.0f, -1.0f) }, + { 0, 1, AZ::Vector3(-0.5773f, -0.5773f, 0.5773f), AZ::Vector2(-1.0f, 0.0f) }, + { 1, 1, AZ::Vector3(-0.5773f, -0.5773f, 0.5773f), AZ::Vector2(0.0f, 0.0f) }, + }; + + auto perPositionCallback = [&testPoints](size_t xIndex, size_t yIndex, + const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + bool found = false; + for (auto& testPoint : testPoints) + { + if (testPoint.m_xIndex == xIndex && testPoint.m_yIndex == yIndex + && testPoint.m_testLocation.GetX() == surfacePoint.m_position.GetX() + && testPoint.m_testLocation.GetY() == surfacePoint.m_position.GetY()) + { + constexpr float epsilon = 0.0001f; + EXPECT_NEAR(surfacePoint.m_normal.GetX(), testPoint.m_expectedNormal.GetX(), epsilon); + EXPECT_NEAR(surfacePoint.m_normal.GetY(), testPoint.m_expectedNormal.GetY(), epsilon); + EXPECT_NEAR(surfacePoint.m_normal.GetZ(), testPoint.m_expectedNormal.GetZ(), epsilon); + found = true; + break; + } + } + EXPECT_EQ(found, true); + }; + + terrainSystem->ProcessNormalsFromRegion(testRegionBox, stepSize, perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR); + } } // namespace UnitTest From aebf93d8824a8b1d8b8e31d7a808161b21357dd8 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Wed, 12 Jan 2022 13:13:52 -0800 Subject: [PATCH 366/399] fixing a typo in docstring Signed-off-by: Scott Murray --- .../editor_python_test_tools/editor_entity_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index bf27ec06e0..c3398406ab 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -264,7 +264,7 @@ class EditorComponent: def disable_component(self): """ Used to disable the component using its id value. - Deprecation warning! Use set_enable(False) instead as this method is in deprecation + Deprecation warning! Use set_enabled(False) instead as this method is in deprecation :return: None """ warnings.warn("disable_component is deprecated, use set_enabled(False) instead.", DeprecationWarning) From 74e40551957548935201d5a935c5a66c9d520310 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Wed, 12 Jan 2022 15:23:06 -0800 Subject: [PATCH 367/399] Fix Prefab instance assets not preloading (#6834) PrefabCatchmentProcessor::ProcessPrefab was no longer updating the ProcessedObjectStore's referenced object list, this change exposes the referenced asset list in the new PrefabDocument API and uses them to update the referenced asset list. Signed-off-by: Nicholas Van Sickle --- .../Prefab/Spawnable/PrefabCatchmentProcessor.cpp | 1 + .../Prefab/Spawnable/PrefabDocument.cpp | 12 +++++++++++- .../Prefab/Spawnable/PrefabDocument.h | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp index 40cd52cac8..a5ca034c36 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp @@ -64,6 +64,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils AZStd::move(uniqueName), context.GetSourceUuid(), AZStd::move(serializer)); AZ_Assert(spawnable, "Failed to create a new spawnable."); + object.GetReferencedAssets() = prefab.GetReferencedAssets(); Instance& instance = prefab.GetInstance(); // Resolve entity aliases that store PrefabDOM information to use the spawnable instead. This is done before the entities are // moved from the instance as they'd otherwise can't be found. diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp index 04fdea30d2..230c2226cd 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp @@ -124,12 +124,22 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils return *m_instance; } + AZStd::vector>& PrefabDocument::GetReferencedAssets() + { + return m_referencedAssets; + } + + const AZStd::vector>& PrefabDocument::GetReferencedAssets() const + { + return m_referencedAssets; + } + bool PrefabDocument::ConstructInstanceFromPrefabDom(const PrefabDom& prefab) { using namespace AzToolsFramework::Prefab; m_instance->Reset(); - if (PrefabDomUtils::LoadInstanceFromPrefabDom(*m_instance, prefab, PrefabDomUtils::LoadFlags::AssignRandomEntityId)) + if (PrefabDomUtils::LoadInstanceFromPrefabDom(*m_instance, prefab, m_referencedAssets, PrefabDomUtils::LoadFlags::AssignRandomEntityId)) { return true; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h index 215daf7f71..661dba5edf 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h @@ -53,12 +53,16 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils AzToolsFramework::Prefab::Instance& GetInstance(); const AzToolsFramework::Prefab::Instance& GetInstance() const; + AZStd::vector>& GetReferencedAssets(); + const AZStd::vector>& GetReferencedAssets() const; + private: bool ConstructInstanceFromPrefabDom(const PrefabDom& prefab); mutable PrefabDom m_dom; AZStd::unique_ptr m_instance; AZStd::string m_name; + AZStd::vector> m_referencedAssets; mutable bool m_isDirty{ false }; }; } // namespace AzToolsFramework::Prefab::PrefabConversionUtils From 073994e8e75d1ec3ffafe84a16d1613962b42b34 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Wed, 12 Jan 2022 17:34:34 -0800 Subject: [PATCH 368/399] Remove quotes around list (#6864) Signed-off-by: amzn-sj --- cmake/Platform/Mac/InstallUtils_mac.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Platform/Mac/InstallUtils_mac.cmake.in b/cmake/Platform/Mac/InstallUtils_mac.cmake.in index 3db9903e48..9be6338752 100644 --- a/cmake/Platform/Mac/InstallUtils_mac.cmake.in +++ b/cmake/Platform/Mac/InstallUtils_mac.cmake.in @@ -43,7 +43,7 @@ function(fixup_python_framework framework_path) file(GLOB_RECURSE exe_file_list "${framework_path}/**/*.exe") if(exe_file_list) - file(REMOVE_RECURSE "${exe_file_list}") + file(REMOVE_RECURSE ${exe_file_list}) endif() execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink include/python@LY_PYTHON_VERSION_MAJOR_MINOR@m Headers WORKING_DIRECTORY "${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@" From e224fc2ee5ec2a12e75a10acae268b7b38ae3a32 Mon Sep 17 00:00:00 2001 From: Roman <69218254+amzn-rhhong@users.noreply.github.com> Date: Wed, 12 Jan 2022 22:39:56 -0800 Subject: [PATCH 369/399] Bugfix - ViewportInteractionImp connected to the wrong id in RenderViewportWidget (#6867) Signed-off-by: rhhong --- .../Code/Source/Viewport/RenderViewportWidget.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp index 505ff70122..b15cf53427 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp @@ -68,6 +68,7 @@ namespace AtomToolsFramework { return false; } + const AzFramework::ViewportId newId = m_viewportContext->GetId(); SetControllerList(AZStd::make_shared()); @@ -78,14 +79,14 @@ namespace AtomToolsFramework m_viewportInteractionImpl = AZStd::make_unique(m_defaultCamera); m_viewportInteractionImpl->m_deviceScalingFactorFn = [this] { return aznumeric_cast(devicePixelRatioF()); }; m_viewportInteractionImpl->m_screenSizeFn = [this] { return AzFramework::ScreenSize(width(), height()); }; - m_viewportInteractionImpl->Connect(id); + m_viewportInteractionImpl->Connect(newId); AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Handler::BusConnect(GetId()); AzFramework::InputChannelEventListener::Connect(); AZ::TickBus::Handler::BusConnect(); AzFramework::WindowRequestBus::Handler::BusConnect(params.windowHandle); - m_inputChannelMapper = new AzToolsFramework::QtEventToAzInputMapper(this, id); + m_inputChannelMapper = new AzToolsFramework::QtEventToAzInputMapper(this, newId); // Forward input events to our controller list. QObject::connect(m_inputChannelMapper, &AzToolsFramework::QtEventToAzInputMapper::InputChannelUpdated, this, From ff0df4b8b6e66286c12391522c4814cc7f8864f7 Mon Sep 17 00:00:00 2001 From: Andre Mitchell <47983418+BytesOfPiDev@users.noreply.github.com> Date: Thu, 13 Jan 2022 03:36:19 -0500 Subject: [PATCH 370/399] Update behavior reflection of EMotionFX's MotionEvent to use nullptr instead of empty lambdas. (#6617) Signed-off-by: Andre Mitchell --- .../Integration/System/SystemComponent.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp b/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp index 15037793f1..08607c330d 100644 --- a/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp +++ b/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp @@ -400,17 +400,16 @@ namespace EMotionFX behaviorContext->EBus("SystemNotificationBus") ; - // In order for a property to be displayed in ScriptCanvas. Both a setter and a getter are necessary(both must be non-null). - // This is being worked on in dragon branch, once this is complete the dummy lambda functions can be removed. + // In order for a property to be displayed in ScriptCanvas. behaviorContext->Class("MotionEvent") - ->Property("entityId", BehaviorValueGetter(&MotionEvent::m_entityId), [](MotionEvent*, const AZ::EntityId&) {}) - ->Property("parameter", BehaviorValueGetter(&MotionEvent::m_parameter), [](MotionEvent*, const char*) {}) - ->Property("eventType", BehaviorValueGetter(&MotionEvent::m_eventType), [](MotionEvent*, const AZ::u32&) {}) - ->Property("eventTypeName", BehaviorValueGetter(&MotionEvent::m_eventTypeName), [](MotionEvent*, const char*) {}) - ->Property("time", BehaviorValueGetter(&MotionEvent::m_time), [](MotionEvent*, const float&) {}) - ->Property("globalWeight", BehaviorValueGetter(&MotionEvent::m_globalWeight), [](MotionEvent*, const float&) {}) - ->Property("localWeight", BehaviorValueGetter(&MotionEvent::m_localWeight), [](MotionEvent*, const float&) {}) - ->Property("isEventStart", BehaviorValueGetter(&MotionEvent::m_isEventStart), [](MotionEvent*, const bool&) {}) + ->Property("entityId", BehaviorValueGetter(&MotionEvent::m_entityId), nullptr) + ->Property("parameter", BehaviorValueGetter(&MotionEvent::m_parameter), nullptr) + ->Property("eventType", BehaviorValueGetter(&MotionEvent::m_eventType), nullptr) + ->Property("eventTypeName", BehaviorValueGetter(&MotionEvent::m_eventTypeName), nullptr) + ->Property("time", BehaviorValueGetter(&MotionEvent::m_time), nullptr) + ->Property("globalWeight", BehaviorValueGetter(&MotionEvent::m_globalWeight), nullptr) + ->Property("localWeight", BehaviorValueGetter(&MotionEvent::m_localWeight), nullptr) + ->Property("isEventStart", BehaviorValueGetter(&MotionEvent::m_isEventStart), nullptr) ; behaviorContext->EBus("ActorNotificationBus") From 6d1a2382e872c74cf51e34127ab4e9573305b1dd Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Thu, 13 Jan 2022 13:56:38 +0000 Subject: [PATCH 371/399] Bug hide window (#5939) * [lyn3736] adding init files to module paths (#5111) * fixing class names in PYI files Signed-off-by: jackalbe <23512001+jackalbe@users.noreply.github.com> Signed-off-by: T.J. McGrath-Daly * Fixed crash when typing asset name and clicking browse (#5495) Signed-off-by: T.J. McGrath-Daly * Fixed bug involving inappropriate window Signed-off-by: T.J. McGrath-Daly Co-authored-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> Co-authored-by: AMZN-AlexOteiza <82234181+AMZN-AlexOteiza@users.noreply.github.com> --- Gems/AudioSystem/Code/Source/Editor/QConnectionsWidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Gems/AudioSystem/Code/Source/Editor/QConnectionsWidget.cpp b/Gems/AudioSystem/Code/Source/Editor/QConnectionsWidget.cpp index d827f657b8..f8414e25e4 100644 --- a/Gems/AudioSystem/Code/Source/Editor/QConnectionsWidget.cpp +++ b/Gems/AudioSystem/Code/Source/Editor/QConnectionsWidget.cpp @@ -33,6 +33,7 @@ namespace AudioControls { setupUi(this); + m_connectionPropertiesFrame->setHidden(true); m_connectionList->viewport()->installEventFilter(this); m_connectionList->installEventFilter(this); From fed1278fe64e8a435b1c19ba8092b18a98fa9eb1 Mon Sep 17 00:00:00 2001 From: amzn-mike <80125227+amzn-mike@users.noreply.github.com> Date: Thu, 13 Jan 2022 08:56:24 -0600 Subject: [PATCH 372/399] AP: product dependency optimization (#6619) * Initial pass at optimizing product path dependency resolution Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Add version of StripAssetPlatform that doesn't allocate or copy strings. Re-add missing test and fix up compile errors. Add benchmark test Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Change UpdateProductDependencies to directly call s_InsertProductDependencyQuery.BindAndStep Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Add test for same filename on multiple platforms Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Rework search logic to keep track of the source of a search path (source vs product) and keep track of which search matches which dependency to avoid doing another search through every product later on Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Clean up code, expand test Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Fix paths not being lowercased by SanitizeForDatabase. Fix UpdateProductDependencies not updating existing dependencies Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Add test for duplicate dependency matches. Fix saving duplicates Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Clean up code Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Separate test into test and benchmark versions Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Cleanup include Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Fix includes, switch hardcoded job manager setup to use JobManagerComponent instead Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Replaced wildcard_match with PathView::Match. Changed StripAssetPlatformNoCopy to use TokenizeNext. Removed Environment Create/Destroy calls. Made ScopedAllocatorFixture a base class of ScopedAllocatorSetupFixture Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Add AZ Environment create/destroy on AP test environment Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Add missing asserts on database functions Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Fix incorrect usage of StripAssetPlatformNoCopy Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Fix source/product dependency type being ignored. Removed need for unordered_set for list of resolved dependencies. Updated unit tests Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Better variable names Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Remove testing code Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Fix missing includes and namespaces Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> --- .../AzCore/AzCore/UnitTest/TestTypes.h | 38 +- .../assetprocessor_test_files.cmake | 1 + .../native/AssetDatabase/AssetDatabase.cpp | 84 ++-- .../native/AssetManager/AssetCatalog.cpp | 4 +- .../AssetManager/PathDependencyManager.cpp | 187 +++++---- .../AssetManager/PathDependencyManager.h | 23 +- .../AssetManager/assetProcessorManager.cpp | 138 ++++--- .../native/tests/BaseAssetProcessorTest.h | 2 + .../tests/PathDependencyManagerTests.cpp | 362 ++++++++++++++++-- .../AssetProcessorManagerTest.cpp | 79 +++- .../assetmanager/AssetProcessorManagerTest.h | 11 +- .../utilities/PlatformConfiguration.cpp | 14 +- .../native/utilities/assetUtils.cpp | 28 +- .../native/utilities/assetUtils.h | 6 +- 14 files changed, 741 insertions(+), 236 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/UnitTest/TestTypes.h b/Code/Framework/AzCore/AzCore/UnitTest/TestTypes.h index afa6898944..0b1d7caefe 100644 --- a/Code/Framework/AzCore/AzCore/UnitTest/TestTypes.h +++ b/Code/Framework/AzCore/AzCore/UnitTest/TestTypes.h @@ -71,18 +71,35 @@ namespace UnitTest }; /** - * RAII wrapper of AllocatorBase. - * The benefit of using this wrapper instead of AllocatorsTestFixture is that SetUp/TearDown of the allocator is managed - * on construction/destruction, allowing member variables of derived classes to exist as value (and do heap allocation). - */ - class ScopedAllocatorSetupFixture + * RAII wrapper of AllocatorBase. + * The benefit of using this wrapper instead of AllocatorsTestFixture is that SetUp/TearDown of the allocator is managed + * on construction/destruction, allowing member variables of derived classes to exist as value (and do heap allocation). + */ + class ScopedAllocatorFixture : AllocatorsBase + { + public: + ScopedAllocatorFixture() + { + SetupAllocator(); + } + explicit ScopedAllocatorFixture(const AZ::SystemAllocator::Descriptor& allocatorDesc) + { + SetupAllocator(allocatorDesc); + } + ~ScopedAllocatorFixture() override + { + TeardownAllocator(); + } + }; + + // Like ScopedAllocatorFixture, but includes the Test base class + class ScopedAllocatorSetupFixture : public ::testing::Test - , AllocatorsBase + , public ScopedAllocatorFixture { public: - ScopedAllocatorSetupFixture() { SetupAllocator(); } - explicit ScopedAllocatorSetupFixture(const AZ::SystemAllocator::Descriptor& allocatorDesc) { SetupAllocator(allocatorDesc); } - ~ScopedAllocatorSetupFixture() { TeardownAllocator(); } + ScopedAllocatorSetupFixture() = default; + explicit ScopedAllocatorSetupFixture(const AZ::SystemAllocator::Descriptor& allocatorDesc) : ScopedAllocatorFixture(allocatorDesc){} }; /** @@ -114,6 +131,7 @@ namespace UnitTest using AllocatorsFixture = AllocatorsTestFixture; #if defined(HAVE_BENCHMARK) + /** * Helper class to handle the boiler plate of setting up a benchmark fixture that uses the system allocators * If you wish to do additional setup and tear down be sure to call the base class SetUp first and TearDown @@ -218,7 +236,7 @@ namespace UnitTest static constexpr bool sHasPadding = size < alignment; AZStd::enable_if mPadding; }; - + template int CreationCounter::s_count = 0; template diff --git a/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake b/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake index 2c4c53642c..a7a46ad62c 100644 --- a/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake +++ b/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake @@ -48,6 +48,7 @@ set(FILES native/tests/InternalBuilders/SettingsRegistryBuilderTests.cpp native/tests/MissingDependencyScannerTests.cpp native/tests/SourceFileRelocatorTests.cpp + native/tests/PathDependencyManagerTests.cpp native/tests/AssetProcessorMessagesTests.cpp native/unittests/AssetProcessingStateDataUnitTests.cpp native/unittests/AssetProcessingStateDataUnitTests.h diff --git a/Code/Tools/AssetProcessor/native/AssetDatabase/AssetDatabase.cpp b/Code/Tools/AssetProcessor/native/AssetDatabase/AssetDatabase.cpp index cf33e559ac..5edf4e1d53 100644 --- a/Code/Tools/AssetProcessor/native/AssetDatabase/AssetDatabase.cpp +++ b/Code/Tools/AssetProcessor/native/AssetDatabase/AssetDatabase.cpp @@ -172,7 +172,7 @@ namespace AssetProcessor static const char* CREATEINDEX_BUILDERGUID_SOURCE_SOURCEDEPENDENCY_STATEMENT = "CREATE INDEX IF NOT EXISTS BuilderGuid_Source_SourceDependency ON SourceDependency (BuilderGuid, Source);"; static const char* CREATEINDEX_TYPEOFDEPENDENCY_SOURCEDEPENDENCY = "AssetProcessor::CreateIndexTypeOfDependency_SourceDependency"; - static const char* CREATEINDEX_TYPEOFDEPENDENCY_SOURCEDEPENDENCY_STATEMENT = + static const char* CREATEINDEX_TYPEOFDEPENDENCY_SOURCEDEPENDENCY_STATEMENT = "CREATE INDEX IF NOT EXISTS TypeOfDependency_SourceDependency ON SourceDependency (TypeOfDependency);"; static const char* CREATEINDEX_SCANFOLDERS_SOURCES_SCANFOLDER = "AssetProcesser::CreateIndexScanFoldersSourcesScanFolder"; @@ -611,7 +611,7 @@ namespace AssetProcessor SqlParam(":missingDependencyString"), SqlParam(":lastScanTime"), SqlParam(":scanTimeSecondsSinceEpoch")); - + static const auto s_DeleteMissingProductDependencyByProductIdQuery = MakeSqlQuery( DELETE_MISSING_PRODUCT_DEPENDENCY_BY_PRODUCTID, @@ -643,7 +643,7 @@ namespace AssetProcessor SqlParam(":analysisFingerprint")); static const char* INSERT_COLUMN_ANALYSISFINGERPRINT = "AssetProcessor::AddColumnAnalysisFingerprint"; - static const char* INSERT_COLUMN_ANALYSISFINGERPRINT_STATEMENT = + static const char* INSERT_COLUMN_ANALYSISFINGERPRINT_STATEMENT = "ALTER TABLE Sources " "ADD AnalysisFingerprint TEXT NOT NULL collate nocase default('');"; @@ -653,7 +653,7 @@ namespace AssetProcessor "ADD TypeOfDependency INTEGER NOT NULL DEFAULT 0;"; static const char* INSERT_COLUMN_FILE_MODTIME = "AssetProcessor::AddFiles_ModTime"; - static const char* INSERT_COLUMN_FILE_MODTIME_STATEMENT = + static const char* INSERT_COLUMN_FILE_MODTIME_STATEMENT = "ALTER TABLE Files " "ADD ModTime INTEGER NOT NULL DEFAULT 0;"; @@ -673,7 +673,7 @@ namespace AssetProcessor "ADD UnresolvedDependencyType INTEGER NOT NULL DEFAULT 0;"; static const char* INSERT_COLUMN_PRODUCTDEPENDENCY_PLATFORM = "AssetProcessor::AddProductDependency_Platform"; - static const char* INSERT_COLUMN_PRODUCTDEPENDENCY_PLATFORM_STATEMENT = + static const char* INSERT_COLUMN_PRODUCTDEPENDENCY_PLATFORM_STATEMENT = "ALTER TABLE ProductDependencies " "ADD Platform TEXT NOT NULL collate nocase default('');"; @@ -721,7 +721,7 @@ namespace AssetProcessor SqlParam(":isfolder"), SqlParam(":modtime"), SqlParam(":hash")); - + static const char* UPDATE_FILE = "AssetProcessor::UpdateFile"; static const char* UPDATE_FILE_STATEMENT = "UPDATE Files SET " @@ -961,7 +961,7 @@ namespace AssetProcessor AZ_TracePrintf(AssetProcessor::ConsoleChannel, "Upgraded Asset Database to version %i (AddedTypeOfDependencyIndex)\n", foundVersion) } } - + if (foundVersion == AssetDatabase::DatabaseVersion::AddedTypeOfDependencyIndex) { if (m_databaseConnection->ExecuteOneOffStatement(INSERT_COLUMN_PRODUCTDEPENDENCY_PLATFORM)) @@ -1178,7 +1178,7 @@ namespace AssetProcessor AddStatement(m_databaseConnection, s_InsertJobQuery); AddStatement(m_databaseConnection, s_UpdateJobQuery); AddStatement(m_databaseConnection, s_DeleteJobQuery); - + // --------------------------------------------------------------------------------------------- // Builder Info Table // --------------------------------------------------------------------------------------------- @@ -1207,7 +1207,7 @@ namespace AssetProcessor m_databaseConnection->AddStatement(CREATE_SOURCE_DEPENDENCY_TABLE, CREATE_SOURCE_DEPENDENCY_TABLE_STATEMENT); m_databaseConnection->AddStatement(INSERT_COLUMN_SOURCEDEPENDENCY_TYPEOFDEPENDENCY, INSERT_COLUMN_SOURCEDEPENDENCY_TYPEOFDEPENDENCY_STATEMENT); m_databaseConnection->AddStatement(INSERT_COLUMNS_SOURCEDEPENDENCY_FROM_ASSETID, INSERT_COLUMNS_SOURCEDEPENDENCY_FROM_ASSETID_STATEMENT); - + m_createStatements.push_back(CREATE_SOURCE_DEPENDENCY_TABLE); AddStatement(m_databaseConnection, s_InsertSourceDependencyQuery); @@ -1242,7 +1242,7 @@ namespace AssetProcessor AddStatement(m_databaseConnection, s_InsertProductDependencyQuery); AddStatement(m_databaseConnection, s_UpdateProductDependencyQuery); AddStatement(m_databaseConnection, s_DeleteProductDependencyByProductIdQuery); - + // --------------------------------------------------------------------------------------------- // Missing Product Dependency table // --------------------------------------------------------------------------------------------- @@ -1253,7 +1253,7 @@ namespace AssetProcessor AddStatement(m_databaseConnection, s_InsertMissingProductDependencyQuery); AddStatement(m_databaseConnection, s_UpdateMissingProductDependencyQuery); AddStatement(m_databaseConnection, s_DeleteMissingProductDependencyByProductIdQuery); - + // --------------------------------------------------------------------------------------------- // Files table // --------------------------------------------------------------------------------------------- @@ -1344,7 +1344,7 @@ namespace AssetProcessor bool AssetDatabaseConnection::GetScanFolderByScanFolderID(AZ::s64 scanfolderID, ScanFolderDatabaseEntry& entry) { bool found = false; - QueryScanFolderByScanFolderID( scanfolderID, + QueryScanFolderByScanFolderID( scanfolderID, [&](ScanFolderDatabaseEntry& scanFolderEntry) { entry = scanFolderEntry; @@ -1357,7 +1357,7 @@ namespace AssetProcessor bool AssetDatabaseConnection::GetScanFolderBySourceID(AZ::s64 sourceID, ScanFolderDatabaseEntry& entry) { bool found = false; - QueryScanFolderBySourceID( sourceID, + QueryScanFolderBySourceID( sourceID, [&](ScanFolderDatabaseEntry& scanFolderEntry) { entry = scanFolderEntry; @@ -1370,7 +1370,7 @@ namespace AssetProcessor bool AssetDatabaseConnection::GetScanFolderByJobID(AZ::s64 jobID, ScanFolderDatabaseEntry& entry) { bool found = false; - QueryScanFolderByJobID( jobID, + QueryScanFolderByJobID( jobID, [&](ScanFolderDatabaseEntry& scanFolderEntry) { entry = scanFolderEntry; @@ -1383,7 +1383,7 @@ namespace AssetProcessor bool AssetDatabaseConnection::GetScanFolderByProductID(AZ::s64 productID, ScanFolderDatabaseEntry& entry) { bool found = false; - QueryScanFolderByProductID( productID, + QueryScanFolderByProductID( productID, [&](ScanFolderDatabaseEntry& scanFolderEntry) { entry = scanFolderEntry; @@ -2105,7 +2105,7 @@ namespace AssetProcessor bool AssetDatabaseConnection::GetProductsLikeProductName(QString likeProductName, LikeType likeType, ProductDatabaseEntryContainer& container, AZ::Uuid builderGuid, QString jobKey, QString platform, JobStatus status) { bool found = false; - + if (likeProductName.isEmpty()) { return false; @@ -2198,7 +2198,7 @@ namespace AssetProcessor bool AssetDatabaseConnection::GetProductByJobIDSubId(AZ::s64 jobID, AZ::u32 subID, AzToolsFramework::AssetDatabase::ProductDatabaseEntry& result) { bool found = false; - QueryProductByJobIDSubID(jobID, subID, + QueryProductByJobIDSubID(jobID, subID, [&](ProductDatabaseEntry& resultFromDB) { found = true; @@ -2312,13 +2312,19 @@ namespace AssetProcessor { return false; } - - bool succeeded = true; + + ScopedTransaction transaction(m_databaseConnection); + for (auto& entry : container) { - succeeded &= SetProduct(entry); + if(!SetProduct(entry)) + { + return false; + } } - return succeeded; + + transaction.Commit(); + return true; } //! Clear the products for a given source. This removes the entry entirely, not just sets it to empty. @@ -2407,7 +2413,7 @@ namespace AssetProcessor if(!platform.isEmpty()) { AZStd::string platformStr = platform.toUtf8().constData(); - + if (!s_DeleteProductsBySourceidPlatformQuery.BindAndStep(*m_databaseConnection, sourceID, platformStr.c_str())) { return false; @@ -2521,7 +2527,7 @@ namespace AssetProcessor { succeeded = succeeded && RemoveSourceFileDependency(entry); } - + if (succeeded) { transaction.Commit(); @@ -2577,7 +2583,7 @@ namespace AssetProcessor } bool AssetDatabaseConnection::GetDependsOnSourceBySource( - const char* source, + const char* source, AzToolsFramework::AssetDatabase::SourceFileDependencyEntry::TypeOfDependency typeOfDependency, AzToolsFramework::AssetDatabase::SourceFileDependencyEntryContainer& container) { @@ -2596,7 +2602,7 @@ namespace AssetProcessor bool AssetDatabaseConnection::GetSourceFileDependencyBySourceDependencyId(AZ::s64 sourceDependencyId, SourceFileDependencyEntry& sourceDependencyEntry) { bool found = false; - QuerySourceDependencyBySourceDependencyId(sourceDependencyId, + QuerySourceDependencyBySourceDependencyId(sourceDependencyId, [&](SourceFileDependencyEntry& entry) { found = true; @@ -2624,7 +2630,7 @@ namespace AssetProcessor return false; } - + if (creatingNew) { AZ::s64 rowID = m_databaseConnection->GetLastRowID(); @@ -2958,9 +2964,25 @@ namespace AssetProcessor for(auto& entry : container) { - if(!SetProductDependency(entry)) + if(entry.m_productDependencyID == InvalidEntryId) { - return false; + if (!s_InsertProductDependencyQuery.BindAndStep( + *m_databaseConnection, entry.m_productPK, entry.m_dependencySourceGuid, entry.m_dependencySubID, + entry.m_dependencyFlags.to_ullong(), entry.m_platform.c_str(), entry.m_unresolvedPath.c_str(), + entry.m_dependencyType, entry.m_fromAssetId)) + { + return false; + } + } + else + { + if(!s_UpdateProductDependencyQuery.BindAndStep( + *m_databaseConnection, entry.m_productPK, entry.m_dependencySourceGuid, entry.m_dependencySubID, + entry.m_dependencyFlags.to_ullong(), entry.m_platform.c_str(), entry.m_unresolvedPath.c_str(), + entry.m_productDependencyID, entry.m_dependencyType, entry.m_fromAssetId)) + { + return false; + } } } @@ -2989,7 +3011,7 @@ namespace AssetProcessor } // now insert the new ones since we know there's no collisions: - + for (auto& entry : container) { @@ -3109,7 +3131,7 @@ namespace AssetProcessor } Statement* statement = autoFinal.Get(); - + if (statement->Step() == Statement::SqlError) { AZ_Warning(LOG_NAME, false, "Failed to write the new source into the database. %s", entry.m_fileName.c_str()); @@ -3126,7 +3148,7 @@ namespace AssetProcessor return UpdateFile(entry, entryAlreadyExists); } - bool AssetDatabaseConnection::UpdateFile(FileDatabaseEntry& entry, bool& entryAlreadyExists) + bool AssetDatabaseConnection::UpdateFile(FileDatabaseEntry& entry, bool& entryAlreadyExists) { entryAlreadyExists = false; diff --git a/Code/Tools/AssetProcessor/native/AssetManager/AssetCatalog.cpp b/Code/Tools/AssetProcessor/native/AssetManager/AssetCatalog.cpp index d7cdd30be8..bda5eb7842 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/AssetCatalog.cpp +++ b/Code/Tools/AssetProcessor/native/AssetManager/AssetCatalog.cpp @@ -480,12 +480,12 @@ namespace AssetProcessor AZ::Data::AssetId assetId(combined.m_sourceGuid, combined.m_subID); // relative file path is gotten by removing the platform and game from the product name - QString relativeProductPath = AssetUtilities::StripAssetPlatform(combined.m_productName); + AZStd::string_view relativeProductPath = AssetUtilities::StripAssetPlatformNoCopy(combined.m_productName); QString fullProductPath = m_cacheRoot.absoluteFilePath(combined.m_productName.c_str()); AZ::Data::AssetInfo info; info.m_assetType = combined.m_assetType; - info.m_relativePath = relativeProductPath.toUtf8().data(); + info.m_relativePath = relativeProductPath; info.m_assetId = assetId; info.m_sizeBytes = AZ::IO::SystemFile::Length(fullProductPath.toUtf8().constData()); diff --git a/Code/Tools/AssetProcessor/native/AssetManager/PathDependencyManager.cpp b/Code/Tools/AssetProcessor/native/AssetManager/PathDependencyManager.cpp index dc10dc2237..6dddfd62d3 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/PathDependencyManager.cpp +++ b/Code/Tools/AssetProcessor/native/AssetManager/PathDependencyManager.cpp @@ -9,18 +9,24 @@ #include "PathDependencyManager.h" #include #include +#include #include #include #include +#include namespace AssetProcessor { void SanitizeForDatabase(AZStd::string& str) { - // Not calling normalize because wildcards should be preserved. AZStd::to_lower(str.begin(), str.end()); - AZStd::replace(str.begin(), str.end(), AZ_WRONG_DATABASE_SEPARATOR, AZ_CORRECT_DATABASE_SEPARATOR); - AzFramework::StringFunc::Replace(str, AZ_DOUBLE_CORRECT_DATABASE_SEPARATOR, AZ_CORRECT_DATABASE_SEPARATOR_STRING); + + // Not calling normalize because wildcards should be preserved. + if (AZ::StringFunc::Contains(str, AZ_WRONG_DATABASE_SEPARATOR, true)) + { + AZStd::replace(str.begin(), str.end(), AZ_WRONG_DATABASE_SEPARATOR, AZ_CORRECT_DATABASE_SEPARATOR); + AzFramework::StringFunc::Replace(str, AZ_DOUBLE_CORRECT_DATABASE_SEPARATOR, AZ_CORRECT_DATABASE_SEPARATOR_STRING); + } } PathDependencyManager::PathDependencyManager(AZStd::shared_ptr stateData, PlatformConfiguration* platformConfig) @@ -29,7 +35,97 @@ namespace AssetProcessor } - void PathDependencyManager::SaveUnresolvedDependenciesToDatabase(AssetBuilderSDK::ProductPathDependencySet& unresolvedDependencies, const AzToolsFramework::AssetDatabase::ProductDatabaseEntry& productEntry, const AZStd::string& platform) + void PathDependencyManager::QueueSourceForDependencyResolution(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry) + { + m_queuedForResolve.push_back(sourceEntry); + } + + void PathDependencyManager::ProcessQueuedDependencyResolves() + { + if (m_queuedForResolve.empty()) + { + return; + } + + auto queuedForResolve = m_queuedForResolve; + m_queuedForResolve.clear(); + + // Grab every product from the database and map to Source PK -> [products] + AZStd::unordered_map> productMap; + m_stateData->QueryCombined([&productMap](const AzToolsFramework::AssetDatabase::CombinedDatabaseEntry& entry) + { + productMap[entry.m_sourcePK].push_back(entry); + return true; + }); + + // Build up a list of all the paths we need to search for: products + 2 variations of the source path + AZStd::vector searches; + + for (const auto& entry : queuedForResolve) + { + // Search for each product + for (const auto& productEntry : productMap[entry.m_sourceID]) + { + const AZStd::string& productName = productEntry.m_productName; + + // strip path of the / + AZStd::string_view result = AssetUtilities::StripAssetPlatformNoCopy(productName); + searches.emplace_back(result, false, &entry, &productEntry); + } + + // Search for the source path + AZStd::string sourceNameWithScanFolder = + ToScanFolderPrefixedPath(aznumeric_cast(entry.m_scanFolderPK), entry.m_sourceName.c_str()); + AZStd::string sanitizedSourceName = entry.m_sourceName; + + SanitizeForDatabase(sourceNameWithScanFolder); + SanitizeForDatabase(sanitizedSourceName); + + searches.emplace_back(sourceNameWithScanFolder, true, &entry, nullptr); + searches.emplace_back(sanitizedSourceName, true, &entry, nullptr); + } + + AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntryContainer unresolvedDependencies; + m_stateData->GetUnresolvedProductDependencies(unresolvedDependencies); + + AZStd::recursive_mutex mapMutex; + // Map of Map of Product Dependency>> + AZStd::unordered_map>> sourceIdToMatchedSearchDependencies; + + // For every search path we created, we're going to see if it matches up against any of the unresolved dependencies + AZ::parallel_for_each( + searches.begin(), searches.end(), + [&sourceIdToMatchedSearchDependencies, &mapMutex, &unresolvedDependencies](const SearchEntry& search) + { + AZStd::unordered_set matches; + for (const auto& entry: unresolvedDependencies) + { + AZ::IO::PathView searchPath(search.m_path); + + if(((entry.m_dependencyType == AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntry::ProductDep_SourceFile && search.m_isSourcePath) + || (entry.m_dependencyType == AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntry::ProductDep_ProductFile && !search.m_isSourcePath)) + && searchPath.Match(entry.m_unresolvedPath)) + { + matches.insert(entry); + } + } + + if (!matches.empty()) + { + AZStd::scoped_lock lock(mapMutex); + auto& productDependencyDatabaseEntries = sourceIdToMatchedSearchDependencies[search.m_sourceEntry->m_sourceID][&search]; + productDependencyDatabaseEntries.insert(matches.begin(), matches.end()); + } + }); + + for (const auto& entry : queuedForResolve) + { + RetryDeferredDependencies(entry, sourceIdToMatchedSearchDependencies[entry.m_sourceID], productMap[entry.m_sourceID]); + } + } + + void PathDependencyManager::SaveUnresolvedDependenciesToDatabase(AssetBuilderSDK::ProductPathDependencySet& unresolvedDependencies, + const AzToolsFramework::AssetDatabase::ProductDatabaseEntry& productEntry, const AZStd::string& platform) { using namespace AzToolsFramework::AssetDatabase; @@ -206,9 +302,9 @@ namespace AssetProcessor } void PathDependencyManager::SaveResolvedDependencies(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry, const MapSet& exclusionMaps, const AZStd::string& sourceNameWithScanFolder, - const AZStd::vector& dependencyEntries, + const AZStd::unordered_set& dependencyEntries, AZStd::string_view matchedPath, bool isSourceDependency, const AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer& matchedProducts, - AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntryContainer& dependencyContainer) const + AZStd::vector& dependencyContainer) const { for (const auto& productDependencyDatabaseEntry : dependencyEntries) { @@ -267,8 +363,7 @@ namespace AssetProcessor } // All checks passed, this is a valid dependency we need to save to the db - dependencyContainer.push_back(); - auto& entry = dependencyContainer.back(); + AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntry entry; entry.m_productDependencyID = dependencyId; entry.m_productPK = productDependencyDatabaseEntry.m_productPK; @@ -276,62 +371,30 @@ namespace AssetProcessor entry.m_dependencySubID = matchedProduct.m_subID; entry.m_platform = productDependencyDatabaseEntry.m_platform; + dependencyContainer.push_back(AZStd::move(entry)); + // If there's more than 1 product, reset the ID so further products create new db entries dependencyId = AzToolsFramework::AssetDatabase::InvalidEntryId; } } } - void PathDependencyManager::RetryDeferredDependencies(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry) + void PathDependencyManager::RetryDeferredDependencies(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry, + const AZStd::unordered_map>& matches, + const AZStd::vector& products) { MapSet exclusionMaps = PopulateExclusionMaps(); - // Gather a list of all the products this source file produced - AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer products; - if (!m_stateData->GetProductsBySourceName(sourceEntry.m_sourceName.c_str(), products)) - { - AZ_TracePrintf(AssetProcessor::ConsoleChannel, "Source %s did not have any products. Skipping dependency processing.\n", sourceEntry.m_sourceName.c_str()); - return; - } - - AZStd::unordered_map> map; - - // Build up a list of all the paths we need to search for: products + 2 variations of the source path - AZStd::vector searchPaths; - - for (const auto& productEntry : products) - { - const AZStd::string& productName = productEntry.m_productName; - - // strip path of the / - AZStd::string strippedPath = AssetUtilities::StripAssetPlatform(productName).toUtf8().constData(); - SanitizeForDatabase(strippedPath); - - searchPaths.push_back(strippedPath); - } - AZStd::string sourceNameWithScanFolder = ToScanFolderPrefixedPath(aznumeric_cast(sourceEntry.m_scanFolderPK), sourceEntry.m_sourceName.c_str()); - AZStd::string sanitizedSourceName = sourceEntry.m_sourceName; - SanitizeForDatabase(sourceNameWithScanFolder); - SanitizeForDatabase(sanitizedSourceName); - - searchPaths.push_back(sourceNameWithScanFolder); - searchPaths.push_back(sanitizedSourceName); - - m_stateData->QueryProductDependenciesUnresolvedAdvanced(searchPaths, [&map](AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntry& entry, const AZStd::string& matchedPath) - { - map[matchedPath].push_back(AZStd::move(entry)); - return true; - }); - AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntryContainer dependencyContainer; + AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntryContainer dependencyVector; // Go through all the matched dependencies - for (const auto& pair : map) + for (const auto& pair : matches) { - AZStd::string_view matchedPath = pair.first; - const bool isSourceDependency = matchedPath == sanitizedSourceName || matchedPath == sourceNameWithScanFolder; + const SearchEntry* searchEntry = pair.first; + const bool isSourceDependency = searchEntry->m_isSourcePath; AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer matchedProducts; @@ -342,34 +405,24 @@ namespace AssetProcessor } else { - for (const auto& productEntry : products) - { - const AZStd::string& productName = productEntry.m_productName; - - // strip path of the leading asset platform / - AZStd::string strippedPath = AssetUtilities::StripAssetPlatform(productName).toUtf8().constData(); - SanitizeForDatabase(strippedPath); - - if (strippedPath == matchedPath) - { - matchedProducts.push_back(productEntry); - } - } + matchedProducts.push_back(*searchEntry->m_productEntry); } // Go through each dependency we're resolving and create a db entry for each product that resolved it (wildcard/source dependencies will generally create more than 1) - SaveResolvedDependencies(sourceEntry, exclusionMaps, sourceNameWithScanFolder, pair.second, matchedPath, isSourceDependency, matchedProducts, dependencyContainer); + SaveResolvedDependencies( + sourceEntry, exclusionMaps, sourceNameWithScanFolder, pair.second, searchEntry->m_path, isSourceDependency, matchedProducts, + dependencyVector); } - // Save everything to the db - if (!m_stateData->UpdateProductDependencies(dependencyContainer)) + // Save everything to the db, this will update matched non-wildcard dependencies and add new records for wildcard matches + if (!m_stateData->UpdateProductDependencies(dependencyVector)) { AZ_Error("PathDependencyManager", false, "Failed to update product dependencies"); } else { // Send a notification for each dependency that has been resolved - NotifyResolvedDependencies(dependencyContainer); + NotifyResolvedDependencies(dependencyVector); } } @@ -460,7 +513,7 @@ namespace AssetProcessor if (isExactDependency) { // Search for products in the cache platform folder - // Example: If a path dependency is "test1.asset" in AutomatedTesting on PC, this would search + // Example: If a path dependency is "test1.asset" in AutomatedTesting on PC, this would search // "AutomatedTesting/Cache/pc/test1.asset" m_stateData->GetProductsByProductName(productNameWithPlatform, productInfoContainer); diff --git a/Code/Tools/AssetProcessor/native/AssetManager/PathDependencyManager.h b/Code/Tools/AssetProcessor/native/AssetManager/PathDependencyManager.h index 3a207ec6a9..763ee2cd74 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/PathDependencyManager.h +++ b/Code/Tools/AssetProcessor/native/AssetManager/PathDependencyManager.h @@ -39,9 +39,27 @@ namespace AssetProcessor PathDependencyManager(AZStd::shared_ptr stateData, PlatformConfiguration* platformConfig); + void QueueSourceForDependencyResolution(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry); + + void ProcessQueuedDependencyResolves(); + + struct SearchEntry + { + SearchEntry(AZStd::string path, bool isSourcePath, const AzToolsFramework::AssetDatabase::SourceDatabaseEntry* sourceEntry, const AzToolsFramework::AssetDatabase::ProductDatabaseEntry* productEntry) + : m_path(std::move(path)), + m_isSourcePath(isSourcePath), + m_sourceEntry(sourceEntry), + m_productEntry(productEntry) {} + + AZStd::string m_path; + bool m_isSourcePath; + const AzToolsFramework::AssetDatabase::SourceDatabaseEntry* m_sourceEntry = nullptr; + const AzToolsFramework::AssetDatabase::ProductDatabaseEntry* m_productEntry = nullptr; + }; + /// This function is responsible for looking up existing, unresolved dependencies that the current asset satisfies. /// These can be dependencies on either the source asset or one of the product assets - void RetryDeferredDependencies(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry); + void RetryDeferredDependencies(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry, const AZStd::unordered_map>& matches, const AZStd::vector& products); /// This function is responsible for taking the path dependencies output by the current asset and trying to resolve them to AssetIds /// This does not look for dependencies that the current asset satisfies. @@ -66,7 +84,7 @@ namespace AssetProcessor MapSet PopulateExclusionMaps() const; void NotifyResolvedDependencies(const AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntryContainer& dependencyContainer) const; - void SaveResolvedDependencies(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry, const MapSet& exclusionMaps, const AZStd::string& sourceNameWithScanFolder, const AZStd::vector& dependencyEntries, AZStd::string_view matchedPath, bool isSourceDependency, const AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer& matchedProducts, AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntryContainer& dependencyContainer) const; + void SaveResolvedDependencies(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry, const MapSet& exclusionMaps, const AZStd::string& sourceNameWithScanFolder, const AZStd::unordered_set& dependencyEntries, AZStd::string_view matchedPath, bool isSourceDependency, const AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer& matchedProducts, AZStd::vector& dependencyContainer) const; static DependencyProductMap& SelectMap(MapSet& mapSet, bool wildcard, AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntry::DependencyType type); /// Returns false if a path contains wildcards, true otherwise @@ -93,5 +111,6 @@ namespace AssetProcessor AZStd::shared_ptr m_stateData; PlatformConfiguration* m_platformConfig{}; DependencyResolvedCallback m_dependencyResolvedCallback{}; + AZStd::vector m_queuedForResolve; }; } // namespace AssetProcessor diff --git a/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp b/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp index 8867f2379f..beb82dfcab 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp +++ b/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp @@ -48,7 +48,7 @@ namespace AssetProcessor // note that this is not the first time we're opening the database - the main thread also opens it before this happens, // which allows it to upgrade it and check it for errors. If we get here, it means the database is already good to go. - m_stateData->OpenDatabase(); + m_stateData->OpenDatabase(); MigrateScanFolders(); @@ -70,7 +70,7 @@ namespace AssetProcessor m_excludedFolderCache = AZStd::make_unique(m_platformConfig); PopulateJobStateCache(); - + AssetProcessor::ProcessingJobInfoBus::Handler::BusConnect(); } @@ -126,7 +126,7 @@ namespace AssetProcessor { // capture scanning stats: AssetProcessor::StatsCapture::BeginCaptureStat("AssetScanning"); - + // Ensure that the source file list is populated before a scan begins m_sourceFilesInDatabase.clear(); m_fileModTimes.clear(); @@ -155,11 +155,11 @@ namespace AssetProcessor QString scanFolderPath; QString relativeToScanFolderPath = QString::fromUtf8(entry.m_fileName.c_str()); - + for (int i = 0; i < m_platformConfig->GetScanFolderCount(); ++i) { const auto& scanFolderInfo = m_platformConfig->GetScanFolderAt(i); - + if (scanFolderInfo.ScanFolderID() == entry.m_scanFolderPK) { scanFolderPath = scanFolderInfo.ScanPath(); @@ -181,7 +181,7 @@ namespace AssetProcessor { m_isCurrentlyScanning = false; AssetProcessor::StatsCapture::EndCaptureStat("AssetScanning"); - + // we cannot invoke this immediately - the scanner might be done, but we aren't actually ready until we've processed all remaining messages: QMetaObject::invokeMethod(this, "CheckMissingFiles", Qt::QueuedConnection); } @@ -216,7 +216,7 @@ namespace AssetProcessor else { QString statKey = QString("ProcessJob,%1,%2,%3").arg(jobEntry.m_databaseSourceName).arg(jobEntry.m_jobKey).arg(jobEntry.m_platformInfo.m_identifier.c_str()); - + if (status == JobStatus::InProgress) { //update to in progress status @@ -232,7 +232,7 @@ namespace AssetProcessor // without going thru the RC. // as such, all the code in this block should be crafted to work regardless of whether its double called. AssetProcessor::StatsCapture::EndCaptureStat(statKey.toUtf8().constData()); - + m_jobRunKeyToJobInfoMap.erase(jobEntry.m_jobRunKey); Q_EMIT SourceFinished(sourceUUID, legacySourceUUID); Q_EMIT JobComplete(jobEntry, status); @@ -308,7 +308,7 @@ namespace AssetProcessor //! A network request came in, Given a Job Run Key (from the above Job Request), asking for the actual log for that job. GetAbsoluteAssetDatabaseLocationResponse AssetProcessorManager::ProcessGetAbsoluteAssetDatabaseLocationRequest(MessageData messageData) - { + { GetAbsoluteAssetDatabaseLocationResponse response; AzToolsFramework::AssetDatabase::AssetDatabaseRequestsBus::Broadcast(&AzToolsFramework::AssetDatabase::AssetDatabaseRequests::GetAssetDatabaseLocation, response.m_absoluteAssetDatabaseLocation); @@ -525,7 +525,7 @@ namespace AssetProcessor { foundOne = true; return true; - }, + }, AZ::Uuid::CreateNull(), nullptr, platform.toUtf8().constData(), @@ -750,7 +750,7 @@ namespace AssetProcessor } OnJobStatusChanged(jobEntry, JobStatus::Failed); - + // note that we always print out the failed job status here in both batch and GUI mode. AZ_TracePrintf(AssetProcessor::ConsoleChannel, "Failed %s, (%s)... \n", jobEntry.m_pathRelativeToWatchFolder.toUtf8().constData(), @@ -868,7 +868,7 @@ namespace AssetProcessor && AzFramework::StringFunc::Equal(job.m_platform.c_str(), itProcessedAsset->m_entry.m_platformInfo.m_identifier.c_str())) { // If we are here it implies that for the same source file we have another job that outputs the same product. - // This is usually the case when two builders process the same source file and outputs the same product file. + // This is usually the case when two builders process the same source file and outputs the same product file. remove = true; AZStd::string consoleMsg = AZStd::string::format("Failing Job (source : %s , jobkey %s) because another job (source : %s , jobkey : %s ) outputted the same product %s.\n", itProcessedAsset->m_entry.m_pathRelativeToWatchFolder.toUtf8().constData(), itProcessedAsset->m_entry.m_jobKey.toUtf8().data(), source.m_sourceName.c_str(), job.m_jobKey.c_str(), newProductName.toUtf8().constData()); @@ -1128,7 +1128,7 @@ namespace AssetProcessor QString fullProductPath = m_cacheRootDir.absoluteFilePath(productName); // Strip the from the front of a relative product path - QString relativeProductPath = AssetUtilities::StripAssetPlatform(priorProduct.m_productName); + AZStd::string_view relativeProductPath = AssetUtilities::StripAssetPlatformNoCopy(priorProduct.m_productName); AZ::Data::AssetId assetId(source.m_sourceGuid, priorProduct.m_subID); @@ -1137,7 +1137,7 @@ namespace AssetProcessor AZ::Data::AssetId legacyAssetId(priorProduct.m_legacyGuid, 0); AZ::Data::AssetId legacySourceAssetId(AssetUtilities::CreateSafeSourceUUIDFromName(source.m_sourceName.c_str(), false), priorProduct.m_subID); - AssetNotificationMessage message(relativeProductPath.toUtf8().constData(), AssetNotificationMessage::AssetRemoved, priorProduct.m_assetType, processedAsset.m_entry.m_platformInfo.m_identifier.c_str()); + AssetNotificationMessage message(relativeProductPath, AssetNotificationMessage::AssetRemoved, priorProduct.m_assetType, processedAsset.m_entry.m_platformInfo.m_identifier.c_str()); message.m_assetId = assetId; if (legacyAssetId != assetId) @@ -1271,7 +1271,7 @@ namespace AssetProcessor [&](AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntry& dependencyEntry) { return dependencyEntry.m_dependencySubID == pair.first.m_subID - && dependencyEntry.m_dependencySourceGuid == source.m_sourceGuid; + && dependencyEntry.m_dependencySourceGuid == source.m_sourceGuid; }); if (conflictItr != dependencySet.end()) @@ -1312,14 +1312,14 @@ namespace AssetProcessor // relative file path is gotten by removing the platform and game from the product name // Strip the from the front of a relative product path - QString relativeProductPath = AssetUtilities::StripAssetPlatform(productName.toUtf8().constData()); + AZStd::string relativeProductPath = AssetUtilities::StripAssetPlatform(productName.toUtf8().constData()).toUtf8().constData(); - AssetNotificationMessage message(relativeProductPath.toUtf8().constData(), AssetNotificationMessage::AssetChanged, newProduct.m_assetType, processedAsset.m_entry.m_platformInfo.m_identifier.c_str()); + AssetNotificationMessage message(relativeProductPath, AssetNotificationMessage::AssetChanged, newProduct.m_assetType, processedAsset.m_entry.m_platformInfo.m_identifier.c_str()); AZ::Data::AssetId assetId(source.m_sourceGuid, newProduct.m_subID); AZ::Data::AssetId legacyAssetId(newProduct.m_legacyGuid, 0); AZ::Data::AssetId legacySourceAssetId(AssetUtilities::CreateSafeSourceUUIDFromName(source.m_sourceName.c_str(), false), newProduct.m_subID); - message.m_data = relativeProductPath.toUtf8().data(); + message.m_data = relativeProductPath; message.m_sizeBytes = QFileInfo(fullProductPath).size(); message.m_assetId = assetId; @@ -1350,7 +1350,7 @@ namespace AssetProcessor } Q_EMIT AssetMessage( message); - + AddKnownFoldersRecursivelyForFile(fullProductPath, m_cacheRootDir.absolutePath()); } @@ -1497,7 +1497,7 @@ namespace AssetProcessor // Record the modtime for the metadata file so we don't re-analyze this change again next time AP starts up QFileInfo metadataFileInfo(originalName); auto* scanFolder = m_platformConfig->GetScanFolderForFile(originalName); - + if (scanFolder) { QString databaseName; @@ -1534,7 +1534,7 @@ namespace AssetProcessor for (const QString& absolutePath : absoluteSourcePathList) { // we need to check if its already in the "active files" (things that we are looking over) - // or if its in the "currently being examined" list. The latter is likely to be the smaller list, + // or if its in the "currently being examined" list. The latter is likely to be the smaller list, // so we check it first. Both of those are absolute paths, so we convert to absolute path before // searching those lists: if (m_filesToExamine.find(absolutePath) != m_filesToExamine.end()) @@ -1633,9 +1633,6 @@ namespace AssetProcessor } } - // Strip the from the front of a relative product path - QString relativePath = AssetUtilities::StripAssetPlatform(relativeProductFile.toUtf8().constData()); - //set the fingerprint on the job that made this product for (auto& job : jobs) { @@ -1678,7 +1675,7 @@ namespace AssetProcessor } QString fullProductPath = m_cacheRootDir.absoluteFilePath(product.m_productName.c_str()); - QString relativeProductPath(AssetUtilities::StripAssetPlatform(product.m_productName)); + AZStd::string_view relativeProductPath = AssetUtilities::StripAssetPlatformNoCopy(product.m_productName); QFileInfo productFileInfo(fullProductPath); if (productFileInfo.exists()) { @@ -1725,7 +1722,7 @@ namespace AssetProcessor AZ::Data::AssetId legacyAssetId(product.m_legacyGuid, 0); AZ::Data::AssetId legacySourceAssetId(AssetUtilities::CreateSafeSourceUUIDFromName(source.m_sourceName.c_str(), false), product.m_subID); - AssetNotificationMessage message(relativeProductPath.toUtf8().constData(), AssetNotificationMessage::AssetRemoved, product.m_assetType, job.m_platform.c_str()); + AssetNotificationMessage message(relativeProductPath, AssetNotificationMessage::AssetRemoved, product.m_assetType, job.m_platform.c_str()); message.m_assetId = assetId; if (legacyAssetId != assetId) @@ -1759,7 +1756,7 @@ namespace AssetProcessor // and no overrides exist for it. // we must delete its products. using namespace AzToolsFramework::AssetDatabase; - + // If we fail to delete a product, the deletion event gets requeued // To avoid retrying forever, we keep track of the time of the first deletion failure and only retry // if less than this amount of time has passed. @@ -1832,7 +1829,7 @@ namespace AssetProcessor { return; } - + // Check if this file causes any file types to be re-evaluated CheckMetaDataRealFiles(normalizedPath); @@ -2046,7 +2043,7 @@ namespace AssetProcessor AZ_TracePrintf(AssetProcessor::DebugChannel, "Non-processed file: %s\n", databaseSourceFile.toUtf8().constData()); ++m_numSourcesNotHandledByAnyBuilder; - + // Record the modtime for the file so we know we've already processed it QString absolutePath = QDir(scanFolder->ScanPath()).absoluteFilePath(normalizedPath); @@ -2114,7 +2111,7 @@ namespace AssetProcessor // Check whether another job emitted this job as a job dependency and if true, queue the dependent job source file also JobDesc jobDesc(jobDetails.m_jobEntry.m_databaseSourceName.toUtf8().data(), jobDetails.m_jobEntry.m_jobKey.toUtf8().data(), jobDetails.m_jobEntry.m_platformInfo.m_identifier); - + shouldProcessAsset = true; QFileInfo file(jobDetails.m_jobEntry.GetAbsoluteSourcePath()); QDateTime dateTime(file.lastModified()); @@ -2347,7 +2344,7 @@ namespace AssetProcessor } QString canonicalRootDir = AssetUtilities::NormalizeFilePath(m_cacheRootDir.canonicalPath()); - + FileExamineContainer swapped; m_filesToExamine.swap(swapped); // makes it okay to call CheckSource(...) @@ -2470,7 +2467,7 @@ namespace AssetProcessor AZ_TracePrintf(AssetProcessor::DebugChannel, "ProcessFilesToExamineQueue: Unable to find the relative path.\n"); continue; } - + const ScanFolderInfo* scanFolderInfo = m_platformConfig->GetScanFolderForFile(normalizedPath); relativePathToFile = databasePathToFile; @@ -2494,9 +2491,9 @@ namespace AssetProcessor QString::fromUtf8(jobInfo.m_watchFolder.c_str()), relativePathToFile, databasePathToFile, - jobInfo.m_builderGuid, - *platformFromInfo, - jobInfo.m_jobKey.c_str(), 0, GenerateNewJobRunKey(), + jobInfo.m_builderGuid, + *platformFromInfo, + jobInfo.m_jobKey.c_str(), 0, GenerateNewJobRunKey(), AZ::Uuid::CreateNull()); job.m_autoFail = true; @@ -2597,7 +2594,7 @@ namespace AssetProcessor { // on the other hand, if we found a file it means that a deleted file revealed a file that // was previously overridden by it. - // Because the deleted file may have "revealed" a file with different case, + // Because the deleted file may have "revealed" a file with different case, // we have to actually correct its case here. This is rare, so it should be reasonable // to call the expensive function to discover correct case. QString pathRelativeToScanFolder; @@ -2674,6 +2671,7 @@ namespace AssetProcessor AZ_TracePrintf(ConsoleChannel, "Builder optimization: %i / %i files required full analysis, %i sources found but not processed by anyone\n", m_numSourcesNeedingFullAnalysis, m_numTotalSourcesFound, m_numSourcesNotHandledByAnyBuilder); } + m_pathDependencyManager->ProcessQueuedDependencyResolves(); QTimer::singleShot(20, this, SLOT(RemoveEmptyFolders())); } else @@ -2739,7 +2737,7 @@ namespace AssetProcessor } // over here we also want to invalidate the metafiles on disk map if it COULD Be a metafile - // note that there is no reason to do an expensive exacting computation here, it will be + // note that there is no reason to do an expensive exacting computation here, it will be // done later and cached when m_cachedMetaFilesExistMap is set to false, we just need to // know if its POSSIBLE that its a metafile, cheaply. // if its a metafile match, then invalidate the metafile table. @@ -2752,7 +2750,7 @@ namespace AssetProcessor m_metaFilesWhichActuallyExistOnDisk.clear(); // invalidate the map, force a recompuation later. } } - + } m_AssetProcessorIsBusy = true; @@ -2927,7 +2925,7 @@ namespace AssetProcessor } AZ::u64 fileHash = AssetUtilities::GetFileHash(fileInfo.m_filePath.toUtf8().constData()); - + if(fileHash != databaseHashValue) { // File contents have changed @@ -3149,7 +3147,7 @@ namespace AssetProcessor { AddMetadataFilesForFingerprinting(kvp.first.c_str(), job.m_fingerprintFiles); } - + // Check the current builder jobs with the previous ones in the database: job.m_jobEntry.m_computedFingerprint = AssetUtilities::GenerateFingerprint(job); JobIndentifier jobIndentifier(JobDesc(job.m_jobEntry.m_databaseSourceName.toUtf8().data(), job.m_jobEntry.m_jobKey.toUtf8().data(), job.m_jobEntry.m_platformInfo.m_identifier), job.m_jobEntry.m_builderGuid); @@ -3208,7 +3206,7 @@ namespace AssetProcessor { // If the database knows about the job than it implies that AP has processed it sucessfully at least once // and therefore the dependent job should not cause the job which depends on it to be processed again. - // If however we find a dependent job which is not known to AP then we know this job needs to be processed + // If however we find a dependent job which is not known to AP then we know this job needs to be processed // after all the dependent jobs have completed at least once. AzToolsFramework::AssetDatabase::JobDatabaseEntryContainer jobs; @@ -3238,7 +3236,7 @@ namespace AssetProcessor } else if(sourceFileDependency.m_sourceDependencyType != AssetBuilderSDK::SourceFileDependency::SourceFileDependencyType::Wildcards) { - AZ_TracePrintf(AssetProcessor::ConsoleChannel, "UpdateJobDependency: Failed to find builder dependency for %s job (%s, %s, %s)\n", + AZ_TracePrintf(AssetProcessor::ConsoleChannel, "UpdateJobDependency: Failed to find builder dependency for %s job (%s, %s, %s)\n", job.m_jobEntry.GetAbsoluteSourcePath().toUtf8().constData(), jobDependencyInternal->m_jobDependency.m_sourceFile.m_sourceFileDependencyPath.c_str(), jobDependencyInternal->m_jobDependency.m_jobKey.c_str(), @@ -3262,7 +3260,7 @@ namespace AssetProcessor ++jobDependencySlot; } - // sorting job dependencies as they can effect the fingerprint of the job + // sorting job dependencies as they can effect the fingerprint of the job AZStd::sort(job.m_jobDependencyList.begin(), job.m_jobDependencyList.end(), [](const AssetProcessor::JobDependencyInternal& lhs, const AssetProcessor::JobDependencyInternal& rhs) { @@ -3289,7 +3287,7 @@ namespace AssetProcessor for (const JobDependencyInternal& jobDependencyInternal : job.m_jobDependencyList) { // Loop over all the builderUuid and check whether the corresponding entry exists in the jobsFingerprint map. - // If an entry exists, it implies than we have already send the job over to the RCController + // If an entry exists, it implies than we have already send the job over to the RCController for (auto builderIter = jobDependencyInternal.m_builderUuidList.begin(); builderIter != jobDependencyInternal.m_builderUuidList.end(); ++builderIter) { JobIndentifier jobIdentifier(JobDesc(jobDependencyInternal.m_jobDependency.m_sourceFile.m_sourceFileDependencyPath, @@ -3299,7 +3297,7 @@ namespace AssetProcessor auto jobFound = m_jobFingerprintMap.find(jobIdentifier); if (jobFound == m_jobFingerprintMap.end()) { - // Job cannot be processed, since one of its dependent job hasn't been fingerprinted + // Job cannot be processed, since one of its dependent job hasn't been fingerprinted return false; } } @@ -3317,7 +3315,7 @@ namespace AssetProcessor // and call the CreateJobs function on the builder. // it bundles the results up in a JobToProcessEntry struct, while it is doing this: JobToProcessEntry entry; - + AZ::Uuid sourceUUID = AssetUtilities::CreateSafeSourceUUIDFromName(databasePathToFile.toUtf8().constData()); // first, we put the source UUID in the map so that its present for any other queries: @@ -3375,14 +3373,14 @@ namespace AssetProcessor builderInfo.m_createJobFunction(createJobsRequest, createJobsResponse); AssetProcessor::StatsCapture::EndCaptureStat(statKey.toUtf8().constData()); } - + AssetProcessor::SetThreadLocalJobId(0); bool isBuilderMissingFingerprint = (createJobsResponse.m_result == AssetBuilderSDK::CreateJobsResultCode::Success && !createJobsResponse.m_createJobOutputs.empty() && !createJobsResponse.m_createJobOutputs[0].m_additionalFingerprintInfo.empty() && builderInfo.m_analysisFingerprint.empty()); - + if (createJobsResponse.m_result == AssetBuilderSDK::CreateJobsResultCode::Failed || isBuilderMissingFingerprint) { AZ_TracePrintf(AssetProcessor::ConsoleChannel, "Createjobs Failed: %s.\n", normalizedPath.toUtf8().constData()); @@ -3393,7 +3391,7 @@ namespace AssetProcessor char resolvedBuffer[AZ_MAX_PATH_LEN] = { 0 }; AZ::IO::FileIOBase::GetInstance()->ResolvePath(fullPathToLogFile.c_str(), resolvedBuffer, AZ_MAX_PATH_LEN); - + JobDetails jobdetail; jobdetail.m_jobEntry = JobEntry( scanFolder->ScanPath(), @@ -3486,9 +3484,9 @@ namespace AssetProcessor scanFolder->ScanPath(), actualRelativePath, databasePathToFile, - builderInfo.m_busId, - *infoForPlatform, - jobDescriptor.m_jobKey.c_str(), 0, GenerateNewJobRunKey(), + builderInfo.m_busId, + *infoForPlatform, + jobDescriptor.m_jobKey.c_str(), 0, GenerateNewJobRunKey(), sourceUUID); newJob.m_jobEntry.m_checkExclusiveLock = jobDescriptor.m_checkExclusiveLock; newJob.m_jobParam = AZStd::move(jobDescriptor.m_jobParameters); @@ -3506,7 +3504,7 @@ namespace AssetProcessor newJob.m_jobDependencyList.push_back(JobDependencyInternal(jobDependency)); ++numJobDependencies; } - + // note that until analysis completes, the jobId is not set and neither is the destination pat JobDesc jobDesc(newJob.m_jobEntry.m_databaseSourceName.toUtf8().data(), newJob.m_jobEntry.m_jobKey.toUtf8().data(), newJob.m_jobEntry.m_platformInfo.m_identifier); m_jobDescToBuilderUuidMap[jobDesc].insert(builderInfo.m_busId); @@ -3515,7 +3513,7 @@ namespace AssetProcessor JobIndentifier jobIdentifier(jobDesc, builderInfo.m_busId); { AZStd::lock_guard lock(AssetProcessor::ProcessingJobInfoBus::GetOrCreateContext().m_contextMutex); - m_jobFingerprintMap.erase(jobIdentifier); + m_jobFingerprintMap.erase(jobIdentifier); } entry.m_jobsToAnalyze.push_back(AZStd::move(newJob)); @@ -3578,7 +3576,7 @@ namespace AssetProcessor // instead of a UUID, a path has been provided, prepare and use that. We need to turn it into a database path QString encodedFileData = QString::fromUtf8(sourceDependency.m_sourceFileDependencyPath.c_str()); encodedFileData = AssetUtilities::NormalizeFilePath(encodedFileData); - + if (sourceDependency.m_sourceDependencyType == AssetBuilderSDK::SourceFileDependency::SourceFileDependencyType::Wildcards) { int wildcardIndex = encodedFileData.indexOf("*"); @@ -3653,7 +3651,7 @@ namespace AssetProcessor } // Convert to relative paths - for (auto dependencyItr = resolvedDependencyList.begin(); dependencyItr != resolvedDependencyList.end();) + for (auto dependencyItr = resolvedDependencyList.begin(); dependencyItr != resolvedDependencyList.end();) { QString relativePath, scanFolder; if (m_platformConfig->ConvertToRelativePath(*dependencyItr, relativePath, scanFolder)) @@ -3705,7 +3703,7 @@ namespace AssetProcessor return (!resultDatabaseSourceName.isEmpty()); } - + void AssetProcessorManager::UpdateSourceFileDependenciesDatabase(JobToProcessEntry& entry) { using namespace AzToolsFramework::AssetDatabase; @@ -3738,7 +3736,7 @@ namespace AssetProcessor QString resolvedDatabaseName; if (!ResolveSourceFileDependencyPath(sourceDependency.second, resolvedDatabaseName,resolvedDependencyList)) { - // ResolveDependencyPath should only fail in a data error, otherwise it always outputs something, + // ResolveDependencyPath should only fail in a data error, otherwise it always outputs something, // even if that something starts with the placeholder. continue; } @@ -3759,7 +3757,7 @@ namespace AssetProcessor SourceFileDependencyEntry newDependencyEntry( sourceDependency.first, entry.m_sourceFileInfo.m_databasePath.toUtf8().constData(), - resolvedDatabaseName.toUtf8().constData(), + resolvedDatabaseName.toUtf8().constData(), sourceDependency.second.m_sourceDependencyType == AssetBuilderSDK::SourceFileDependency::SourceFileDependencyType::Wildcards ? SourceFileDependencyEntry::DEP_SourceLikeMatch : SourceFileDependencyEntry::DEP_SourceToSource, !sourceDependency.second.m_sourceFileDependencyUUID.IsNull()); // If the UUID is null, then record that this dependency came from a (resolved) path newDependencies.push_back(AZStd::move(newDependencyEntry)); @@ -3803,7 +3801,7 @@ namespace AssetProcessor } // get all the old dependencies and remove them. This function is comprehensive on all dependencies - // for a given source file so we can just eliminate all of them from that same source file and replace + // for a given source file so we can just eliminate all of them from that same source file and replace // them with all of the new ones for the given source file: AZStd::unordered_set oldDependencies; m_stateData->QueryDependsOnSourceBySourceDependency( @@ -4018,7 +4016,7 @@ namespace AssetProcessor result.m_watchFolder = QString::fromUtf8(scanFolder.m_scanFolder.c_str()); result.m_sourceRelativeToWatchFolder = result.m_sourceDatabaseName; - { + { // this scope exists to restrict the duration of the below lock. AZStd::lock_guard lock(m_sourceUUIDToSourceInfoMapMutex); m_sourceUUIDToSourceInfoMap.insert(AZStd::make_pair(sourceUuid, result)); @@ -4045,9 +4043,9 @@ namespace AssetProcessor auto jobPair = m_jobsToProcess.insert(AZStd::move(jobDetail)); if (!jobPair.second) { - // if we are here it means that this job was already found in the jobs to process list + // if we are here it means that this job was already found in the jobs to process list // and therefore insert failed, we will try to update the iterator manually here. - // Note that if insert fails the original object is not destroyed and therefore we can use move again. + // Note that if insert fails the original object is not destroyed and therefore we can use move again. // we just replaced a job, so we have to decrement its count. UpdateAnalysisTrackerForFile(jobPair.first->m_jobEntry, AnalysisTrackerUpdateType::JobFinished); @@ -4068,7 +4066,7 @@ namespace AssetProcessor QSet absoluteSourceFilePathQueue; QString databasePath; QString scanFolder; - + auto callbackFunction = [this, &absoluteSourceFilePathQueue](SourceFileDependencyEntry& entry) { QString relativeDatabaseName = QString::fromUtf8(entry.m_source.c_str()); @@ -4111,7 +4109,7 @@ namespace AssetProcessor sourceDatabaseEntry.m_sourceName = relativeSourceFilePath.toUtf8().constData(); sourceDatabaseEntry.m_sourceGuid = AssetUtilities::CreateSafeSourceUUIDFromName(sourceDatabaseEntry.m_sourceName.c_str()); - + if (!m_stateData->SetSource(sourceDatabaseEntry)) { AZ_Error(AssetProcessor::ConsoleChannel, false, "Failed to add source to the database!!!"); @@ -4260,7 +4258,7 @@ namespace AssetProcessor { AZ_TracePrintf(DebugChannel, "Builder %s analysis fingerprint changed. Files assigned to it will be re-analyzed.\n", priorBuilderUUID.ToString().c_str()); } - + if (builderIsDirty) { m_anyBuilderChange = true; @@ -4414,7 +4412,7 @@ namespace AssetProcessor source.m_analysisFingerprint.append(builderFP.ToString()); } - m_pathDependencyManager->RetryDeferredDependencies(source); + m_pathDependencyManager->QueueSourceForDependencyResolution(source); m_stateData->SetSource(source); databaseSourceName = source.m_sourceName.c_str(); @@ -4593,7 +4591,7 @@ namespace AssetProcessor { continue; } - + QString firstMatchingFile = m_platformConfig->FindFirstMatchingFile(dep); if (firstMatchingFile.isEmpty()) { @@ -4787,7 +4785,7 @@ namespace AssetProcessor assetIter->m_entry.m_sourceFileUUID); jobdetail.m_autoFail = true; jobdetail.m_critical = true; - jobdetail.m_priority = INT_MAX; // front of the queue. + jobdetail.m_priority = INT_MAX; // front of the queue. jobdetail.m_scanFolder = m_platformConfig->GetScanFolderForFile(assetIter->m_entry.GetAbsoluteSourcePath()); // the new lines make it easier to copy and paste the file names. jobdetail.m_jobParam[AZ_CRC(AutoFailReasonKey)] = autoFailReason; @@ -4859,6 +4857,6 @@ namespace AssetProcessor return filesFound; } - + } // namespace AssetProcessor diff --git a/Code/Tools/AssetProcessor/native/tests/BaseAssetProcessorTest.h b/Code/Tools/AssetProcessor/native/tests/BaseAssetProcessorTest.h index 71d3fa0f6d..be7e78d097 100644 --- a/Code/Tools/AssetProcessor/native/tests/BaseAssetProcessorTest.h +++ b/Code/Tools/AssetProcessor/native/tests/BaseAssetProcessorTest.h @@ -40,12 +40,14 @@ protected: void SetupEnvironment() override { // Setup code + AZ::Environment::Create(nullptr); qInstallMessageHandler(UnitTestMessageHandler); } void TeardownEnvironment() override { qInstallMessageHandler(nullptr); + AZ::Environment::Destroy(); } private: diff --git a/Code/Tools/AssetProcessor/native/tests/PathDependencyManagerTests.cpp b/Code/Tools/AssetProcessor/native/tests/PathDependencyManagerTests.cpp index b20d373307..1d6e92e47e 100644 --- a/Code/Tools/AssetProcessor/native/tests/PathDependencyManagerTests.cpp +++ b/Code/Tools/AssetProcessor/native/tests/PathDependencyManagerTests.cpp @@ -12,13 +12,23 @@ #include "AzToolsFramework/API/AssetDatabaseBus.h" #include "AssetDatabase/AssetDatabase.h" #include +#include +#include +#include +#include namespace UnitTests { class MockDatabaseLocationListener : public AzToolsFramework::AssetDatabase::AssetDatabaseRequests::Bus::Handler { public: - MOCK_METHOD1(GetAssetDatabaseLocation, bool(AZStd::string&)); + bool GetAssetDatabaseLocation(AZStd::string& location) override + { + location = m_databaseLocation; + return true; + } + + AZStd::string m_databaseLocation; }; namespace Util @@ -38,25 +48,45 @@ namespace UnitTests } } - struct PathDependencyDeletionTest - : UnitTest::ScopedAllocatorSetupFixture - , UnitTest::TraceBusRedirector + struct PathDependencyBase + : UnitTest::TraceBusRedirector { - void SetUp() override; - void TearDown() override; + void Init(); + void Destroy(); QTemporaryDir m_tempDir; AZStd::string m_databaseLocation; - ::testing::NiceMock m_databaseLocationListener; + MockDatabaseLocationListener m_databaseLocationListener; AZStd::shared_ptr m_stateData; AZStd::unique_ptr m_platformConfig; + AZStd::unique_ptr m_serializeContext; + AZ::Entity* m_jobManagerEntity{}; + AZ::ComponentDescriptor* m_descriptor{}; }; - void PathDependencyDeletionTest::SetUp() + struct PathDependencyDeletionTest + : UnitTest::ScopedAllocatorSetupFixture + , PathDependencyBase + { + void SetUp() override + { + PathDependencyBase::Init(); + } + + void TearDown() override + { + PathDependencyBase::Destroy(); + } + }; + + void PathDependencyBase::Init() { using namespace ::testing; using namespace AzToolsFramework::AssetDatabase; + ::UnitTest::TestRunner::Instance().m_suppressAsserts = false; + ::UnitTest::TestRunner::Instance().m_suppressErrors = false; + BusConnect(); QDir tempPath(m_tempDir.path()); @@ -68,21 +98,39 @@ namespace UnitTests // ":memory:" databases are one-instance-only, and even if another connection is opened to ":memory:" it would // not share with others created using ":memory:" and get a unique database instead. m_databaseLocation = tempPath.absoluteFilePath("test_database.sqlite").toUtf8().constData(); - - ON_CALL(m_databaseLocationListener, GetAssetDatabaseLocation(_)) - .WillByDefault( - DoAll( // set the 0th argument ref (string) to the database location and return true. - SetArgReferee<0>(m_databaseLocation), - Return(true))); + m_databaseLocationListener.m_databaseLocation = m_databaseLocation; m_stateData = AZStd::shared_ptr(new AssetProcessor::AssetDatabaseConnection()); m_stateData->OpenDatabase(); m_platformConfig = AZStd::make_unique(); + + AZ::AllocatorInstance::Create(); + AZ::AllocatorInstance::Create(); + + m_serializeContext = AZStd::make_unique(); + m_descriptor = AZ::JobManagerComponent::CreateDescriptor(); + m_descriptor->Reflect(m_serializeContext.get()); + + m_jobManagerEntity = aznew AZ::Entity{}; + m_jobManagerEntity->CreateComponent(); + m_jobManagerEntity->Init(); + m_jobManagerEntity->Activate(); } - void PathDependencyDeletionTest::TearDown() + void PathDependencyBase::Destroy() { + m_stateData = nullptr; + m_platformConfig = nullptr; + + m_jobManagerEntity->Deactivate(); + delete m_jobManagerEntity; + + delete m_descriptor; + + AZ::AllocatorInstance::Destroy(); + AZ::AllocatorInstance::Destroy(); + BusDisconnect(); } @@ -91,7 +139,7 @@ namespace UnitTests using namespace AzToolsFramework::AssetDatabase; // Add a product to the db with an unmet dependency - ScanFolderDatabaseEntry scanFolder("folder", "test", "test", ""); + ScanFolderDatabaseEntry scanFolder("folder", "test", "test", 0); m_stateData->SetScanFolder(scanFolder); SourceDatabaseEntry source1, source2; @@ -110,7 +158,8 @@ namespace UnitTests Util::CreateSourceJobAndProduct(m_stateData.get(), scanFolder.m_scanFolderID, source2, job2, product2, "source2.txt", "product2.jpg"); - manager.RetryDeferredDependencies(source2); + manager.QueueSourceForDependencyResolution(source2); + manager.ProcessQueuedDependencyResolves(); } TEST_F(PathDependencyDeletionTest, ExistingSourceWithUnmetDependency_RemovedFromDB_DependentProductCreatedWithoutError) @@ -118,7 +167,7 @@ namespace UnitTests using namespace AzToolsFramework::AssetDatabase; // Add a product to the db with an unmet dependency - ScanFolderDatabaseEntry scanFolder("folder", "test", "test", ""); + ScanFolderDatabaseEntry scanFolder("folder", "test", "test", 0); m_stateData->SetScanFolder(scanFolder); SourceDatabaseEntry source1, source2; @@ -137,7 +186,8 @@ namespace UnitTests Util::CreateSourceJobAndProduct(m_stateData.get(), scanFolder.m_scanFolderID, source2, job2, product2, "source2.txt", "product2.jpg"); - manager.RetryDeferredDependencies(source2); + manager.QueueSourceForDependencyResolution(source2); + manager.ProcessQueuedDependencyResolves(); } TEST_F(PathDependencyDeletionTest, NewSourceWithUnmetDependency_RemovedFromDB_DependentSourceCreatedWithoutError) @@ -147,7 +197,7 @@ namespace UnitTests AssetProcessor::PathDependencyManager manager(m_stateData, m_platformConfig.get()); // Add a product to the db with an unmet dependency - ScanFolderDatabaseEntry scanFolder("folder", "test", "test", ""); + ScanFolderDatabaseEntry scanFolder("folder", "test", "test", 0); m_stateData->SetScanFolder(scanFolder); SourceDatabaseEntry source1, source2; @@ -166,7 +216,8 @@ namespace UnitTests Util::CreateSourceJobAndProduct(m_stateData.get(), scanFolder.m_scanFolderID, source2, job2, product2, "source2.txt", "product2.jpg"); - manager.RetryDeferredDependencies(source2); + manager.QueueSourceForDependencyResolution(source2); + manager.ProcessQueuedDependencyResolves(); } TEST_F(PathDependencyDeletionTest, NewSourceWithUnmetDependency_RemovedFromDB_DependentProductCreatedWithoutError) @@ -176,7 +227,7 @@ namespace UnitTests AssetProcessor::PathDependencyManager manager(m_stateData, m_platformConfig.get()); // Add a product to the db with an unmet dependency - ScanFolderDatabaseEntry scanFolder("folder", "test", "test", ""); + ScanFolderDatabaseEntry scanFolder("folder", "test", "test", 0); m_stateData->SetScanFolder(scanFolder); SourceDatabaseEntry source1, source2; @@ -195,7 +246,8 @@ namespace UnitTests Util::CreateSourceJobAndProduct(m_stateData.get(), scanFolder.m_scanFolderID, source2, job2, product2, "source2.txt", "product2.jpg"); - manager.RetryDeferredDependencies(source2); + manager.QueueSourceForDependencyResolution(source2); + manager.ProcessQueuedDependencyResolves(); } TEST_F(PathDependencyDeletionTest, NewSourceWithUnmetDependency_Wildcard_RemovedFromDB_DependentSourceCreatedWithoutError) @@ -205,7 +257,7 @@ namespace UnitTests AssetProcessor::PathDependencyManager manager(m_stateData, m_platformConfig.get()); // Add a product to the db with an unmet dependency - ScanFolderDatabaseEntry scanFolder("folder", "test", "test", ""); + ScanFolderDatabaseEntry scanFolder("folder", "test", "test", 0); m_stateData->SetScanFolder(scanFolder); SourceDatabaseEntry source1, source2; @@ -224,6 +276,266 @@ namespace UnitTests Util::CreateSourceJobAndProduct(m_stateData.get(), scanFolder.m_scanFolderID, source2, job2, product2, "source2.txt", "product2.jpg"); - manager.RetryDeferredDependencies(source2); + manager.QueueSourceForDependencyResolution(source2); + manager.ProcessQueuedDependencyResolves(); + } + + using PathDependencyTests = PathDependencyDeletionTest; + + TEST_F(PathDependencyTests, SourceAndProductHaveSameName_SourceFileDependency_MatchesSource) + { + using namespace AzToolsFramework::AssetDatabase; + + AssetProcessor::PathDependencyManager manager(m_stateData, m_platformConfig.get()); + + ScanFolderDatabaseEntry scanFolder("folder", "test", "test", 0); + m_stateData->SetScanFolder(scanFolder); + + SourceDatabaseEntry source1, source2; + JobDatabaseEntry job1, job2; + ProductDatabaseEntry product1, product2, product3; + + Util::CreateSourceJobAndProduct( + m_stateData.get(), scanFolder.m_scanFolderID, source1, job1, product1, "source1.txt", "product1.jpg"); + + AssetBuilderSDK::ProductPathDependencySet set; + set.insert(AssetBuilderSDK::ProductPathDependency("*.xml", AssetBuilderSDK::ProductPathDependencyType::SourceFile)); + + manager.SaveUnresolvedDependenciesToDatabase(set, product1, "pc"); + + Util::CreateSourceJobAndProduct( + m_stateData.get(), scanFolder.m_scanFolderID, source2, job2, product2, "source2.xml", "source2.xml"); + + // Create a 2nd product for this source + product3 = ProductDatabaseEntry{ job2.m_jobID, product2.m_subID + 1, "source2.txt", AZ::Data::AssetType::CreateRandom() }; + ASSERT_TRUE(m_stateData->SetProduct(product3)); + + manager.QueueSourceForDependencyResolution(source2); + manager.ProcessQueuedDependencyResolves(); + + ProductDependencyDatabaseEntryContainer productDependencies; + m_stateData->GetProductDependencies(productDependencies); + + EXPECT_EQ(productDependencies.size(), 3); + } + + TEST_F(PathDependencyTests, SourceAndProductHaveSameName_ProductFileDependency_MatchesProduct) + { + using namespace AzToolsFramework::AssetDatabase; + + AssetProcessor::PathDependencyManager manager(m_stateData, m_platformConfig.get()); + + ScanFolderDatabaseEntry scanFolder("folder", "test", "test", 0); + m_stateData->SetScanFolder(scanFolder); + + SourceDatabaseEntry source1, source2; + JobDatabaseEntry job1, job2; + ProductDatabaseEntry product1, product2, product3; + + Util::CreateSourceJobAndProduct( + m_stateData.get(), scanFolder.m_scanFolderID, source1, job1, product1, "source1.txt", "product1.jpg"); + + AssetBuilderSDK::ProductPathDependencySet set; + set.insert(AssetBuilderSDK::ProductPathDependency("*.xml", AssetBuilderSDK::ProductPathDependencyType::ProductFile)); + + manager.SaveUnresolvedDependenciesToDatabase(set, product1, "pc"); + + Util::CreateSourceJobAndProduct( + m_stateData.get(), scanFolder.m_scanFolderID, source2, job2, product2, "source2.xml", "source2.xml"); + + // Create a 2nd product for this source + product3 = ProductDatabaseEntry{job2.m_jobID, product2.m_subID + 1, "source2.txt", AZ::Data::AssetType::CreateRandom()}; + ASSERT_TRUE(m_stateData->SetProduct(product3)); + + manager.QueueSourceForDependencyResolution(source2); + manager.ProcessQueuedDependencyResolves(); + + ProductDependencyDatabaseEntryContainer productDependencies; + m_stateData->GetProductDependencies(productDependencies); + + EXPECT_EQ(productDependencies.size(), 2); } + + struct PathDependencyBenchmarks + : UnitTest::ScopedAllocatorFixture + , PathDependencyBase + { + static inline constexpr int NumTestDependencies = 4; // Must be a multiple of 4 + static inline constexpr int NumTestProducts = 2; // Must be a multiple of 2 + + AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer m_products; + AzToolsFramework::AssetDatabase::SourceDatabaseEntry m_source1, m_source2, m_source4; + AzToolsFramework::AssetDatabase::JobDatabaseEntry m_job1, m_job2, m_job4; + AzToolsFramework::AssetDatabase::ProductDatabaseEntry m_product1, m_product2, m_product4; + AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntryContainer m_dependencies; + + void SetupTestData() + { + using namespace AzToolsFramework::AssetDatabase; + + ScanFolderDatabaseEntry scanFolder("folder", "test", "test", 0); + ASSERT_TRUE(m_stateData->SetScanFolder(scanFolder)); + + Util::CreateSourceJobAndProduct( + m_stateData.get(), scanFolder.m_scanFolderID, m_source1, m_job1, m_product1, "source1.txt", "product1.jpg"); + + Util::CreateSourceJobAndProduct( + m_stateData.get(), scanFolder.m_scanFolderID, m_source4, m_job4, m_product4, "source4.txt", "product4.jpg"); + + for (int i = 0; i < NumTestDependencies / 2; ++i) + { + m_dependencies.emplace_back( + m_product1.m_productID, AZ::Uuid::CreateNull(), 0, 0, "pc", 0, + AZStd::string::format("folder/folder2/%d_*2.jpg", i).c_str()); + ++i; + m_dependencies.emplace_back( + m_product1.m_productID, AZ::Uuid::CreateNull(), 0, 0, "mac", 0, + AZStd::string::format("folder/folder2/%d_*2.jpg", i).c_str()); + } + + for (int i = 0; i < NumTestDependencies / 2; ++i) + { + m_dependencies.emplace_back( + m_product4.m_productID, AZ::Uuid::CreateNull(), 0, 0, "pc", 0, + AZStd::string::format("folder/folder2/%d_*2.jpg", i).c_str()); + ++i; + m_dependencies.emplace_back( + m_product4.m_productID, AZ::Uuid::CreateNull(), 0, 0, "mac", 0, + AZStd::string::format("folder/folder2/%d_*2.jpg", i).c_str()); + } + + ASSERT_TRUE(m_stateData->SetProductDependencies(m_dependencies)); + + Util::CreateSourceJobAndProduct( + m_stateData.get(), scanFolder.m_scanFolderID, m_source2, m_job2, m_product2, "source2.txt", "product2.jpg"); + + auto job3 = JobDatabaseEntry( + m_source2.m_sourceID, "jobkey", 1111, "mac", AZ::Uuid::CreateRandom(), AzToolsFramework::AssetSystem::JobStatus::Completed, + 4444); + ASSERT_TRUE(m_stateData->SetJob(job3)); + + for (int i = 0; i < NumTestProducts; ++i) + { + m_products.emplace_back( + m_job2.m_jobID, i, AZStd::string::format("pc/folder/folder2/%d_product2.jpg", i).c_str(), + AZ::Data::AssetType::CreateRandom()); + ++i; + m_products.emplace_back( + job3.m_jobID, i, AZStd::string::format("mac/folder/folder2/%d_product2.jpg", i).c_str(), + AZ::Data::AssetType::CreateRandom()); + } + + ASSERT_TRUE(m_stateData->SetProducts(m_products)); + } + + void DoTest() + { + AssetProcessor::PathDependencyManager manager(m_stateData, m_platformConfig.get()); + + manager.QueueSourceForDependencyResolution(m_source2); + manager.ProcessQueuedDependencyResolves(); + } + + void VerifyResult() + { + using namespace AzToolsFramework::AssetDatabase; + + ProductDependencyDatabaseEntryContainer productDependencies; + m_stateData->GetProductDependencies(productDependencies); + + for (int i = 0; i < NumTestDependencies / 2 && i < NumTestProducts; ++i) + { + const auto& product = m_products[i]; + int found = 0; + + for (const auto& unresolvedProductDependency : productDependencies) + { + if (unresolvedProductDependency.m_dependencySourceGuid == m_source2.m_sourceGuid && + unresolvedProductDependency.m_dependencySubID == product.m_subID && + unresolvedProductDependency.m_productPK == m_product1.m_productID) + { + ++found; + } + + if (unresolvedProductDependency.m_dependencySourceGuid == m_source2.m_sourceGuid && + unresolvedProductDependency.m_dependencySubID == product.m_subID && + unresolvedProductDependency.m_productPK == m_product4.m_productID) + { + ++found; + } + + if (found == 2) + break; + } + + EXPECT_TRUE(found == 2) << product.m_productName.c_str() << " was not found"; + } + + EXPECT_EQ(productDependencies.size(), NumTestDependencies * 2); + } + }; + + // For some reason, BENCHMARK_F doesn't seem to call the destructor + // So we'll wrap the class and handle the new/delete ourselves + struct PathDependencyBenchmarksWrapperClass : public ::benchmark::Fixture + { + void SetUp([[maybe_unused]] const benchmark::State& st) override + { + m_benchmarks = new PathDependencyBenchmarks(); + m_benchmarks->Init(); + m_benchmarks->SetupTestData(); + } + + void SetUp([[maybe_unused]] benchmark::State& st) override + { + m_benchmarks = new PathDependencyBenchmarks(); + m_benchmarks->Init(); + m_benchmarks->SetupTestData(); + } + + void TearDown([[maybe_unused]] benchmark::State& st) override + { + m_benchmarks->Destroy(); + delete m_benchmarks; + } + + void TearDown([[maybe_unused]] const benchmark::State& st) override + { + m_benchmarks->Destroy(); + delete m_benchmarks; + } + + PathDependencyBenchmarks* m_benchmarks = {}; + }; + + struct PathDependencyTestValidation + : PathDependencyBenchmarks, ::testing::Test + { + void SetUp() override + { + PathDependencyBase::Init(); + } + void TearDown() override + { + PathDependencyBase::Destroy(); + } + }; + + TEST_F(PathDependencyTestValidation, DeferredWildcardDependencyResolution) + { + SetupTestData(); + DoTest(); + VerifyResult(); + } + + BENCHMARK_F(PathDependencyBenchmarksWrapperClass, BM_DeferredWildcardDependencyResolution)(benchmark::State& state) + { + for (auto _ : state) + { + m_benchmarks->m_stateData->SetProductDependencies(m_benchmarks->m_dependencies); + + m_benchmarks->DoTest(); + } + } + } diff --git a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp index 58f76f8da6..0908d0fdb9 100644 --- a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp +++ b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp @@ -15,6 +15,10 @@ #include #include +#include +#include +#include +#include using namespace AssetProcessor; @@ -26,6 +30,7 @@ public: friend class GTEST_TEST_CLASS_NAME_(MultiplatformPathDependencyTest, AssetProcessed_Impl_MultiplatformDependencies); friend class GTEST_TEST_CLASS_NAME_(MultiplatformPathDependencyTest, AssetProcessed_Impl_MultiplatformDependencies_DeferredResolution); + friend class GTEST_TEST_CLASS_NAME_(MultiplatformPathDependencyTest, SameFilenameForAllPlatforms); friend class GTEST_TEST_CLASS_NAME_(MultiplatformPathDependencyTest, AssetProcessed_Impl_MultiplatformDependencies_SourcePath); @@ -176,8 +181,21 @@ void AssetProcessorManagerTest::SetUp() AssetProcessorTest::SetUp(); + AZ::AllocatorInstance::Create(); + AZ::AllocatorInstance::Create(); + m_data = AZStd::make_unique(); + m_data->m_serializeContext = AZStd::make_unique(); + + m_data->m_descriptor = AZ::JobManagerComponent::CreateDescriptor(); + m_data->m_descriptor->Reflect(m_data->m_serializeContext.get()); + + m_data->m_jobManagerEntity = aznew AZ::Entity{}; + m_data->m_jobManagerEntity->CreateComponent(); + m_data->m_jobManagerEntity->Init(); + m_data->m_jobManagerEntity->Activate(); + m_config.reset(new AssetProcessor::PlatformConfiguration()); m_mockApplicationManager.reset(new AssetProcessor::MockApplicationManager()); @@ -256,6 +274,10 @@ void AssetProcessorManagerTest::SetUp() void AssetProcessorManagerTest::TearDown() { + m_data->m_jobManagerEntity->Deactivate(); + delete m_data->m_jobManagerEntity; + delete m_data->m_descriptor; + m_data = nullptr; QObject::disconnect(m_idleConnection); @@ -271,6 +293,9 @@ void AssetProcessorManagerTest::TearDown() m_qApp.reset(); m_scopeDir.reset(); + AZ::AllocatorInstance::Destroy(); + AZ::AllocatorInstance::Destroy(); + AssetProcessor::AssetProcessorTest::TearDown(); } @@ -1270,7 +1295,8 @@ TEST_F(AbsolutePathProductDependencyTest, AbsolutePathProductDependency_RetryDef AZ::Data::AssetType::CreateNull()); m_assetProcessorManager->m_stateData->SetProduct(matchingProductForDependency); - m_assetProcessorManager->m_pathDependencyManager->RetryDeferredDependencies(matchingSource); + m_assetProcessorManager->m_pathDependencyManager->QueueSourceForDependencyResolution(matchingSource); + m_assetProcessorManager->m_pathDependencyManager->ProcessQueuedDependencyResolves(); // The product dependency ID shouldn't change when it goes from unresolved to resolved. AZStd::vector resolvedProductDependencies; @@ -1405,6 +1431,7 @@ bool PathDependencyTest::ProcessAsset(TestAsset& asset, const OutputAssetSet& ou // tell the APM that the asset has been processed and allow it to bubble through its event queue: m_isIdling = false; m_assetProcessorManager->AssetProcessed(capturedDetails[jobSet].m_jobEntry, processJobResponse); + m_assetProcessorManager->CheckForIdle(); jobSet++; } @@ -2646,6 +2673,44 @@ TEST_F(MultiplatformPathDependencyTest, AssetProcessed_Impl_MultiplatformDepende ASSERT_NE(SearchDependencies(dependencyContainer, asset1.m_products[0]), SearchDependencies(dependencyContainer, asset1.m_products[1])); } +TEST_F(MultiplatformPathDependencyTest, SameFilenameForAllPlatforms) +{ + TestAsset asset2("asset2"); + bool result = ProcessAsset( + asset2, { { ".output" }, { ".output" } }, { { "*1.output", AssetBuilderSDK::ProductPathDependencyType::ProductFile } }, "subfolder1/", + ".txt"); + + ASSERT_TRUE(result); + + TestAsset asset1("asset1"); + result = ProcessAsset(asset1, { { ".output" }, { ".output" } }, {}); + + ASSERT_TRUE(result); + + AssetDatabaseConnection* sharedConnection = m_assetProcessorManager->m_stateData.get(); + ASSERT_TRUE(sharedConnection); + + AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntryContainer dependencyContainer; + + sharedConnection->GetProductDependencies(dependencyContainer); + int resolvedCount = 0; + int unresolvedCount = 0; + for (const auto& dep : dependencyContainer) + { + if (dep.m_unresolvedPath.empty()) + { + resolvedCount++; + } + else + { + unresolvedCount++; + } + } + ASSERT_EQ(resolvedCount, 2); + ASSERT_EQ(unresolvedCount, 2); + VerifyDependencies(dependencyContainer, { asset1.m_products[0], asset1.m_products[1] }, { "*1.output", "*1.output" }); +} + TEST_F(MultiplatformPathDependencyTest, AssetProcessed_Impl_MultiplatformDependencies_SourcePath) { // One product will be pc, one will be console (order is non-deterministic) @@ -4185,7 +4250,7 @@ TEST_F(LockedFileTest, DeleteFile_LockedProduct_DeleteFails) auto theFile = m_data->m_absolutePath[1].toUtf8(); const char* theFileString = theFile.constData(); auto [sourcePath, productPath] = *m_data->m_productPaths.find(theFileString); - + { QFile file(theFileString); file.remove(); @@ -4257,7 +4322,7 @@ TEST_F(LockedFileTest, DeleteFile_LockedProduct_DeletesWhenReleased) EXPECT_FALSE(QFile::exists(productPath)); EXPECT_EQ(m_data->m_deletedSources.size(), 1); - + EXPECT_GT(m_deleteCounter, 1); // Make sure the AP tried more than once to delete the file m_errorAbsorber->ExpectAsserts(0); } @@ -5364,7 +5429,7 @@ AZStd::vector WildcardSourceDependencyTest::FileAddedTest(const Q void WildcardSourceDependencyTest::SetUp() { AssetProcessorManagerTest::SetUp(); - + QDir tempPath(m_tempDir.path()); // Add a non-recursive scan folder. Only files directly inside of this folder should be picked up, subfolders are ignored @@ -5454,7 +5519,7 @@ TEST_F(WildcardSourceDependencyTest, Relative_Broad) { // Expect all files except for the 2 invalid ones (e and f) AZStd::vector resolvedPaths; - + ASSERT_TRUE(Test("*.foo", resolvedPaths)); ASSERT_THAT(resolvedPaths, ::testing::UnorderedElementsAre("a.foo", "b.foo", "folder/one/c.foo", "folder/one/d.foo", "1a.foo", "1b.foo")); } @@ -5585,7 +5650,7 @@ TEST_F(WildcardSourceDependencyTest, Relative_CacheFolder) { AZStd::vector resolvedPaths; QDir tempPath(m_tempDir.path()); - + ASSERT_TRUE(Test("*cache.foo", resolvedPaths)); ASSERT_THAT(resolvedPaths, ::testing::UnorderedElementsAre()); } @@ -5635,7 +5700,7 @@ TEST_F(WildcardSourceDependencyTest, FilesRemovedAfterInitialCache) ASSERT_EQ(excludedFolders.size(), 3); } - + m_fileStateCache->SignalDeleteEvent(tempPath.absoluteFilePath("subfolder2/redirected/folder/two/ignored")); const auto& excludedFolders = excludedFolderCacheInterface->GetExcludedFolders(); diff --git a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h index 7bbef41f44..c532b08016 100644 --- a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h +++ b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h @@ -23,6 +23,8 @@ #include #include +#include +#include #include #include #include "resourcecompiler/rccontroller.h" @@ -39,7 +41,7 @@ class AssetProcessorManagerTest : public AssetProcessor::AssetProcessorTest { public: - + AssetProcessorManagerTest(); virtual ~AssetProcessorManagerTest() @@ -67,16 +69,19 @@ protected: { AZStd::string m_databaseLocation; ::testing::NiceMock m_databaseLocationListener; + AZ::Entity* m_jobManagerEntity{}; + AZ::ComponentDescriptor* m_descriptor{}; + AZStd::unique_ptr m_serializeContext; }; AZStd::unique_ptr m_data; - + private: int m_argc; char** m_argv; AZStd::unique_ptr m_scopeDir; - AZStd::unique_ptr m_qApp; + AZStd::unique_ptr m_qApp; }; struct AbsolutePathProductDependencyTest diff --git a/Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.cpp b/Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.cpp index 7543e9ec8b..c62d822171 100644 --- a/Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.cpp @@ -51,7 +51,7 @@ namespace AssetProcessor case AZ::SettingsRegistryInterface::VisitAction::Begin: { // Only continue traversal if the path is exactly the AssetProcessorSettingsKey (which indicates the start of traversal) - // or if a "Platform *" object and it's children are being traversed + // or if a "Platform *" object and it's children are being traversed if (jsonPath == AssetProcessorSettingsKey) { return AZ::SettingsRegistryInterface::VisitResponse::Continue; @@ -631,7 +631,7 @@ namespace AssetProcessor for (const AssetBuilderSDK::PlatformInfo& platform : m_enabledPlatforms) { AZStd::string_view currentRCParams = assetRecognizer.m_defaultParams; - // The "/Amazon/AssetProcessor/Settings/RC */" entry will be queried + // The "/Amazon/AssetProcessor/Settings/RC */" entry will be queried AZ::IO::Path overrideParamsKey = AZ::IO::Path(AZ::IO::PosixPathSeparator); overrideParamsKey /= path; overrideParamsKey /= platform.m_identifier; @@ -644,7 +644,7 @@ namespace AssetProcessor } else { - // otherwise check for tags associated with the platform + // otherwise check for tags associated with the platform for (const AZStd::string& tag : platform.m_tags) { overrideParamsKey.ReplaceFilename(AZ::IO::PathView(tag)); @@ -1416,6 +1416,8 @@ namespace AssetProcessor return QString(); } + auto* fileStateInterface = AZ::Interface::Get(); + for (int pathIdx = 0; pathIdx < m_scanFolders.size(); ++pathIdx) { AssetProcessor::ScanFolderInfo scanFolderInfo = m_scanFolders[pathIdx]; @@ -1430,7 +1432,7 @@ namespace AssetProcessor QDir rooted(scanFolderInfo.ScanPath()); QString absolutePath = rooted.absoluteFilePath(tempRelativeName); AssetProcessor::FileStateInfo fileStateInfo; - auto* fileStateInterface = AZ::Interface::Get(); + if (fileStateInterface) { if (fileStateInterface->GetFileInfo(absolutePath, &fileStateInfo)) @@ -1499,7 +1501,7 @@ namespace AssetProcessor QRegExp nameMatch{ posixRelativeName, Qt::CaseInsensitive, QRegExp::Wildcard }; AZStd::stack dirs; dirs.push(sourceFolderDir.absolutePath()); - + while (!dirs.empty()) { QString absolutePath = dirs.top(); @@ -1528,7 +1530,7 @@ namespace AssetProcessor continue; } } - + QString pathMatch{ sourceFolderDir.relativeFilePath(dirIterator.filePath()) }; if (nameMatch.exactMatch(pathMatch)) { diff --git a/Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp b/Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp index 6bcd0dec01..a6cbfd8077 100644 --- a/Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp @@ -131,7 +131,7 @@ namespace AssetUtilsInternal } } } while (!timer.hasExpired(waitTimeInSeconds * 1000)); //We will keep retrying until the timer has expired the inputted timeout - + // once we're done, regardless of success or failure, we 'unlock' those files for further process. // if we failed, also re-trigger them to rebuild (the bool param at the end of the ebus call) QString normalized = AssetUtilities::NormalizeFilePath(outputFile); @@ -870,23 +870,27 @@ namespace AssetUtilities return true; } - QString StripAssetPlatform(AZStd::string_view relativeProductPath) + AZStd::string_view StripAssetPlatformNoCopy(AZStd::string_view relativeProductPath) { // Skip over the assetPlatform path segment if it is matches one of the platform defaults // Otherwise return the path unchanged - AZStd::string_view strippedProductPath{ relativeProductPath }; - if (AZStd::optional pathSegment = AZ::StringFunc::TokenizeNext(strippedProductPath, AZ_CORRECT_AND_WRONG_FILESYSTEM_SEPARATOR); - pathSegment.has_value()) + + AZStd::string_view originalPath = relativeProductPath; + AZStd::optional firstPathSegment = AZ::StringFunc::TokenizeNext(relativeProductPath, AZ_CORRECT_AND_WRONG_FILESYSTEM_SEPARATOR); + + if (firstPathSegment && AzFramework::PlatformHelper::GetPlatformIdFromName(*firstPathSegment) != AzFramework::PlatformId::Invalid) { - AZ::IO::FixedMaxPathString assetPlatformSegmentLower{ *pathSegment }; - AZStd::to_lower(assetPlatformSegmentLower.begin(), assetPlatformSegmentLower.end()); - if (AzFramework::PlatformHelper::GetPlatformIdFromName(assetPlatformSegmentLower) != AzFramework::PlatformId::Invalid) - { - return QString::fromUtf8(strippedProductPath.data(), aznumeric_cast(strippedProductPath.size())); - } + return relativeProductPath; } - return QString::fromUtf8(relativeProductPath.data(), aznumeric_cast(relativeProductPath.size())); + return originalPath; + } + + QString StripAssetPlatform(AZStd::string_view relativeProductPath) + { + AZStd::string_view result = StripAssetPlatformNoCopy(relativeProductPath); + + return QString::fromUtf8(result.data(), aznumeric_cast(result.size())); } QString NormalizeFilePath(const QString& filePath) diff --git a/Code/Tools/AssetProcessor/native/utilities/assetUtils.h b/Code/Tools/AssetProcessor/native/utilities/assetUtils.h index 46ec5d6145..18cf5422de 100644 --- a/Code/Tools/AssetProcessor/native/utilities/assetUtils.h +++ b/Code/Tools/AssetProcessor/native/utilities/assetUtils.h @@ -145,7 +145,7 @@ namespace AssetUtilities //! Strips the first "asset platform" from the first path segment of a relative product path //! This is meant for removing the asset platform for paths such as "pc/MyAssetFolder/MyAsset.asset" //! Therefore the result here becomes "MyAssetFolder/MyAsset" - //! + //! //! Similarly invoking this function on relative path that begins with the "server" platform //! "server/AssetFolder/Server.asset2" -> "AssetFolder/Server.asset2" //! This function does not strip an asset platform from anywhere, but the first path segment @@ -153,6 +153,10 @@ namespace AssetUtilities //! would return a copy of the relative path QString StripAssetPlatform(AZStd::string_view relativeProductPath); + //! Same as StripAssetPlatform, but does not perform any string copies + //! The return result is only valid for as long as the original input is valid + AZStd::string_view StripAssetPlatformNoCopy(AZStd::string_view relativeProductPath); + //! Converts all slashes to forward slashes, removes double slashes, //! replaces all indirections such as '.' or '..' as appropriate. //! On windows, the drive letter (if present) is converted to uppercase. From 3f0bd9285372e41b3634b26aa9b342da9a527913 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 13 Jan 2022 10:28:58 -0600 Subject: [PATCH 373/399] Removed some unused EditorUtils functions Signed-off-by: Chris Galvan --- Code/Editor/Util/EditorUtils.cpp | 17 -- Code/Editor/Util/EditorUtils.h | 165 ------------------ .../Editor/Animation/Util/UiEditorUtils.cpp | 17 -- 3 files changed, 199 deletions(-) diff --git a/Code/Editor/Util/EditorUtils.cpp b/Code/Editor/Util/EditorUtils.cpp index adae34773a..47264a51ab 100644 --- a/Code/Editor/Util/EditorUtils.cpp +++ b/Code/Editor/Util/EditorUtils.cpp @@ -176,23 +176,6 @@ QString TrimTrailingZeros(QString str) return str; } -////////////////////////////////////////////////////////////////////////// -// This function is supposed to format float in user-friendly way, -// omitting the exponent notation. -// -// Why not using printf? Its formatting rules has following drawbacks: -// %g - will use exponent for small numbers; -// %.Nf - doesn't allow to control total amount of significant numbers, -// which exposes limited precision during binary-to-decimal fraction -// conversion. -////////////////////////////////////////////////////////////////////////// -void FormatFloatForUI(QString& str, int significantDigits, double value) -{ - str = TrimTrailingZeros(QString::number(value, 'f', significantDigits)); - return; -} -//////////////////////////////////////////////////////////////////////////- - ////////////////////////////////////////////////////////////////////////// QColor ColorLinearToGamma(ColorF col) { diff --git a/Code/Editor/Util/EditorUtils.h b/Code/Editor/Util/EditorUtils.h index e950d75012..5a69633d0f 100644 --- a/Code/Editor/Util/EditorUtils.h +++ b/Code/Editor/Util/EditorUtils.h @@ -212,22 +212,6 @@ namespace XmlHelpers ////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -// Drag Drop helper functions -////////////////////////////////////////////////////////////////////////// -namespace EditorDragDropHelpers -{ - inline QString GetAnimationNameClipboardFormat() - { - return QStringLiteral("application/x-animation-browser-copy"); - } - - inline QString GetFragmentClipboardFormat() - { - return QStringLiteral("application/x-preview-fragment-properties"); - } -} - ////////////////////////////////////////////////////////////////////////// /*! @@ -292,116 +276,6 @@ public: } }; - -////////////////////////////////////////////////////////////////////////// -// -// Convert String representation of color to RGB integer value. -// -////////////////////////////////////////////////////////////////////////// -inline QColor String2Color(const QString& val) -{ - unsigned int r = 0, g = 0, b = 0; - int res = 0; - res = azsscanf(val.toUtf8().data(), "R:%d,G:%d,B:%d", &r, &g, &b); - if (res != 3) - { - res = azsscanf(val.toUtf8().data(), "R:%d G:%d B:%d", &r, &g, &b); - } - if (res != 3) - { - res = azsscanf(val.toUtf8().data(), "%d,%d,%d", &r, &g, &b); - } - if (res != 3) - { - res = azsscanf(val.toUtf8().data(), "%d %d %d", &r, &g, &b); - } - if (res != 3) - { - azsscanf(val.toUtf8().data(), "%x", &r); - return r; - } - - return QColor(r, g, b); -} - -// Converts QColor to Vector. -inline Vec3 Rgb2Vec(const QColor& color) -{ - return Vec3(aznumeric_cast(color.redF()), aznumeric_cast(color.greenF()), aznumeric_cast(color.blueF())); -} - -// Converts QColor to ColorF. -inline ColorF Rgb2ColorF(const QColor& color) -{ - return ColorF(aznumeric_cast(color.redF()), aznumeric_cast(color.greenF()), aznumeric_cast(color.blueF()), 1.0f); -} - -// Converts QColor to Vector. -inline QColor Vec2Rgb(const Vec3& color) -{ - return QColor(aznumeric_cast(color.x * 255), aznumeric_cast(color.y * 255), aznumeric_cast(color.z * 255)); -} - -// Converts ColorF to QColor. -inline QColor ColorF2Rgb(const ColorF& color) -{ - return QColor(aznumeric_cast(color.r * 255), aznumeric_cast(color.g * 255), aznumeric_cast(color.b * 255)); -} - -////////////////////////////////////////////////////////////////////////// -// Tokenize string. -////////////////////////////////////////////////////////////////////////// -inline QString TokenizeString(const QString& s, LPCSTR pszTokens, int& iStart) -{ - assert(iStart >= 0); - - QByteArray str = s.toUtf8(); - - if (pszTokens == nullptr) - { - return str; - } - - auto pszPlace = str.begin() + iStart; - auto pszEnd = str.end(); - if (pszPlace < pszEnd) - { - int nIncluding = (int)strspn(pszPlace, pszTokens); - ; - - if ((pszPlace + nIncluding) < pszEnd) - { - pszPlace += nIncluding; - int nExcluding = (int)strcspn(pszPlace, pszTokens); - - int iFrom = iStart + nIncluding; - int nUntil = nExcluding; - iStart = iFrom + nUntil + 1; - - return (str.mid(iFrom, nUntil)); - } - } - - // return empty string, done tokenizing - iStart = -1; - return ""; -} - -// This template function will join strings from a vector into a single string, using a separator char -template -inline void JoinStrings(const QList& rStrings, QString& rDestStr, char aSeparator = ',') -{ - for (size_t i = 0, iCount = rStrings.size(); i < iCount; ++i) - { - rDestStr += rStrings[i]; - - if (i < iCount - 1) - { - rDestStr += aSeparator; - } - } -} - // This function will split a string containing separated strings, into a vector of strings // better version of TokenizeString inline void SplitString(const QString& rSrcStr, QStringList& rDestStrings, char aSeparator = ',') @@ -435,45 +309,6 @@ inline void SplitString(const QString& rSrcStr, QStringList& rDestStrings, char } } -// Format unsigned number to string with 1000s separator -inline QString FormatWithThousandsSeperator(const unsigned int number) -{ - QString string; - - string = QString::number(number); - - for (int p = string.length() - 3; p > 0; p -= 3) - { - string.insert(p, ','); - } - - return string; -} - - -void FormatFloatForUI(QString& str, int significantDigits, double value); - -////////////////////////////////////////////////////////////////////////// -// Simply sub string searching case insensitive. -////////////////////////////////////////////////////////////////////////// -inline const char* strstri(const char* pString, const char* pSubstring) -{ - int i, j, k; - for (i = 0; pString[i]; i++) - { - for (j = i, k = 0; tolower(pString[j]) == tolower(pSubstring[k]); j++, k++) - { - if (!pSubstring[k + 1]) - { - return (pString + i); - } - } - } - - return nullptr; -} - - inline bool CheckVirtualKey(Qt::MouseButton button) { return (qApp->property("pressedMouseButtons").toInt() & button) != 0; diff --git a/Gems/LyShine/Code/Editor/Animation/Util/UiEditorUtils.cpp b/Gems/LyShine/Code/Editor/Animation/Util/UiEditorUtils.cpp index 41f7300002..85270df355 100644 --- a/Gems/LyShine/Code/Editor/Animation/Util/UiEditorUtils.cpp +++ b/Gems/LyShine/Code/Editor/Animation/Util/UiEditorUtils.cpp @@ -92,23 +92,6 @@ QString TrimTrailingZeros(QString str) return str; } -////////////////////////////////////////////////////////////////////////// -// This function is supposed to format float in user-friendly way, -// omitting the exponent notation. -// -// Why not using printf? Its formatting rules has following drawbacks: -// %g - will use exponent for small numbers; -// %.Nf - doesn't allow to control total amount of significant numbers, -// which exposes limited precision during binary-to-decimal fraction -// conversion. -////////////////////////////////////////////////////////////////////////// -void FormatFloatForUI(QString& str, int significantDigits, double value) -{ - str = TrimTrailingZeros(QString::number(value, 'f', significantDigits)); - return; -} -//////////////////////////////////////////////////////////////////////////- - ////////////////////////////////////////////////////////////////////////// QColor ColorLinearToGamma(ColorF col) { From 62e7483b0e7a025369c09fcd92bcf326ea71a131 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Thu, 13 Jan 2022 14:44:59 -0600 Subject: [PATCH 374/399] Switched GradientSignal to use GemTestEnvironment. (#6886) This allows actual Shape components to be used instead of MockShapes, which is important for the benchmarks to get accurate results as Mocks are extremely expensive. It also removes a lot of unnecessary mock handling and test setup code. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../EditorGradientSignalPreviewTests.cpp | 38 +++-- .../Code/Tests/GradientSignalImageTests.cpp | 31 ++-- .../Tests/GradientSignalReferencesTests.cpp | 38 ++--- .../Tests/GradientSignalServicesTests.cpp | 10 +- .../Code/Tests/GradientSignalSurfaceTests.cpp | 10 +- .../Code/Tests/GradientSignalTest.cpp | 47 +++--- .../Code/Tests/GradientSignalTestFixtures.cpp | 134 ++++++++---------- .../Code/Tests/GradientSignalTestFixtures.h | 84 +++++------ .../Code/Tests/ImageAssetTests.cpp | 21 +-- 9 files changed, 193 insertions(+), 220 deletions(-) diff --git a/Gems/GradientSignal/Code/Tests/EditorGradientSignalPreviewTests.cpp b/Gems/GradientSignal/Code/Tests/EditorGradientSignalPreviewTests.cpp index e8bd9f2dff..83892f1c69 100644 --- a/Gems/GradientSignal/Code/Tests/EditorGradientSignalPreviewTests.cpp +++ b/Gems/GradientSignal/Code/Tests/EditorGradientSignalPreviewTests.cpp @@ -29,21 +29,34 @@ namespace UnitTest { GradientSignalTest::SetUp(); - // Set up job manager with two threads so that we can run and test the preview job logic. - AZ::JobManagerDesc desc; - AZ::JobManagerThreadDesc threadDesc; - desc.m_workerThreads.push_back(threadDesc); - desc.m_workerThreads.push_back(threadDesc); - m_jobManager = aznew AZ::JobManager(desc); - m_jobContext = aznew AZ::JobContext(*m_jobManager); - AZ::JobContext::SetGlobalContext(m_jobContext); + auto globalContext = AZ::JobContext::GetGlobalContext(); + if (globalContext) + { + AZ_Assert( + globalContext->GetJobManager().GetNumWorkerThreads() >= 2, + "Job Manager previously started by test environment with too few threads for this test."); + } + else + { + // Set up job manager with two threads so that we can run and test the preview job logic. + AZ::JobManagerDesc desc; + AZ::JobManagerThreadDesc threadDesc; + desc.m_workerThreads.push_back(threadDesc); + desc.m_workerThreads.push_back(threadDesc); + m_jobManager = aznew AZ::JobManager(desc); + m_jobContext = aznew AZ::JobContext(*m_jobManager); + AZ::JobContext::SetGlobalContext(m_jobContext); + } } void TearDown() override { - AZ::JobContext::SetGlobalContext(nullptr); - delete m_jobContext; - delete m_jobManager; + if (m_jobContext) + { + AZ::JobContext::SetGlobalContext(nullptr); + delete m_jobContext; + delete m_jobManager; + } GradientSignalTest::TearDown(); } @@ -180,4 +193,5 @@ namespace UnitTest } } -AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV); +// This uses a custom test hook so that we can load LmbrCentral and use Shape components in our unit tests. +AZ_UNIT_TEST_HOOK(new UnitTest::GradientSignalTestEnvironment); diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp index 5cd3c7edf6..8ec190000d 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp @@ -14,10 +14,13 @@ #include #include #include +#include #include #include +#include + namespace UnitTest { struct GradientSignalImageTestsFixture @@ -89,23 +92,21 @@ namespace UnitTest test.m_imageSize, test.m_imageSize, static_cast(test.m_pixel.GetX()), static_cast(test.m_pixel.GetY())); config.m_tilingX = test.m_tiling; config.m_tilingY = test.m_tiling; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); // Create the Gradient Transform Component. GradientSignal::GradientTransformConfig gradientTransformConfig; gradientTransformConfig.m_wrappingType = test.m_wrappingType; - CreateComponent(entity.get(), gradientTransformConfig); + entity->CreateComponent(gradientTransformConfig); - // Create a mock Shape component that describes the bounds that we're using to map our ImageGradient into world space. - CreateComponent(entity.get()); - MockShapeComponentHandler mockShapeHandler(entity->GetId()); - mockShapeHandler.m_GetLocalBounds = AZ::Aabb::CreateCenterRadius(AZ::Vector3(shapeHalfBounds), shapeHalfBounds); + LmbrCentral::BoxShapeConfig boxConfig(AZ::Vector3(shapeHalfBounds * 2.0f)); + auto boxComponent = entity->CreateComponent(LmbrCentral::AxisAlignedBoxShapeComponentTypeId); + boxComponent->SetConfiguration(boxConfig); - // Create a mock Transform component that locates our ImageGradient in the center of our desired mock Shape. - MockTransformHandler mockTransformHandler; - mockTransformHandler.m_GetLocalTMOutput = AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds)); - mockTransformHandler.m_GetWorldTMOutput = AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds)); - mockTransformHandler.BusConnect(entity->GetId()); + // Create a transform that locates our gradient in the center of our desired mock Shape. + auto transform = entity->CreateComponent(); + transform->SetLocalTM(AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds))); + transform->SetWorldTM(AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds))); // All components are created, so activate the entity ActivateEntity(entity.get()); @@ -365,7 +366,7 @@ namespace UnitTest mockShapeTransformHandler.BusConnect(mockShape->GetId()); // Create the mock shape that maps our 3x3 image to a 3x3 sample space in the world. - CreateComponent(mockShape.get()); + mockShape->CreateComponent(); MockShapeComponentHandler mockShapeComponentHandler(mockShape->GetId()); // Create a 2x2 box shape (shapes are inclusive, so that's 3x3 sampling space), so that each pixel in the image directly maps to 1 meter in the box. mockShapeComponentHandler.m_GetEncompassingAabb = AZ::Aabb::CreateFromMinMax(AZ::Vector3(0.0f), AZ::Vector3(2.0f)); @@ -379,7 +380,7 @@ namespace UnitTest // Create an ImageGradient with a 3x3 asset with the center pixel set. GradientSignal::ImageGradientConfig gradientConfig; gradientConfig.m_imageAsset = ImageAssetMockAssetHandler::CreateSpecificPixelImageAsset(3, 3, 1, 1); - CreateComponent(entity.get(), gradientConfig); + entity->CreateComponent(gradientConfig); // Create the test GradientTransform GradientSignal::GradientTransformConfig config; @@ -400,7 +401,7 @@ namespace UnitTest config.m_overrideRotate = false; config.m_overrideScale = false; config.m_is3d = false; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); // Set up the transform on the gradient entity. MockTransformHandler mockTransformHandler; @@ -409,7 +410,7 @@ namespace UnitTest mockTransformHandler.BusConnect(entity->GetId()); // Put a default shape on our gradient entity. This is only used for previews, so it doesn't matter what it gets set to. - CreateComponent(entity.get()); + entity->CreateComponent(); MockShapeComponentHandler mockShapeHandler(entity->GetId()); ActivateEntity(entity.get()); diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp index cc91c58fce..72bdfa202e 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp @@ -55,7 +55,7 @@ namespace UnitTest config.m_layers.push_back(layer); auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -88,7 +88,7 @@ namespace UnitTest config.m_smoothStep.m_falloffStrength = falloffStrength; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -391,7 +391,7 @@ namespace UnitTest GradientSignal::ReferenceGradientConfig referenceGradientConfig1; referenceGradientConfig1.m_gradientSampler.m_ownerEntityId = referenceGradientEntity1->GetId(); referenceGradientConfig1.m_gradientSampler.m_gradientId = constantGradientEntity->GetId(); - CreateComponent(referenceGradientEntity1.get(), referenceGradientConfig1); + referenceGradientEntity1->CreateComponent(referenceGradientConfig1); ActivateEntity(referenceGradientEntity1.get()); EXPECT_TRUE(referenceGradientConfig1.m_gradientSampler.ValidateGradientEntityId()); @@ -400,7 +400,7 @@ namespace UnitTest GradientSignal::ReferenceGradientConfig referenceGradientConfig2; referenceGradientConfig2.m_gradientSampler.m_ownerEntityId = referenceGradientEntity2->GetId(); referenceGradientConfig2.m_gradientSampler.m_gradientId = referenceGradientEntity1->GetId(); - CreateComponent(referenceGradientEntity2.get(), referenceGradientConfig2); + referenceGradientEntity2->CreateComponent(referenceGradientConfig2); ActivateEntity(referenceGradientEntity2.get()); EXPECT_TRUE(referenceGradientConfig2.m_gradientSampler.ValidateGradientEntityId()); @@ -409,7 +409,7 @@ namespace UnitTest GradientSignal::ReferenceGradientConfig referenceGradientConfig3; referenceGradientConfig3.m_gradientSampler.m_ownerEntityId = referenceGradientEntity3->GetId(); referenceGradientConfig3.m_gradientSampler.m_gradientId = referenceGradientEntity3->GetId(); - CreateComponent(referenceGradientEntity3.get(), referenceGradientConfig3); + referenceGradientEntity3->CreateComponent(referenceGradientConfig3); ActivateEntity(referenceGradientEntity3.get()); EXPECT_FALSE(referenceGradientConfig3.m_gradientSampler.ValidateGradientEntityId()); EXPECT_EQ(referenceGradientConfig3.m_gradientSampler.m_gradientId, AZ::EntityId()); @@ -422,19 +422,19 @@ namespace UnitTest GradientSignal::ReferenceGradientConfig referenceGradientConfig4; referenceGradientConfig4.m_gradientSampler.m_ownerEntityId = referenceGradientEntity4->GetId(); referenceGradientConfig4.m_gradientSampler.m_gradientId = referenceGradientEntity5->GetId(); - CreateComponent(referenceGradientEntity4.get(), referenceGradientConfig4); + referenceGradientEntity4->CreateComponent(referenceGradientConfig4); ActivateEntity(referenceGradientEntity4.get()); GradientSignal::ReferenceGradientConfig referenceGradientConfig5; referenceGradientConfig5.m_gradientSampler.m_ownerEntityId = referenceGradientEntity5->GetId(); referenceGradientConfig5.m_gradientSampler.m_gradientId = referenceGradientEntity6->GetId(); - CreateComponent(referenceGradientEntity5.get(), referenceGradientConfig5); + referenceGradientEntity5->CreateComponent(referenceGradientConfig5); ActivateEntity(referenceGradientEntity5.get()); GradientSignal::ReferenceGradientConfig referenceGradientConfig6; referenceGradientConfig6.m_gradientSampler.m_ownerEntityId = referenceGradientEntity6->GetId(); referenceGradientConfig6.m_gradientSampler.m_gradientId = referenceGradientEntity4->GetId(); - CreateComponent(referenceGradientEntity6.get(), referenceGradientConfig6); + referenceGradientEntity6->CreateComponent(referenceGradientConfig6); ActivateEntity(referenceGradientEntity6.get()); EXPECT_FALSE(referenceGradientConfig6.m_gradientSampler.ValidateGradientEntityId()); @@ -456,7 +456,7 @@ namespace UnitTest // Create an AABB from -1 to 1, so points at coorindates 0 and 1 fall on it, but any points at coordinate 2 won't. auto entityShape = CreateEntity(); - CreateComponent(entityShape.get()); + entityShape->CreateComponent(); MockShapeComponentHandler mockShapeComponentHandler(entityShape->GetId()); mockShapeComponentHandler.m_GetEncompassingAabb = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-1.0f), AZ::Vector3(1.0f)); @@ -466,7 +466,7 @@ namespace UnitTest config.m_falloffType = GradientSignal::FalloffType::Outer; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -481,7 +481,7 @@ namespace UnitTest // Create our test shape from -1 to 0, so we have a corner directly on (0, 0). auto entityShape = CreateEntity(); - CreateComponent(entityShape.get()); + entityShape->CreateComponent(); MockShapeComponentHandler mockShapeComponentHandler(entityShape->GetId()); mockShapeComponentHandler.m_GetEncompassingAabb = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-1.0f), AZ::Vector3(0.0f)); @@ -512,7 +512,7 @@ namespace UnitTest } auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -533,7 +533,7 @@ namespace UnitTest // We're pinning a shape, so the bounding box of (0, 0, 0) - (10, 10, 10) will be the one that applies. auto entityShape = CreateEntity(); - CreateComponent(entityShape.get()); + entityShape->CreateComponent(); MockShapeComponentHandler mockShapeComponentHandler(entityShape->GetId()); mockShapeComponentHandler.m_GetEncompassingAabb = AZ::Aabb::CreateFromMinMax(AZ::Vector3::CreateZero(), AZ::Vector3(10.0f)); @@ -551,7 +551,7 @@ namespace UnitTest config.m_altitudeMax = 24.0f; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -584,7 +584,7 @@ namespace UnitTest config.m_altitudeMax = 10.0f; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -612,7 +612,7 @@ namespace UnitTest config.m_altitudeMax = 15.0f; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -649,7 +649,7 @@ namespace UnitTest config.m_altitudeMax = 15.0f; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -684,7 +684,7 @@ namespace UnitTest config.m_surfaceTagList.push_back(AZ_CRC("test_mask", 0x7a16e9ff)); auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -711,7 +711,7 @@ namespace UnitTest config.m_surfaceTagList.push_back(AZ_CRC("test_mask", 0x7a16e9ff)); auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp index ec770f038d..449719af67 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp @@ -31,7 +31,7 @@ namespace UnitTest config.m_value = expectedOutput; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); GradientSignal::GradientSampler gradientSampler; @@ -75,7 +75,7 @@ namespace UnitTest config.m_gradientSampler.m_gradientId = entityMock->GetId(); auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -109,7 +109,7 @@ namespace UnitTest config.m_gradientSampler.m_gradientId = entityMock->GetId(); auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -147,7 +147,7 @@ namespace UnitTest config.m_gradientSampler.m_gradientId = entityMock->GetId(); auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -185,7 +185,7 @@ namespace UnitTest config.m_gradientSampler.m_gradientId = entityMock->GetId(); auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp index 702965c0de..a716fc79b8 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp @@ -44,11 +44,9 @@ namespace UnitTest // This lets our component register with surfaceData successfully. MockSurfaceDataSystem mockSurfaceDataSystem; - // Create a mock shape entity in case we want to use it. + // Create a mock shape entity in case our gradient test uses shape constraints. // The mock shape is a cube that goes from -0.5 to 0.5 in space. - auto mockShapeEntity = CreateEntity(); - CreateComponent(mockShapeEntity.get()); - MockShapeComponentHandler mockShapeHandler(mockShapeEntity->GetId()); + auto mockShapeEntity = CreateTestEntity(0.5f); ActivateEntity(mockShapeEntity.get()); // For ease of testing, use a constant gradient as our input gradient. @@ -76,8 +74,8 @@ namespace UnitTest // Create the test entity with the GradientSurfaceData component and the required gradient dependency auto entity = CreateEntity(); - CreateComponent(entity.get(), constantGradientConfig); - CreateComponent(entity.get(), config); + entity->CreateComponent(constantGradientConfig); + entity->CreateComponent(config); ActivateEntity(entity.get()); // Get our registered modifier handle (and verify that it's valid) diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp index adc35e6738..13e535e072 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp @@ -27,14 +27,12 @@ namespace UnitTest void TestLevelsGradientComponent(int dataSize, const AZStd::vector& inputData, const AZStd::vector& expectedOutput, float inputMin, float inputMid, float inputMax, float outputMin, float outputMax) { - auto entityMock = CreateEntity(); + auto entityMock = CreateTestEntity(1.0f); const AZ::EntityId id = entityMock->GetId(); UnitTest::MockGradientArrayRequestsBus mockGradientRequestsBus(id, inputData, dataSize); GradientSignal::GradientTransformConfig gradientTransformConfig; - CreateComponent(entityMock.get(), gradientTransformConfig); - CreateComponent(entityMock.get()); - MockShapeComponentHandler mockShapeHandler(entityMock->GetId()); + entityMock->CreateComponent(gradientTransformConfig); ActivateEntity(entityMock.get()); @@ -47,7 +45,7 @@ namespace UnitTest config.m_outputMax = outputMax; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -56,14 +54,12 @@ namespace UnitTest void TestPosterizeGradientComponent(int dataSize, const AZStd::vector& inputData, const AZStd::vector& expectedOutput, GradientSignal::PosterizeGradientConfig::ModeType posterizeMode, int bands) { - auto entityMock = CreateEntity(); + auto entityMock = CreateTestEntity(0.5f); const AZ::EntityId id = entityMock->GetId(); UnitTest::MockGradientArrayRequestsBus mockGradientRequestsBus(id, inputData, dataSize); GradientSignal::GradientTransformConfig gradientTransformConfig; - CreateComponent(entityMock.get(), gradientTransformConfig); - CreateComponent(entityMock.get()); - MockShapeComponentHandler mockShapeHandler(entityMock->GetId()); + entityMock->CreateComponent(gradientTransformConfig); ActivateEntity(entityMock.get()); @@ -73,7 +69,7 @@ namespace UnitTest config.m_bands = bands; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -82,14 +78,12 @@ namespace UnitTest void TestSmoothStepGradientComponent(int dataSize, const AZStd::vector& inputData, const AZStd::vector& expectedOutput, float midpoint, float range, float softness) { - auto entityMock = CreateEntity(); + auto entityMock = CreateTestEntity(0.5f); const AZ::EntityId id = entityMock->GetId(); UnitTest::MockGradientArrayRequestsBus mockGradientRequestsBus(id, inputData, dataSize); GradientSignal::GradientTransformConfig gradientTransformConfig; - CreateComponent(entityMock.get(), gradientTransformConfig); - CreateComponent(entityMock.get()); - MockShapeComponentHandler mockShapeHandler(entityMock->GetId()); + entityMock->CreateComponent(gradientTransformConfig); ActivateEntity(entityMock.get()); @@ -100,7 +94,7 @@ namespace UnitTest config.m_smoothStep.m_falloffStrength = softness; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -108,14 +102,12 @@ namespace UnitTest void TestThresholdGradientComponent(int dataSize, const AZStd::vector& inputData, const AZStd::vector& expectedOutput, float threshold) { - auto entityMock = CreateEntity(); + auto entityMock = CreateTestEntity(0.5f); const AZ::EntityId id = entityMock->GetId(); UnitTest::MockGradientArrayRequestsBus mockGradientRequestsBus(id, inputData, dataSize); GradientSignal::GradientTransformConfig gradientTransformConfig; - CreateComponent(entityMock.get(), gradientTransformConfig); - CreateComponent(entityMock.get()); - MockShapeComponentHandler mockShapeHandler(entityMock->GetId()); + entityMock->CreateComponent(gradientTransformConfig); ActivateEntity(entityMock.get()); @@ -124,7 +116,7 @@ namespace UnitTest config.m_threshold = threshold; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -167,11 +159,11 @@ namespace UnitTest AZStd::vector expectedOutput = { AZ_TRAIT_UNIT_TEST_PERLINE_GRADIANT_GOLDEN_VALUES_7878 }; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); GradientSignal::GradientTransformConfig gradientTransformConfig; - CreateComponent(entity.get(), gradientTransformConfig); - CreateComponent(entity.get()); + entity->CreateComponent(gradientTransformConfig); + entity->CreateComponent(); MockShapeComponentHandler mockShapeHandler(entity->GetId()); ActivateEntity(entity.get()); @@ -197,11 +189,11 @@ namespace UnitTest config.m_randomSeed = 5656; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); GradientSignal::GradientTransformConfig gradientTransformConfig; - CreateComponent(entity.get(), gradientTransformConfig); - CreateComponent(entity.get()); + entity->CreateComponent(gradientTransformConfig); + entity->CreateComponent(); MockShapeComponentHandler mockShapeHandler(entity->GetId()); ActivateEntity(entity.get()); @@ -546,4 +538,5 @@ namespace UnitTest } } -AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV); +// This uses custom test / benchmark hooks so that we can load LmbrCentral and use Shape components in our unit tests and benchmarks. +AZ_UNIT_TEST_HOOK(new UnitTest::GradientSignalTestEnvironment, UnitTest::GradientSignalBenchmarkEnvironment); diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp index 154e9032b2..d81370f6a8 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp @@ -10,7 +10,9 @@ #include #include +#include #include +#include // Base gradient components #include @@ -36,65 +38,48 @@ namespace UnitTest { - void GradientSignalBaseFixture::SetupCoreSystems() + void GradientSignalTestEnvironment::AddGemsAndComponents() { - m_app = AZStd::make_unique(); - ASSERT_TRUE(m_app != nullptr); - - AZ::ComponentApplication::Descriptor componentAppDesc; - - m_systemEntity = m_app->Create(componentAppDesc); - ASSERT_TRUE(m_systemEntity != nullptr); - m_app->AddEntity(m_systemEntity); + AddDynamicModulePaths({ "LmbrCentral" }); + + AddComponentDescriptors({ + AzFramework::TransformComponent::CreateDescriptor(), + + GradientSignal::ConstantGradientComponent::CreateDescriptor(), + GradientSignal::DitherGradientComponent::CreateDescriptor(), + GradientSignal::GradientSurfaceDataComponent::CreateDescriptor(), + GradientSignal::GradientTransformComponent::CreateDescriptor(), + GradientSignal::ImageGradientComponent::CreateDescriptor(), + GradientSignal::InvertGradientComponent::CreateDescriptor(), + GradientSignal::LevelsGradientComponent::CreateDescriptor(), + GradientSignal::MixedGradientComponent::CreateDescriptor(), + GradientSignal::PerlinGradientComponent::CreateDescriptor(), + GradientSignal::PosterizeGradientComponent::CreateDescriptor(), + GradientSignal::RandomGradientComponent::CreateDescriptor(), + GradientSignal::ReferenceGradientComponent::CreateDescriptor(), + GradientSignal::ShapeAreaFalloffGradientComponent::CreateDescriptor(), + GradientSignal::SmoothStepGradientComponent::CreateDescriptor(), + GradientSignal::SurfaceAltitudeGradientComponent::CreateDescriptor(), + GradientSignal::SurfaceMaskGradientComponent::CreateDescriptor(), + GradientSignal::SurfaceSlopeGradientComponent::CreateDescriptor(), + GradientSignal::ThresholdGradientComponent::CreateDescriptor(), + + MockShapeComponent::CreateDescriptor(), + }); + } - AZ::AllocatorInstance::Create(); - AZ::Data::AssetManager::Descriptor desc; - AZ::Data::AssetManager::Create(desc); - m_mockHandler = new ImageAssetMockAssetHandler(); + void GradientSignalBaseFixture::SetupCoreSystems() + { + m_mockHandler = new UnitTest::ImageAssetMockAssetHandler(); AZ::Data::AssetManager::Instance().RegisterHandler(m_mockHandler, azrtti_typeid()); - - m_mockShapeHandlers = new AZStd::vector>>(); } void GradientSignalBaseFixture::TearDownCoreSystems() { - // Clear any mock shape handlers that we've created for our test entities. - delete m_mockShapeHandlers; - AZ::Data::AssetManager::Instance().UnregisterHandler(m_mockHandler); delete m_mockHandler; // delete after removing from the asset manager AzFramework::LegacyAssetEventBus::ClearQueuedEvents(); - AZ::Data::AssetManager::Destroy(); - AZ::AllocatorInstance::Destroy(); - - m_app->Destroy(); - m_app.reset(); - m_systemEntity = nullptr; - } - - AZStd::unique_ptr> GradientSignalBaseFixture::CreateMockShape( - const AZ::Aabb& spawnerBox, const AZ::EntityId& shapeEntityId) - { - AZStd::unique_ptr> mockShape = - AZStd::make_unique>(shapeEntityId); - - ON_CALL(*mockShape, GetEncompassingAabb).WillByDefault(testing::Return(spawnerBox)); - ON_CALL(*mockShape, GetTransformAndLocalBounds) - .WillByDefault( - [spawnerBox](AZ::Transform& transform, AZ::Aabb& bounds) - { - transform = AZ::Transform::CreateTranslation(spawnerBox.GetCenter()); - bounds = spawnerBox.GetTranslated(-spawnerBox.GetCenter()); - }); - ON_CALL(*mockShape, IsPointInside) - .WillByDefault( - [spawnerBox](const AZ::Vector3& point) -> bool - { - return spawnerBox.Contains(point); - }); - - return mockShape; } AZStd::unique_ptr GradientSignalBaseFixture::CreateMockSurfaceDataSystem(const AZ::Aabb& spawnerBox) @@ -130,16 +115,12 @@ namespace UnitTest // Create the base entity AZStd::unique_ptr testEntity = CreateEntity(); - // Create a mock Shape component that describes the bounds that we're using to map our gradient into world space. - CreateComponent(testEntity.get()); - - // Create and keep a reference to a mock shape handler that will respond to shape requests for the mock shape. - auto mockShapeHandler = - CreateMockShape(AZ::Aabb::CreateCenterRadius(AZ::Vector3(shapeHalfBounds), shapeHalfBounds), testEntity->GetId()); - m_mockShapeHandlers->push_back(AZStd::move(mockShapeHandler)); + LmbrCentral::BoxShapeConfig boxConfig(AZ::Vector3(shapeHalfBounds * 2.0f)); + auto boxComponent = testEntity->CreateComponent(LmbrCentral::AxisAlignedBoxShapeComponentTypeId); + boxComponent->SetConfiguration(boxConfig); // Create a transform that locates our gradient in the center of our desired mock Shape. - auto transform = CreateComponent(testEntity.get()); + auto transform = testEntity->CreateComponent(); transform->SetLocalTM(AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds))); transform->SetWorldTM(AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds))); @@ -152,7 +133,7 @@ namespace UnitTest auto entity = CreateTestEntity(shapeHalfBounds); GradientSignal::ConstantGradientConfig config; config.m_value = 0.75f; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -168,12 +149,12 @@ namespace UnitTest config.m_imageAsset = ImageAssetMockAssetHandler::CreateImageAsset(imageSize, imageSize, imageSeed); config.m_tilingX = 1.0f; config.m_tilingY = 1.0f; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); // Create a Gradient Transform Component with arbitrary parameters. GradientSignal::GradientTransformConfig gradientTransformConfig; gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(entity.get(), gradientTransformConfig); + entity->CreateComponent(gradientTransformConfig); ActivateEntity(entity.get()); return entity; @@ -188,12 +169,12 @@ namespace UnitTest config.m_frequency = 1.1f; config.m_octave = 4; config.m_randomSeed = 12345; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); // Create a Gradient Transform Component with arbitrary parameters. GradientSignal::GradientTransformConfig gradientTransformConfig; gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(entity.get(), gradientTransformConfig); + entity->CreateComponent(gradientTransformConfig); ActivateEntity(entity.get()); return entity; @@ -205,12 +186,12 @@ namespace UnitTest auto entity = CreateTestEntity(shapeHalfBounds); GradientSignal::RandomGradientConfig config; config.m_randomSeed = 12345; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); // Create a Gradient Transform Component with arbitrary parameters. GradientSignal::GradientTransformConfig gradientTransformConfig; gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(entity.get(), gradientTransformConfig); + entity->CreateComponent(gradientTransformConfig); ActivateEntity(entity.get()); return entity; @@ -224,7 +205,7 @@ namespace UnitTest config.m_shapeEntityId = entity->GetId(); config.m_falloffWidth = 16.0f; config.m_falloffType = GradientSignal::FalloffType::InnerOuter; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -238,10 +219,11 @@ namespace UnitTest GradientSignal::DitherGradientConfig config; config.m_gradientSampler.m_gradientId = inputGradientId; config.m_useSystemPointsPerUnit = false; - config.m_pointsPerUnit = 1.0f; + // Use a number other than 1.0f for pointsPerUnit to ensure the dither math is getting exercised properly. + config.m_pointsPerUnit = 0.25f; config.m_patternOffset = AZ::Vector3::CreateZero(); config.m_patternType = GradientSignal::DitherGradientConfig::BayerPatternType::PATTERN_SIZE_4x4; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -254,7 +236,7 @@ namespace UnitTest auto entity = CreateTestEntity(shapeHalfBounds); GradientSignal::InvertGradientConfig config; config.m_gradientSampler.m_gradientId = inputGradientId; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -272,7 +254,7 @@ namespace UnitTest config.m_inputMax = 0.9f; config.m_outputMin = 0.0f; config.m_outputMax = 1.0f; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -298,7 +280,7 @@ namespace UnitTest layer.m_gradientSampler.m_opacity = 0.75f; config.m_layers.push_back(layer); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -313,7 +295,7 @@ namespace UnitTest config.m_gradientSampler.m_gradientId = inputGradientId; config.m_mode = GradientSignal::PosterizeGradientConfig::ModeType::Ps; config.m_bands = 5; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -327,7 +309,7 @@ namespace UnitTest GradientSignal::ReferenceGradientConfig config; config.m_gradientSampler.m_gradientId = inputGradientId; config.m_gradientSampler.m_ownerEntityId = entity->GetId(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -343,7 +325,7 @@ namespace UnitTest config.m_smoothStep.m_falloffMidpoint = 0.75f; config.m_smoothStep.m_falloffRange = 0.125f; config.m_smoothStep.m_falloffStrength = 0.25f; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -357,7 +339,7 @@ namespace UnitTest GradientSignal::ThresholdGradientConfig config; config.m_gradientSampler.m_gradientId = inputGradientId; config.m_threshold = 0.75f; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -370,7 +352,7 @@ namespace UnitTest GradientSignal::SurfaceAltitudeGradientConfig config; config.m_altitudeMin = -5.0f; config.m_altitudeMax = 15.0f; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -382,7 +364,7 @@ namespace UnitTest auto entity = CreateTestEntity(shapeHalfBounds); GradientSignal::SurfaceMaskGradientConfig config; config.m_surfaceTagList.push_back(AZ_CRC_CE("test_mask")); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -399,7 +381,7 @@ namespace UnitTest config.m_smoothStep.m_falloffMidpoint = 0.75f; config.m_smoothStep.m_falloffRange = 0.125f; config.m_smoothStep.m_falloffStrength = 0.25f; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h index 478f1c1d92..5fda88ea27 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h @@ -9,9 +9,39 @@ #include #include +#include namespace UnitTest { + // The GradientSignal unit tests need to use the GemTestEnvironment to load the LmbrCentral Gem so that Shape components can be used + // in the unit tests and benchmarks. + class GradientSignalTestEnvironment + : public AZ::Test::GemTestEnvironment + { + public: + void AddGemsAndComponents() override; + }; + +#ifdef HAVE_BENCHMARK + //! The Benchmark environment is used for one time setup and tear down of shared resources + class GradientSignalBenchmarkEnvironment + : public AZ::Test::BenchmarkEnvironmentBase + , public GradientSignalTestEnvironment + + { + protected: + void SetUpBenchmark() override + { + SetupEnvironment(); + } + + void TearDownBenchmark() override + { + TeardownEnvironment(); + } + }; +#endif + // Base test fixture used for GradientSignal unit tests and benchmark tests class GradientSignalBaseFixture { @@ -30,24 +60,6 @@ namespace UnitTest entity->Activate(); } - template - Component* CreateComponent(AZ::Entity* entity, const Configuration& config) - { - m_app->RegisterComponentDescriptor(Component::CreateDescriptor()); - return entity->CreateComponent(config); - } - - template - Component* CreateComponent(AZ::Entity* entity) - { - m_app->RegisterComponentDescriptor(Component::CreateDescriptor()); - return entity->CreateComponent(); - } - - // Create a mock shape that will respond to the shape bus with proper responses for the given input box. - AZStd::unique_ptr> CreateMockShape( - const AZ::Aabb& spawnerBox, const AZ::EntityId& shapeEntityId); - // Create a mock SurfaceDataSystem that will respond to requests for surface points with mock responses for points inside // the given input box. AZStd::unique_ptr CreateMockSurfaceDataSystem(const AZ::Aabb& spawnerBox); @@ -77,27 +89,22 @@ namespace UnitTest AZStd::unique_ptr BuildTestSurfaceMaskGradient(float shapeHalfBounds); AZStd::unique_ptr BuildTestSurfaceSlopeGradient(float shapeHalfBounds); - AZStd::unique_ptr m_app; - AZ::Entity* m_systemEntity = nullptr; - ImageAssetMockAssetHandler* m_mockHandler = nullptr; - AZStd::vector>>* m_mockShapeHandlers = nullptr; + UnitTest::ImageAssetMockAssetHandler* m_mockHandler = nullptr; }; struct GradientSignalTest : public GradientSignalBaseFixture - , public UnitTest::AllocatorsTestFixture + , public ::testing::Test { protected: void SetUp() override { - UnitTest::AllocatorsTestFixture::SetUp(); SetupCoreSystems(); } void TearDown() override { TearDownCoreSystems(); - UnitTest::AllocatorsTestFixture::TearDown(); } void TestFixedDataSampler(const AZStd::vector& expectedOutput, int size, AZ::EntityId gradientEntityId); @@ -106,41 +113,36 @@ namespace UnitTest #ifdef HAVE_BENCHMARK class GradientSignalBenchmarkFixture : public GradientSignalBaseFixture - , public UnitTest::AllocatorsBenchmarkFixture - , public UnitTest::TraceBusRedirector + , public ::benchmark::Fixture { public: - void internalSetUp(const benchmark::State& state) + void internalSetUp() { - AZ::Debug::TraceMessageBus::Handler::BusConnect(); - UnitTest::AllocatorsBenchmarkFixture::SetUp(state); SetupCoreSystems(); } - void internalTearDown(const benchmark::State& state) + void internalTearDown() { TearDownCoreSystems(); - UnitTest::AllocatorsBenchmarkFixture::TearDown(state); - AZ::Debug::TraceMessageBus::Handler::BusDisconnect(); } protected: - void SetUp(const benchmark::State& state) override + void SetUp([[maybe_unused]] const benchmark::State& state) override { - internalSetUp(state); + internalSetUp(); } - void SetUp(benchmark::State& state) override + void SetUp([[maybe_unused]] benchmark::State& state) override { - internalSetUp(state); + internalSetUp(); } - void TearDown(const benchmark::State& state) override + void TearDown([[maybe_unused]] const benchmark::State& state) override { - internalTearDown(state); + internalTearDown(); } - void TearDown(benchmark::State& state) override + void TearDown([[maybe_unused]] benchmark::State& state) override { - internalTearDown(state); + internalTearDown(); } }; #endif diff --git a/Gems/GradientSignal/Code/Tests/ImageAssetTests.cpp b/Gems/GradientSignal/Code/Tests/ImageAssetTests.cpp index 0111f10c3a..7b1c260d45 100644 --- a/Gems/GradientSignal/Code/Tests/ImageAssetTests.cpp +++ b/Gems/GradientSignal/Code/Tests/ImageAssetTests.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include @@ -64,26 +65,8 @@ namespace } } - class ImageAssetTest - : public ::testing::Test + class ImageAssetTest : public ::testing::Test { - protected: - AZ::ComponentApplication m_app; - AZ::Entity* m_systemEntity = nullptr; - - void SetUp() override - { - AZ::ComponentApplication::Descriptor appDesc; - appDesc.m_memoryBlocksByteSize = 128 * 1024 * 1024; - m_systemEntity = m_app.Create(appDesc); - m_app.AddEntity(m_systemEntity); - } - - void TearDown() override - { - m_app.Destroy(); - m_systemEntity = nullptr; - } }; #if AZ_TRAIT_DISABLE_FAILED_GRADIENT_SIGNAL_TESTS From 79431f5e5fbec10608e0de865c6474b0bead2c32 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Thu, 13 Jan 2022 14:50:54 -0600 Subject: [PATCH 375/399] First batch of GetValues() overrides (#6852) * Benchmarks and tests for Image and Constant GetValues Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Verify GetValues for Perlin and Random Gradients Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Standardized the assert format for GetValues(). Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * More GetValues unit tests and test cleanup Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed typos Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * GetValues() unit tests for surface gradients. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Benchmarks for ShapeAreaFalloff Gradient Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added benchmarks for all remaining gradients and cleaned up the helper methods. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Renamed class for better report formatting. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added missing Mocks dependencies for the Editor tests. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * First batch of specific GetValues() overrides. Each one is measurably faster than the generic version. Also, in ShapeAreaFalloffGradient, I optimized and simplified the logic a bit, so GetValue() is marginally faster too. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Components/ConstantGradientComponent.h | 1 + .../Components/ImageGradientComponent.h | 1 + .../Components/PerlinGradientComponent.h | 1 + .../Components/RandomGradientComponent.h | 3 + .../ShapeAreaFalloffGradientComponent.h | 1 + .../Components/ConstantGradientComponent.cpp | 16 +++++ .../Components/ImageGradientComponent.cpp | 33 +++++++++ .../Components/PerlinGradientComponent.cpp | 34 ++++++++++ .../Components/RandomGradientComponent.cpp | 67 +++++++++++++++---- .../ShapeAreaFalloffGradientComponent.cpp | 59 +++++++++++++--- 10 files changed, 195 insertions(+), 21 deletions(-) diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h index cb27914b8a..af896f0933 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h @@ -62,6 +62,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h index 8214436f83..9fc98124cb 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h @@ -69,6 +69,7 @@ namespace GradientSignal // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; // AZ::Data::AssetBus overrides... void OnAssetReady(AZ::Data::Asset asset) override; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h index ef171f5319..1b39f7f17b 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h @@ -70,6 +70,7 @@ namespace GradientSignal // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; private: PerlinGradientConfig m_configuration; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h index b0dbd964a0..274442a2c0 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h @@ -61,6 +61,7 @@ namespace GradientSignal // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; private: RandomGradientConfig m_configuration; @@ -73,5 +74,7 @@ namespace GradientSignal // RandomGradientRequestBus overrides... int GetRandomSeed() const override; void SetRandomSeed(int seed) override; + + float GetRandomValue(const AZ::Vector3& position, AZStd::size_t seed) const; }; } diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h index d7c2344fd2..df86c38069 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h @@ -69,6 +69,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp index 86e8a5abc6..2b1487f75e 100644 --- a/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp @@ -134,6 +134,22 @@ namespace GradientSignal return m_configuration.m_value; } + void ConstantGradientComponent::GetValues( + [[maybe_unused]] AZStd::array_view positions, AZStd::array_view outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + for (auto& outValue : outValues) + { + float& writableOutValue = const_cast(outValue); + writableOutValue = m_configuration.m_value; + } + } + float ConstantGradientComponent::GetConstantValue() const { return m_configuration.m_value; diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp index 269bfbc2df..06a3674188 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp @@ -219,6 +219,39 @@ namespace GradientSignal return 0.0f; } + void ImageGradientComponent::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + AZ::Vector3 uvw; + bool wasPointRejected = false; + + AZStd::shared_lock imageLock(m_imageMutex); + + for (size_t index = 0; index < positions.size(); index++) + { + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + + m_gradientTransform.TransformPositionToUVWNormalized(positions[index], uvw, wasPointRejected); + + if (!wasPointRejected) + { + outValue = GetValueFromImageAsset( + m_configuration.m_imageAsset, uvw, m_configuration.m_tilingX, m_configuration.m_tilingY, 0.0f); + } + else + { + outValue = 0.0f; + } + } + } + AZStd::string ImageGradientComponent::GetImageAssetPath() const { AZStd::string assetPathString; diff --git a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp index 3096afa3dc..667d8c30a7 100644 --- a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp @@ -203,6 +203,40 @@ namespace GradientSignal return 0.0f; } + void PerlinGradientComponent::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + AZ::Vector3 uvw; + bool wasPointRejected = false; + + AZStd::shared_lock lock(m_transformMutex); + + for (size_t index = 0; index < positions.size(); index++) + { + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + + m_gradientTransform.TransformPositionToUVW(positions[index], uvw, wasPointRejected); + + if (!wasPointRejected) + { + outValue = m_perlinImprovedNoise->GenerateOctaveNoise( + uvw.GetX(), uvw.GetY(), uvw.GetZ(), m_configuration.m_octave, m_configuration.m_amplitude, + m_configuration.m_frequency); + } + else + { + outValue = 0.0f; + } + } + } + int PerlinGradientComponent::GetRandomSeed() const { return m_configuration.m_randomSeed; diff --git a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp index 1b6753560c..ae51bdd4ac 100644 --- a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp @@ -145,6 +145,22 @@ namespace GradientSignal m_gradientTransform = newTransform; } + float RandomGradientComponent::GetRandomValue(const AZ::Vector3& position, AZStd::size_t seed) const + { + // generating stable pseudo-random noise from a position based hash + float x = position.GetX(); + float y = position.GetY(); + AZStd::size_t result = 0; + + AZStd::hash_combine(result, x * seed + y); + AZStd::hash_combine(result, y * seed + x); + AZStd::hash_combine(result, x * y * seed); + + // always returns [0.0,1.0] + return static_cast(result % std::numeric_limits::max()) / static_cast(std::numeric_limits::max()); + } + + float RandomGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { @@ -158,23 +174,50 @@ namespace GradientSignal if (!wasPointRejected) { - //generating stable pseudo-random noise from a position based hash - float x = uvw.GetX(); - float y = uvw.GetY(); - AZStd::size_t result = 0; - const AZStd::size_t seed = m_configuration.m_randomSeed + AZStd::size_t(2); // Add 2 to avoid seeds 0 and 1, which can create strange patterns with this particular algorithm - - AZStd::hash_combine(result, x * seed + y); - AZStd::hash_combine(result, y * seed + x); - AZStd::hash_combine(result, x * y * seed); - - //always returns [0.0,1.0] - return static_cast(result % std::numeric_limits::max()) / static_cast(std::numeric_limits::max()); + const AZStd::size_t seed = m_configuration.m_randomSeed + + AZStd::size_t(2); // Add 2 to avoid seeds 0 and 1, which can create strange patterns with this particular algorithm + + return GetRandomValue(uvw, seed); } return 0.0f; } + void RandomGradientComponent::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + AZ::Vector3 uvw; + bool wasPointRejected = false; + const AZStd::size_t seed = m_configuration.m_randomSeed + + AZStd::size_t(2); // Add 2 to avoid seeds 0 and 1, which can create strange patterns with this particular algorithm + + AZStd::shared_lock lock(m_transformMutex); + + for (size_t index = 0; index < positions.size(); index++) + { + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + + m_gradientTransform.TransformPositionToUVW(positions[index], uvw, wasPointRejected); + + if (!wasPointRejected) + { + outValue = GetRandomValue(uvw, seed); + } + else + { + outValue = 0.0f; + } + } + } + + int RandomGradientComponent::GetRandomSeed() const { return m_configuration.m_randomSeed; diff --git a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp index 9e1a250900..f2416f4fb6 100644 --- a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp @@ -157,21 +157,62 @@ namespace GradientSignal float ShapeAreaFalloffGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(Entity); - float distance = 0.0f; LmbrCentral::ShapeComponentRequestsBus::EventResult(distance, m_configuration.m_shapeEntityId, &LmbrCentral::ShapeComponentRequestsBus::Events::DistanceFromPoint, sampleParams.m_position); - // In the special case of 0 falloff, make sure that all points inside the shape (0 distance) return - // 1.0, and all points outside the shape return 0. - if (m_configuration.m_falloffWidth == 0.0f) + // Since this is outer falloff, distance should give us values from 1.0 at the minimum distance to 0.0 at the maximum distance. + // The statement is written specifically to handle the 0 falloff case as well. For 0 falloff, all points inside the shape + // (0 distance) return 1.0, and all points outside the shape return 0. This works because division by 0 gives infinity, which gets + // clamped by the GetMax() to 0. However, if distance == 0, it would give us NaN, so we have the separate conditional check to + // handle that case and clamp to 1.0. + return (distance <= 0.0f) ? 1.0f : AZ::GetMax(1.0f - (distance / m_configuration.m_falloffWidth), 0.0f); + } + + void ShapeAreaFalloffGradientComponent::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + { + if (positions.size() != outValues.size()) { - return (distance > 0.0f) ? 0.0f : 1.0f; + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; } - // Since this is outer falloff, distance should give us values from 1.0 at the minimum distance - // to 0.0 at the maximum distance. - return GetRatio(m_configuration.m_falloffWidth, 0.0f, distance); + bool shapeConnected = false; + const float falloffWidth = m_configuration.m_falloffWidth; + + LmbrCentral::ShapeComponentRequestsBus::Event( + m_configuration.m_shapeEntityId, + [falloffWidth, positions, &outValues, &shapeConnected](LmbrCentral::ShapeComponentRequestsBus::Events* shapeRequests) + { + shapeConnected = true; + + for (size_t index = 0; index < positions.size(); index++) + { + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + + float distance = shapeRequests->DistanceFromPoint(positions[index]); + + // Since this is outer falloff, distance should give us values from 1.0 at the minimum distance to 0.0 at the maximum + // distance. The statement is written specifically to handle the 0 falloff case as well. For 0 falloff, all points + // inside the shape (0 distance) return 1.0, and all points outside the shape return 0. This works because division by 0 + // gives infinity, which gets clamped by the GetMax() to 0. However, if distance == 0, it would give us NaN, so we have + // the separate conditional check to handle that case and clamp to 1.0. + outValue = (distance <= 0.0f) ? 1.0f : AZ::GetMax(1.0f - (distance / falloffWidth), 0.0f); + } + }); + + // If there's no shape, there's no falloff. + if (!shapeConnected) + { + for (size_t index = 0; index < positions.size(); index++) + { + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + outValue = 1.0f; + } + } } AZ::EntityId ShapeAreaFalloffGradientComponent::GetShapeEntityId() const From 34d74857f5e940b8e18a971e7b053fb6805c48b2 Mon Sep 17 00:00:00 2001 From: Scott Romero <24445312+AMZN-ScottR@users.noreply.github.com> Date: Thu, 13 Jan 2022 12:55:36 -0800 Subject: [PATCH 376/399] [development] fix for a possible MSVC compiler bug (#6870) Replaced a variable with the name "interface" to avoid conflict with MSVC keyword Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> --- .../AssetProcessor/native/tests/SourceFileRelocatorTests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Tools/AssetProcessor/native/tests/SourceFileRelocatorTests.cpp b/Code/Tools/AssetProcessor/native/tests/SourceFileRelocatorTests.cpp index d7801abb3d..8d52ba23bd 100644 --- a/Code/Tools/AssetProcessor/native/tests/SourceFileRelocatorTests.cpp +++ b/Code/Tools/AssetProcessor/native/tests/SourceFileRelocatorTests.cpp @@ -793,9 +793,9 @@ namespace UnitTests TEST_F(SourceFileRelocatorTest, TestInterface) { - auto* interface = AZ::Interface::Get(); + auto* sourceFileRelocator = AZ::Interface::Get(); - ASSERT_NE(interface, nullptr); + ASSERT_NE(sourceFileRelocator, nullptr); } TEST_F(SourceFileRelocatorTest, Move_Real_Succeeds) From 193f529b9c8469930252b20d9fd15bd2bbc9bf60 Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Thu, 13 Jan 2022 12:56:34 -0800 Subject: [PATCH 377/399] Add an LyShine client API target (#6829) * Reduce the need to link with LyShine static lib in other gems Signed-off-by: abrmich * Add UiBasics.Builders to VirtualGamepad.Builders alias Signed-off-by: abrmich * Add UiBasics to LyShine gem's metadata Signed-off-by: abrmich * Change include to a forward declaration Signed-off-by: abrmich --- Gems/GameStateSamples/Code/CMakeLists.txt | 2 +- Gems/LyShine/Code/CMakeLists.txt | 19 ++++---- Gems/LyShine/Code/Editor/GuideHelpers.cpp | 2 +- .../Code/Editor/ViewportCanvasBackground.cpp | 2 +- .../Code/Editor/ViewportDragInteraction.h | 2 +- Gems/LyShine/Code/Editor/ViewportHelpers.h | 2 +- Gems/LyShine/Code/Editor/ViewportIcon.cpp | 12 ++--- Gems/LyShine/Code/Editor/ViewportIcon.h | 2 +- Gems/LyShine/Code/Editor/ViewportWidget.cpp | 2 +- Gems/LyShine/Code/Include/LyShine/IDraw2d.h | 44 +++++++++++++++++++ Gems/LyShine/Code/Include/LyShine/ILyShine.h | 9 ++++ Gems/LyShine/Code/Source/Draw2d.cpp | 38 +--------------- .../Code/{Include/LyShine => Source}/Draw2d.h | 3 -- Gems/LyShine/Code/Source/LyShine.cpp | 10 ++++- Gems/LyShine/Code/Source/LyShine.h | 1 + Gems/LyShine/Code/Source/LyShineDebug.cpp | 22 +++++----- .../LyShine/Code/Source/UiCanvasComponent.cpp | 2 +- Gems/LyShine/Code/Source/UiCanvasManager.cpp | 6 +-- Gems/LyShine/Code/Source/UiFaderComponent.cpp | 2 +- Gems/LyShine/Code/Source/UiImageComponent.cpp | 2 +- .../Code/Source/UiImageSequenceComponent.cpp | 2 +- Gems/LyShine/Code/Source/UiMaskComponent.cpp | 2 +- Gems/LyShine/Code/Source/UiRenderer.cpp | 4 +- Gems/LyShine/Code/Source/UiTextComponent.cpp | 10 ++--- Gems/LyShine/Code/lyshine_static_files.cmake | 4 +- Gems/LyShine/gem.json | 3 +- Gems/LyShineExamples/Code/CMakeLists.txt | 4 +- .../Code/Source/UiCustomImageComponent.cpp | 2 +- Gems/MessagePopup/Code/CMakeLists.txt | 4 +- Gems/UiBasics/CMakeLists.txt | 1 + Gems/VirtualGamepad/Code/CMakeLists.txt | 4 +- 31 files changed, 125 insertions(+), 99 deletions(-) rename Gems/LyShine/Code/{Include/LyShine => Source}/Draw2d.h (98%) diff --git a/Gems/GameStateSamples/Code/CMakeLists.txt b/Gems/GameStateSamples/Code/CMakeLists.txt index 5d1d180de0..a07bef6a06 100644 --- a/Gems/GameStateSamples/Code/CMakeLists.txt +++ b/Gems/GameStateSamples/Code/CMakeLists.txt @@ -21,7 +21,7 @@ ly_add_target( INTERFACE Gem::GameState Gem::LocalUser - Gem::LyShine.Static + Gem::LyShine.Clients.API Gem::SaveData.Static Gem::MessagePopup.Static Legacy::CryCommon diff --git a/Gems/LyShine/Code/CMakeLists.txt b/Gems/LyShine/Code/CMakeLists.txt index 4f2c4e90a7..2b550b0e36 100644 --- a/Gems/LyShine/Code/CMakeLists.txt +++ b/Gems/LyShine/Code/CMakeLists.txt @@ -58,10 +58,13 @@ ly_add_target( # by default, load the above "Gem::LyShine" module in Client and Server applications: ly_create_alias(NAME LyShine.Clients NAMESPACE Gem TARGETS Gem::LyShine) ly_create_alias(NAME LyShine.Servers NAMESPACE Gem TARGETS Gem::LyShine) +# create an alias for other gems to depend on an LyShine public API (may be converted to a target in the future): +ly_create_alias(NAME LyShine.Clients.API NAMESPACE Gem TARGETS Gem::LyShine.Clients) +ly_create_alias(NAME LyShine.Servers.API NAMESPACE Gem TARGETS Gem::LyShine.Servers) if (PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( - NAME LyShine.Editor.Static STATIC + NAME LyShine.Tools.Static STATIC NAMESPACE Gem AUTOMOC AUTOUIC @@ -73,7 +76,6 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) . Source Editor - PUBLIC Include BUILD_DEPENDENCIES PRIVATE @@ -100,7 +102,7 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) ) ly_add_target( - NAME LyShine.Editor GEM_MODULE + NAME LyShine.Tools GEM_MODULE NAMESPACE Gem FILES_CMAKE lyshine_common_module_files.cmake @@ -112,18 +114,18 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) . Source Editor - PUBLIC Include BUILD_DEPENDENCIES PRIVATE Legacy::CryCommon AZ::AzToolsFramework - Gem::LyShine.Editor.Static + Gem::LyShine.Tools.Static Gem::LmbrCentral.Editor Gem::TextureAtlas.Editor RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor Gem::TextureAtlas.Editor + Gem::UiBasics.Tools ) # by naming this target LyShine.Builders it ensures that it is loaded @@ -179,10 +181,9 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) Gem::LyShine.Builders.Static Gem::LmbrCentral.Editor Gem::TextureAtlas.Editor + RUNTIME_DEPENDENCIES + Gem::UiBasics.Builders ) - - # by default, load the above "Gem::LyShine.Editor" module in dev tools: - ly_create_alias(NAME LyShine.Tools NAMESPACE Gem TARGETS Gem::LyShine.Editor) endif() ################################################################################ @@ -241,7 +242,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzTest Legacy::CryCommon AZ::AssetBuilderSDK - Gem::LyShine.Editor.Static + Gem::LyShine.Tools.Static Gem::LyShine.Builders.Static Gem::LmbrCentral.Editor Gem::TextureAtlas diff --git a/Gems/LyShine/Code/Editor/GuideHelpers.cpp b/Gems/LyShine/Code/Editor/GuideHelpers.cpp index eb5966568e..b6d7acc57a 100644 --- a/Gems/LyShine/Code/Editor/GuideHelpers.cpp +++ b/Gems/LyShine/Code/Editor/GuideHelpers.cpp @@ -173,7 +173,7 @@ namespace GuideHelpers // the line is drawn as the inverse of the background color AZ::Color guideColor(1.0f, 1.0f, 1.0f, 1.0f); - CDraw2d::RenderState renderState; + IDraw2d::RenderState renderState; renderState.m_blendState.m_blendSource = AZ::RHI::BlendFactor::ColorDestInverse; renderState.m_blendState.m_blendDest = AZ::RHI::BlendFactor::Zero; diff --git a/Gems/LyShine/Code/Editor/ViewportCanvasBackground.cpp b/Gems/LyShine/Code/Editor/ViewportCanvasBackground.cpp index 668c4e8024..b1961de0a1 100644 --- a/Gems/LyShine/Code/Editor/ViewportCanvasBackground.cpp +++ b/Gems/LyShine/Code/Editor/ViewportCanvasBackground.cpp @@ -50,7 +50,7 @@ void ViewportCanvasBackground::Draw(Draw2dHelper& draw2d, const AZ::Vector2& can // now draw the same as Stretched but with UV's adjusted const AZ::Vector2 uvs[4] = { AZ::Vector2(0, 0), AZ::Vector2(uvScale.GetX(), 0), AZ::Vector2(uvScale.GetX(), uvScale.GetY()), AZ::Vector2(0, uvScale.GetY()) }; AZ::Color colorWhite(1.0f, 1.0f, 1.0f, 1.0f); - CDraw2d::VertexPosColUV verts[4]; + IDraw2d::VertexPosColUV verts[4]; for (int i = 0; i < 4; ++i) { verts[i].position = positions[i]; diff --git a/Gems/LyShine/Code/Editor/ViewportDragInteraction.h b/Gems/LyShine/Code/Editor/ViewportDragInteraction.h index 3b26b66308..6b48fc0133 100644 --- a/Gems/LyShine/Code/Editor/ViewportDragInteraction.h +++ b/Gems/LyShine/Code/Editor/ViewportDragInteraction.h @@ -8,7 +8,7 @@ #pragma once #include -#include +#include //! Abstract base class for drag interactions in the UI Editor viewport window. class ViewportDragInteraction diff --git a/Gems/LyShine/Code/Editor/ViewportHelpers.h b/Gems/LyShine/Code/Editor/ViewportHelpers.h index 8068f4af65..f2722fb6b8 100644 --- a/Gems/LyShine/Code/Editor/ViewportHelpers.h +++ b/Gems/LyShine/Code/Editor/ViewportHelpers.h @@ -7,7 +7,7 @@ */ #pragma once -#include +#include namespace ViewportHelpers { diff --git a/Gems/LyShine/Code/Editor/ViewportIcon.cpp b/Gems/LyShine/Code/Editor/ViewportIcon.cpp index 3f0fdfaba0..33f2f40ffe 100644 --- a/Gems/LyShine/Code/Editor/ViewportIcon.cpp +++ b/Gems/LyShine/Code/Editor/ViewportIcon.cpp @@ -6,7 +6,7 @@ * */ #include "EditorCommon.h" -#include +#include #include #include @@ -15,7 +15,7 @@ float ViewportIcon::m_dpiScaleFactor = 1.0f; ViewportIcon::ViewportIcon(const char* textureFilename) { - m_image = CDraw2d::LoadTexture(textureFilename); + m_image = Draw2dHelper::LoadTexture(textureFilename); } ViewportIcon::~ViewportIcon() @@ -48,7 +48,7 @@ void ViewportIcon::DrawImageAligned(Draw2dHelper& draw2d, AZ::Vector2& pivot, fl opacity); } -void ViewportIcon::DrawImageTiled(Draw2dHelper& draw2d, CDraw2d::VertexPosColUV* verts) +void ViewportIcon::DrawImageTiled(Draw2dHelper& draw2d, IDraw2d::VertexPosColUV* verts) { // Use default blending and rounding modes IDraw2d::Rounding rounding = IDraw2d::Rounding::Nearest; @@ -63,7 +63,7 @@ void ViewportIcon::DrawAxisAlignedBoundingBox(Draw2dHelper& draw2d, AZ::Vector2 float endTexCoordU = fabsf((bound1.GetX() - bound0.GetX()) * pixelLengthForDottedLineTexture); float endTexCoordV = fabsf((bound1.GetY() - bound0.GetY()) * pixelLengthForDottedLineTexture); - CDraw2d::VertexPosColUV verts[2]; + IDraw2d::VertexPosColUV verts[2]; { verts[0].color = dottedColor; verts[1].color = dottedColor; @@ -158,7 +158,7 @@ void ViewportIcon::Draw(Draw2dHelper& draw2d, AZ::Vector2 anchorPos, const AZ::M AZ::Matrix4x4 moveFromPivotSpaceMat = AZ::Matrix4x4::CreateTranslation(pivot3); AZ::Matrix4x4 newTransform = transform * moveFromPivotSpaceMat * rotMat * moveToPivotSpaceMat; - CDraw2d::VertexPosColUV verts[4]; + IDraw2d::VertexPosColUV verts[4]; // points are a clockwise quad static const AZ::Vector2 uvs[4] = { AZ::Vector2(0.0f, 0.0f), AZ::Vector2(1.0f, 0.0f), AZ::Vector2(1.0f, 1.0f), AZ::Vector2(0.0f, 1.0f) @@ -251,7 +251,7 @@ void ViewportIcon::DrawDistanceLine(Draw2dHelper& draw2d, AZ::Vector2 start, AZ: const float pixelLengthForDottedLineTexture = 8.0f; float endTexCoordU = length / pixelLengthForDottedLineTexture; - CDraw2d::VertexPosColUV verts[2]; + IDraw2d::VertexPosColUV verts[2]; verts[0].position = start; verts[0].color = dottedColor; diff --git a/Gems/LyShine/Code/Editor/ViewportIcon.h b/Gems/LyShine/Code/Editor/ViewportIcon.h index f815b244e9..fadd829bcf 100644 --- a/Gems/LyShine/Code/Editor/ViewportIcon.h +++ b/Gems/LyShine/Code/Editor/ViewportIcon.h @@ -20,7 +20,7 @@ public: void DrawImageAligned(Draw2dHelper& draw2d, AZ::Vector2& pivot, float opacity); - void DrawImageTiled(Draw2dHelper& draw2d, CDraw2d::VertexPosColUV* verts); + void DrawImageTiled(Draw2dHelper& draw2d, IDraw2d::VertexPosColUV* verts); void Draw(Draw2dHelper& draw2d, AZ::Vector2 anchorPos, const AZ::Matrix4x4& transform, float iconRot = 0.0f, AZ::Color color = AZ::Color(1.0f, 1.0f, 1.0f, 1.0f)) const; diff --git a/Gems/LyShine/Code/Editor/ViewportWidget.cpp b/Gems/LyShine/Code/Editor/ViewportWidget.cpp index 993f57aeeb..b481e9cbf1 100644 --- a/Gems/LyShine/Code/Editor/ViewportWidget.cpp +++ b/Gems/LyShine/Code/Editor/ViewportWidget.cpp @@ -16,7 +16,6 @@ #include #include -#include #include "LyShine.h" #include "UiRenderer.h" @@ -27,6 +26,7 @@ #include "RulerWidget.h" #include "CanvasHelpers.h" #include "AssetDropHelpers.h" +#include "Draw2d.h" #include "QtHelpers.h" #include diff --git a/Gems/LyShine/Code/Include/LyShine/IDraw2d.h b/Gems/LyShine/Code/Include/LyShine/IDraw2d.h index 620b8c23c9..77dc5ac601 100644 --- a/Gems/LyShine/Code/Include/LyShine/IDraw2d.h +++ b/Gems/LyShine/Code/Include/LyShine/IDraw2d.h @@ -482,6 +482,50 @@ public: // static member functions return nullptr; } + //! Helper to load a texture + static AZ::Data::Instance LoadTexture(const AZStd::string& pathName) + { + if (gEnv && gEnv->pLyShine) // [LYSHINE_ATOM_TODO][GHI #3569] Remove LyShine global interface pointer from legacy global environment + { + return gEnv->pLyShine->LoadTexture(pathName); + } + + return nullptr; + } + + //! Given a position and size and an alignment return the top left corner of the aligned quad + static AZ::Vector2 Align(AZ::Vector2 position, AZ::Vector2 size, IDraw2d::HAlign horizontalAlignment, IDraw2d::VAlign verticalAlignment) + { + AZ::Vector2 result = AZ::Vector2::CreateZero(); + switch (horizontalAlignment) + { + case IDraw2d::HAlign::Left: + result.SetX(position.GetX()); + break; + case IDraw2d::HAlign::Center: + result.SetX(position.GetX() - size.GetX() * 0.5f); + break; + case IDraw2d::HAlign::Right: + result.SetX(position.GetX() - size.GetX()); + break; + } + + switch (verticalAlignment) + { + case IDraw2d::VAlign::Top: + result.SetY(position.GetY()); + break; + case IDraw2d::VAlign::Center: + result.SetY(position.GetY() - size.GetY() * 0.5f); + break; + case IDraw2d::VAlign::Bottom: + result.SetY(position.GetY() - size.GetY()); + break; + } + + return result; + } + //! Round the X and Y coordinates of a point using the given rounding policy template static T RoundXY(T value, IDraw2d::Rounding roundingType) diff --git a/Gems/LyShine/Code/Include/LyShine/ILyShine.h b/Gems/LyShine/Code/Include/LyShine/ILyShine.h index 7832497d8c..71ca6ec074 100644 --- a/Gems/LyShine/Code/Include/LyShine/ILyShine.h +++ b/Gems/LyShine/Code/Include/LyShine/ILyShine.h @@ -9,12 +9,18 @@ #include #include +#include class IDraw2d; class ISprite; struct IUiAnimationSystem; class UiEntityContext; +namespace AZ::RPI +{ + class Image; +} + // The following ifdef block is the standard way of creating macros which make exporting // from a DLL simpler. All files within this DLL are compiled with the LYSHINE_EXPORTS // symbol defined in the StdAfx.h. this symbol should not be defined on any project @@ -82,6 +88,9 @@ public: //! Check if a sprite's texture asset exists. The .sprite sidecar file is optional and is not checked virtual bool DoesSpriteTextureAssetExist(const AZStd::string& pathname) = 0; + //! Load an image asset by texture pathname + virtual AZ::Data::Instance LoadTexture(const AZStd::string& pathName) = 0; + //! Perform post-initialization (script system will be available) virtual void PostInit() = 0; diff --git a/Gems/LyShine/Code/Source/Draw2d.cpp b/Gems/LyShine/Code/Source/Draw2d.cpp index 2838ed4877..ff8c7f1c6d 100644 --- a/Gems/LyShine/Code/Source/Draw2d.cpp +++ b/Gems/LyShine/Code/Source/Draw2d.cpp @@ -6,7 +6,7 @@ * */ -#include +#include "Draw2d.h" #include #include "LyShinePassDataBus.h" @@ -215,7 +215,7 @@ void CDraw2d::DrawImageAligned(AZ::Data::Instance image, AZ::Vec HAlign horizontalAlignment, VAlign verticalAlignment, float opacity, float rotation, const AZ::Vector2* minMaxTexCoords, ImageOptions* imageOptions) { - AZ::Vector2 alignedPosition = Align(position, size, horizontalAlignment, verticalAlignment); + AZ::Vector2 alignedPosition = Draw2dHelper::Align(position, size, horizontalAlignment, verticalAlignment); DrawImage(image, alignedPosition, size, opacity, rotation, &position, minMaxTexCoords, imageOptions); } @@ -524,40 +524,6 @@ void CDraw2d::SetSortKey(int64_t key) // PUBLIC STATIC FUNCTIONS //////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////// -AZ::Vector2 CDraw2d::Align(AZ::Vector2 position, AZ::Vector2 size, - HAlign horizontalAlignment, VAlign verticalAlignment) -{ - AZ::Vector2 result = AZ::Vector2::CreateZero(); - switch (horizontalAlignment) - { - case HAlign::Left: - result.SetX(position.GetX()); - break; - case HAlign::Center: - result.SetX(position.GetX() - size.GetX() * 0.5f); - break; - case HAlign::Right: - result.SetX(position.GetX() - size.GetX()); - break; - } - - switch (verticalAlignment) - { - case VAlign::Top: - result.SetY(position.GetY()); - break; - case VAlign::Center: - result.SetY(position.GetY() - size.GetY() * 0.5f); - break; - case VAlign::Bottom: - result.SetY(position.GetY() - size.GetY()); - break; - } - - return result; -} - //////////////////////////////////////////////////////////////////////////////////////////////////// AZ::Data::Instance CDraw2d::LoadTexture(const AZStd::string& pathName) { diff --git a/Gems/LyShine/Code/Include/LyShine/Draw2d.h b/Gems/LyShine/Code/Source/Draw2d.h similarity index 98% rename from Gems/LyShine/Code/Include/LyShine/Draw2d.h rename to Gems/LyShine/Code/Source/Draw2d.h index d138f41b03..6d400c6b55 100644 --- a/Gems/LyShine/Code/Include/LyShine/Draw2d.h +++ b/Gems/LyShine/Code/Source/Draw2d.h @@ -180,9 +180,6 @@ private: public: // static member functions - //! Given a position and size and an alignment return the top left corner of the aligned quad - static AZ::Vector2 Align(AZ::Vector2 position, AZ::Vector2 size, HAlign horizontalAlignment, VAlign verticalAlignment); - //! Helper to load a texture static AZ::Data::Instance LoadTexture(const AZStd::string& pathName); diff --git a/Gems/LyShine/Code/Source/LyShine.cpp b/Gems/LyShine/Code/Source/LyShine.cpp index 683d72f4ab..5a704329ef 100644 --- a/Gems/LyShine/Code/Source/LyShine.cpp +++ b/Gems/LyShine/Code/Source/LyShine.cpp @@ -43,11 +43,11 @@ #include "Sprite.h" #include "UiSerialize.h" #include "UiRenderer.h" +#include "Draw2d.h" #include #include #include -#include #if defined(LYSHINE_INTERNAL_UNIT_TEST) #include "TextMarkup.h" @@ -355,6 +355,12 @@ bool CLyShine::DoesSpriteTextureAssetExist(const AZStd::string& pathname) return CSprite::DoesSpriteTextureAssetExist(pathname); } +//////////////////////////////////////////////////////////////////////////////////////////////////// +AZ::Data::Instance CLyShine::LoadTexture(const AZStd::string& pathname) +{ + return CDraw2d::LoadTexture(pathname); +} + //////////////////////////////////////////////////////////////////////////////////////////////////// void CLyShine::PostInit() { @@ -691,7 +697,7 @@ void CLyShine::RenderUiCursor() AZ::RHI::Size cursorSize = m_uiCursorTexture->GetDescriptor().m_size; const AZ::Vector2 dimensions(aznumeric_cast(cursorSize.m_width), aznumeric_cast(cursorSize.m_height)); - CDraw2d::ImageOptions imageOptions; + IDraw2d::ImageOptions imageOptions; imageOptions.m_clamp = true; const float opacity = 1.0f; const float rotation = 0.0f; diff --git a/Gems/LyShine/Code/Source/LyShine.h b/Gems/LyShine/Code/Source/LyShine.h index 82f902a9f8..eab52258c1 100644 --- a/Gems/LyShine/Code/Source/LyShine.h +++ b/Gems/LyShine/Code/Source/LyShine.h @@ -72,6 +72,7 @@ public: ISprite* LoadSprite(const AZStd::string& pathname) override; ISprite* CreateSprite(const AZStd::string& renderTargetName) override; bool DoesSpriteTextureAssetExist(const AZStd::string& pathname) override; + AZ::Data::Instance LoadTexture(const AZStd::string& pathname) override; void PostInit() override; diff --git a/Gems/LyShine/Code/Source/LyShineDebug.cpp b/Gems/LyShine/Code/Source/LyShineDebug.cpp index bb57e70857..7e99652f45 100644 --- a/Gems/LyShine/Code/Source/LyShineDebug.cpp +++ b/Gems/LyShine/Code/Source/LyShineDebug.cpp @@ -7,7 +7,7 @@ */ #include "LyShineDebug.h" #include "IConsole.h" -#include +#include #include @@ -377,7 +377,7 @@ static void DebugDrawColoredBox(AZ::Vector2 pos, AZ::Vector2 size, AZ::Color col { IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); - CDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); + IDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); imageOptions.color = color.GetAsVector3(); auto whiteTexture = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::White); draw2d->DrawImageAligned(whiteTexture, pos, size, horizontalAlignment, verticalAlignment, @@ -392,7 +392,7 @@ static void DebugDrawStringWithSizeBox(AZStd::string_view font, unsigned int eff { IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); - CDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); + IDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); if (!font.empty()) { textOptions.fontName = font; @@ -618,7 +618,7 @@ static AZ::Vector2 DebugDrawFontColorTestBox(AZ::Vector2 pos, const char* string float pointSize = 32.0f; const float spacing = 6.0f; - CDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); + IDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); textOptions.effectIndex = 1; // no drop shadow baked in textOptions.color = color; @@ -742,7 +742,7 @@ static void DebugDraw2dImageColor() AZ::Data::Instance texture = GetMonoAlphaTestTexture(); - CDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); + IDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); draw2d->DrawText( "Testing image colors, image is black and white, top row is opacity=1, bottom row is opacity = 0.5", @@ -780,7 +780,7 @@ static void DebugDraw2dImageBlendMode() AZ::Data::Instance texture = GetColorAlphaTestTexture(); - CDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); + IDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); draw2d->DrawText("Testing blend modes, src blend changes across x-axis, dst blend changes across y axis", AZ::Vector2(20, 20), 16); @@ -801,7 +801,7 @@ static void DebugDraw2dImageBlendMode() AZ::Vector2 pos(xStart + xSpacing * srcIndex, yStart + ySpacing * dstIndex); // first draw a background with varying color and alpha - CDraw2d::VertexPosColUV verts[4] = + IDraw2d::VertexPosColUV verts[4] = { { // top left AZ::Vector2(pos.GetX(), pos.GetY()), @@ -828,7 +828,7 @@ static void DebugDraw2dImageBlendMode() // Draw the image with this color - CDraw2d::RenderState renderState; + IDraw2d::RenderState renderState; renderState.m_blendState.m_blendSource = g_srcBlendModes[srcIndex]; renderState.m_blendState.m_blendDest = g_dstBlendModes[dstIndex]; draw2d->DrawImage(texture, pos, size, 1.0f, 0.0f, 0, 0, &imageOptions); @@ -845,7 +845,7 @@ static void DebugDraw2dImageUVs() AZ::Data::Instance texture = GetColorTestTexture(); - CDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); + IDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); draw2d->DrawText( "Testing DrawImage with minMaxTexCoords. Full image, top left quadrant, middle section, full flipped", @@ -894,7 +894,7 @@ static void DebugDraw2dImagePixelRounding() AZ::Data::Instance texture = GetColorTestTexture(); - CDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); + IDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); draw2d->DrawText("Testing DrawImage pixel rounding options", AZ::Vector2(20, 20), 16); @@ -933,7 +933,7 @@ static void DebugDraw2dLineBasic() { IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); - CDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); + IDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); draw2d->DrawText("Testing DrawLine", AZ::Vector2(20, 20), 16); diff --git a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp index 0a21f92119..ea6e3681a3 100644 --- a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp +++ b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include diff --git a/Gems/LyShine/Code/Source/UiCanvasManager.cpp b/Gems/LyShine/Code/Source/UiCanvasManager.cpp index 70646246f0..fc373f17f6 100644 --- a/Gems/LyShine/Code/Source/UiCanvasManager.cpp +++ b/Gems/LyShine/Code/Source/UiCanvasManager.cpp @@ -6,7 +6,7 @@ * */ #include "UiCanvasManager.h" -#include +#include #include "UiCanvasFileObject.h" #include "UiCanvasComponent.h" @@ -1020,7 +1020,7 @@ void UiCanvasManager::DebugDisplayCanvasData(int setting) const // local function to write a line of text (with a background rect) and increment Y offset AZStd::function WriteLine = [&](const char* buffer, const AZ::Vector3& color) { - CDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); + IDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); textOptions.color = color; AZ::Vector2 textSize = draw2d->GetTextSize(buffer, fontSize, &textOptions); AZ::Vector2 rectTopLeft = AZ::Vector2(xOffset - 2, yOffset); @@ -1174,7 +1174,7 @@ void UiCanvasManager::DebugDisplayDrawCallData() const // local function to write a line of text (with a background rect) and increment Y offset AZStd::function WriteLine = [&](const char* buffer, const AZ::Vector3& color) { - CDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); + IDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); textOptions.color = color; AZ::Vector2 textSize = draw2d->GetTextSize(buffer, fontSize, &textOptions); AZ::Vector2 rectTopLeft = AZ::Vector2(xOffset - 2, yOffset); diff --git a/Gems/LyShine/Code/Source/UiFaderComponent.cpp b/Gems/LyShine/Code/Source/UiFaderComponent.cpp index e1f5153e99..e84e5162b5 100644 --- a/Gems/LyShine/Code/Source/UiFaderComponent.cpp +++ b/Gems/LyShine/Code/Source/UiFaderComponent.cpp @@ -7,7 +7,7 @@ */ #include "UiFaderComponent.h" #include "RenderGraph.h" -#include +#include #include #include diff --git a/Gems/LyShine/Code/Source/UiImageComponent.cpp b/Gems/LyShine/Code/Source/UiImageComponent.cpp index baf210a629..a8b4210d6b 100644 --- a/Gems/LyShine/Code/Source/UiImageComponent.cpp +++ b/Gems/LyShine/Code/Source/UiImageComponent.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include diff --git a/Gems/LyShine/Code/Source/UiImageSequenceComponent.cpp b/Gems/LyShine/Code/Source/UiImageSequenceComponent.cpp index 4e7d22d96a..3559dc6306 100644 --- a/Gems/LyShine/Code/Source/UiImageSequenceComponent.cpp +++ b/Gems/LyShine/Code/Source/UiImageSequenceComponent.cpp @@ -9,7 +9,7 @@ #include "Sprite.h" #include "RenderGraph.h" -#include +#include #include #include #include diff --git a/Gems/LyShine/Code/Source/UiMaskComponent.cpp b/Gems/LyShine/Code/Source/UiMaskComponent.cpp index 09975d1351..67ba8ee0fb 100644 --- a/Gems/LyShine/Code/Source/UiMaskComponent.cpp +++ b/Gems/LyShine/Code/Source/UiMaskComponent.cpp @@ -6,7 +6,7 @@ * */ #include "UiMaskComponent.h" -#include +#include #include #include diff --git a/Gems/LyShine/Code/Source/UiRenderer.cpp b/Gems/LyShine/Code/Source/UiRenderer.cpp index 3b835dec92..a9c56ece90 100644 --- a/Gems/LyShine/Code/Source/UiRenderer.cpp +++ b/Gems/LyShine/Code/Source/UiRenderer.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include //////////////////////////////////////////////////////////////////////////////////////////////////// // PUBLIC MEMBER FUNCTIONS @@ -449,7 +449,7 @@ void UiRenderer::DebugDisplayTextureData(int recordingOption) // local function to write a line of text (with a background rect) and increment Y offset AZStd::function WriteLine = [&](const char* buffer, const AZ::Vector3& color) { - CDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); + IDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); textOptions.color = color; AZ::Vector2 textSize = draw2d->GetTextSize(buffer, fontSize, &textOptions); AZ::Vector2 rectTopLeft = AZ::Vector2(xOffset - 2, yOffset); diff --git a/Gems/LyShine/Code/Source/UiTextComponent.cpp b/Gems/LyShine/Code/Source/UiTextComponent.cpp index 01cfd49e99..aa0235470a 100644 --- a/Gems/LyShine/Code/Source/UiTextComponent.cpp +++ b/Gems/LyShine/Code/Source/UiTextComponent.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include @@ -1105,7 +1105,7 @@ UiTextComponent::InlineImage::InlineImage(const AZStd::string& texturePathname, else { // Load the texture - m_texture = CDraw2d::LoadTexture(m_filepath); + m_texture = Draw2dHelper::LoadTexture(m_filepath); if (m_texture) { AZ::RHI::Size size = m_texture->GetDescriptor().m_size; @@ -1157,7 +1157,7 @@ bool UiTextComponent::InlineImage::OnAtlasUnloaded(const TextureAtlasNamespace:: else { // Load the texture - m_texture = CDraw2d::LoadTexture(m_filepath); + m_texture = Draw2dHelper::LoadTexture(m_filepath); } return true; } @@ -2675,7 +2675,7 @@ void UiTextComponent::GetClickableTextRects(UiClickableTextInterface::ClickableT } else { - alignedPosition = CDraw2d::Align(pos, drawBatchLine.lineSize, m_textHAlignment, IDraw2d::VAlign::Top); // y is already aligned + alignedPosition = Draw2dHelper::Align(pos, drawBatchLine.lineSize, m_textHAlignment, IDraw2d::VAlign::Top); // y is already aligned } alignedPosition.SetY(alignedPosition.GetY() + newlinePosYIncrement); @@ -4043,7 +4043,7 @@ void UiTextComponent::RenderDrawBatchLines( } else { - alignedPosition = CDraw2d::Align(pos, drawBatchLine.lineSize, m_textHAlignment, IDraw2d::VAlign::Top); // y is already aligned + alignedPosition = Draw2dHelper::Align(pos, drawBatchLine.lineSize, m_textHAlignment, IDraw2d::VAlign::Top); // y is already aligned } alignedPosition.SetY(alignedPosition.GetY() + newlinePosYIncrement); diff --git a/Gems/LyShine/Code/lyshine_static_files.cmake b/Gems/LyShine/Code/lyshine_static_files.cmake index 1adbe1b796..925658e756 100644 --- a/Gems/LyShine/Code/lyshine_static_files.cmake +++ b/Gems/LyShine/Code/lyshine_static_files.cmake @@ -7,8 +7,6 @@ # set(FILES - Source/Draw2d.cpp - Include/LyShine/Draw2d.h Include/LyShine/IDraw2d.h Include/LyShine/IRenderGraph.h Include/LyShine/ISprite.h @@ -88,6 +86,8 @@ set(FILES Include/LyShine/Bus/World/UiCanvasOnMeshBus.h Include/LyShine/Bus/World/UiCanvasRefBus.h Include/LyShine/Bus/Tools/UiSystemToolsBus.h + Source/Draw2d.cpp + Source/Draw2d.h Source/LyShine.cpp Source/LyShine.h Source/LyShinePassDataBus.h diff --git a/Gems/LyShine/gem.json b/Gems/LyShine/gem.json index f3c3fc2c67..8dcac6404a 100644 --- a/Gems/LyShine/gem.json +++ b/Gems/LyShine/gem.json @@ -24,6 +24,7 @@ "Atom_Bootstrap", "AtomFont", "TextureAtlas", - "AtomToolsFramework" + "AtomToolsFramework", + "UiBasics" ] } diff --git a/Gems/LyShineExamples/Code/CMakeLists.txt b/Gems/LyShineExamples/Code/CMakeLists.txt index 6e8f53d5cd..40032d6342 100644 --- a/Gems/LyShineExamples/Code/CMakeLists.txt +++ b/Gems/LyShineExamples/Code/CMakeLists.txt @@ -21,7 +21,7 @@ ly_add_target( Gem::LmbrCentral PUBLIC Legacy::CryCommon - Gem::LyShine.Static + Gem::LyShine.Clients.API ) ly_add_target( @@ -42,7 +42,7 @@ ly_add_target( # if enabled, LyShineExamples is used by all kinds of applications, however, the dependency to LmbrCentral is different # per application type -ly_create_alias(NAME LyShineExamples.Builders NAMESPACE Gem TARGETS Gem::LyShineExamples Gem::LmbrCentral.Editor) +ly_create_alias(NAME LyShineExamples.Builders NAMESPACE Gem TARGETS Gem::LyShineExamples Gem::UiBasics.Builders Gem::LmbrCentral.Editor) ly_create_alias(NAME LyShineExamples.Tools NAMESPACE Gem TARGETS Gem::LyShineExamples Gem::LmbrCentral.Editor) ly_create_alias(NAME LyShineExamples.Clients NAMESPACE Gem TARGETS Gem::LyShineExamples Gem::LmbrCentral) ly_create_alias(NAME LyShineExamples.Servers NAMESPACE Gem TARGETS Gem::LyShineExamples Gem::LmbrCentral) diff --git a/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp b/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp index 542e18b98c..e8b0e4370a 100644 --- a/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp +++ b/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include #include diff --git a/Gems/MessagePopup/Code/CMakeLists.txt b/Gems/MessagePopup/Code/CMakeLists.txt index 51ec1a3bd1..2ed9c71632 100644 --- a/Gems/MessagePopup/Code/CMakeLists.txt +++ b/Gems/MessagePopup/Code/CMakeLists.txt @@ -19,7 +19,7 @@ ly_add_target( BUILD_DEPENDENCIES PUBLIC Legacy::CryCommon - Gem::LyShine + Gem::LyShine.Clients.API ) ly_add_target( @@ -39,4 +39,4 @@ ly_add_target( # MessagePopup is used only in client applications ly_create_alias(NAME MessagePopup.Clients NAMESPACE Gem TARGETS Gem::MessagePopup) - +ly_create_alias(NAME MessagePopup.Builders NAMESPACE Gem TARGETS Gem::UiBasics.Builders) diff --git a/Gems/UiBasics/CMakeLists.txt b/Gems/UiBasics/CMakeLists.txt index 8d71bd08c7..9c3cf01d26 100644 --- a/Gems/UiBasics/CMakeLists.txt +++ b/Gems/UiBasics/CMakeLists.txt @@ -9,4 +9,5 @@ # This will export its "SourcePaths" to the generated "cmake_dependencies..assetbuilder.setreg" if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_create_alias(NAME UiBasics.Builders NAMESPACE Gem) + ly_create_alias(NAME UiBasics.Tools NAMESPACE Gem) endif() diff --git a/Gems/VirtualGamepad/Code/CMakeLists.txt b/Gems/VirtualGamepad/Code/CMakeLists.txt index d32834633f..6700004a30 100644 --- a/Gems/VirtualGamepad/Code/CMakeLists.txt +++ b/Gems/VirtualGamepad/Code/CMakeLists.txt @@ -21,7 +21,7 @@ ly_add_target( AZ::AzCore AZ::AzFramework Legacy::CryCommon - Gem::LyShine + Gem::LyShine.Clients.API ) ly_add_target( @@ -42,4 +42,4 @@ ly_add_target( # the virtual gamepad is needed everywhere except servers: ly_create_alias(NAME VirtualGamepad.Clients NAMESPACE Gem TARGETS Gem::VirtualGamepad) ly_create_alias(NAME VirtualGamepad.Tools NAMESPACE Gem TARGETS Gem::VirtualGamepad) -ly_create_alias(NAME VirtualGamepad.Builders NAMESPACE Gem TARGETS Gem::VirtualGamepad) +ly_create_alias(NAME VirtualGamepad.Builders NAMESPACE Gem TARGETS Gem::VirtualGamepad Gem::UiBasics.Builders) From 42c523b27512f3697be50be637b18c400d9cec57 Mon Sep 17 00:00:00 2001 From: Vincent Liu <5900509+onecent1101@users.noreply.github.com> Date: Thu, 13 Jan 2022 16:07:44 -0800 Subject: [PATCH 378/399] Add SetEnv and UnSetEnv for environment variable to util (#6884) * Add SetEnv and UnSetEnv for environment variable to util * Move utils to AzTest * enable for ios and android * fix wrong file path --- .../Android/platform_android_files.cmake | 1 + .../AzTest/Utils_Unimplemented.cpp | 25 +++++++++++++++++++ .../Common/UnixLike/AzTest/Utils_UnixLike.cpp | 25 +++++++++++++++++++ .../Common/WinAPI/AzTest/Utils_WinAPI.cpp | 25 +++++++++++++++++++ .../Platform/Linux/platform_linux_files.cmake | 1 + .../Platform/Mac/platform_mac_files.cmake | 1 + .../Windows/platform_windows_files.cmake | 1 + .../Platform/iOS/platform_ios_files.cmake | 1 + Code/Framework/AzTest/AzTest/Utils.h | 13 ++++++++++ 9 files changed, 93 insertions(+) create mode 100644 Code/Framework/AzTest/AzTest/Platform/Common/Unimplemented/AzTest/Utils_Unimplemented.cpp create mode 100644 Code/Framework/AzTest/AzTest/Platform/Common/UnixLike/AzTest/Utils_UnixLike.cpp create mode 100644 Code/Framework/AzTest/AzTest/Platform/Common/WinAPI/AzTest/Utils_WinAPI.cpp diff --git a/Code/Framework/AzTest/AzTest/Platform/Android/platform_android_files.cmake b/Code/Framework/AzTest/AzTest/Platform/Android/platform_android_files.cmake index e0f47c8fa6..83ae97fa20 100644 --- a/Code/Framework/AzTest/AzTest/Platform/Android/platform_android_files.cmake +++ b/Code/Framework/AzTest/AzTest/Platform/Android/platform_android_files.cmake @@ -8,6 +8,7 @@ set(FILES ../Common/UnixLike/AzTest/ColorizedOutput_UnixLike.cpp + ../Common/UnixLike/AzTest/Utils_UnixLike.cpp ScopedAutoTempDirectory_Android.cpp Platform_Android.cpp AzTest_Traits_Platform.h diff --git a/Code/Framework/AzTest/AzTest/Platform/Common/Unimplemented/AzTest/Utils_Unimplemented.cpp b/Code/Framework/AzTest/AzTest/Platform/Common/Unimplemented/AzTest/Utils_Unimplemented.cpp new file mode 100644 index 0000000000..0f91ea1020 --- /dev/null +++ b/Code/Framework/AzTest/AzTest/Platform/Common/Unimplemented/AzTest/Utils_Unimplemented.cpp @@ -0,0 +1,25 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +namespace AZ +{ + namespace Test + { + bool SetEnv([[maybe_unused]] const char* envname, [[maybe_unused]] const char* envvalue, [[maybe_unused]] bool overwrite) + { + return false; + } + + bool UnsetEnv([[maybe_unused]] const char* envname) + { + return false; + } + } // namespace Test +} // namespace AZ diff --git a/Code/Framework/AzTest/AzTest/Platform/Common/UnixLike/AzTest/Utils_UnixLike.cpp b/Code/Framework/AzTest/AzTest/Platform/Common/UnixLike/AzTest/Utils_UnixLike.cpp new file mode 100644 index 0000000000..8efdb5d082 --- /dev/null +++ b/Code/Framework/AzTest/AzTest/Platform/Common/UnixLike/AzTest/Utils_UnixLike.cpp @@ -0,0 +1,25 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +namespace AZ +{ + namespace Test + { + bool SetEnv(const char* envname, const char* envvalue, bool overwrite) + { + return setenv(envname, envvalue, overwrite) != -1; + } + + bool UnsetEnv(const char* envname) + { + return unsetenv(envname) != -1; + } + } +} diff --git a/Code/Framework/AzTest/AzTest/Platform/Common/WinAPI/AzTest/Utils_WinAPI.cpp b/Code/Framework/AzTest/AzTest/Platform/Common/WinAPI/AzTest/Utils_WinAPI.cpp new file mode 100644 index 0000000000..a06cbf7ffe --- /dev/null +++ b/Code/Framework/AzTest/AzTest/Platform/Common/WinAPI/AzTest/Utils_WinAPI.cpp @@ -0,0 +1,25 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +namespace AZ +{ + namespace Test + { + bool SetEnv(const char* envname, const char* envvalue, [[maybe_unused]] bool overwrite) + { + return _putenv_s(envname, envvalue); + } + + bool UnsetEnv(const char* envname) + { + return SetEnv(envname, "", 1); + } + } +} diff --git a/Code/Framework/AzTest/AzTest/Platform/Linux/platform_linux_files.cmake b/Code/Framework/AzTest/AzTest/Platform/Linux/platform_linux_files.cmake index 68ca9332c7..9c6692b409 100644 --- a/Code/Framework/AzTest/AzTest/Platform/Linux/platform_linux_files.cmake +++ b/Code/Framework/AzTest/AzTest/Platform/Linux/platform_linux_files.cmake @@ -9,6 +9,7 @@ set(FILES ../Common/UnixLike/AzTest/ColorizedOutput_UnixLike.cpp ../Common/UnixLike/AzTest/ScopedAutoTempDirectory_UnixLike.cpp + ../Common/UnixLike/AzTest/Utils_UnixLike.cpp Platform_Linux.cpp AzTest_Traits_Platform.h AzTest_Traits_Linux.h diff --git a/Code/Framework/AzTest/AzTest/Platform/Mac/platform_mac_files.cmake b/Code/Framework/AzTest/AzTest/Platform/Mac/platform_mac_files.cmake index 3cbe35792c..cb641e2113 100644 --- a/Code/Framework/AzTest/AzTest/Platform/Mac/platform_mac_files.cmake +++ b/Code/Framework/AzTest/AzTest/Platform/Mac/platform_mac_files.cmake @@ -9,6 +9,7 @@ set(FILES ../Common/UnixLike/AzTest/ColorizedOutput_UnixLike.cpp ../Common/UnixLike/AzTest/ScopedAutoTempDirectory_UnixLike.cpp + ../Common/UnixLike/AzTest/Utils_UnixLike.cpp Platform_Mac.cpp AzTest_Traits_Platform.h AzTest_Traits_Mac.h diff --git a/Code/Framework/AzTest/AzTest/Platform/Windows/platform_windows_files.cmake b/Code/Framework/AzTest/AzTest/Platform/Windows/platform_windows_files.cmake index 656b28a373..4730b383a2 100644 --- a/Code/Framework/AzTest/AzTest/Platform/Windows/platform_windows_files.cmake +++ b/Code/Framework/AzTest/AzTest/Platform/Windows/platform_windows_files.cmake @@ -8,6 +8,7 @@ set(FILES ../Common/WinAPI/AzTest/ColorizedOutput_WinAPI.cpp + ../Common/WinAPI/AzTest/Utils_WinAPI.cpp Platform_Windows.cpp ScopedAutoTempDirectory_Windows.cpp AzTest_Traits_Platform.h diff --git a/Code/Framework/AzTest/AzTest/Platform/iOS/platform_ios_files.cmake b/Code/Framework/AzTest/AzTest/Platform/iOS/platform_ios_files.cmake index 64bbc27bc1..81875f71e5 100644 --- a/Code/Framework/AzTest/AzTest/Platform/iOS/platform_ios_files.cmake +++ b/Code/Framework/AzTest/AzTest/Platform/iOS/platform_ios_files.cmake @@ -9,6 +9,7 @@ set(FILES ../Common/UnixLike/AzTest/ColorizedOutput_UnixLike.cpp ../Common/Unimplemented/AzTest/ScopedAutoTempDirectory_Unimplemented.cpp + ../Common/UnixLike/AzTest/Utils_UnixLike.cpp Platform_iOS.cpp AzTest_Traits_Platform.h AzTest_Traits_iOS.h diff --git a/Code/Framework/AzTest/AzTest/Utils.h b/Code/Framework/AzTest/AzTest/Utils.h index 2778e163b3..e3b45e97f2 100644 --- a/Code/Framework/AzTest/AzTest/Utils.h +++ b/Code/Framework/AzTest/AzTest/Utils.h @@ -55,6 +55,19 @@ namespace AZ // Returns the path to the engine's root by cdup from the current execution path until engine.txt is found AZStd::string GetEngineRootPath(); + //! Create or modify environment variable. + //! @param envname The environment variable name + //! @param envvalue The environment variable name + //! @param overwrite If name does exist in the environment, then its value is changed to value if overwrite is nonzero; + //! if overwrite is zero, then the value of name is not changed + //! @returns Return true if successful, otherwise false + bool SetEnv(const char* envname, const char* envvalue, bool overwrite); + + //! Remove environment variable. + //! @param envname The environment variable name + //! @returns Return true if successful, otherwise false + bool UnsetEnv(const char* envname); + //! Provides a scoped object that will create a temporary operating-system specific folder on creation, and delete it and //! its contents on destruction. This class is only available on host platforms (Windows, Mac, and Linux) class ScopedAutoTempDirectory From 5c603882b348bdf220eda73e90c2491217744079 Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Thu, 13 Jan 2022 19:57:22 -0700 Subject: [PATCH 379/399] Changed the Shader instanceId to the combined assetId and supervariant index Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- .../Include/Atom/RPI.Public/Shader/Shader.h | 5 --- .../Code/Source/RPI.Public/Shader/Shader.cpp | 44 ++++++++++--------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/Shader.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/Shader.h index 92b67c3a7a..be20d89d65 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/Shader.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/Shader.h @@ -136,11 +136,6 @@ namespace AZ //! This tag corresponds to the ShaderAsset object's DrawListName. RHI::DrawListTag GetDrawListTag() const; - //! Changes the supervariant of the shader to the specified supervariantIndex. - //! [GFX TODO][ATOM-15813]: this can be removed when the shader InstanceDatabase can support multiple shader - //! instances with different supervariants. - void ChangeSupervariant(SupervariantIndex supervariantIndex); - private: explicit Shader(const SupervariantIndex& supervariantIndex) : m_supervariantIndex(supervariantIndex){}; Shader() = delete; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp index b1ae460af6..3830d8ee42 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp @@ -25,21 +25,34 @@ namespace AZ Data::Instance Shader::FindOrCreate(const Data::Asset& shaderAsset, const Name& supervariantName) { auto anySupervariantName = AZStd::any(supervariantName); - Data::Instance shaderInstance = Data::InstanceDatabase::Instance().FindOrCreate( - Data::InstanceId::CreateFromAssetId(shaderAsset.GetId()), shaderAsset, &anySupervariantName); - if (shaderInstance) + // retrieve the supervariant index from the shader asset + SupervariantIndex supervariantIndex = shaderAsset->GetSupervariantIndex(supervariantName); + if (!supervariantIndex.IsValid()) { - // [GFX TODO][ATOM-15813] Change InstanceDatabase to support multiple instances with different supervariants. - // At this time we do not support multiple supervariants loaded for a shader asset simultaneously, so if this shader - // is referring to the wrong supervariant we need to change it to the correct one. - SupervariantIndex supervariantIndex = shaderAsset->GetSupervariantIndex(supervariantName); - if (supervariantIndex.IsValid() && shaderInstance->GetSupervariantIndex() != supervariantIndex) - { - shaderInstance->ChangeSupervariant(supervariantIndex); - } + AZ_Error("Shader", false, "Supervariant with name %s, was not found in shader %s", supervariantName.GetCStr(), shaderAsset->GetName().GetCStr()); + return nullptr; } + // create the InstanceId from the combined assetId and supervariantIndex + const Data::AssetId& assetId = shaderAsset.GetId(); + uint32_t shaderSupervariantIndex = supervariantIndex.GetIndex(); + + const uint32_t instanceIdDataSize = sizeof(assetId.m_guid) + sizeof(assetId.m_subId) + sizeof(shaderSupervariantIndex); + uint8_t instanceIdData[instanceIdDataSize]; + uint8_t* instanceIdDataPtr = instanceIdData; + + memcpy(instanceIdDataPtr, &assetId.m_guid, sizeof(assetId.m_guid)); + instanceIdDataPtr += sizeof(assetId.m_guid); + memcpy(instanceIdDataPtr, &assetId.m_subId, sizeof(assetId.m_subId)); + instanceIdDataPtr += sizeof(assetId.m_subId); + memcpy(instanceIdDataPtr, &shaderSupervariantIndex, sizeof(shaderSupervariantIndex)); + + Data::InstanceId instanceId = Data::InstanceId::CreateData(instanceIdData, instanceIdDataSize); + + // retrieve the shader instance from the Instance database + Data::Instance shaderInstance = Data::InstanceDatabase::Instance().FindOrCreate(instanceId, shaderAsset, &anySupervariantName); + return shaderInstance; } @@ -478,14 +491,5 @@ namespace AZ return m_drawListTag; } - void Shader::ChangeSupervariant(SupervariantIndex supervariantIndex) - { - if (supervariantIndex != m_supervariantIndex) - { - m_supervariantIndex = supervariantIndex; - Init(*m_asset); - } - } - } // namespace RPI } // namespace AZ From a43cd9531328d006f8487f449555318750712115 Mon Sep 17 00:00:00 2001 From: moraaar Date: Fri, 14 Jan 2022 10:01:38 +0000 Subject: [PATCH 380/399] Fixed physics periodic tests on linux platform (#6881) - Fixed path separators, now levels will be correctly opened in linux. - Fixed casing of physics paths. - Fixed casing of files inside levels Joints_HingeNoLimitsConstrained and RigidBody_KinematicModeWorks. - Resaved a level that still used old test ids in its name but the python tests didn't match. Linux: Start 21: AutomatedTesting::PhysicsTests_Periodic.periodic::TEST_RUN 8/11 Test #21: AutomatedTesting::PhysicsTests_Periodic.periodic::TEST_RUN .................. Passed 609.87 sec Windows: Start 21: AutomatedTesting::PhysicsTests_Periodic.periodic::TEST_RUN 8/13 Test #21: AutomatedTesting::PhysicsTests_Periodic.periodic::TEST_RUN ....................... Passed 810.59 sec Signed-off-by: moraaar --- ...ameCollisionGroupSameCustomLayerCollide.py | 2 +- ...tipleForcesInSameComponentCombineForces.py | 2 +- ...DefaultLibraryUpdatedAcrossLevels_after.py | 4 +- ...efaultLibraryUpdatedAcrossLevels_before.py | 2 +- .../Material_LibraryUpdatedAcrossLevels.py | 6 +- ...iptCanvas_SpawnEntityWithPhysComponents.py | 2 +- .../Joints_HingeNoLimitsConstrained.ly | 4 +- .../0/0.ly | 3 + .../0/filelist.xml | 6 + .../0/level.pak | 3 + .../tags.txt | 0 .../terraintexture.pak | 0 .../1/1.ly | 3 + .../1/filelist.xml | 6 + .../1/level.pak | 3 + .../tags.txt | 0 .../terraintexture.pak | 0 ...5_Material_LibraryUpdatedAcrossLevels_0.ly | 3 - .../filelist.xml | 6 - .../level.pak | 3 - .../leveldata/Environment.xml | 14 - .../leveldata/GameTokens.xml | 5 - .../leveldata/TerrainTexture.xml | 7 - .../leveldata/TimeOfDay.xml | 356 ------------------ .../leveldata/VegetationMap.dat | 3 - .../terrain/terrain.pxheightfield | 3 - ...5_Material_LibraryUpdatedAcrossLevels_1.ly | 3 - .../filelist.xml | 6 - .../level.pak | 3 - .../leveldata/Environment.xml | 14 - .../leveldata/GameTokens.xml | 5 - .../leveldata/TerrainTexture.xml | 7 - .../leveldata/TimeOfDay.xml | 356 ------------------ .../leveldata/VegetationMap.dat | 3 - .../terrain/terrain.pxheightfield | 3 - .../RigidBody_KinematicModeWorks.ly | 4 +- 36 files changed, 36 insertions(+), 814 deletions(-) create mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/0.ly create mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/filelist.xml create mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/level.pak rename AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/{C15425935_Material_LibraryUpdatedAcrossLevels_0 => 0}/tags.txt (100%) rename AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/{C15425935_Material_LibraryUpdatedAcrossLevels_0 => 0}/terraintexture.pak (100%) create mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/1.ly create mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/filelist.xml create mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/level.pak rename AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/{C15425935_Material_LibraryUpdatedAcrossLevels_1 => 1}/tags.txt (100%) rename AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/{C15425935_Material_LibraryUpdatedAcrossLevels_1 => 1}/terraintexture.pak (100%) delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/C15425935_Material_LibraryUpdatedAcrossLevels_0.ly delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/filelist.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/level.pak delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/Environment.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/GameTokens.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/TerrainTexture.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/TimeOfDay.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/VegetationMap.dat delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/terrain/terrain.pxheightfield delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/C15425935_Material_LibraryUpdatedAcrossLevels_1.ly delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/filelist.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/level.pak delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/Environment.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/GameTokens.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/TerrainTexture.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/TimeOfDay.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/VegetationMap.dat delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/terrain/terrain.pxheightfield diff --git a/AutomatedTesting/Gem/PythonTests/Physics/tests/collider/Collider_SameCollisionGroupSameCustomLayerCollide.py b/AutomatedTesting/Gem/PythonTests/Physics/tests/collider/Collider_SameCollisionGroupSameCustomLayerCollide.py index 2e40c0b557..8e8fccd725 100644 --- a/AutomatedTesting/Gem/PythonTests/Physics/tests/collider/Collider_SameCollisionGroupSameCustomLayerCollide.py +++ b/AutomatedTesting/Gem/PythonTests/Physics/tests/collider/Collider_SameCollisionGroupSameCustomLayerCollide.py @@ -127,7 +127,7 @@ def Collider_SameCollisionGroupSameCustomLayerCollide(): # Main Script # 1) Load the level helper.init_idle() - helper.open_level("physics", "Collider_SameCollisionGroupSameCustomLayerCollide") + helper.open_level("Physics", "Collider_SameCollisionGroupSameCustomLayerCollide") # 2) Enter Game Mode helper.enter_game_mode(Tests.enter_game_mode) diff --git a/AutomatedTesting/Gem/PythonTests/Physics/tests/force_region/ForceRegion_MultipleForcesInSameComponentCombineForces.py b/AutomatedTesting/Gem/PythonTests/Physics/tests/force_region/ForceRegion_MultipleForcesInSameComponentCombineForces.py index 7307f3a2fb..e5f6e236cf 100644 --- a/AutomatedTesting/Gem/PythonTests/Physics/tests/force_region/ForceRegion_MultipleForcesInSameComponentCombineForces.py +++ b/AutomatedTesting/Gem/PythonTests/Physics/tests/force_region/ForceRegion_MultipleForcesInSameComponentCombineForces.py @@ -162,7 +162,7 @@ def ForceRegion_MultipleForcesInSameComponentCombineForces(): helper.init_idle() # 1) Load Level - helper.open_level("physics", "ForceRegion_MultipleForcesInSameComponentCombineForces") + helper.open_level("Physics", "ForceRegion_MultipleForcesInSameComponentCombineForces") # 2) Enter Game Mode helper.enter_game_mode(Tests.enter_game_mode) diff --git a/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_DefaultLibraryUpdatedAcrossLevels_after.py b/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_DefaultLibraryUpdatedAcrossLevels_after.py index 1f8cfae498..41ccc8f2dd 100644 --- a/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_DefaultLibraryUpdatedAcrossLevels_after.py +++ b/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_DefaultLibraryUpdatedAcrossLevels_after.py @@ -229,8 +229,8 @@ def Material_DefaultLibraryUpdatedAcrossLevels_after(): for test in test_list: # 1) Open the correct level is open helper.open_level( - "physics", - f"Material_DefaultLibraryUpdatedAcrossLevels\\{test.level}" + "Physics", + os.path.join("Material_DefaultLibraryUpdatedAcrossLevels", str(test.level)) ) # 2) Enter Game Mode diff --git a/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_DefaultLibraryUpdatedAcrossLevels_before.py b/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_DefaultLibraryUpdatedAcrossLevels_before.py index 15db5808e2..d86a016be1 100644 --- a/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_DefaultLibraryUpdatedAcrossLevels_before.py +++ b/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_DefaultLibraryUpdatedAcrossLevels_before.py @@ -189,7 +189,7 @@ def Material_DefaultLibraryUpdatedAcrossLevels_before(): # 1) Open the correct level is open helper.open_level( "Physics", - f"Material_DefaultLibraryUpdatedAcrossLevels\\{test.level}" + os.path.join("Material_DefaultLibraryUpdatedAcrossLevels", str(test.level)) ) # 2) Enter Game Mode diff --git a/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_LibraryUpdatedAcrossLevels.py b/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_LibraryUpdatedAcrossLevels.py index 0b647361f6..6eebfe60bc 100644 --- a/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_LibraryUpdatedAcrossLevels.py +++ b/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_LibraryUpdatedAcrossLevels.py @@ -252,10 +252,8 @@ def Material_LibraryUpdatedAcrossLevels(): for test in test_list: # 1) Open the correct level for the test helper.open_level( - "physics", - "Material_LibraryUpdatedAcrossLevels\\Material_LibraryUpdatedAcrossLevels_{}".format( - test.level_index - ), + "Physics", + os.path.join("Material_LibraryUpdatedAcrossLevels", str(test.level_index)) ) # 2) Open Game Mode diff --git a/AutomatedTesting/Gem/PythonTests/Physics/tests/script_canvas/ScriptCanvas_SpawnEntityWithPhysComponents.py b/AutomatedTesting/Gem/PythonTests/Physics/tests/script_canvas/ScriptCanvas_SpawnEntityWithPhysComponents.py index 5862b7586b..e6e29063d6 100644 --- a/AutomatedTesting/Gem/PythonTests/Physics/tests/script_canvas/ScriptCanvas_SpawnEntityWithPhysComponents.py +++ b/AutomatedTesting/Gem/PythonTests/Physics/tests/script_canvas/ScriptCanvas_SpawnEntityWithPhysComponents.py @@ -106,7 +106,7 @@ def ScriptCanvas_SpawnEntityWithPhysComponents(): # Main Script helper.init_idle() # 1) Open Level - helper.open_level("physics", "ScriptCanvas_SpawnEntityWithPhysComponents") + helper.open_level("Physics", "ScriptCanvas_SpawnEntityWithPhysComponents") # 2) Enter Game Mode helper.enter_game_mode(Tests.enter_game_mode) diff --git a/AutomatedTesting/Levels/Physics/Joints_HingeNoLimitsConstrained/Joints_HingeNoLimitsConstrained.ly b/AutomatedTesting/Levels/Physics/Joints_HingeNoLimitsConstrained/Joints_HingeNoLimitsConstrained.ly index 9babf84ba4..18b503bab5 100644 --- a/AutomatedTesting/Levels/Physics/Joints_HingeNoLimitsConstrained/Joints_HingeNoLimitsConstrained.ly +++ b/AutomatedTesting/Levels/Physics/Joints_HingeNoLimitsConstrained/Joints_HingeNoLimitsConstrained.ly @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:60276c07b45a734e4f71d695278167ea61e884f8b513906168c9642078ad5954 -size 6045 +oid sha256:0d004c329a7c5044a8fe05b6dbbf9b19de29c60acec75f13fdbc344a55aab8c7 +size 6404 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/0.ly b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/0.ly new file mode 100644 index 0000000000..b908d29eab --- /dev/null +++ b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/0.ly @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e89946c224d2e765931e8ba8e33133ac24651af321a404016d9a9ea8c323db6c +size 8563 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/filelist.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/filelist.xml new file mode 100644 index 0000000000..bb94b733b3 --- /dev/null +++ b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/filelist.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/level.pak b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/level.pak new file mode 100644 index 0000000000..614e41c4b2 --- /dev/null +++ b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/level.pak @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a46437ba86135567d87d43af0c4d499bf3cfe321721dbaf6e3cda8e49427ee1 +size 40212 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/tags.txt b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/tags.txt similarity index 100% rename from AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/tags.txt rename to AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/tags.txt diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/terraintexture.pak b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/terraintexture.pak similarity index 100% rename from AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/terraintexture.pak rename to AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/terraintexture.pak diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/1.ly b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/1.ly new file mode 100644 index 0000000000..216426fc2a --- /dev/null +++ b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/1.ly @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:95996da3902d885060e700c573d13144bab246b930dfeedaed6066c13c879b11 +size 8737 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/filelist.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/filelist.xml new file mode 100644 index 0000000000..5f5b4928fc --- /dev/null +++ b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/filelist.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/level.pak b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/level.pak new file mode 100644 index 0000000000..d920770374 --- /dev/null +++ b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/level.pak @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:894dfd4ab92aa4d1d6003aebf82cf7ff854a8b3684e010234e073879f88b64e5 +size 40210 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/tags.txt b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/tags.txt similarity index 100% rename from AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/tags.txt rename to AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/tags.txt diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/terraintexture.pak b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/terraintexture.pak similarity index 100% rename from AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/terraintexture.pak rename to AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/terraintexture.pak diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/C15425935_Material_LibraryUpdatedAcrossLevels_0.ly b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/C15425935_Material_LibraryUpdatedAcrossLevels_0.ly deleted file mode 100644 index a5953fc44b..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/C15425935_Material_LibraryUpdatedAcrossLevels_0.ly +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:969b77ee335d2a04524a27c765dd2f2bdee048661f3ff7be0766ba69d18d5842 -size 10409 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/filelist.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/filelist.xml deleted file mode 100644 index 9a78b1bfd5..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/filelist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/level.pak b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/level.pak deleted file mode 100644 index 8e6b3b29cb..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/level.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:547d7fdfcd959569b69d78eb6f63c7c19fc90840d69ca2d46eca8a3e82b8db75 -size 39337 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/Environment.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/Environment.xml deleted file mode 100644 index 4ba36f66ae..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/Environment.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/GameTokens.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/GameTokens.xml deleted file mode 100644 index 668a4583bd..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/GameTokens.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/TerrainTexture.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/TerrainTexture.xml deleted file mode 100644 index f43df05b22..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/TerrainTexture.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/TimeOfDay.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/TimeOfDay.xml deleted file mode 100644 index 456d609b8a..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/TimeOfDay.xml +++ /dev/null @@ -1,356 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/VegetationMap.dat b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/VegetationMap.dat deleted file mode 100644 index dce5631cd0..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/VegetationMap.dat +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e6a5435c928079b27796f6b202bbc2623e7e454244ddc099a3cadf33b7cb9e9 -size 63 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/terrain/terrain.pxheightfield b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/terrain/terrain.pxheightfield deleted file mode 100644 index 011356e521..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/terrain/terrain.pxheightfield +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:19096597087688692a225c1955f73d22c46354995fca1df8dff107a90c2f17a2 -size 4202594 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/C15425935_Material_LibraryUpdatedAcrossLevels_1.ly b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/C15425935_Material_LibraryUpdatedAcrossLevels_1.ly deleted file mode 100644 index 9f48f08a1b..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/C15425935_Material_LibraryUpdatedAcrossLevels_1.ly +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:29f752c141514cb4b50aea07e6b63de5c8f43149ddac37722e9ddb8b5f4a667d -size 9495 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/filelist.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/filelist.xml deleted file mode 100644 index 9a78b1bfd5..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/filelist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/level.pak b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/level.pak deleted file mode 100644 index 8e6b3b29cb..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/level.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:547d7fdfcd959569b69d78eb6f63c7c19fc90840d69ca2d46eca8a3e82b8db75 -size 39337 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/Environment.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/Environment.xml deleted file mode 100644 index 4ba36f66ae..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/Environment.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/GameTokens.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/GameTokens.xml deleted file mode 100644 index 668a4583bd..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/GameTokens.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/TerrainTexture.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/TerrainTexture.xml deleted file mode 100644 index f43df05b22..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/TerrainTexture.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/TimeOfDay.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/TimeOfDay.xml deleted file mode 100644 index 456d609b8a..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/TimeOfDay.xml +++ /dev/null @@ -1,356 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/VegetationMap.dat b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/VegetationMap.dat deleted file mode 100644 index dce5631cd0..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/VegetationMap.dat +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e6a5435c928079b27796f6b202bbc2623e7e454244ddc099a3cadf33b7cb9e9 -size 63 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/terrain/terrain.pxheightfield b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/terrain/terrain.pxheightfield deleted file mode 100644 index 011356e521..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/terrain/terrain.pxheightfield +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:19096597087688692a225c1955f73d22c46354995fca1df8dff107a90c2f17a2 -size 4202594 diff --git a/AutomatedTesting/Levels/Physics/RigidBody_KinematicModeWorks/RigidBody_KinematicModeWorks.ly b/AutomatedTesting/Levels/Physics/RigidBody_KinematicModeWorks/RigidBody_KinematicModeWorks.ly index d6052ffa7c..a4b28a9e96 100644 --- a/AutomatedTesting/Levels/Physics/RigidBody_KinematicModeWorks/RigidBody_KinematicModeWorks.ly +++ b/AutomatedTesting/Levels/Physics/RigidBody_KinematicModeWorks/RigidBody_KinematicModeWorks.ly @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cb97ada674d123c67d7a32eb65e81fa66472cf51f748054c4a4297649f2a0f40 -size 5568 +oid sha256:0f645243fb623258ed4b063c5a18ea414560496f97d7234782ca97884e0ed8f0 +size 5961 From e1572ce5c9615d8b4ecaa5ee8b8409f2fcb7944b Mon Sep 17 00:00:00 2001 From: AMZN-stankowi <4838196+AMZN-stankowi@users.noreply.github.com> Date: Fri, 14 Jan 2022 08:49:42 -0800 Subject: [PATCH 381/399] Updating assimp to the v12 packages (#6861) Signed-off-by: AMZN-stankowi <4838196+AMZN-stankowi@users.noreply.github.com> --- cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake | 2 +- cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake | 2 +- cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake index f7bc2721ae..f1e8fdc950 100644 --- a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake +++ b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake @@ -8,7 +8,6 @@ # shared by other platforms: ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348) -ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev11-multiplatform TARGETS assimplib PACKAGE_HASH 1a9113788b893ef4a2ee63ac01eb71b981a92894a5a51175703fa225f5804dec) ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023) ly_associate_package(PACKAGE_NAME RapidXML-1.13-rev1-multiplatform TARGETS RapidXML PACKAGE_HASH 4b7b5651e47cfd019b6b295cc17bb147b65e53073eaab4a0c0d20a37ab74a246) @@ -21,6 +20,7 @@ ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform TARGETS xxhash PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e) # platform-specific: +ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev12-linux TARGETS assimplib PACKAGE_HASH 49d32e11c594e58a9079972ad63570dd895ac61e6148e428b9c39a62feb676ee) ly_associate_package(PACKAGE_NAME AWSGameLiftServerSDK-3.4.1-rev1-linux TARGETS AWSGameLiftServerSDK PACKAGE_HASH a8149a95bd100384af6ade97e2b21a56173740d921e6c3da8188cd51554d39af) ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-rev3-linux TARGETS TIFF PACKAGE_HASH 2377f48b2ebc2d1628d9f65186c881544c92891312abe478a20d10b85877409a) ly_associate_package(PACKAGE_NAME freetype-2.10.4.16-linux TARGETS freetype PACKAGE_HASH 3f10c703d9001ecd2bb51a3bd003d3237c02d8f947ad0161c0252fdc54cbcf97) diff --git a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake index ea324a5cb7..575a2dd70e 100644 --- a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake +++ b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake @@ -8,7 +8,6 @@ # shared by other platforms: ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348) -ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev11-multiplatform TARGETS assimplib PACKAGE_HASH 1a9113788b893ef4a2ee63ac01eb71b981a92894a5a51175703fa225f5804dec) ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023) ly_associate_package(PACKAGE_NAME RapidXML-1.13-rev1-multiplatform TARGETS RapidXML PACKAGE_HASH 4b7b5651e47cfd019b6b295cc17bb147b65e53073eaab4a0c0d20a37ab74a246) @@ -21,6 +20,7 @@ ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform TARGETS xxhash PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e) # platform-specific: +ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev12-mac TARGETS assimplib PACKAGE_HASH 12db03817553f607bee0d65b690bcaae748014f3ed9266b70384f463bc98c9d1) ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxc-1.6.2104-o3de-rev3-mac TARGETS DirectXShaderCompilerDxc PACKAGE_HASH 3f77367dbb0342136ec4ebbd44bc1fedf7198089a0f83c5631248530769b2be6) ly_associate_package(PACKAGE_NAME SPIRVCross-2021.04.29-rev1-mac TARGETS SPIRVCross PACKAGE_HASH 78c6376ed2fd195b9b1f5fb2b56e5267a32c3aa21fb399e905308de470eb4515) ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-rev3-mac TARGETS TIFF PACKAGE_HASH c2615ccdadcc0e1d6c5ed61e5965c4d3a82193d206591b79b805c3b3ff35a4bf) diff --git a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake index 5441bcd76f..7fd07927cc 100644 --- a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake +++ b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake @@ -8,7 +8,6 @@ # shared by other platforms: ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348) -ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev11-multiplatform TARGETS assimplib PACKAGE_HASH 1a9113788b893ef4a2ee63ac01eb71b981a92894a5a51175703fa225f5804dec) ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023) ly_associate_package(PACKAGE_NAME RapidXML-1.13-rev1-multiplatform TARGETS RapidXML PACKAGE_HASH 4b7b5651e47cfd019b6b295cc17bb147b65e53073eaab4a0c0d20a37ab74a246) @@ -21,6 +20,7 @@ ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform TARGETS xxhash PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e) # platform-specific: +ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev12-windows TARGETS assimplib PACKAGE_HASH 5273b7661a7a247bb18e8bc928d25c9cd1bd8ce9dfcc56c50742bac8fa02f0f2) ly_associate_package(PACKAGE_NAME AWSGameLiftServerSDK-3.4.1-rev1-windows TARGETS AWSGameLiftServerSDK PACKAGE_HASH a0586b006e4def65cc25f388de17dc475e417dc1e6f9d96749777c88aa8271b0) ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxc-1.6.2104-o3de-rev3-windows TARGETS DirectXShaderCompilerDxc PACKAGE_HASH 803e10b94006b834cbbdd30f562a8ddf04174c2cb6956c8399ec164ef8418d1f) ly_associate_package(PACKAGE_NAME SPIRVCross-2021.04.29-rev1-windows TARGETS SPIRVCross PACKAGE_HASH 7d601ea9d625b1d509d38bd132a1f433d7e895b16adab76bac6103567a7a6817) From 4392c8963c66786d9db2164fb3d7384dc2e7a6f9 Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Fri, 14 Jan 2022 09:00:26 -0800 Subject: [PATCH 382/399] [Linux] Prefer higher versioned clang compilers to lower versions (#6824) If the user does not specify which compiler to use via cache variables in the CMake invocation, we perform a search for which version to use. Previously this was done using a glob search on some pre-defined paths, and then sorting the results using `list(SORT ... COMPARE NATURAL)`. Sorting in this manner results in lower versions being moved to the head of the list. The first result in the list was then used. Consequently, if the user has `clang-11` and `clang-12` installed, `clang-11` was chosen. This reverses the sort order so that the highest installed version is chosen. Signed-off-by: Chris Burel --- cmake/Platform/Linux/CompilerSettings_linux.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Platform/Linux/CompilerSettings_linux.cmake b/cmake/Platform/Linux/CompilerSettings_linux.cmake index 9bb629c53b..a1a632e957 100644 --- a/cmake/Platform/Linux/CompilerSettings_linux.cmake +++ b/cmake/Platform/Linux/CompilerSettings_linux.cmake @@ -19,7 +19,7 @@ if(NOT CMAKE_C_COMPILER AND NOT CMAKE_CXX_COMPILER AND NOT "$ENV{CC}" AND NOT "$ file(GLOB clang_versions ${path_search}) if(clang_versions) # Find and pick the highest installed version - list(SORT clang_versions COMPARE NATURAL) + list(SORT clang_versions COMPARE NATURAL ORDER DESCENDING) list(GET clang_versions 0 clang_higher_version_path) string(REGEX MATCH "clang-([0-9.]*)" clang_higher_version ${clang_higher_version_path}) if(CMAKE_MATCH_1) From b62d130475b81e9936f89c5123d1436b4c3dfb1a Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 14 Jan 2022 11:32:29 -0600 Subject: [PATCH 383/399] Updated AnimNode registration in LyShine and Maestro to register to a member variable map (#6786) * Updated the Maestro MovieSystem and LyShine AnimationSystem to register Anim Nodes and Anim Params into a member variable map Previously the registration was occuring in a global variable map inside of Movie.cpp and UiAnimationSystem.cpp Rolled back the changes to update the CUiAnimNode and CAnimParamType to use the stateless allocator in their m_name string member. This was only needed because those types were used in global memory. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the AZStd::hash specializations for basic_string and basic_fixed_string to be transparent. This allows hashing of types that aren't basic_string or basic_fixed_string using the hash specializations for those types without needing to create an instance of those types. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Adding call to disable saving of the UserSettings.xml in the DisplaySettingsPythonBindingsFixture to avoid race condition running the test in parallel Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- .../test_DisplaySettingsPythonBindings.cpp | 5 + .../AzCore/AzCore/std/string/fixed_string.inl | 3 +- .../AzCore/AzCore/std/string/string.h | 5 +- Code/Legacy/CryCommon/IMovieSystem.h | 5 +- .../Styling/SelectorImplementations.h | 2 +- Gems/LyShine/Code/Source/Animation/AnimNode.h | 3 +- .../Source/Animation/UiAnimationSystem.cpp | 141 ++++------ .../Code/Source/Animation/UiAnimationSystem.h | 22 +- Gems/LyShine/Code/Source/LyShine.cpp | 2 - .../Code/Source/Cinematics/AnimPostFXNode.cpp | 3 +- Gems/Maestro/Code/Source/Cinematics/Movie.cpp | 265 ++++++++---------- Gems/Maestro/Code/Source/Cinematics/Movie.h | 20 +- .../Code/Source/TextureAtlasImpl.h | 2 +- 13 files changed, 234 insertions(+), 244 deletions(-) diff --git a/Code/Editor/Lib/Tests/test_DisplaySettingsPythonBindings.cpp b/Code/Editor/Lib/Tests/test_DisplaySettingsPythonBindings.cpp index fd65634d4e..b73cb039ea 100644 --- a/Code/Editor/Lib/Tests/test_DisplaySettingsPythonBindings.cpp +++ b/Code/Editor/Lib/Tests/test_DisplaySettingsPythonBindings.cpp @@ -35,6 +35,11 @@ namespace DisplaySettingsPythonBindingsUnitTests m_app.Start(appDesc); m_app.RegisterComponentDescriptor(AzToolsFramework::DisplaySettingsPythonFuncsHandler::CreateDescriptor()); + + // 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 + // in the unit tests. + AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize); } void TearDown() override diff --git a/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl b/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl index 15d2acf7a1..a1c95b7ba2 100644 --- a/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl +++ b/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl @@ -1760,7 +1760,8 @@ namespace AZStd template struct hash> { - inline constexpr size_t operator()(const basic_fixed_string& value) const + using is_transparent = void; + inline constexpr size_t operator()(const basic_string_view& value) const { return hash_string(value.begin(), value.length()); } diff --git a/Code/Framework/AzCore/AzCore/std/string/string.h b/Code/Framework/AzCore/AzCore/std/string/string.h index 7dd6dd7065..56afd16226 100644 --- a/Code/Framework/AzCore/AzCore/std/string/string.h +++ b/Code/Framework/AzCore/AzCore/std/string/string.h @@ -2071,9 +2071,8 @@ namespace AZStd template struct hash< basic_string< Element, Traits, Allocator> > { - typedef basic_string< Element, Traits, Allocator> argument_type; - typedef AZStd::size_t result_type; - inline result_type operator()(const argument_type& value) const + using is_transparent = void; + inline constexpr size_t operator()(const basic_string_view& value) const { return hash_string(value.begin(), value.length()); } diff --git a/Code/Legacy/CryCommon/IMovieSystem.h b/Code/Legacy/CryCommon/IMovieSystem.h index 79c000bfca..a55d764afa 100644 --- a/Code/Legacy/CryCommon/IMovieSystem.h +++ b/Code/Legacy/CryCommon/IMovieSystem.h @@ -13,7 +13,6 @@ #include #include #include -#include #include #include @@ -184,7 +183,7 @@ public: private: AnimParamType m_type; - AZStd::basic_string, AZStd::stateless_allocator> m_name; + AZStd::string m_name; }; namespace AZStd @@ -620,7 +619,7 @@ public: , valueType(_valueType) , flags(_flags) {}; - AZStd::basic_string, AZStd::stateless_allocator> name; // parameter name. + AZStd::string name; // parameter name. CAnimParamType paramType; // parameter id. AnimValueType valueType; // value type, defines type of track to use for animating this parameter. ESupportedParamFlags flags; // combination of flags from ESupportedParamFlags. diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/SelectorImplementations.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/SelectorImplementations.h index 1c65bf1915..eac9abdec8 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/SelectorImplementations.h +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/SelectorImplementations.h @@ -79,7 +79,7 @@ namespace GraphCanvas private: AZStd::string m_value; - AZStd::hash::result_type m_hash; + size_t m_hash; friend class BasicSelectorEventHandler; }; diff --git a/Gems/LyShine/Code/Source/Animation/AnimNode.h b/Gems/LyShine/Code/Source/Animation/AnimNode.h index 4d139e99ca..0076276204 100644 --- a/Gems/LyShine/Code/Source/Animation/AnimNode.h +++ b/Gems/LyShine/Code/Source/Animation/AnimNode.h @@ -13,7 +13,6 @@ #include #include "UiAnimationSystem.h" -#include /*! @@ -40,7 +39,7 @@ public: , valueType(_valueType) , flags(_flags) {}; - AZStd::basic_string, AZStd::stateless_allocator> name; // parameter name. + AZStd::string name; // parameter name. CUiAnimParamType paramType; // parameter id. EUiAnimValue valueType; // value type, defines type of track to use for animating this parameter. ESupportedParamFlags flags; // combination of flags from ESupportedParamFlags. diff --git a/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp b/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp index c8818836d6..06e7110fe2 100644 --- a/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp +++ b/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp @@ -14,77 +14,59 @@ #include "UiAnimSerialize.h" #include -#include #include #include -#include #include #include #include ////////////////////////////////////////////////////////////////////////// -namespace -{ - using UiAnimParamSystemString = AZStd::basic_string, AZStd::stateless_allocator>; - template > - using UiAnimSystemOrderedMap = AZStd::map; - template , typename EqualKey = AZStd::equal_to> - using UiAnimSystemUnorderedMap = AZStd::unordered_map; -} // Serialization for anim nodes & param types -#define REGISTER_NODE_TYPE(name) assert(!g_animNodeEnumToStringMap.contains(eUiAnimNodeType_ ## name)); \ - g_animNodeEnumToStringMap[eUiAnimNodeType_ ## name] = AZ_STRINGIZE(name); \ - g_animNodeStringToEnumMap[UiAnimParamSystemString(AZ_STRINGIZE(name))] = eUiAnimNodeType_ ## name; - -#define REGISTER_PARAM_TYPE(name) assert(!g_animParamEnumToStringMap.contains(eUiAnimParamType_ ## name)); \ - g_animParamEnumToStringMap[eUiAnimParamType_ ## name] = AZ_STRINGIZE(name); \ - g_animParamStringToEnumMap[UiAnimParamSystemString(AZ_STRINGIZE(name))] = eUiAnimParamType_ ## name; - -namespace -{ - UiAnimSystemUnorderedMap g_animNodeEnumToStringMap; - UiAnimSystemOrderedMap> g_animNodeStringToEnumMap; - - UiAnimSystemUnorderedMap g_animParamEnumToStringMap; - UiAnimSystemOrderedMap> g_animParamStringToEnumMap; - - // If you get an assert in this function, it means two node types have the same enum value. - void RegisterNodeTypes() - { - REGISTER_NODE_TYPE(Entity) - REGISTER_NODE_TYPE(Director) - REGISTER_NODE_TYPE(Camera) - REGISTER_NODE_TYPE(CVar) - REGISTER_NODE_TYPE(ScriptVar) - REGISTER_NODE_TYPE(Material) - REGISTER_NODE_TYPE(Event) - REGISTER_NODE_TYPE(Group) - REGISTER_NODE_TYPE(Layer) - REGISTER_NODE_TYPE(Comment) - REGISTER_NODE_TYPE(RadialBlur) - REGISTER_NODE_TYPE(ColorCorrection) - REGISTER_NODE_TYPE(DepthOfField) - REGISTER_NODE_TYPE(ScreenFader) - REGISTER_NODE_TYPE(Light) - REGISTER_NODE_TYPE(HDRSetup) - REGISTER_NODE_TYPE(ShadowSetup) - REGISTER_NODE_TYPE(Alembic) - REGISTER_NODE_TYPE(GeomCache) - REGISTER_NODE_TYPE(Environment) - REGISTER_NODE_TYPE(ScreenDropsSetup) - REGISTER_NODE_TYPE(AzEntity) - } - - // If you get an assert in this function, it means two param types have the same enum value. - void RegisterParamTypes() - { - REGISTER_PARAM_TYPE(Event) - REGISTER_PARAM_TYPE(Float) - REGISTER_PARAM_TYPE(TrackEvent) - REGISTER_PARAM_TYPE(AzComponentField) - } +#define REGISTER_NODE_TYPE(name) assert(!m_animNodeEnumToStringMap.contains(eUiAnimNodeType_ ## name)); \ + m_animNodeEnumToStringMap[eUiAnimNodeType_ ## name] = AZ_STRINGIZE(name); \ + m_animNodeStringToEnumMap[UiAnimParamSystemString(AZ_STRINGIZE(name))] = eUiAnimNodeType_ ## name; + +#define REGISTER_PARAM_TYPE(name) assert(!m_animParamEnumToStringMap.contains(eUiAnimParamType_ ## name)); \ + m_animParamEnumToStringMap[eUiAnimParamType_ ## name] = AZ_STRINGIZE(name); \ + m_animParamStringToEnumMap[UiAnimParamSystemString(AZ_STRINGIZE(name))] = eUiAnimParamType_ ## name; + + +// If you get an assert in this function, it means two node types have the same enum value. +void UiAnimationSystem::RegisterNodeTypes() +{ + REGISTER_NODE_TYPE(Entity) + REGISTER_NODE_TYPE(Director) + REGISTER_NODE_TYPE(Camera) + REGISTER_NODE_TYPE(CVar) + REGISTER_NODE_TYPE(ScriptVar) + REGISTER_NODE_TYPE(Material) + REGISTER_NODE_TYPE(Event) + REGISTER_NODE_TYPE(Group) + REGISTER_NODE_TYPE(Layer) + REGISTER_NODE_TYPE(Comment) + REGISTER_NODE_TYPE(RadialBlur) + REGISTER_NODE_TYPE(ColorCorrection) + REGISTER_NODE_TYPE(DepthOfField) + REGISTER_NODE_TYPE(ScreenFader) + REGISTER_NODE_TYPE(Light) + REGISTER_NODE_TYPE(HDRSetup) + REGISTER_NODE_TYPE(ShadowSetup) + REGISTER_NODE_TYPE(Alembic) + REGISTER_NODE_TYPE(GeomCache) + REGISTER_NODE_TYPE(Environment) + REGISTER_NODE_TYPE(ScreenDropsSetup) + REGISTER_NODE_TYPE(AzEntity) +} + +// If you get an assert in this function, it means two param types have the same enum value. +void UiAnimationSystem::RegisterParamTypes() +{ + REGISTER_PARAM_TYPE(Event) + REGISTER_PARAM_TYPE(Float) + REGISTER_PARAM_TYPE(TrackEvent) + REGISTER_PARAM_TYPE(AzComponentField) } ////////////////////////////////////////////////////////////////////////// @@ -98,6 +80,10 @@ UiAnimationSystem::UiAnimationSystem() m_lastUpdateTime = AZ::Time::ZeroTimeUs; m_nextSequenceId = 1; + + DoNodeStaticInitialisation(); + RegisterNodeTypes(); + RegisterParamTypes(); } ////////////////////////////////////////////////////////////////////////// @@ -1173,16 +1159,16 @@ void UiAnimationSystem::SerializeNodeType(EUiAnimNodeType& animNodeType, XmlNode XmlString nodeTypeString; if (xmlNode->getAttr(kType, nodeTypeString)) { - assert(g_animNodeStringToEnumMap.find(nodeTypeString.c_str()) != g_animNodeStringToEnumMap.end()); - animNodeType = stl::find_in_map(g_animNodeStringToEnumMap, nodeTypeString.c_str(), eUiAnimNodeType_Invalid); + assert(m_animNodeStringToEnumMap.contains(nodeTypeString.c_str())); + animNodeType = stl::find_in_map(m_animNodeStringToEnumMap, nodeTypeString.c_str(), eUiAnimNodeType_Invalid); } } } else { const char* pTypeString = "Invalid"; - assert(g_animNodeEnumToStringMap.find(animNodeType) != g_animNodeEnumToStringMap.end()); - pTypeString = g_animNodeEnumToStringMap[animNodeType].c_str(); + assert(m_animNodeEnumToStringMap.find(animNodeType) != m_animNodeEnumToStringMap.end()); + pTypeString = m_animNodeEnumToStringMap[animNodeType].c_str(); xmlNode->setAttr(kType, pTypeString); } } @@ -1242,8 +1228,8 @@ void UiAnimationSystem::SerializeParamType(CUiAnimParamType& animParamType, XmlN } else { - assert(g_animParamStringToEnumMap.find(paramTypeString.c_str()) != g_animParamStringToEnumMap.end()); - animParamType.m_type = stl::find_in_map(g_animParamStringToEnumMap, paramTypeString.c_str(), eUiAnimParamType_Invalid); + assert(m_animParamStringToEnumMap.contains(paramTypeString.c_str())); + animParamType.m_type = stl::find_in_map(m_animParamStringToEnumMap, paramTypeString.c_str(), eUiAnimParamType_Invalid); } } } @@ -1265,8 +1251,8 @@ void UiAnimationSystem::SerializeParamType(CUiAnimParamType& animParamType, XmlN } else { - assert(g_animParamEnumToStringMap.find(animParamType.m_type) != g_animParamEnumToStringMap.end()); - pTypeString = g_animParamEnumToStringMap[animParamType.m_type].c_str(); + assert(m_animParamEnumToStringMap.find(animParamType.m_type) != m_animParamEnumToStringMap.end()); + pTypeString = m_animParamEnumToStringMap[animParamType.m_type].c_str(); } xmlNode->setAttr(kParamType, pTypeString); @@ -1332,9 +1318,9 @@ const char* UiAnimationSystem::GetParamTypeName(const CUiAnimParamType& animPara } else { - if (g_animParamEnumToStringMap.find(animParamType.m_type) != g_animParamEnumToStringMap.end()) + if (m_animParamEnumToStringMap.find(animParamType.m_type) != m_animParamEnumToStringMap.end()) { - return g_animParamEnumToStringMap[animParamType.m_type].c_str(); + return m_animParamEnumToStringMap[animParamType.m_type].c_str(); } } @@ -1346,15 +1332,6 @@ void UiAnimationSystem::OnCameraCut() { } -////////////////////////////////////////////////////////////////////////// -void UiAnimationSystem::StaticInitialize() -{ - DoNodeStaticInitialisation(); - - RegisterNodeTypes(); - RegisterParamTypes(); -} - ////////////////////////////////////////////////////////////////////////// void UiAnimationSystem::Reflect(AZ::SerializeContext* serializeContext) { @@ -1380,13 +1357,13 @@ void UiAnimationSystem::Reflect(AZ::SerializeContext* serializeContext) ////////////////////////////////////////////////////////////////////////// EUiAnimNodeType UiAnimationSystem::GetNodeTypeFromString(const char* pString) const { - return stl::find_in_map(g_animNodeStringToEnumMap, pString, eUiAnimNodeType_Invalid); + return stl::find_in_map(m_animNodeStringToEnumMap, pString, eUiAnimNodeType_Invalid); } ////////////////////////////////////////////////////////////////////////// CUiAnimParamType UiAnimationSystem::GetParamTypeFromString(const char* pString) const { - const EUiAnimParamType paramType = stl::find_in_map(g_animParamStringToEnumMap, pString, eUiAnimParamType_Invalid); + const EUiAnimParamType paramType = stl::find_in_map(m_animParamStringToEnumMap, pString, eUiAnimParamType_Invalid); if (paramType != eUiAnimParamType_Invalid) { diff --git a/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.h b/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.h index cd51cd51d0..6c710205fa 100644 --- a/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.h +++ b/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.h @@ -14,6 +14,8 @@ #include #include +#include + struct PlayingUIAnimSequence { //! Sequence playing @@ -134,12 +136,10 @@ public: void SerializeParamType(CUiAnimParamType& animParamType, XmlNodeRef& xmlNode, bool bLoading, const uint version) override; void SerializeParamData(UiAnimParamData& animParamData, XmlNodeRef& xmlNode, bool bLoading) override; - static const char* GetParamTypeName(const CUiAnimParamType& animParamType); + const char* GetParamTypeName(const CUiAnimParamType& animParamType); void OnCameraCut(); - static void StaticInitialize(); - static void Reflect(AZ::SerializeContext* serializeContext); void NotifyTrackEventListeners(const char* eventName, const char* valueName, IUiAnimSequence* pSequence) override; @@ -187,5 +187,21 @@ private: // A sequence which turned on the early animation update last time uint32 m_nextSequenceId; + + using UiAnimParamSystemString = AZStd::string; + template > + using UiAnimSystemOrderedMap = AZStd::map; + template , typename EqualKey = AZStd::equal_to<>> + using UiAnimSystemUnorderedMap = AZStd::unordered_map; + + UiAnimSystemUnorderedMap m_animNodeEnumToStringMap; + UiAnimSystemOrderedMap m_animNodeStringToEnumMap; + + UiAnimSystemUnorderedMap m_animParamEnumToStringMap; + UiAnimSystemOrderedMap m_animParamStringToEnumMap; + + void RegisterNodeTypes(); + void RegisterParamTypes(); + void ShowPlayedSequencesDebug(); }; diff --git a/Gems/LyShine/Code/Source/LyShine.cpp b/Gems/LyShine/Code/Source/LyShine.cpp index 5a704329ef..b362ed2106 100644 --- a/Gems/LyShine/Code/Source/LyShine.cpp +++ b/Gems/LyShine/Code/Source/LyShine.cpp @@ -156,8 +156,6 @@ CLyShine::CLyShine([[maybe_unused]] ISystem* system) UiElementComponent::Initialize(); UiCanvasComponent::Initialize(); - UiAnimationSystem::StaticInitialize(); - AzFramework::InputChannelEventListener::Connect(); AzFramework::InputTextEventListener::Connect(); UiCursorBus::Handler::BusConnect(); diff --git a/Gems/Maestro/Code/Source/Cinematics/AnimPostFXNode.cpp b/Gems/Maestro/Code/Source/Cinematics/AnimPostFXNode.cpp index b535033351..7e32301b71 100644 --- a/Gems/Maestro/Code/Source/Cinematics/AnimPostFXNode.cpp +++ b/Gems/Maestro/Code/Source/Cinematics/AnimPostFXNode.cpp @@ -8,7 +8,6 @@ #include -#include #include "AnimPostFXNode.h" #include "AnimSplineTrack.h" #include "CompoundSplineTrack.h" @@ -39,7 +38,7 @@ public: virtual void GetDefault(bool& val) const = 0; virtual void GetDefault(Vec4& val) const = 0; - AZStd::basic_string, AZStd::stateless_allocator> m_name; + AZStd::string m_name; protected: virtual ~CControlParamBase(){} diff --git a/Gems/Maestro/Code/Source/Cinematics/Movie.cpp b/Gems/Maestro/Code/Source/Cinematics/Movie.cpp index dc0782f982..51be8a4c24 100644 --- a/Gems/Maestro/Code/Source/Cinematics/Movie.cpp +++ b/Gems/Maestro/Code/Source/Cinematics/Movie.cpp @@ -7,7 +7,6 @@ */ #include -#include #include #include #include @@ -28,7 +27,6 @@ #include "LayerNode.h" #include "ShadowsSetupNode.h" -#include #include #include @@ -74,136 +72,117 @@ static SMovieSequenceAutoComplete s_movieSequenceAutoComplete; #endif ////////////////////////////////////////////////////////////////////////// -namespace -{ - using AnimParamSystemString = AZStd::basic_string, AZStd::stateless_allocator>; - - template > - using AnimSystemOrderedMap = AZStd::map; - template , typename EqualKey = AZStd::equal_to> - using AnimSystemUnorderedMap = AZStd::unordered_map; -} - // Serialization for anim nodes & param types -#define REGISTER_NODE_TYPE(name) assert(!g_animNodeEnumToStringMap.contains(AnimNodeType::name)); \ - g_animNodeEnumToStringMap[AnimNodeType::name] = AZ_STRINGIZE(name); \ - g_animNodeStringToEnumMap[AnimParamSystemString(AZ_STRINGIZE(name))] = AnimNodeType::name; - -#define REGISTER_PARAM_TYPE(name) assert(!g_animParamEnumToStringMap.contains(AnimParamType::name)); \ - g_animParamEnumToStringMap[AnimParamType::name] = AZ_STRINGIZE(name); \ - g_animParamStringToEnumMap[AnimParamSystemString(AZ_STRINGIZE(name))] = AnimParamType::name; - -namespace -{ - AnimSystemUnorderedMap g_animNodeEnumToStringMap; - AnimSystemOrderedMap> g_animNodeStringToEnumMap; - - AnimSystemUnorderedMap g_animParamEnumToStringMap; - AnimSystemOrderedMap> g_animParamStringToEnumMap; - - // If you get an assert in this function, it means two node types have the same enum value. - void RegisterNodeTypes() - { - REGISTER_NODE_TYPE(Entity) - REGISTER_NODE_TYPE(Director) - REGISTER_NODE_TYPE(Camera) - REGISTER_NODE_TYPE(CVar) - REGISTER_NODE_TYPE(ScriptVar) - REGISTER_NODE_TYPE(Material) - REGISTER_NODE_TYPE(Event) - REGISTER_NODE_TYPE(Group) - REGISTER_NODE_TYPE(Layer) - REGISTER_NODE_TYPE(Comment) - REGISTER_NODE_TYPE(RadialBlur) - REGISTER_NODE_TYPE(ColorCorrection) - REGISTER_NODE_TYPE(DepthOfField) - REGISTER_NODE_TYPE(ScreenFader) - REGISTER_NODE_TYPE(Light) - REGISTER_NODE_TYPE(ShadowSetup) - REGISTER_NODE_TYPE(Alembic) - REGISTER_NODE_TYPE(GeomCache) - REGISTER_NODE_TYPE(Environment) - REGISTER_NODE_TYPE(AzEntity) - REGISTER_NODE_TYPE(Component) - } - - // If you get an assert in this function, it means two param types have the same enum value. - void RegisterParamTypes() - { - REGISTER_PARAM_TYPE(FOV) - REGISTER_PARAM_TYPE(Position) - REGISTER_PARAM_TYPE(Rotation) - REGISTER_PARAM_TYPE(Scale) - REGISTER_PARAM_TYPE(Event) - REGISTER_PARAM_TYPE(Visibility) - REGISTER_PARAM_TYPE(Camera) - REGISTER_PARAM_TYPE(Animation) - REGISTER_PARAM_TYPE(Sound) - REGISTER_PARAM_TYPE(Sequence) - REGISTER_PARAM_TYPE(Console) - REGISTER_PARAM_TYPE(Music) ///@deprecated in 1.11, left in for legacy serialization - REGISTER_PARAM_TYPE(Float) - REGISTER_PARAM_TYPE(LookAt) - REGISTER_PARAM_TYPE(TrackEvent) - REGISTER_PARAM_TYPE(ShakeAmplitudeA) - REGISTER_PARAM_TYPE(ShakeAmplitudeB) - REGISTER_PARAM_TYPE(ShakeFrequencyA) - REGISTER_PARAM_TYPE(ShakeFrequencyB) - REGISTER_PARAM_TYPE(ShakeMultiplier) - REGISTER_PARAM_TYPE(ShakeNoise) - REGISTER_PARAM_TYPE(ShakeWorking) - REGISTER_PARAM_TYPE(ShakeAmpAMult) - REGISTER_PARAM_TYPE(ShakeAmpBMult) - REGISTER_PARAM_TYPE(ShakeFreqAMult) - REGISTER_PARAM_TYPE(ShakeFreqBMult) - REGISTER_PARAM_TYPE(DepthOfField) - REGISTER_PARAM_TYPE(FocusDistance) - REGISTER_PARAM_TYPE(FocusRange) - REGISTER_PARAM_TYPE(BlurAmount) - REGISTER_PARAM_TYPE(Capture) - REGISTER_PARAM_TYPE(TransformNoise) - REGISTER_PARAM_TYPE(TimeWarp) - REGISTER_PARAM_TYPE(FixedTimeStep) - REGISTER_PARAM_TYPE(NearZ) - REGISTER_PARAM_TYPE(Goto) - REGISTER_PARAM_TYPE(PositionX) - REGISTER_PARAM_TYPE(PositionY) - REGISTER_PARAM_TYPE(PositionZ) - REGISTER_PARAM_TYPE(RotationX) - REGISTER_PARAM_TYPE(RotationY) - REGISTER_PARAM_TYPE(RotationZ) - REGISTER_PARAM_TYPE(ScaleX) - REGISTER_PARAM_TYPE(ScaleY) - REGISTER_PARAM_TYPE(ScaleZ) - REGISTER_PARAM_TYPE(ColorR) - REGISTER_PARAM_TYPE(ColorG) - REGISTER_PARAM_TYPE(ColorB) - REGISTER_PARAM_TYPE(CommentText) - REGISTER_PARAM_TYPE(ScreenFader) - REGISTER_PARAM_TYPE(LightDiffuse) - REGISTER_PARAM_TYPE(LightRadius) - REGISTER_PARAM_TYPE(LightDiffuseMult) - REGISTER_PARAM_TYPE(LightHDRDynamic) - REGISTER_PARAM_TYPE(LightSpecularMult) - REGISTER_PARAM_TYPE(LightSpecPercentage) - REGISTER_PARAM_TYPE(MaterialDiffuse) - REGISTER_PARAM_TYPE(MaterialSpecular) - REGISTER_PARAM_TYPE(MaterialEmissive) - REGISTER_PARAM_TYPE(MaterialEmissiveIntensity) - REGISTER_PARAM_TYPE(MaterialOpacity) - REGISTER_PARAM_TYPE(MaterialSmoothness) - REGISTER_PARAM_TYPE(TimeRanges) - REGISTER_PARAM_TYPE(Physics) - REGISTER_PARAM_TYPE(GSMCache) - REGISTER_PARAM_TYPE(ShutterSpeed) - REGISTER_PARAM_TYPE(Physicalize) - REGISTER_PARAM_TYPE(PhysicsDriven) - REGISTER_PARAM_TYPE(SunLongitude) - REGISTER_PARAM_TYPE(SunLatitude) - REGISTER_PARAM_TYPE(MoonLongitude) - REGISTER_PARAM_TYPE(MoonLatitude) - REGISTER_PARAM_TYPE(ProceduralEyes) - } +#define REGISTER_NODE_TYPE(name) assert(!m_animNodeEnumToStringMap.contains(AnimNodeType::name)); \ + m_animNodeEnumToStringMap[AnimNodeType::name] = AZ_STRINGIZE(name); \ + m_animNodeStringToEnumMap[AnimParamSystemString(AZ_STRINGIZE(name))] = AnimNodeType::name; + +#define REGISTER_PARAM_TYPE(name) assert(!m_animParamEnumToStringMap.contains(AnimParamType::name)); \ + m_animParamEnumToStringMap[AnimParamType::name] = AZ_STRINGIZE(name); \ + m_animParamStringToEnumMap[AnimParamSystemString(AZ_STRINGIZE(name))] = AnimParamType::name; + +// If you get an assert in this function, it means two node types have the same enum value. +void CMovieSystem::RegisterNodeTypes() +{ + REGISTER_NODE_TYPE(Entity) + REGISTER_NODE_TYPE(Director) + REGISTER_NODE_TYPE(Camera) + REGISTER_NODE_TYPE(CVar) + REGISTER_NODE_TYPE(ScriptVar) + REGISTER_NODE_TYPE(Material) + REGISTER_NODE_TYPE(Event) + REGISTER_NODE_TYPE(Group) + REGISTER_NODE_TYPE(Layer) + REGISTER_NODE_TYPE(Comment) + REGISTER_NODE_TYPE(RadialBlur) + REGISTER_NODE_TYPE(ColorCorrection) + REGISTER_NODE_TYPE(DepthOfField) + REGISTER_NODE_TYPE(ScreenFader) + REGISTER_NODE_TYPE(Light) + REGISTER_NODE_TYPE(ShadowSetup) + REGISTER_NODE_TYPE(Alembic) + REGISTER_NODE_TYPE(GeomCache) + REGISTER_NODE_TYPE(Environment) + REGISTER_NODE_TYPE(AzEntity) + REGISTER_NODE_TYPE(Component) +} + +// If you get an assert in this function, it means two param types have the same enum value. +void CMovieSystem::RegisterParamTypes() +{ + REGISTER_PARAM_TYPE(FOV) + REGISTER_PARAM_TYPE(Position) + REGISTER_PARAM_TYPE(Rotation) + REGISTER_PARAM_TYPE(Scale) + REGISTER_PARAM_TYPE(Event) + REGISTER_PARAM_TYPE(Visibility) + REGISTER_PARAM_TYPE(Camera) + REGISTER_PARAM_TYPE(Animation) + REGISTER_PARAM_TYPE(Sound) + REGISTER_PARAM_TYPE(Sequence) + REGISTER_PARAM_TYPE(Console) + REGISTER_PARAM_TYPE(Music) ///@deprecated in 1.11, left in for legacy serialization + REGISTER_PARAM_TYPE(Float) + REGISTER_PARAM_TYPE(LookAt) + REGISTER_PARAM_TYPE(TrackEvent) + REGISTER_PARAM_TYPE(ShakeAmplitudeA) + REGISTER_PARAM_TYPE(ShakeAmplitudeB) + REGISTER_PARAM_TYPE(ShakeFrequencyA) + REGISTER_PARAM_TYPE(ShakeFrequencyB) + REGISTER_PARAM_TYPE(ShakeMultiplier) + REGISTER_PARAM_TYPE(ShakeNoise) + REGISTER_PARAM_TYPE(ShakeWorking) + REGISTER_PARAM_TYPE(ShakeAmpAMult) + REGISTER_PARAM_TYPE(ShakeAmpBMult) + REGISTER_PARAM_TYPE(ShakeFreqAMult) + REGISTER_PARAM_TYPE(ShakeFreqBMult) + REGISTER_PARAM_TYPE(DepthOfField) + REGISTER_PARAM_TYPE(FocusDistance) + REGISTER_PARAM_TYPE(FocusRange) + REGISTER_PARAM_TYPE(BlurAmount) + REGISTER_PARAM_TYPE(Capture) + REGISTER_PARAM_TYPE(TransformNoise) + REGISTER_PARAM_TYPE(TimeWarp) + REGISTER_PARAM_TYPE(FixedTimeStep) + REGISTER_PARAM_TYPE(NearZ) + REGISTER_PARAM_TYPE(Goto) + REGISTER_PARAM_TYPE(PositionX) + REGISTER_PARAM_TYPE(PositionY) + REGISTER_PARAM_TYPE(PositionZ) + REGISTER_PARAM_TYPE(RotationX) + REGISTER_PARAM_TYPE(RotationY) + REGISTER_PARAM_TYPE(RotationZ) + REGISTER_PARAM_TYPE(ScaleX) + REGISTER_PARAM_TYPE(ScaleY) + REGISTER_PARAM_TYPE(ScaleZ) + REGISTER_PARAM_TYPE(ColorR) + REGISTER_PARAM_TYPE(ColorG) + REGISTER_PARAM_TYPE(ColorB) + REGISTER_PARAM_TYPE(CommentText) + REGISTER_PARAM_TYPE(ScreenFader) + REGISTER_PARAM_TYPE(LightDiffuse) + REGISTER_PARAM_TYPE(LightRadius) + REGISTER_PARAM_TYPE(LightDiffuseMult) + REGISTER_PARAM_TYPE(LightHDRDynamic) + REGISTER_PARAM_TYPE(LightSpecularMult) + REGISTER_PARAM_TYPE(LightSpecPercentage) + REGISTER_PARAM_TYPE(MaterialDiffuse) + REGISTER_PARAM_TYPE(MaterialSpecular) + REGISTER_PARAM_TYPE(MaterialEmissive) + REGISTER_PARAM_TYPE(MaterialEmissiveIntensity) + REGISTER_PARAM_TYPE(MaterialOpacity) + REGISTER_PARAM_TYPE(MaterialSmoothness) + REGISTER_PARAM_TYPE(TimeRanges) + REGISTER_PARAM_TYPE(Physics) + REGISTER_PARAM_TYPE(GSMCache) + REGISTER_PARAM_TYPE(ShutterSpeed) + REGISTER_PARAM_TYPE(Physicalize) + REGISTER_PARAM_TYPE(PhysicsDriven) + REGISTER_PARAM_TYPE(SunLongitude) + REGISTER_PARAM_TYPE(SunLatitude) + REGISTER_PARAM_TYPE(MoonLongitude) + REGISTER_PARAM_TYPE(MoonLatitude) + REGISTER_PARAM_TYPE(ProceduralEyes) } namespace Internal @@ -1666,16 +1645,16 @@ void CMovieSystem::SerializeNodeType(AnimNodeType& animNodeType, XmlNodeRef& xml XmlString nodeTypeString; if (xmlNode->getAttr(kType, nodeTypeString)) { - assert(g_animNodeStringToEnumMap.find(nodeTypeString.c_str()) != g_animNodeStringToEnumMap.end()); - animNodeType = stl::find_in_map(g_animNodeStringToEnumMap, nodeTypeString.c_str(), AnimNodeType::Invalid); + assert(m_animNodeStringToEnumMap.find(nodeTypeString.c_str()) != m_animNodeStringToEnumMap.end()); + animNodeType = stl::find_in_map(m_animNodeStringToEnumMap, nodeTypeString.c_str(), AnimNodeType::Invalid); } } } else { const char* pTypeString = "Invalid"; - assert(g_animNodeEnumToStringMap.find(animNodeType) != g_animNodeEnumToStringMap.end()); - pTypeString = g_animNodeEnumToStringMap[animNodeType].c_str(); + assert(m_animNodeEnumToStringMap.find(animNodeType) != m_animNodeEnumToStringMap.end()); + pTypeString = m_animNodeEnumToStringMap[animNodeType].c_str(); xmlNode->setAttr(kType, pTypeString); } } @@ -1744,8 +1723,8 @@ void CMovieSystem::LoadParamTypeFromXml(CAnimParamType& animParamType, const Xml animParamType.m_name = virtualPropertyValue; } - assert(g_animParamStringToEnumMap.find(paramTypeString.c_str()) != g_animParamStringToEnumMap.end()); - animParamType.m_type = stl::find_in_map(g_animParamStringToEnumMap, paramTypeString.c_str(), AnimParamType::Invalid); + assert(m_animParamStringToEnumMap.find(paramTypeString.c_str()) != m_animParamStringToEnumMap.end()); + animParamType.m_type = stl::find_in_map(m_animParamStringToEnumMap, paramTypeString.c_str(), AnimParamType::Invalid); } } } @@ -1775,8 +1754,8 @@ void CMovieSystem::SaveParamTypeToXml(const CAnimParamType& animParamType, XmlNo xmlNode->setAttr(CAnimParamTypeXmlNames::kVirtualPropertyName, animParamType.m_name.c_str()); } - assert(g_animParamEnumToStringMap.find(animParamType.m_type) != g_animParamEnumToStringMap.end()); - pTypeString = g_animParamEnumToStringMap[animParamType.m_type].c_str(); + assert(m_animParamEnumToStringMap.find(animParamType.m_type) != m_animParamEnumToStringMap.end()); + pTypeString = m_animParamEnumToStringMap[animParamType.m_type].c_str(); } xmlNode->setAttr(kParamType, pTypeString); @@ -1809,9 +1788,9 @@ const char* CMovieSystem::GetParamTypeName(const CAnimParamType& animParamType) } else { - if (g_animParamEnumToStringMap.find(animParamType.m_type) != g_animParamEnumToStringMap.end()) + if (m_animParamEnumToStringMap.contains(animParamType.m_type)) { - return g_animParamEnumToStringMap[animParamType.m_type].c_str(); + return m_animParamEnumToStringMap[animParamType.m_type].c_str(); } } @@ -1973,13 +1952,13 @@ void CLightAnimWrapper::RemoveCachedLightAnim(const char* name) ////////////////////////////////////////////////////////////////////////// AnimNodeType CMovieSystem::GetNodeTypeFromString(const char* pString) const { - return stl::find_in_map(g_animNodeStringToEnumMap, pString, AnimNodeType::Invalid); + return stl::find_in_map(m_animNodeStringToEnumMap, pString, AnimNodeType::Invalid); } ////////////////////////////////////////////////////////////////////////// CAnimParamType CMovieSystem::GetParamTypeFromString(const char* pString) const { - const AnimParamType paramType = stl::find_in_map(g_animParamStringToEnumMap, pString, AnimParamType::Invalid); + const AnimParamType paramType = stl::find_in_map(m_animParamStringToEnumMap, pString, AnimParamType::Invalid); if (paramType != AnimParamType::Invalid) { diff --git a/Gems/Maestro/Code/Source/Cinematics/Movie.h b/Gems/Maestro/Code/Source/Cinematics/Movie.h index ab2c2e649b..4af2b55ced 100644 --- a/Gems/Maestro/Code/Source/Cinematics/Movie.h +++ b/Gems/Maestro/Code/Source/Cinematics/Movie.h @@ -18,6 +18,7 @@ #include #include +#include #include "IMovieSystem.h" #include "IShader.h" @@ -192,7 +193,7 @@ public: void SaveParamTypeToXml(const CAnimParamType& animParamType, XmlNodeRef& xmlNode) override; void SerializeParamType(CAnimParamType& animParamType, XmlNodeRef& xmlNode, bool bLoading, const uint version) override; - static const char* GetParamTypeName(const CAnimParamType& animParamType); + const char* GetParamTypeName(const CAnimParamType& animParamType); void OnCameraCut(); @@ -290,6 +291,23 @@ private: void ShowPlayedSequencesDebug(); + + using AnimParamSystemString = AZStd::string; + + template > + using AnimSystemOrderedMap = AZStd::map; + template , typename EqualKey = AZStd::equal_to<>> + using AnimSystemUnorderedMap = AZStd::unordered_map; + + AnimSystemUnorderedMap m_animNodeEnumToStringMap; + AnimSystemOrderedMap m_animNodeStringToEnumMap; + + AnimSystemUnorderedMap m_animParamEnumToStringMap; + AnimSystemOrderedMap m_animParamStringToEnumMap; + + void RegisterNodeTypes(); + void RegisterParamTypes(); + public: static float m_mov_cameraPrecacheTime; #if !defined(_RELEASE) diff --git a/Gems/TextureAtlas/Code/Source/TextureAtlasImpl.h b/Gems/TextureAtlas/Code/Source/TextureAtlasImpl.h index ce2f4826da..bb0ed650e5 100644 --- a/Gems/TextureAtlas/Code/Source/TextureAtlasImpl.h +++ b/Gems/TextureAtlas/Code/Source/TextureAtlasImpl.h @@ -33,7 +33,7 @@ namespace TextureAtlasNamespace struct hash_case_insensitive : public AZStd::hash { AZ_TYPE_INFO(hash_case_insensitive, "{FE0F4349-D80D-4286-8874-733966A32B29}"); - inline result_type operator()(const AZStd::string& value) const + inline size_t operator()(const AZStd::string& value) const { AZStd::string lowerStr = value; AZStd::to_lower(lowerStr.begin(), lowerStr.end()); From f87e1f6906d1ccdb4485d6e6e1237101128b68fd Mon Sep 17 00:00:00 2001 From: LesaelR <89800757+LesaelR@users.noreply.github.com> Date: Fri, 14 Jan 2022 09:48:46 -0800 Subject: [PATCH 384/399] Disabling BundleMode, AssetBundler, and MissingDependency tests on Linux. (#6888) Signed-off-by: Rosario Cox --- .../asset_processor_tests/CMakeLists.txt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt index e37a5ed99b..5839093473 100644 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt @@ -93,15 +93,19 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) ) ly_add_pytest( - NAME AssetPipelineTests.AssetBundler - PATH ${CMAKE_CURRENT_LIST_DIR}/asset_bundler_batch_tests.py + NAME AssetPipelineTests.AssetBuilder + PATH ${CMAKE_CURRENT_LIST_DIR}/asset_builder_tests.py EXCLUDE_TEST_RUN_TARGET_FROM_IDE TEST_SERIAL TEST_SUITE periodic RUNTIME_DEPENDENCIES AZ::AssetProcessor - AZ::AssetBundlerBatch ) + + set(SUPPORTED_PLATFORMS "Windows" "Mac") + if (NOT "${PAL_PLATFORM_NAME}" IN_LIST SUPPORTED_PLATFORMS) + return() + endif() ly_add_pytest( NAME AssetPipelineTests.BundleMode @@ -117,16 +121,16 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) ) ly_add_pytest( - NAME AssetPipelineTests.AssetBuilder - PATH ${CMAKE_CURRENT_LIST_DIR}/asset_builder_tests.py + NAME AssetPipelineTests.AssetBundler + PATH ${CMAKE_CURRENT_LIST_DIR}/asset_bundler_batch_tests.py EXCLUDE_TEST_RUN_TARGET_FROM_IDE TEST_SERIAL TEST_SUITE periodic RUNTIME_DEPENDENCIES AZ::AssetProcessor + AZ::AssetBundlerBatch ) - ly_add_pytest( NAME AssetPipelineTests.MissingDependency PATH ${CMAKE_CURRENT_LIST_DIR}/missing_dependency_tests.py @@ -136,5 +140,5 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) RUNTIME_DEPENDENCIES AZ::AssetProcessorBatch ) - + endif() From c778606c89e795ff885f5a732eaecd3b8946ba98 Mon Sep 17 00:00:00 2001 From: AMZN-byrcolin <68035668+byrcolin@users.noreply.github.com> Date: Fri, 14 Jan 2022 10:27:20 -0800 Subject: [PATCH 385/399] Templates restricted (#6498) * Templates/Restricted upgrade/fixes: Fixed template storage format: templates now only store true relative paths and no longer save "origin" paths and "optional" has been removed, it was never used. Upgraded all templates to new standard Template system now correctly handles child objects: Child objects no longer have to specify restricted they inherit from parent Restricted now operates at the object level and makes no assumptions about parent Restricted templates can now be combined and seperated on creation ly_get_list_relative_filename has been deprecated for o3de_pal_dir All Gems/Projects/Templates updated to use new code Signed-off-by: byrcolin --- AutomatedTesting/CMakeLists.txt | 1 - AutomatedTesting/Gem/CMakeLists.txt | 7 +- AutomatedTesting/Gem/Code/CMakeLists.txt | 2 +- .../Gem/PythonCoverage/CMakeLists.txt | 4 + .../Gem/PythonCoverage/Code/CMakeLists.txt | 2 +- AutomatedTesting/Gem/PythonCoverage/gem.json | 6 +- .../Gem/PythonTests/Blast/CMakeLists.txt | 2 +- .../Gem/PythonTests/CMakeLists.txt | 2 +- .../Gem/PythonTests/WhiteBox/CMakeLists.txt | 2 +- AutomatedTesting/Gem/Sponza/gem.json | 11 +- AutomatedTesting/Gem/gem.json | 14 +- AutomatedTesting/project.json | 9 +- CMakeLists.txt | 69 +- Code/Editor/CMakeLists.txt | 2 +- Code/Framework/AzCore/CMakeLists.txt | 10 +- Code/Framework/AzFramework/CMakeLists.txt | 12 +- Code/Framework/AzNetworking/CMakeLists.txt | 4 +- Code/Framework/AzQtComponents/CMakeLists.txt | 2 +- Code/Framework/AzTest/CMakeLists.txt | 8 +- Code/Framework/GridMate/CMakeLists.txt | 6 +- Code/LauncherUnified/CMakeLists.txt | 2 +- Code/LauncherUnified/launcher_generator.cmake | 2 +- Code/Legacy/CryCommon/CMakeLists.txt | 2 +- Code/Legacy/CrySystem/CMakeLists.txt | 2 +- Code/Tools/AWSNativeSDKInit/CMakeLists.txt | 4 +- .../AssetBuilderSDK/CMakeLists.txt | 2 +- Code/Tools/AzTestRunner/CMakeLists.txt | 2 +- Code/Tools/CrashHandler/CMakeLists.txt | 2 +- Code/Tools/LuaIDE/CMakeLists.txt | 4 +- .../ProjectManager/Source/PythonBindings.cpp | 2 +- Code/Tools/RemoteConsole/CMakeLists.txt | 2 +- Code/Tools/SceneAPI/SceneData/CMakeLists.txt | 2 +- Code/Tools/TestImpactFramework/CMakeLists.txt | 4 +- .../Runtime/Code/CMakeLists.txt | 4 +- Gems/AWSClientAuth/CMakeLists.txt | 4 + Gems/AWSClientAuth/Code/CMakeLists.txt | 2 +- Gems/AWSClientAuth/gem.json | 4 +- Gems/AWSCore/CMakeLists.txt | 4 + Gems/AWSCore/Code/CMakeLists.txt | 4 +- Gems/AWSCore/gem.json | 8 +- Gems/AWSGameLift/gem.json | 5 +- Gems/AWSMetrics/gem.json | 4 +- Gems/Achievements/CMakeLists.txt | 4 + Gems/Achievements/Code/CMakeLists.txt | 6 +- Gems/Achievements/gem.json | 1 + Gems/AssetValidation/gem.json | 1 + Gems/Atom/Asset/CMakeLists.txt | 10 - .../Asset/ImageProcessingAtom/CMakeLists.txt | 4 + .../ImageProcessingAtom/Code/CMakeLists.txt | 6 +- Gems/Atom/Asset/ImageProcessingAtom/gem.json | 2 + Gems/Atom/Asset/Shader/CMakeLists.txt | 4 + Gems/Atom/Asset/Shader/Code/CMakeLists.txt | 6 +- Gems/Atom/Asset/Shader/gem.json | 8 +- Gems/Atom/Bootstrap/CMakeLists.txt | 4 + Gems/Atom/Bootstrap/Code/CMakeLists.txt | 2 +- Gems/Atom/Bootstrap/gem.json | 2 + Gems/Atom/CMakeLists.txt | 10 +- Gems/Atom/Component/CMakeLists.txt | 9 - .../Atom/Component/DebugCamera/CMakeLists.txt | 4 + Gems/Atom/Component/DebugCamera/gem.json | 2 + Gems/Atom/Feature/CMakeLists.txt | 9 - Gems/Atom/Feature/Common/CMakeLists.txt | 4 + Gems/Atom/Feature/Common/Code/CMakeLists.txt | 4 +- Gems/Atom/Feature/Common/gem.json | 2 + Gems/Atom/RHI/CMakeLists.txt | 8 +- Gems/Atom/RHI/Code/CMakeLists.txt | 4 +- Gems/Atom/RHI/DX12/CMakeLists.txt | 4 + Gems/Atom/RHI/DX12/Code/CMakeLists.txt | 6 +- Gems/Atom/RHI/DX12/gem.json | 2 + Gems/Atom/RHI/Metal/CMakeLists.txt | 4 + Gems/Atom/RHI/Metal/Code/CMakeLists.txt | 4 +- Gems/Atom/RHI/Metal/gem.json | 2 + Gems/Atom/RHI/Null/CMakeLists.txt | 4 + Gems/Atom/RHI/Null/Code/CMakeLists.txt | 4 +- Gems/Atom/RHI/Null/gem.json | 2 + Gems/Atom/RHI/Vulkan/CMakeLists.txt | 4 + Gems/Atom/RHI/Vulkan/Code/CMakeLists.txt | 4 +- Gems/Atom/RHI/Vulkan/gem.json | 2 + Gems/Atom/RHI/gem.json | 7 + Gems/Atom/RPI/CMakeLists.txt | 4 + Gems/Atom/RPI/Code/CMakeLists.txt | 6 +- Gems/Atom/RPI/gem.json | 4 +- .../Tools/AtomToolsFramework/CMakeLists.txt | 4 + .../AtomToolsFramework/Code/CMakeLists.txt | 2 +- Gems/Atom/Tools/AtomToolsFramework/gem.json | 2 + Gems/Atom/Tools/CMakeLists.txt | 2 - Gems/Atom/Tools/MaterialEditor/CMakeLists.txt | 4 + .../Tools/MaterialEditor/Code/CMakeLists.txt | 2 +- Gems/Atom/Tools/MaterialEditor/gem.json | 2 + .../Code/CMakeLists.txt | 2 +- Gems/Atom/Utils/Code/CMakeLists.txt | 5 +- Gems/Atom/gem.json | 12 + Gems/AtomContent/CMakeLists.txt | 2 - Gems/AtomContent/ReferenceMaterials/gem.json | 10 +- Gems/AtomContent/Sponza/gem.json | 5 +- Gems/AtomContent/gem.json | 9 +- .../AtomBridge/CMakeLists.txt | 4 + .../AtomBridge/Code/CMakeLists.txt | 2 +- Gems/AtomLyIntegration/AtomBridge/gem.json | 2 + .../AtomLyIntegration/AtomFont/CMakeLists.txt | 4 + .../AtomFont/Code/CMakeLists.txt | 2 +- Gems/AtomLyIntegration/AtomFont/gem.json | 2 + .../AtomLyIntegration/AtomImGuiTools/gem.json | 2 + .../AtomViewportDisplayIcons/gem.json | 2 + .../AtomViewportDisplayInfo/gem.json | 2 + Gems/AtomLyIntegration/CMakeLists.txt | 9 - .../CommonFeatures/CMakeLists.txt | 4 + .../CommonFeatures/Code/CMakeLists.txt | 4 +- .../AtomLyIntegration/CommonFeatures/gem.json | 2 + Gems/AtomLyIntegration/EMotionFXAtom/gem.json | 2 + Gems/AtomLyIntegration/ImguiAtom/gem.json | 2 + .../TechnicalArt/CMakeLists.txt | 9 - .../DccScriptingInterface/CMakeLists.txt | 1 - .../DccScriptingInterface/gem.json | 4 +- Gems/AtomLyIntegration/gem.json | 12 + Gems/AtomTressFX/gem.json | 5 +- Gems/AudioEngineWwise/CMakeLists.txt | 4 + Gems/AudioEngineWwise/Code/CMakeLists.txt | 4 +- Gems/AudioEngineWwise/gem.json | 1 + Gems/AudioSystem/CMakeLists.txt | 4 + Gems/AudioSystem/Code/CMakeLists.txt | 4 +- Gems/AudioSystem/gem.json | 1 + Gems/BarrierInput/gem.json | 2 + Gems/Blast/CMakeLists.txt | 4 + Gems/Blast/Code/CMakeLists.txt | 2 +- Gems/Blast/gem.json | 1 + Gems/Camera/gem.json | 1 + Gems/CameraFramework/gem.json | 1 + Gems/CertificateManager/gem.json | 1 + Gems/CrashReporting/CMakeLists.txt | 4 + Gems/CrashReporting/Code/CMakeLists.txt | 2 +- Gems/CrashReporting/gem.json | 1 + Gems/CustomAssetExample/gem.json | 1 + Gems/DebugDraw/gem.json | 1 + Gems/DevTextures/gem.json | 1 + Gems/EMotionFX/CMakeLists.txt | 4 + Gems/EMotionFX/Code/CMakeLists.txt | 7 +- Gems/EMotionFX/gem.json | 1 + Gems/EditorPythonBindings/gem.json | 1 + Gems/ExpressionEvaluation/gem.json | 1 + Gems/FastNoise/gem.json | 1 + Gems/GameState/gem.json | 1 + Gems/GameStateSamples/CMakeLists.txt | 4 + Gems/GameStateSamples/Code/CMakeLists.txt | 2 +- Gems/GameStateSamples/gem.json | 1 + Gems/Gestures/gem.json | 1 + Gems/GradientSignal/gem.json | 1 + Gems/GraphCanvas/gem.json | 1 + Gems/GraphModel/gem.json | 1 + Gems/HttpRequestor/CMakeLists.txt | 4 + Gems/HttpRequestor/Code/CMakeLists.txt | 2 +- Gems/HttpRequestor/gem.json | 1 + Gems/ImGui/CMakeLists.txt | 4 + Gems/ImGui/Code/CMakeLists.txt | 2 +- Gems/ImGui/gem.json | 1 + Gems/InAppPurchases/CMakeLists.txt | 4 + Gems/InAppPurchases/Code/CMakeLists.txt | 2 +- Gems/InAppPurchases/gem.json | 1 + Gems/LandscapeCanvas/gem.json | 1 + Gems/LmbrCentral/CMakeLists.txt | 4 + Gems/LmbrCentral/Code/CMakeLists.txt | 4 +- Gems/LmbrCentral/gem.json | 1 + Gems/LocalUser/CMakeLists.txt | 4 + Gems/LocalUser/Code/CMakeLists.txt | 2 +- Gems/LocalUser/gem.json | 1 + Gems/LyShine/CMakeLists.txt | 4 + Gems/LyShine/Code/CMakeLists.txt | 4 +- Gems/LyShine/gem.json | 1 + Gems/LyShineExamples/gem.json | 1 + Gems/Maestro/gem.json | 1 + Gems/MessagePopup/gem.json | 1 + Gems/Metastream/CMakeLists.txt | 4 + Gems/Metastream/Code/CMakeLists.txt | 4 +- Gems/Metastream/gem.json | 1 + Gems/Microphone/CMakeLists.txt | 4 + Gems/Microphone/Code/CMakeLists.txt | 2 +- Gems/Microphone/gem.json | 1 + Gems/Multiplayer/CMakeLists.txt | 4 + Gems/Multiplayer/Code/CMakeLists.txt | 2 + Gems/Multiplayer/gem.json | 2 + Gems/MultiplayerCompression/gem.json | 1 + Gems/NvCloth/CMakeLists.txt | 4 + Gems/NvCloth/Code/CMakeLists.txt | 2 +- Gems/NvCloth/gem.json | 3 +- Gems/PhysX/CMakeLists.txt | 4 + Gems/PhysX/Code/CMakeLists.txt | 2 +- Gems/PhysXDebug/CMakeLists.txt | 4 + Gems/PhysXDebug/Code/CMakeLists.txt | 6 +- Gems/PhysXDebug/gem.json | 1 + Gems/Prefab/PrefabBuilder/gem.json | 1 + Gems/Presence/CMakeLists.txt | 4 + Gems/Presence/Code/CMakeLists.txt | 2 +- Gems/Presence/gem.json | 1 + Gems/PrimitiveAssets/gem.json | 1 + Gems/Profiler/gem.json | 1 + Gems/PythonAssetBuilder/gem.json | 1 + Gems/QtForPython/Code/CMakeLists.txt | 2 +- Gems/QtForPython/gem.json | 1 + Gems/SaveData/CMakeLists.txt | 4 + Gems/SaveData/Code/CMakeLists.txt | 2 +- Gems/SaveData/gem.json | 1 + Gems/SceneLoggingExample/gem.json | 1 + Gems/SceneProcessing/gem.json | 1 + Gems/ScriptCanvas/gem.json | 1 + Gems/ScriptCanvasDeveloper/gem.json | 1 + Gems/ScriptCanvasPhysics/gem.json | 1 + Gems/ScriptCanvasTesting/gem.json | 1 + Gems/ScriptEvents/gem.json | 1 + Gems/ScriptedEntityTweener/gem.json | 1 + Gems/SliceFavorites/gem.json | 5 + Gems/StartingPointCamera/gem.json | 1 + Gems/StartingPointInput/gem.json | 1 + Gems/StartingPointMovement/gem.json | 1 + Gems/SurfaceData/gem.json | 1 + Gems/Terrain/gem.json | 1 + Gems/TestAssetBuilder/gem.json | 1 + Gems/TextureAtlas/gem.json | 1 + Gems/TickBusOrderViewer/gem.json | 1 + Gems/Twitch/CMakeLists.txt | 4 + Gems/Twitch/Code/CMakeLists.txt | 4 +- Gems/Twitch/gem.json | 4 +- Gems/UiBasics/gem.json | 1 + Gems/Vegetation/gem.json | 1 + Gems/VideoPlaybackFramework/gem.json | 1 + Gems/VirtualGamepad/gem.json | 1 + Gems/WhiteBox/CMakeLists.txt | 4 + Gems/WhiteBox/Code/CMakeLists.txt | 4 +- Gems/WhiteBox/gem.json | 1 + Templates/AssetGem/Template/gem.json | 15 +- Templates/AssetGem/template.json | 32 +- Templates/CppToolGem/Template/gem.json | 15 +- Templates/CppToolGem/template.json | 262 ++---- Templates/DefaultGem/Template/CMakeLists.txt | 9 +- .../DefaultGem/Template/Code/CMakeLists.txt | 4 +- Templates/DefaultGem/Template/gem.json | 14 +- Templates/DefaultGem/template.json | 250 ++---- .../DefaultProject/Template/CMakeLists.txt | 1 - .../{Code => Gem}/${NameLower}_files.cmake | 0 .../${NameLower}_shared_files.cmake | 0 .../Template/Gem}/CMakeLists.txt | 11 +- .../Include/${Name}/${Name}Bus.h | 2 +- .../Android/${NameLower}_android_files.cmake | 0 .../${NameLower}_shared_android_files.cmake | 0 .../Platform/Android/PAL_android.cmake | 0 .../Linux/${NameLower}_linux_files.cmake | 0 .../${NameLower}_shared_linux_files.cmake | 0 .../Platform/Linux/PAL_linux.cmake | 0 .../Platform/Mac/${NameLower}_mac_files.cmake | 0 .../Mac/${NameLower}_shared_mac_files.cmake | 0 .../{Code => Gem}/Platform/Mac/PAL_mac.cmake | 0 .../${NameLower}_shared_windows_files.cmake | 0 .../Windows/${NameLower}_windows_files.cmake | 0 .../Platform/Windows/PAL_windows.cmake | 0 .../Platform/iOS/${NameLower}_ios_files.cmake | 0 .../iOS/${NameLower}_shared_ios_files.cmake | 0 .../{Code => Gem}/Platform/iOS/PAL_ios.cmake | 0 .../{Code => Gem}/Source/${Name}Module.cpp | 0 .../Source/${Name}SystemComponent.cpp | 2 +- .../Source/${Name}SystemComponent.h | 0 .../Template/{Code => Gem}/enabled_gems.cmake | 0 .../DefaultProject/Template/Gem/gem.json | 21 + .../DefaultProject/Template/project.json | 7 +- Templates/DefaultProject/template.json | 542 ++++-------- Templates/GemRepo/Template/gem.json | 22 +- Templates/GemRepo/template.json | 18 +- .../MinimalProject/Template/CMakeLists.txt | 1 - .../{Code => Gem}/${NameLower}_files.cmake | 0 .../${NameLower}_shared_files.cmake | 0 .../Template/Gem}/CMakeLists.txt | 11 +- .../Include/${Name}/${Name}Bus.h | 0 .../Android/${NameLower}_android_files.cmake | 0 .../${NameLower}_shared_android_files.cmake | 0 .../Platform/Android/PAL_android.cmake | 0 .../Linux/${NameLower}_linux_files.cmake | 0 .../${NameLower}_shared_linux_files.cmake | 0 .../Platform/Linux/PAL_linux.cmake | 0 .../Platform/Mac/${NameLower}_mac_files.cmake | 0 .../Mac/${NameLower}_shared_mac_files.cmake | 0 .../{Code => Gem}/Platform/Mac/PAL_mac.cmake | 0 .../${NameLower}_shared_windows_files.cmake | 0 .../Windows/${NameLower}_windows_files.cmake | 0 .../Platform/Windows/PAL_windows.cmake | 0 .../Platform/iOS/${NameLower}_ios_files.cmake | 0 .../iOS/${NameLower}_shared_ios_files.cmake | 0 .../{Code => Gem}/Platform/iOS/PAL_ios.cmake | 0 .../{Code => Gem}/Source/${Name}Module.cpp | 0 .../Source/${Name}SystemComponent.cpp | 0 .../Source/${Name}SystemComponent.h | 0 .../Template/{Code => Gem}/enabled_gems.cmake | 0 .../MinimalProject/Template/Gem/gem.json | 21 + .../Template/cmake/CompilerSettings.cmake | 4 +- .../Linux/CompilerSettings_linux.cmake | 4 +- .../MinimalProject/Template/project.json | 6 +- Templates/MinimalProject/template.json | 523 ++++------- Templates/PythonToolGem/Template/gem.json | 6 +- Templates/PythonToolGem/template.json | 162 ++-- cmake/3rdParty.cmake | 6 +- cmake/3rdParty/BuiltInPackages.cmake | 4 +- cmake/3rdPartyPackages.cmake | 3 +- cmake/Configurations.cmake | 2 +- cmake/FileUtil.cmake | 21 +- cmake/Install.cmake | 4 +- cmake/LYTestWrappers.cmake | 2 +- cmake/LYWrappers.cmake | 2 +- cmake/PAL.cmake | 323 +++++-- cmake/PALTools.cmake | 4 +- cmake/Packaging.cmake | 2 +- cmake/Projects.cmake | 22 +- cmake/RuntimeDependencies.cmake | 2 +- engine.json | 2 +- scripts/o3de/CMakeLists.txt | 2 +- scripts/o3de/o3de/disable_gem.py | 6 - scripts/o3de/o3de/download.py | 5 - scripts/o3de/o3de/enable_gem.py | 6 - scripts/o3de/o3de/engine_template.py | 831 ++++++++++-------- scripts/o3de/o3de/get_registration.py | 6 - scripts/o3de/o3de/manifest.py | 471 +++++----- scripts/o3de/o3de/print_registration.py | 135 +-- scripts/o3de/o3de/register.py | 7 +- scripts/o3de/tests/unit_test_enable_gem.py | 11 +- .../o3de/tests/unit_test_engine_template.py | 56 +- .../o3de/tests/unit_test_gem_properties.py | 9 +- scripts/o3de/tests/unit_test_manifest.py | 64 +- .../tests/unit_test_print_registration.py | 19 +- 324 files changed, 2357 insertions(+), 2434 deletions(-) delete mode 100644 Gems/Atom/Asset/CMakeLists.txt delete mode 100644 Gems/Atom/Component/CMakeLists.txt delete mode 100644 Gems/Atom/Feature/CMakeLists.txt delete mode 100644 Gems/AtomLyIntegration/TechnicalArt/CMakeLists.txt rename Templates/DefaultProject/Template/{Code => Gem}/${NameLower}_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/${NameLower}_shared_files.cmake (100%) rename Templates/{MinimalProject/Template/Code => DefaultProject/Template/Gem}/CMakeLists.txt (87%) rename Templates/DefaultProject/Template/{Code => Gem}/Include/${Name}/${Name}Bus.h (99%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Android/${NameLower}_android_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Android/${NameLower}_shared_android_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Android/PAL_android.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Linux/${NameLower}_linux_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Linux/${NameLower}_shared_linux_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Linux/PAL_linux.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Mac/${NameLower}_mac_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Mac/${NameLower}_shared_mac_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Mac/PAL_mac.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Windows/${NameLower}_shared_windows_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Windows/${NameLower}_windows_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Windows/PAL_windows.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/iOS/${NameLower}_ios_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/iOS/${NameLower}_shared_ios_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/iOS/PAL_ios.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Source/${Name}Module.cpp (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Source/${Name}SystemComponent.cpp (99%) rename Templates/DefaultProject/Template/{Code => Gem}/Source/${Name}SystemComponent.h (100%) rename Templates/DefaultProject/Template/{Code => Gem}/enabled_gems.cmake (100%) create mode 100644 Templates/DefaultProject/Template/Gem/gem.json rename Templates/MinimalProject/Template/{Code => Gem}/${NameLower}_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/${NameLower}_shared_files.cmake (100%) rename Templates/{DefaultProject/Template/Code => MinimalProject/Template/Gem}/CMakeLists.txt (87%) rename Templates/MinimalProject/Template/{Code => Gem}/Include/${Name}/${Name}Bus.h (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Android/${NameLower}_android_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Android/${NameLower}_shared_android_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Android/PAL_android.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Linux/${NameLower}_linux_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Linux/${NameLower}_shared_linux_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Linux/PAL_linux.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Mac/${NameLower}_mac_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Mac/${NameLower}_shared_mac_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Mac/PAL_mac.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Windows/${NameLower}_shared_windows_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Windows/${NameLower}_windows_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Windows/PAL_windows.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/iOS/${NameLower}_ios_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/iOS/${NameLower}_shared_ios_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/iOS/PAL_ios.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Source/${Name}Module.cpp (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Source/${Name}SystemComponent.cpp (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Source/${Name}SystemComponent.h (100%) rename Templates/MinimalProject/Template/{Code => Gem}/enabled_gems.cmake (100%) create mode 100644 Templates/MinimalProject/Template/Gem/gem.json diff --git a/AutomatedTesting/CMakeLists.txt b/AutomatedTesting/CMakeLists.txt index 1c5382ba4b..9621c0accb 100644 --- a/AutomatedTesting/CMakeLists.txt +++ b/AutomatedTesting/CMakeLists.txt @@ -27,5 +27,4 @@ else() set_property(GLOBAL APPEND PROPERTY LY_PROJECTS_TARGET_NAME ${project_target_name}) - add_subdirectory(Gem) endif() \ No newline at end of file diff --git a/AutomatedTesting/Gem/CMakeLists.txt b/AutomatedTesting/Gem/CMakeLists.txt index 7a411544ec..e3d8a4087a 100644 --- a/AutomatedTesting/Gem/CMakeLists.txt +++ b/AutomatedTesting/Gem/CMakeLists.txt @@ -6,6 +6,9 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) -add_subdirectory(PythonTests) -add_subdirectory(PythonCoverage) +add_subdirectory(PythonTests) \ No newline at end of file diff --git a/AutomatedTesting/Gem/Code/CMakeLists.txt b/AutomatedTesting/Gem/Code/CMakeLists.txt index 8808507765..1a88d6e69a 100644 --- a/AutomatedTesting/Gem/Code/CMakeLists.txt +++ b/AutomatedTesting/Gem/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME AutomatedTesting ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} diff --git a/AutomatedTesting/Gem/PythonCoverage/CMakeLists.txt b/AutomatedTesting/Gem/PythonCoverage/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/AutomatedTesting/Gem/PythonCoverage/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonCoverage/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/CMakeLists.txt b/AutomatedTesting/Gem/PythonCoverage/Code/CMakeLists.txt index a865ccc49f..ea6db88c1c 100644 --- a/AutomatedTesting/Gem/PythonCoverage/Code/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonCoverage/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${o3de_gem_restricted_path} ${o3de_gem_path} ${o3de_gem_name}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) if(PAL_TRAIT_PYTHONCOVERAGE_SUPPORTED) diff --git a/AutomatedTesting/Gem/PythonCoverage/gem.json b/AutomatedTesting/Gem/PythonCoverage/gem.json index b99ce0daad..681696d78e 100644 --- a/AutomatedTesting/Gem/PythonCoverage/gem.json +++ b/AutomatedTesting/Gem/PythonCoverage/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "A tool for generating gem coverage for Python tests.", "canonical_tags": [ @@ -13,5 +14,8 @@ "PythonCoverage" ], "icon_path": "preview.png", - "requirements": "" + "requirements": "", + "documentation_url": "", + "dependencies": [ + ] } diff --git a/AutomatedTesting/Gem/PythonTests/Blast/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/Blast/CMakeLists.txt index aea2562e0b..64effb5b4c 100644 --- a/AutomatedTesting/Gem/PythonTests/Blast/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/Blast/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # for PAL_TRAIT_BLAST Traits diff --git a/AutomatedTesting/Gem/PythonTests/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/CMakeLists.txt index 800f347359..26c03e78c2 100644 --- a/AutomatedTesting/Gem/PythonTests/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/CMakeLists.txt @@ -10,7 +10,7 @@ # Automated Tests ################################################################################ -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_dir}/PAL_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/AutomatedTesting/Gem/PythonTests/WhiteBox/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/WhiteBox/CMakeLists.txt index 733e8edf29..d4554ee84b 100644 --- a/AutomatedTesting/Gem/PythonTests/WhiteBox/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/WhiteBox/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # for PAL_TRAIT_WHITEBOX Traits diff --git a/AutomatedTesting/Gem/Sponza/gem.json b/AutomatedTesting/Gem/Sponza/gem.json index 68749cd5f4..f36b22a805 100644 --- a/AutomatedTesting/Gem/Sponza/gem.json +++ b/AutomatedTesting/Gem/Sponza/gem.json @@ -4,14 +4,19 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "A standard test scene for Global Illumination (forked from crytek sponza scene)", "canonical_tags": [ - "Gem" + "Gem", + "Asset" ], "user_tags": [ - "Assets" + "Sponza" ], + "icon_path": "preview.png", "requirements": "", - "dependencies": [] + "documentation_url": "", + "dependencies": [ + ] } diff --git a/AutomatedTesting/Gem/gem.json b/AutomatedTesting/Gem/gem.json index df197df09d..90a0c8cb01 100644 --- a/AutomatedTesting/Gem/gem.json +++ b/AutomatedTesting/Gem/gem.json @@ -3,13 +3,21 @@ "display_name": "AutomatedTesting", "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", - "origin": "Amazon Web Services, Inc.", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "Project Gem for customizing the AutomatedTesting project functionality.", "canonical_tags": [ "Gem" ], - "user_tags": [], + "user_tags": [ + "AutomatedTesting" + ], "icon_path": "preview.png", - "requirements": "" + "requirements": "", + "documentation_url": "", + "dependencies": [], + "external_subdirectories": [ + "PythonCoverage" + ] } diff --git a/AutomatedTesting/project.json b/AutomatedTesting/project.json index fc14645d2b..5a4b303570 100644 --- a/AutomatedTesting/project.json +++ b/AutomatedTesting/project.json @@ -5,12 +5,15 @@ "modules": [], "project_id": "{D816AFAE-4BB7-4FEF-88F4-E2B786DCF29D}", "android_settings": { - "package_name": "com.lumberyard.yourgame", + "package_name": "org.o3de.automatedtesting", "version_number": 1, "version_name": "1.0.0", "orientation": "landscape" }, "engine": "o3de", "display_name": "AutomatedTesting", - "icon_path": "preview.png" -} + "icon_path": "preview.png", + "external_subdirectories": [ + "Gem" + ] +} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index f61a9561e8..c81581fe0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,21 +49,56 @@ include(cmake/O3DEJson.cmake) # Subdirectory processing ################################################################################ +# this function is building up the LY_EXTERNAL_SUBDIRS global property +function(add_engine_gem_json_external_subdirectories gem_path) + set(gem_json_path ${gem_path}/gem.json) + if(EXISTS ${gem_json_path}) + read_json_external_subdirs(gem_external_subdirs ${gem_path}/gem.json) + foreach(gem_external_subdir ${gem_external_subdirs}) + file(REAL_PATH ${gem_external_subdir} real_external_subdir BASE_DIRECTORY ${gem_path}) + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${real_external_subdir}) + add_engine_gem_json_external_subdirectories(${real_external_subdir}) + endforeach() + endif() +endfunction() + function(add_engine_json_external_subdirectories) - read_json_external_subdirs(external_subdis ${LY_ROOT_FOLDER}/engine.json) - foreach(external_subdir ${external_subdis}) - file(REAL_PATH ${external_subdir} real_external_subdir BASE_DIRECTORY ${LY_ROOT_FOLDER}) - list(APPEND engine_external_subdirs ${real_external_subdir}) + read_json_external_subdirs(engine_external_subdirs ${LY_ROOT_FOLDER}/engine.json) + foreach(engine_external_subdir ${engine_external_subdirs}) + file(REAL_PATH ${engine_external_subdir} real_external_subdir BASE_DIRECTORY ${LY_ROOT_FOLDER}) + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${real_external_subdir}) + add_engine_gem_json_external_subdirectories(${real_external_subdir}) endforeach() +endfunction() - set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${engine_external_subdirs}) +function(add_subdirectory_on_externalsubdirs) + get_property(external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) + list(APPEND LY_EXTERNAL_SUBDIRS ${external_subdirs}) + # Loop over the additional external subdirectories and invoke add_subdirectory on them + foreach(external_directory ${LY_EXTERNAL_SUBDIRS}) + # Hash the external_directory name and append it to the Binary Directory section of add_subdirectory + # This is to deal with potential situations where multiple external directories has the same last directory name + # For example if D:/Company1/RayTracingGem and F:/Company2/Path/RayTracingGem were both added as a subdirectory + file(REAL_PATH ${external_directory} full_directory_path) + string(SHA256 full_directory_hash ${full_directory_path}) + # Truncate the full_directory_hash down to 8 characters to avoid hitting the Windows 260 character path limit + # when the external subdirectory contains relative paths of significant length + string(SUBSTRING ${full_directory_hash} 0 8 full_directory_hash) + # Use the last directory as the suffix path to use for the Binary Directory + get_filename_component(directory_name ${external_directory} NAME) + add_subdirectory(${external_directory} ${CMAKE_BINARY_DIR}/External/${directory_name}-${full_directory_hash}) + endforeach() endfunction() # Add the projects first so the Launcher can find them include(cmake/Projects.cmake) if(NOT INSTALLED_ENGINE) - + # Add external subdirectories listed in the engine.json. LY_EXTERNAL_SUBDIRS is a cache variable so the user can add extra + # external subdirectories. This should go before adding the rest of the targets so the targets are availbe to the launcher. + add_engine_json_external_subdirectories() + add_subdirectory_on_externalsubdirs() + # Add the rest of the targets add_subdirectory(Assets) add_subdirectory(Code) @@ -73,31 +108,11 @@ if(NOT INSTALLED_ENGINE) add_subdirectory(Templates) add_subdirectory(Tools) - # Add external subdirectories listed in the engine.json. LY_EXTERNAL_SUBDIRS is a cache variable so the user can add extra - # external subdirectories - add_engine_json_external_subdirectories() else() ly_find_o3de_packages() + add_subdirectory_on_externalsubdirs() endif() -get_property(external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) -list(APPEND LY_EXTERNAL_SUBDIRS ${external_subdirs}) - -# Loop over the additional external subdirectories and invoke add_subdirectory on them -foreach(external_directory ${LY_EXTERNAL_SUBDIRS}) - # Hash the extenal_directory name and append it to the Binary Directory section of add_subdirectory - # This is to deal with potential situations where multiple external directories has the same last directory name - # For example if D:/Company1/RayTracingGem and F:/Company2/Path/RayTracingGem were both added as a subdirectory - file(REAL_PATH ${external_directory} full_directory_path) - string(SHA256 full_directory_hash ${full_directory_path}) - # Truncate the full_directory_hash down to 8 characters to avoid hitting the Windows 260 character path limit - # when the external subdirectory contains relative paths of significant length - string(SUBSTRING ${full_directory_hash} 0 8 full_directory_hash) - # Use the last directory as the suffix path to use for the Binary Directory - get_filename_component(directory_name ${external_directory} NAME) - add_subdirectory(${external_directory} ${CMAKE_BINARY_DIR}/External/${directory_name}-${full_directory_hash}) -endforeach() - ################################################################################ # Post-processing ################################################################################ diff --git a/Code/Editor/CMakeLists.txt b/Code/Editor/CMakeLists.txt index 3358b49dce..9d74f8e3a2 100644 --- a/Code/Editor/CMakeLists.txt +++ b/Code/Editor/CMakeLists.txt @@ -63,7 +63,7 @@ ly_add_target( set(pal_cmake_files "") foreach(enabled_platform ${LY_PAL_TOOLS_ENABLED}) string(TOLOWER ${enabled_platform} enabled_platform_lowercase) - ly_get_list_relative_pal_filename(pal_cmake_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${enabled_platform}) + o3de_pal_dir(pal_cmake_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${enabled_platform} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) list(APPEND pal_cmake_files ${pal_cmake_dir}/editor_lib_${enabled_platform_lowercase}_files.cmake) endforeach() diff --git a/Code/Framework/AzCore/CMakeLists.txt b/Code/Framework/AzCore/CMakeLists.txt index 838142f0df..01f4086a18 100644 --- a/Code/Framework/AzCore/CMakeLists.txt +++ b/Code/Framework/AzCore/CMakeLists.txt @@ -9,8 +9,8 @@ # TODO: would like to be able to build from this path, however, the whole setup is done at the workspace's root # we also dont want to drop cmake output files everywhere. -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) +set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) if(PAL_TRAIT_PROF_PIX_SUPPORTED) set(LY_PIX_ENABLED OFF CACHE BOOL "Enables PIX profiler integration.") @@ -110,15 +110,15 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzTest ) - ly_get_list_relative_pal_filename(pal_test_dir ${CMAKE_CURRENT_LIST_DIR}/Tests/Platform/${PAL_PLATFORM_NAME}) + o3de_pal_dir(pal_tests_dir ${CMAKE_CURRENT_LIST_DIR}/Tests/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME AzCore.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE AZ FILES_CMAKE Tests/azcoretests_files.cmake - ${pal_test_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake + ${pal_tests_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake PLATFORM_INCLUDE_FILES - ${pal_test_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake + ${pal_tests_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake INCLUDE_DIRECTORIES PRIVATE Tests diff --git a/Code/Framework/AzFramework/CMakeLists.txt b/Code/Framework/AzFramework/CMakeLists.txt index 9f30d23a19..bd7af2724e 100644 --- a/Code/Framework/AzFramework/CMakeLists.txt +++ b/Code/Framework/AzFramework/CMakeLists.txt @@ -8,8 +8,8 @@ include(AzFramework/feature_options.cmake) -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) +set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) ly_add_target( NAME AzFramework STATIC @@ -44,7 +44,7 @@ ly_add_source_properties( if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) - ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Tests/Platform/${PAL_PLATFORM_NAME}) + o3de_pal_dir(test_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Tests/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME AzFrameworkTestShared STATIC @@ -86,11 +86,11 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) NAMESPACE AZ FILES_CMAKE Tests/frameworktests_files.cmake - ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake + ${test_pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake INCLUDE_DIRECTORIES PRIVATE Tests - ${pal_dir} + ${test_pal_dir} BUILD_DEPENDENCIES PRIVATE AZ::AzFramework @@ -104,7 +104,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) NAME AZ::AzFramework.Tests ) - include(${pal_dir}/platform_specific_test_targets.cmake) + include(${test_pal_dir}/platform_specific_test_targets.cmake) endif() diff --git a/Code/Framework/AzNetworking/CMakeLists.txt b/Code/Framework/AzNetworking/CMakeLists.txt index a0a3871201..ba2eecd023 100644 --- a/Code/Framework/AzNetworking/CMakeLists.txt +++ b/Code/Framework/AzNetworking/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) +set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) ly_add_target( NAME AzNetworking STATIC diff --git a/Code/Framework/AzQtComponents/CMakeLists.txt b/Code/Framework/AzQtComponents/CMakeLists.txt index a24b68bcd7..76850e196b 100644 --- a/Code/Framework/AzQtComponents/CMakeLists.txt +++ b/Code/Framework/AzQtComponents/CMakeLists.txt @@ -10,7 +10,7 @@ if(NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME AzQtComponents SHARED diff --git a/Code/Framework/AzTest/CMakeLists.txt b/Code/Framework/AzTest/CMakeLists.txt index 95e444a1e9..2edc80f893 100644 --- a/Code/Framework/AzTest/CMakeLists.txt +++ b/Code/Framework/AzTest/CMakeLists.txt @@ -7,18 +7,18 @@ # if(NOT LY_MONOLITHIC_GAME) - ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/AzTest/Platform/${PAL_PLATFORM_NAME}) + o3de_pal_dir(pal_aztest_dir ${CMAKE_CURRENT_LIST_DIR}/AzTest/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME AzTest STATIC NAMESPACE AZ FILES_CMAKE AzTest/aztest_files.cmake - ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake + ${pal_aztest_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake INCLUDE_DIRECTORIES PUBLIC . - ${pal_dir} + ${pal_aztest_dir} BUILD_DEPENDENCIES PUBLIC 3rdParty::googletest::GMock @@ -26,6 +26,6 @@ if(NOT LY_MONOLITHIC_GAME) 3rdParty::GoogleBenchmark AZ::AzCore PLATFORM_INCLUDE_FILES - ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake + ${pal_aztest_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake ) endif() diff --git a/Code/Framework/GridMate/CMakeLists.txt b/Code/Framework/GridMate/CMakeLists.txt index 0da878081d..07c2f8b4a8 100644 --- a/Code/Framework/GridMate/CMakeLists.txt +++ b/Code/Framework/GridMate/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) +set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) ly_add_target( NAME GridMate STATIC @@ -41,7 +41,7 @@ ly_add_source_properties( ################################################################################ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) - ly_get_list_relative_pal_filename(pal_test_dir ${CMAKE_CURRENT_LIST_DIR}/Tests/Platform/${PAL_PLATFORM_NAME}) + o3de_pal_dir(pal_test_dir ${CMAKE_CURRENT_LIST_DIR}/Tests/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME GridMate.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE AZ diff --git a/Code/LauncherUnified/CMakeLists.txt b/Code/LauncherUnified/CMakeLists.txt index 845c2cd6c7..8097570462 100644 --- a/Code/LauncherUnified/CMakeLists.txt +++ b/Code/LauncherUnified/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/LauncherUnified_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/Code/LauncherUnified/launcher_generator.cmake b/Code/LauncherUnified/launcher_generator.cmake index 550a67bc49..70bcf776af 100644 --- a/Code/LauncherUnified/launcher_generator.cmake +++ b/Code/LauncherUnified/launcher_generator.cmake @@ -201,7 +201,7 @@ function(ly_delayed_generate_static_modules_inl) foreach(game_gem_dependency ${all_game_gem_dependencies}) # Sometimes, a gem's Client variant may be an interface library - # which dependes on multiple gem targets. The interface libraries + # which depends on multiple gem targets. The interface libraries # should be skipped; the real dependencies of the interface will be processed if(TARGET ${game_gem_dependency}) get_target_property(target_type ${game_gem_dependency} TYPE) diff --git a/Code/Legacy/CryCommon/CMakeLists.txt b/Code/Legacy/CryCommon/CMakeLists.txt index 1556c6a099..629f26d217 100644 --- a/Code/Legacy/CryCommon/CMakeLists.txt +++ b/Code/Legacy/CryCommon/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME CryCommon STATIC diff --git a/Code/Legacy/CrySystem/CMakeLists.txt b/Code/Legacy/CrySystem/CMakeLists.txt index ebfc866f4a..3153205b69 100644 --- a/Code/Legacy/CrySystem/CMakeLists.txt +++ b/Code/Legacy/CrySystem/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) add_subdirectory(XML) diff --git a/Code/Tools/AWSNativeSDKInit/CMakeLists.txt b/Code/Tools/AWSNativeSDKInit/CMakeLists.txt index 57ee31d30d..04f61eb924 100644 --- a/Code/Tools/AWSNativeSDKInit/CMakeLists.txt +++ b/Code/Tools/AWSNativeSDKInit/CMakeLists.txt @@ -6,14 +6,14 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/source/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME AWSNativeSDKInit STATIC NAMESPACE AZ FILES_CMAKE aws_native_sdk_init_files.cmake - ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake + ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake INCLUDE_DIRECTORIES PUBLIC include diff --git a/Code/Tools/AssetProcessor/AssetBuilderSDK/CMakeLists.txt b/Code/Tools/AssetProcessor/AssetBuilderSDK/CMakeLists.txt index bfbcc35663..f32d55844e 100644 --- a/Code/Tools/AssetProcessor/AssetBuilderSDK/CMakeLists.txt +++ b/Code/Tools/AssetProcessor/AssetBuilderSDK/CMakeLists.txt @@ -11,7 +11,7 @@ ly_get_pal_tool_dirs(pal_tool_dirs ${CMAKE_CURRENT_LIST_DIR}/AssetBuilderSDK/Pla set(pal_files "") foreach(enabled_platform ${LY_PAL_TOOLS_ENABLED}) string(TOLOWER ${enabled_platform} enabled_platform_lowercase) - ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/AssetBuilderSDK/Platform/${enabled_platform}) + o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/AssetBuilderSDK/Platform/${enabled_platform} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) list(APPEND pal_files ${pal_dir}/assetbuildersdk_${enabled_platform_lowercase}_files.cmake) endforeach() diff --git a/Code/Tools/AzTestRunner/CMakeLists.txt b/Code/Tools/AzTestRunner/CMakeLists.txt index 5f3bb829a8..2bd74fa1a1 100644 --- a/Code/Tools/AzTestRunner/CMakeLists.txt +++ b/Code/Tools/AzTestRunner/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/platform_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/Code/Tools/CrashHandler/CMakeLists.txt b/Code/Tools/CrashHandler/CMakeLists.txt index 259a7d2891..db50741326 100644 --- a/Code/Tools/CrashHandler/CMakeLists.txt +++ b/Code/Tools/CrashHandler/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/Code/Tools/LuaIDE/CMakeLists.txt b/Code/Tools/LuaIDE/CMakeLists.txt index 98c8d7f04b..58e0fe505a 100644 --- a/Code/Tools/LuaIDE/CMakeLists.txt +++ b/Code/Tools/LuaIDE/CMakeLists.txt @@ -10,6 +10,8 @@ if(NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) + ly_add_target( NAME LuaIDE APPLICATION NAMESPACE AZ @@ -18,7 +20,7 @@ ly_add_target( AUTORCC FILES_CMAKE lua_ide_files.cmake - Platform/${PAL_PLATFORM_NAME}/lua_ide_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake + ${pal_dir}/lua_ide_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake INCLUDE_DIRECTORIES PRIVATE . diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.cpp b/Code/Tools/ProjectManager/Source/PythonBindings.cpp index 35bdfe0031..7c436a3a70 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.cpp +++ b/Code/Tools/ProjectManager/Source/PythonBindings.cpp @@ -1221,7 +1221,7 @@ namespace O3DE::ProjectManager auto result = ExecuteWithLockErrorHandling( [&] { - for (auto repoUri : m_manifest.attr("get_repos")()) + for (auto repoUri : m_manifest.attr("get_manifest_repos")()) { gemRepos.push_back(GetGemRepoInfo(repoUri)); } diff --git a/Code/Tools/RemoteConsole/CMakeLists.txt b/Code/Tools/RemoteConsole/CMakeLists.txt index d2685b2aea..b9a08650b6 100644 --- a/Code/Tools/RemoteConsole/CMakeLists.txt +++ b/Code/Tools/RemoteConsole/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME RemoteConsoleCore STATIC diff --git a/Code/Tools/SceneAPI/SceneData/CMakeLists.txt b/Code/Tools/SceneAPI/SceneData/CMakeLists.txt index 5507ada2b9..0d4ef4a5df 100644 --- a/Code/Tools/SceneAPI/SceneData/CMakeLists.txt +++ b/Code/Tools/SceneAPI/SceneData/CMakeLists.txt @@ -10,7 +10,7 @@ if (NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME SceneData SHARED diff --git a/Code/Tools/TestImpactFramework/CMakeLists.txt b/Code/Tools/TestImpactFramework/CMakeLists.txt index 1cdf02d101..15d93b1a70 100644 --- a/Code/Tools/TestImpactFramework/CMakeLists.txt +++ b/Code/Tools/TestImpactFramework/CMakeLists.txt @@ -6,9 +6,9 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) -include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) +include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) if(PAL_TRAIT_TEST_IMPACT_FRAMEWORK_SUPPORTED) add_subdirectory(Runtime) diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/CMakeLists.txt b/Code/Tools/TestImpactFramework/Runtime/Code/CMakeLists.txt index 0b8432642a..f3262a26af 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/CMakeLists.txt +++ b/Code/Tools/TestImpactFramework/Runtime/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) +set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) ly_add_target( NAME TestImpact.Runtime.Static STATIC diff --git a/Gems/AWSClientAuth/CMakeLists.txt b/Gems/AWSClientAuth/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/AWSClientAuth/CMakeLists.txt +++ b/Gems/AWSClientAuth/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/AWSClientAuth/Code/CMakeLists.txt b/Gems/AWSClientAuth/Code/CMakeLists.txt index 1f0c119f5a..ac9d221f07 100644 --- a/Gems/AWSClientAuth/Code/CMakeLists.txt +++ b/Gems/AWSClientAuth/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME AWSClientAuth.Static STATIC diff --git a/Gems/AWSClientAuth/gem.json b/Gems/AWSClientAuth/gem.json index 9c7188f103..d6729cee99 100644 --- a/Gems/AWSClientAuth/gem.json +++ b/Gems/AWSClientAuth/gem.json @@ -3,7 +3,8 @@ "display_name": "AWS Client Authorization", "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", - "origin": "Amazon Web Services, Inc.", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "AWS Client Auth provides client authentication and AWS authorization solution.", "canonical_tags": [ @@ -15,6 +16,7 @@ "SDK" ], "icon_path": "preview.png", + "requirements": "", "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/aws/aws-client-auth/", "dependencies": [ "AWSCore", diff --git a/Gems/AWSCore/CMakeLists.txt b/Gems/AWSCore/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/AWSCore/CMakeLists.txt +++ b/Gems/AWSCore/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/AWSCore/Code/CMakeLists.txt b/Gems/AWSCore/Code/CMakeLists.txt index 877696e26c..3911aefce6 100644 --- a/Gems/AWSCore/Code/CMakeLists.txt +++ b/Gems/AWSCore/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME AWSCore.Static STATIC @@ -61,7 +61,7 @@ ly_create_alias( if (PAL_TRAIT_BUILD_HOST_TOOLS) - include(${CMAKE_CURRENT_SOURCE_DIR}/Platform/${PAL_PLATFORM_NAME}/PAL_traits_editor_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) + include(${pal_dir}/PAL_traits_editor_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) ly_add_target( NAME AWSCore.Editor.Static STATIC diff --git a/Gems/AWSCore/gem.json b/Gems/AWSCore/gem.json index 3bced07e8d..3bc8e6f77c 100644 --- a/Gems/AWSCore/gem.json +++ b/Gems/AWSCore/gem.json @@ -3,7 +3,8 @@ "display_name": "AWS Core", "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", - "origin": "Amazon Web Services, Inc.", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The AWS Core Gem provides basic shared AWS functionality such as AWS SDK initialization and client configuration, and is automatically added when selecting any AWS feature Gem.", "canonical_tags": [ @@ -15,5 +16,8 @@ "SDK" ], "icon_path": "preview.png", - "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/aws/aws-core/" + "requirements": "", + "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/aws/aws-core/", + "dependencies": [ + ] } diff --git a/Gems/AWSGameLift/gem.json b/Gems/AWSGameLift/gem.json index 1ac65c4526..e1b80cb9fe 100644 --- a/Gems/AWSGameLift/gem.json +++ b/Gems/AWSGameLift/gem.json @@ -3,7 +3,8 @@ "display_name": "AWS GameLift", "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", - "origin": "Amazon Web Services, Inc.", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The AWS GameLift Gem provides a framework to extend O3DE networking layer to work with GameLift resources via GameLift server and client SDK.", "canonical_tags": [ @@ -12,7 +13,7 @@ "user_tags": [ "AWS", "Framework", - "Network", + "Network", "SDK" ], "icon_path": "preview.png", diff --git a/Gems/AWSMetrics/gem.json b/Gems/AWSMetrics/gem.json index 054c3624c4..bd462edec3 100644 --- a/Gems/AWSMetrics/gem.json +++ b/Gems/AWSMetrics/gem.json @@ -3,7 +3,8 @@ "display_name": "AWS Metrics", "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", - "origin": "Amazon Web Services, Inc.", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The AWS Metrics Gem provides a solution for AWS metrics submission and analytics.", "canonical_tags": [ @@ -15,6 +16,7 @@ "SDK" ], "icon_path": "preview.png", + "requirements": "", "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/aws/aws-metrics/", "dependencies": [ "AWSCore" diff --git a/Gems/Achievements/CMakeLists.txt b/Gems/Achievements/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Achievements/CMakeLists.txt +++ b/Gems/Achievements/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Achievements/Code/CMakeLists.txt b/Gems/Achievements/Code/CMakeLists.txt index 2d00ac2fb2..5ac43e9736 100644 --- a/Gems/Achievements/Code/CMakeLists.txt +++ b/Gems/Achievements/Code/CMakeLists.txt @@ -6,16 +6,16 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME Achievements.Static STATIC NAMESPACE Gem PLATFORM_INCLUDE_FILES - ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake + ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake FILES_CMAKE achievements_files.cmake - ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake + ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake INCLUDE_DIRECTORIES PUBLIC Include diff --git a/Gems/Achievements/gem.json b/Gems/Achievements/gem.json index 8180584500..5fc83aefe2 100644 --- a/Gems/Achievements/gem.json +++ b/Gems/Achievements/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Achievements Gem provides a target platform agnostic interface for retrieving achievement details and unlocking achievements.", "canonical_tags": [ diff --git a/Gems/AssetValidation/gem.json b/Gems/AssetValidation/gem.json index 55cdffb9f3..de1d36ffb4 100644 --- a/Gems/AssetValidation/gem.json +++ b/Gems/AssetValidation/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Asset Validation Gem provides seed-related commands to ensure assets have valid seeds for asset bundling.", "canonical_tags": [ diff --git a/Gems/Atom/Asset/CMakeLists.txt b/Gems/Atom/Asset/CMakeLists.txt deleted file mode 100644 index 3ed20148a2..0000000000 --- a/Gems/Atom/Asset/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -add_subdirectory(ImageProcessingAtom) -add_subdirectory(Shader) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/CMakeLists.txt b/Gems/Atom/Asset/ImageProcessingAtom/CMakeLists.txt index 54543a000a..92079d35be 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/CMakeLists.txt +++ b/Gems/Atom/Asset/ImageProcessingAtom/CMakeLists.txt @@ -7,4 +7,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt b/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt index 982ec43715..74876994f6 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt @@ -26,15 +26,15 @@ set(pal_tools_include_dirs) foreach(enabled_platform ${LY_PAL_TOOLS_ENABLED}) string(TOLOWER ${enabled_platform} enabled_platform_lowercase) - ly_get_list_relative_pal_filename(pal_tools_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${enabled_platform}) + o3de_pal_dir(pal_tools_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${enabled_platform} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) list(APPEND pal_tools_include_dirs ${pal_tools_source_dir}) list(APPEND platform_tools_files ${pal_tools_source_dir}/pal_tools_${enabled_platform_lowercase}.cmake) list(APPEND pal_tools_include_files ${pal_tools_source_dir}/pal_tools_${enabled_platform_lowercase}_files.cmake) endforeach() -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) ly_add_target( NAME ImageProcessingAtom.Editor.Static STATIC diff --git a/Gems/Atom/Asset/ImageProcessingAtom/gem.json b/Gems/Atom/Asset/ImageProcessingAtom/gem.json index 4fd437d298..c2af4b7e7e 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/gem.json +++ b/Gems/Atom/Asset/ImageProcessingAtom/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RPI", "Atom_RHI", diff --git a/Gems/Atom/Asset/Shader/CMakeLists.txt b/Gems/Atom/Asset/Shader/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Atom/Asset/Shader/CMakeLists.txt +++ b/Gems/Atom/Asset/Shader/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/Asset/Shader/Code/CMakeLists.txt b/Gems/Atom/Asset/Shader/Code/CMakeLists.txt index ed5aa45bbf..9ebd5e6d2d 100644 --- a/Gems/Atom/Asset/Shader/Code/CMakeLists.txt +++ b/Gems/Atom/Asset/Shader/Code/CMakeLists.txt @@ -10,8 +10,8 @@ if(NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) #for PAL_TRAIT_BUILD_ATOM_ASSET_SHADER_SUPPORTED @@ -71,7 +71,7 @@ ly_add_target( set(builder_tools_include_files) foreach(enabled_platform ${LY_PAL_TOOLS_ENABLED}) string(TOLOWER ${enabled_platform} enabled_platform_lowercase) - ly_get_list_relative_pal_filename(builder_tools_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${enabled_platform}) + o3de_pal_dir(builder_tools_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${enabled_platform} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) list(APPEND builder_tools_include_files ${builder_tools_source_dir}/platform_builders_${enabled_platform_lowercase}.cmake) endforeach() diff --git a/Gems/Atom/Asset/Shader/gem.json b/Gems/Atom/Asset/Shader/gem.json index 9f59c65f78..8b4ba4fb0d 100644 --- a/Gems/Atom/Asset/Shader/gem.json +++ b/Gems/Atom/Asset/Shader/gem.json @@ -4,13 +4,17 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "Atom Shader Builder", "canonical_tags": [ "Gem" ], - "user_tags": [], + "user_tags": [ + "AtomShader" + ], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI", "Atom_RPI" diff --git a/Gems/Atom/Bootstrap/CMakeLists.txt b/Gems/Atom/Bootstrap/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Atom/Bootstrap/CMakeLists.txt +++ b/Gems/Atom/Bootstrap/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/Bootstrap/Code/CMakeLists.txt b/Gems/Atom/Bootstrap/Code/CMakeLists.txt index fd9df96124..0ba8d17865 100644 --- a/Gems/Atom/Bootstrap/Code/CMakeLists.txt +++ b/Gems/Atom/Bootstrap/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME Atom_Bootstrap.Headers HEADERONLY diff --git a/Gems/Atom/Bootstrap/gem.json b/Gems/Atom/Bootstrap/gem.json index df615366da..543efe0f34 100644 --- a/Gems/Atom/Bootstrap/gem.json +++ b/Gems/Atom/Bootstrap/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RPI" ] diff --git a/Gems/Atom/CMakeLists.txt b/Gems/Atom/CMakeLists.txt index a71afa64e0..b5dd311e5a 100644 --- a/Gems/Atom/CMakeLists.txt +++ b/Gems/Atom/CMakeLists.txt @@ -6,12 +6,10 @@ # # -add_subdirectory(Asset) -add_subdirectory(Bootstrap) -add_subdirectory(Component) -add_subdirectory(Feature) -add_subdirectory(RHI) -add_subdirectory(RPI) +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Tools) add_subdirectory(Utils) diff --git a/Gems/Atom/Component/CMakeLists.txt b/Gems/Atom/Component/CMakeLists.txt deleted file mode 100644 index 8b867b8c67..0000000000 --- a/Gems/Atom/Component/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -add_subdirectory(DebugCamera) diff --git a/Gems/Atom/Component/DebugCamera/CMakeLists.txt b/Gems/Atom/Component/DebugCamera/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Atom/Component/DebugCamera/CMakeLists.txt +++ b/Gems/Atom/Component/DebugCamera/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/Component/DebugCamera/gem.json b/Gems/Atom/Component/DebugCamera/gem.json index 8eab74f41d..74d88a21b6 100644 --- a/Gems/Atom/Component/DebugCamera/gem.json +++ b/Gems/Atom/Component/DebugCamera/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RPI" ] diff --git a/Gems/Atom/Feature/CMakeLists.txt b/Gems/Atom/Feature/CMakeLists.txt deleted file mode 100644 index 32d654d5c4..0000000000 --- a/Gems/Atom/Feature/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -add_subdirectory(Common) diff --git a/Gems/Atom/Feature/Common/CMakeLists.txt b/Gems/Atom/Feature/Common/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Atom/Feature/Common/CMakeLists.txt +++ b/Gems/Atom/Feature/Common/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/Feature/Common/Code/CMakeLists.txt b/Gems/Atom/Feature/Common/Code/CMakeLists.txt index db9ac8560f..a832c46539 100644 --- a/Gems/Atom/Feature/Common/Code/CMakeLists.txt +++ b/Gems/Atom/Feature/Common/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) ly_add_target( NAME Atom_Feature_Common.Static STATIC diff --git a/Gems/Atom/Feature/Common/gem.json b/Gems/Atom/Feature/Common/gem.json index 84ab07a9f9..f4c936dc4a 100644 --- a/Gems/Atom/Feature/Common/gem.json +++ b/Gems/Atom/Feature/Common/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RPI", "Atom", diff --git a/Gems/Atom/RHI/CMakeLists.txt b/Gems/Atom/RHI/CMakeLists.txt index 074f6acfd7..5812828c1a 100644 --- a/Gems/Atom/RHI/CMakeLists.txt +++ b/Gems/Atom/RHI/CMakeLists.txt @@ -6,10 +6,10 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + ly_add_external_target_path(${CMAKE_CURRENT_LIST_DIR}/3rdParty) add_subdirectory(Code) -add_subdirectory(DX12) -add_subdirectory(Metal) -add_subdirectory(Vulkan) -add_subdirectory(Null) diff --git a/Gems/Atom/RHI/Code/CMakeLists.txt b/Gems/Atom/RHI/Code/CMakeLists.txt index 5238985feb..fe9db107a8 100644 --- a/Gems/Atom/RHI/Code/CMakeLists.txt +++ b/Gems/Atom/RHI/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_dir}/AtomRHITests_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/Gems/Atom/RHI/DX12/CMakeLists.txt b/Gems/Atom/RHI/DX12/CMakeLists.txt index 51912a5ff0..5812828c1a 100644 --- a/Gems/Atom/RHI/DX12/CMakeLists.txt +++ b/Gems/Atom/RHI/DX12/CMakeLists.txt @@ -6,6 +6,10 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + ly_add_external_target_path(${CMAKE_CURRENT_LIST_DIR}/3rdParty) add_subdirectory(Code) diff --git a/Gems/Atom/RHI/DX12/Code/CMakeLists.txt b/Gems/Atom/RHI/DX12/Code/CMakeLists.txt index 975b838ffa..95118c60a7 100644 --- a/Gems/Atom/RHI/DX12/Code/CMakeLists.txt +++ b/Gems/Atom/RHI/DX12/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_include_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_include_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # PAL_TRAIT_ATOM_RHI_DX12_SUPPORTED @@ -23,7 +23,7 @@ set(pal_builder_tools_files) set(pal_builder_tools_includes) foreach(enabled_platform ${LY_PAL_TOOLS_ENABLED}) string(TOLOWER ${enabled_platform} enabled_platform_lowercase) - ly_get_list_relative_pal_filename(pal_builder_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${enabled_platform}) + o3de_pal_dir(pal_builder_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${enabled_platform} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) list(APPEND pal_builder_tools_includes ${pal_builder_source_dir}) list(APPEND pal_builder_tools_files ${pal_builder_source_dir}/platform_builders_${enabled_platform_lowercase}_tools_files.cmake) endforeach() diff --git a/Gems/Atom/RHI/DX12/gem.json b/Gems/Atom/RHI/DX12/gem.json index 868acd43db..803ae4f4d0 100644 --- a/Gems/Atom/RHI/DX12/gem.json +++ b/Gems/Atom/RHI/DX12/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI" ] diff --git a/Gems/Atom/RHI/Metal/CMakeLists.txt b/Gems/Atom/RHI/Metal/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Atom/RHI/Metal/CMakeLists.txt +++ b/Gems/Atom/RHI/Metal/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/RHI/Metal/Code/CMakeLists.txt b/Gems/Atom/RHI/Metal/Code/CMakeLists.txt index 11876e0a30..3df00a30e0 100644 --- a/Gems/Atom/RHI/Metal/Code/CMakeLists.txt +++ b/Gems/Atom/RHI/Metal/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_include_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_include_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_source_dir}/PAL2_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/Gems/Atom/RHI/Metal/gem.json b/Gems/Atom/RHI/Metal/gem.json index 6e983ba505..0257048bd3 100644 --- a/Gems/Atom/RHI/Metal/gem.json +++ b/Gems/Atom/RHI/Metal/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI" ] diff --git a/Gems/Atom/RHI/Null/CMakeLists.txt b/Gems/Atom/RHI/Null/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Atom/RHI/Null/CMakeLists.txt +++ b/Gems/Atom/RHI/Null/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/RHI/Null/Code/CMakeLists.txt b/Gems/Atom/RHI/Null/Code/CMakeLists.txt index 71df9f696f..081edd4c44 100644 --- a/Gems/Atom/RHI/Null/Code/CMakeLists.txt +++ b/Gems/Atom/RHI/Null/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_include_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_include_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( diff --git a/Gems/Atom/RHI/Null/gem.json b/Gems/Atom/RHI/Null/gem.json index e9f22c5fcb..1ea2eb4cb0 100644 --- a/Gems/Atom/RHI/Null/gem.json +++ b/Gems/Atom/RHI/Null/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI" ] diff --git a/Gems/Atom/RHI/Vulkan/CMakeLists.txt b/Gems/Atom/RHI/Vulkan/CMakeLists.txt index 51912a5ff0..5812828c1a 100644 --- a/Gems/Atom/RHI/Vulkan/CMakeLists.txt +++ b/Gems/Atom/RHI/Vulkan/CMakeLists.txt @@ -6,6 +6,10 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + ly_add_external_target_path(${CMAKE_CURRENT_LIST_DIR}/3rdParty) add_subdirectory(Code) diff --git a/Gems/Atom/RHI/Vulkan/Code/CMakeLists.txt b/Gems/Atom/RHI/Vulkan/Code/CMakeLists.txt index fb13d1fddb..674e5aff9e 100644 --- a/Gems/Atom/RHI/Vulkan/Code/CMakeLists.txt +++ b/Gems/Atom/RHI/Vulkan/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_include_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_include_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # PAL_TRAIT_ATOM_RHI_VULKAN_SUPPORTED / PAL_TRAIT_ATOM_RHI_VULKAN_TARGETS_ALREADY_DEFINED diff --git a/Gems/Atom/RHI/Vulkan/gem.json b/Gems/Atom/RHI/Vulkan/gem.json index 1dfeb9eafa..508ad85c75 100644 --- a/Gems/Atom/RHI/Vulkan/gem.json +++ b/Gems/Atom/RHI/Vulkan/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI" ] diff --git a/Gems/Atom/RHI/gem.json b/Gems/Atom/RHI/gem.json index de46c312ad..858a64fc17 100644 --- a/Gems/Atom/RHI/gem.json +++ b/Gems/Atom/RHI/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,12 @@ ], "user_tags": [], "requirements": "", + "external_subdirectories": [ + "DX12", + "Metal", + "Null", + "Vulkan" + ], "dependencies": [ "Atom_RHI_DX12", "Atom_RHI_Metal", diff --git a/Gems/Atom/RPI/CMakeLists.txt b/Gems/Atom/RPI/CMakeLists.txt index 6d148328ec..2c2cee5804 100644 --- a/Gems/Atom/RPI/CMakeLists.txt +++ b/Gems/Atom/RPI/CMakeLists.txt @@ -6,6 +6,10 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) add_subdirectory(Tools) diff --git a/Gems/Atom/RPI/Code/CMakeLists.txt b/Gems/Atom/RPI/Code/CMakeLists.txt index f0459a23c2..dcdad13c10 100644 --- a/Gems/Atom/RPI/Code/CMakeLists.txt +++ b/Gems/Atom/RPI/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) #for PAL_TRAIT_BUILD_ATOM_RPI_ASSETS_SUPPORTED and PAL_TRAIT_BUILD_ATOM_RPI_MASKED_OCCLUSION_CULLING_SUPPORTED include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) @@ -176,8 +176,8 @@ endif() if(PAL_TRAIT_BUILD_HOST_TOOLS) - ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) - ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) + o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) + set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) if(NOT PAL_TRAIT_BUILD_ATOM_RPI_ASSETS_SUPPORTED) diff --git a/Gems/Atom/RPI/gem.json b/Gems/Atom/RPI/gem.json index 885f150508..0acef5179b 100644 --- a/Gems/Atom/RPI/gem.json +++ b/Gems/Atom/RPI/gem.json @@ -1,16 +1,18 @@ { "gem_name": "Atom_RPI", "display_name": "Atom API", - "summary": "", "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", + "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI" ] diff --git a/Gems/Atom/Tools/AtomToolsFramework/CMakeLists.txt b/Gems/Atom/Tools/AtomToolsFramework/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/CMakeLists.txt +++ b/Gems/Atom/Tools/AtomToolsFramework/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/CMakeLists.txt b/Gems/Atom/Tools/AtomToolsFramework/Code/CMakeLists.txt index e7e8208722..0fc896e88a 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/CMakeLists.txt +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/CMakeLists.txt @@ -10,7 +10,7 @@ if(NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME AtomToolsFramework.Static STATIC diff --git a/Gems/Atom/Tools/AtomToolsFramework/gem.json b/Gems/Atom/Tools/AtomToolsFramework/gem.json index de2a9e06f2..6e5a7b311a 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/gem.json +++ b/Gems/Atom/Tools/AtomToolsFramework/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RPI", "Atom_RHI", diff --git a/Gems/Atom/Tools/CMakeLists.txt b/Gems/Atom/Tools/CMakeLists.txt index 653babd0b3..82a803bdef 100644 --- a/Gems/Atom/Tools/CMakeLists.txt +++ b/Gems/Atom/Tools/CMakeLists.txt @@ -6,6 +6,4 @@ # # -add_subdirectory(AtomToolsFramework) -add_subdirectory(MaterialEditor) add_subdirectory(ShaderManagementConsole) diff --git a/Gems/Atom/Tools/MaterialEditor/CMakeLists.txt b/Gems/Atom/Tools/MaterialEditor/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Atom/Tools/MaterialEditor/CMakeLists.txt +++ b/Gems/Atom/Tools/MaterialEditor/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt b/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt index 99beb721d6..1d9295f9b3 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt +++ b/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt @@ -10,7 +10,7 @@ if(NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # PAL_TRAIT_ATOM_MATERIAL_EDITOR_APPLICATION_SUPPORTED diff --git a/Gems/Atom/Tools/MaterialEditor/gem.json b/Gems/Atom/Tools/MaterialEditor/gem.json index 807e3fa65f..463553c27d 100644 --- a/Gems/Atom/Tools/MaterialEditor/gem.json +++ b/Gems/Atom/Tools/MaterialEditor/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "Editor for creating, modifying, and previewing materials", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "AtomToolsFramework", "Atom_RPI", diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/CMakeLists.txt b/Gems/Atom/Tools/ShaderManagementConsole/Code/CMakeLists.txt index d384378b09..3f7788418a 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/CMakeLists.txt +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/CMakeLists.txt @@ -10,7 +10,7 @@ if(NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # PAL_TRAIT_ATOM_SHADER_MANAGEMENT_CONSOLE_APPLICATION_SUPPORTED diff --git a/Gems/Atom/Utils/Code/CMakeLists.txt b/Gems/Atom/Utils/Code/CMakeLists.txt index 90d7ce501b..a657262f2d 100644 --- a/Gems/Atom/Utils/Code/CMakeLists.txt +++ b/Gems/Atom/Utils/Code/CMakeLists.txt @@ -6,8 +6,6 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) - ly_add_target( NAME Atom_Utils.Static STATIC NAMESPACE Gem @@ -52,6 +50,9 @@ endif() # Tests ################################################################################ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) + + o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) + ly_add_target( NAME Atom_Utils.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE Gem diff --git a/Gems/Atom/gem.json b/Gems/Atom/gem.json index 0f409ad993..ee6a617ee7 100644 --- a/Gems/Atom/gem.json +++ b/Gems/Atom/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Atom Renderer Gem provides Atom Renderer and its associated tools (such as Material Editor), utilites, libraries, and interfaces.", "canonical_tags": [ @@ -15,6 +16,17 @@ ], "requirements": "", "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/rendering/atom/atom/", + "external_subdirectories": [ + "Asset/ImageProcessingAtom", + "Asset/Shader", + "Bootstrap", + "Component/DebugCamera", + "Feature/Common", + "RHI", + "RPI", + "Tools/AtomToolsFramework", + "Tools/MaterialEditor" + ], "dependencies": [ "Atom_Feature_Common", "AtomShader", diff --git a/Gems/AtomContent/CMakeLists.txt b/Gems/AtomContent/CMakeLists.txt index ee06f07bc3..29477608b9 100644 --- a/Gems/AtomContent/CMakeLists.txt +++ b/Gems/AtomContent/CMakeLists.txt @@ -5,8 +5,6 @@ # SPDX-License-Identifier: Apache-2.0 OR MIT # # -add_subdirectory(ReferenceMaterials) -add_subdirectory(Sponza) if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_create_alias(NAME AtomContent.Builders NAMESPACE Gem TARGETS Gem::AtomContent_ReferenceMaterials.Builders Gem::AtomContent_Sponza.Builders) diff --git a/Gems/AtomContent/ReferenceMaterials/gem.json b/Gems/AtomContent/ReferenceMaterials/gem.json index b75b01e1ae..49a488b9d3 100644 --- a/Gems/AtomContent/ReferenceMaterials/gem.json +++ b/Gems/AtomContent/ReferenceMaterials/gem.json @@ -2,7 +2,9 @@ "gem_name": "ReferenceMaterials", "display_name": "PBR Reference Materials", "license": "Code, text, data files: Apache-2.0 Or MIT, assets/content/images: CC BY 4.0", - "origin": "https://github.com/aws-lumberyard-dev/o3de.git", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "Atom Asset Gem with a library of reference materials for StandardPBR (and others in the future)", "canonical_tags": [ @@ -14,6 +16,8 @@ "Materials" ], "icon_path": "preview.png", - "dependencies": [], - "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt" + "requirements": "", + "documentation_url": "", + "dependencies": [ + ] } diff --git a/Gems/AtomContent/Sponza/gem.json b/Gems/AtomContent/Sponza/gem.json index 68749cd5f4..f15d57a4d1 100644 --- a/Gems/AtomContent/Sponza/gem.json +++ b/Gems/AtomContent/Sponza/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "A standard test scene for Global Illumination (forked from crytek sponza scene)", "canonical_tags": [ @@ -13,5 +14,7 @@ "Assets" ], "requirements": "", - "dependencies": [] + "documentation_url": "", + "dependencies": [ + ] } diff --git a/Gems/AtomContent/gem.json b/Gems/AtomContent/gem.json index 400e897a3b..9be15f7da8 100644 --- a/Gems/AtomContent/gem.json +++ b/Gems/AtomContent/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "The Atom Content Gem provides assets for Atom Renderer and a modified version of the Pixar Look Development Studio.", "canonical_tags": [ @@ -17,7 +18,11 @@ "requirements": "", "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/rendering/atom/atom-content/", "dependencies": [ - "ReferenceMaterials", - "Sponza" + "Sponza", + "ReferenceMaterials" + ], + "external_subdirectories": [ + "Sponza", + "ReferenceMaterials" ] } diff --git a/Gems/AtomLyIntegration/AtomBridge/CMakeLists.txt b/Gems/AtomLyIntegration/AtomBridge/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/AtomLyIntegration/AtomBridge/CMakeLists.txt +++ b/Gems/AtomLyIntegration/AtomBridge/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt b/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt index 67f28767e0..fa3669d7c2 100644 --- a/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt +++ b/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME Atom_AtomBridge.Static STATIC diff --git a/Gems/AtomLyIntegration/AtomBridge/gem.json b/Gems/AtomLyIntegration/AtomBridge/gem.json index e8ca413023..5a8512c90d 100644 --- a/Gems/AtomLyIntegration/AtomBridge/gem.json +++ b/Gems/AtomLyIntegration/AtomBridge/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RPI", "Atom_Bootstrap", diff --git a/Gems/AtomLyIntegration/AtomFont/CMakeLists.txt b/Gems/AtomLyIntegration/AtomFont/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/AtomLyIntegration/AtomFont/CMakeLists.txt +++ b/Gems/AtomLyIntegration/AtomFont/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/AtomLyIntegration/AtomFont/Code/CMakeLists.txt b/Gems/AtomLyIntegration/AtomFont/Code/CMakeLists.txt index 6567736f02..79d97e797d 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/CMakeLists.txt +++ b/Gems/AtomLyIntegration/AtomFont/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME AtomFont ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} diff --git a/Gems/AtomLyIntegration/AtomFont/gem.json b/Gems/AtomLyIntegration/AtomFont/gem.json index 8907ec0979..d979509059 100644 --- a/Gems/AtomLyIntegration/AtomFont/gem.json +++ b/Gems/AtomLyIntegration/AtomFont/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI", "Atom_RPI", diff --git a/Gems/AtomLyIntegration/AtomImGuiTools/gem.json b/Gems/AtomLyIntegration/AtomImGuiTools/gem.json index e188ba0cb8..205120f6f0 100644 --- a/Gems/AtomLyIntegration/AtomImGuiTools/gem.json +++ b/Gems/AtomLyIntegration/AtomImGuiTools/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "", "canonical_tags": [ @@ -14,6 +15,7 @@ "Rendering" ], "requirements": "", + "documentation_url": "", "dependencies": [ "ImguiAtom", "Atom" diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json index 5a0763e0da..cff957c1f1 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json +++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI", "Atom_RPI", diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json index 639d93d301..a2bc92c76d 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json +++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI", "Atom_RPI" diff --git a/Gems/AtomLyIntegration/CMakeLists.txt b/Gems/AtomLyIntegration/CMakeLists.txt index 4ab976d68f..25d7356b01 100644 --- a/Gems/AtomLyIntegration/CMakeLists.txt +++ b/Gems/AtomLyIntegration/CMakeLists.txt @@ -6,13 +6,4 @@ # # -add_subdirectory(CommonFeatures) -add_subdirectory(ImguiAtom) -add_subdirectory(AtomImGuiTools) -add_subdirectory(EMotionFXAtom) -add_subdirectory(AtomFont) -add_subdirectory(TechnicalArt) -add_subdirectory(AtomBridge) -add_subdirectory(AtomViewportDisplayInfo) -add_subdirectory(AtomViewportDisplayIcons) diff --git a/Gems/AtomLyIntegration/CommonFeatures/CMakeLists.txt b/Gems/AtomLyIntegration/CommonFeatures/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/CMakeLists.txt +++ b/Gems/AtomLyIntegration/CommonFeatures/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/CMakeLists.txt b/Gems/AtomLyIntegration/CommonFeatures/Code/CMakeLists.txt index 7b685ece13..3234db2292 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/CMakeLists.txt +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) ly_add_target( NAME AtomLyIntegration_CommonFeatures.Public HEADERONLY diff --git a/Gems/AtomLyIntegration/CommonFeatures/gem.json b/Gems/AtomLyIntegration/CommonFeatures/gem.json index 6fa8938332..a06f607fab 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/gem.json +++ b/Gems/AtomLyIntegration/CommonFeatures/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_Feature_Common", "LmbrCentral", diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/gem.json b/Gems/AtomLyIntegration/EMotionFXAtom/gem.json index 3514d4c1b9..8bea93da91 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/gem.json +++ b/Gems/AtomLyIntegration/EMotionFXAtom/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "EMotionFX", "Atom", diff --git a/Gems/AtomLyIntegration/ImguiAtom/gem.json b/Gems/AtomLyIntegration/ImguiAtom/gem.json index fa611d8224..4c65d80e33 100644 --- a/Gems/AtomLyIntegration/ImguiAtom/gem.json +++ b/Gems/AtomLyIntegration/ImguiAtom/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "ImGui", "Atom_Feature_Common" diff --git a/Gems/AtomLyIntegration/TechnicalArt/CMakeLists.txt b/Gems/AtomLyIntegration/TechnicalArt/CMakeLists.txt deleted file mode 100644 index 4fc1e5241d..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -add_subdirectory(DccScriptingInterface) diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/CMakeLists.txt b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/CMakeLists.txt index 5780172755..f26d18b90e 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/CMakeLists.txt +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/CMakeLists.txt @@ -6,5 +6,4 @@ # # -add_subdirectory(Code) update_pip_requirements(${CMAKE_CURRENT_LIST_DIR}/requirements.txt DccScriptingInterface) diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json index 4cc6fff169..7786a8adf4 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json @@ -1,11 +1,12 @@ { "gem_name": "DccScriptingInterface", "display_name": "Atom DccScriptingInterface (DCCsi)", - "summary": "A python framework for working with various DCC tools and workflows.", "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", + "summary": "A python framework for working with various DCC tools and workflows.", "canonical_tags": [ "Gem" ], @@ -16,5 +17,6 @@ "Creation" ], "requirements": "", + "documentation_url": "", "dependencies": [] } diff --git a/Gems/AtomLyIntegration/gem.json b/Gems/AtomLyIntegration/gem.json index d9e526aee0..c491126269 100644 --- a/Gems/AtomLyIntegration/gem.json +++ b/Gems/AtomLyIntegration/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Atom O3DE Integration Gem provides components, libraries, and functionality to support and integrate Atom Renderer in Open 3D Engine.", "canonical_tags": [ @@ -25,5 +26,16 @@ "CommonFeaturesAtom", "EMotionFX_Atom", "ImguiAtom" + ], + "external_subdirectories": [ + "AtomBridge", + "AtomFont", + "AtomImGuiTools", + "AtomViewportDisplayIcons", + "AtomViewportDisplayInfo", + "CommonFeatures", + "EMotionFXAtom", + "ImguiAtom", + "TechnicalArt/DccScriptingInterface" ] } diff --git a/Gems/AtomTressFX/gem.json b/Gems/AtomTressFX/gem.json index b7588ea374..1bd619a418 100644 --- a/Gems/AtomTressFX/gem.json +++ b/Gems/AtomTressFX/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "Atom TressFX Gem provides a cutting edge hair and fur simulation and rendering in Atom enhancing the AMD TressFX 4.1. The open source TressFX can be found here: https://github.com/GPUOpen-Effects/TressFX", "canonical_tags": [ @@ -15,5 +16,7 @@ "Animation" ], "requirements": "", - "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/rendering/amd/atom-tressfx/" + "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/rendering/amd/atom-tressfx/", + "dependencies": [ + ] } diff --git a/Gems/AudioEngineWwise/CMakeLists.txt b/Gems/AudioEngineWwise/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/AudioEngineWwise/CMakeLists.txt +++ b/Gems/AudioEngineWwise/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/AudioEngineWwise/Code/CMakeLists.txt b/Gems/AudioEngineWwise/Code/CMakeLists.txt index 33c80bc31c..02d4f1e6c8 100644 --- a/Gems/AudioEngineWwise/Code/CMakeLists.txt +++ b/Gems/AudioEngineWwise/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) #for PAL_TRAIT_AUDIO_ENGINE_WWISE Traits diff --git a/Gems/AudioEngineWwise/gem.json b/Gems/AudioEngineWwise/gem.json index 2b0af30d40..f0d8c73be2 100644 --- a/Gems/AudioEngineWwise/gem.json +++ b/Gems/AudioEngineWwise/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Wwise Audio Engine Gem provides support for Audiokinetic Wave Works Interactive Sound Engine (Wwise).", "canonical_tags": [ diff --git a/Gems/AudioSystem/CMakeLists.txt b/Gems/AudioSystem/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/AudioSystem/CMakeLists.txt +++ b/Gems/AudioSystem/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/AudioSystem/Code/CMakeLists.txt b/Gems/AudioSystem/Code/CMakeLists.txt index 17dbd91878..e5778e9152 100644 --- a/Gems/AudioSystem/Code/CMakeLists.txt +++ b/Gems/AudioSystem/Code/CMakeLists.txt @@ -10,7 +10,7 @@ set(AUDIOSYSTEM_COMPILEDEFINITIONS $,AUDIO_RELEASE,ENABLE_AUDIO_LOGGING> ) -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME AudioSystem.Static STATIC @@ -65,7 +65,7 @@ ly_create_alias(NAME AudioSystem.Clients NAMESPACE Gem TARGETS Gem::AudioSystem # Tests ################################################################################ if (PAL_TRAIT_BUILD_TESTS_SUPPORTED) - ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) + set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) ly_add_target( NAME AudioSystem.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE Gem diff --git a/Gems/AudioSystem/gem.json b/Gems/AudioSystem/gem.json index ed028068a1..be618ee44e 100644 --- a/Gems/AudioSystem/gem.json +++ b/Gems/AudioSystem/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Audio System Gem provides the Audio Translation Layer (ATL) and Audio Controls Editor, which add support for audio in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/BarrierInput/gem.json b/Gems/BarrierInput/gem.json index 72d6398550..e8dcf0d93c 100644 --- a/Gems/BarrierInput/gem.json +++ b/Gems/BarrierInput/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Barrier Input Gem allows the Open 3D Engine to function as a Barrier client so that it can receive input from a remote Barrier server.", "canonical_tags": [ @@ -16,6 +17,7 @@ ], "icon_path": "preview.png", "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RPI" ] diff --git a/Gems/Blast/CMakeLists.txt b/Gems/Blast/CMakeLists.txt index 7c478ef2b2..e2fe57d8cc 100644 --- a/Gems/Blast/CMakeLists.txt +++ b/Gems/Blast/CMakeLists.txt @@ -6,5 +6,9 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Blast/Code/CMakeLists.txt b/Gems/Blast/Code/CMakeLists.txt index d3555b2855..7f478054b8 100644 --- a/Gems/Blast/Code/CMakeLists.txt +++ b/Gems/Blast/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # for PAL_TRAIT_BLAST Traits diff --git a/Gems/Blast/gem.json b/Gems/Blast/gem.json index 761eb04761..dc90c587d7 100644 --- a/Gems/Blast/gem.json +++ b/Gems/Blast/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The NVIDIA Blast Gem provides tools to author fractured mesh assets in Houdini, and functionality to create realistic destruction simulations in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/Camera/gem.json b/Gems/Camera/gem.json index 4cf0747c7b..c6367d4663 100644 --- a/Gems/Camera/gem.json +++ b/Gems/Camera/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Camera Gem provides a basic camera component that defines a frustum for runtime rendering.", "canonical_tags": [ diff --git a/Gems/CameraFramework/gem.json b/Gems/CameraFramework/gem.json index d24014be61..0803fd7522 100644 --- a/Gems/CameraFramework/gem.json +++ b/Gems/CameraFramework/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Camera Framework Gem provides a base for implementing more complex camera systems.", "canonical_tags": [ diff --git a/Gems/CertificateManager/gem.json b/Gems/CertificateManager/gem.json index 11ea14ea5e..c582e932be 100644 --- a/Gems/CertificateManager/gem.json +++ b/Gems/CertificateManager/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Certificate Manager Gem provides access to authentication files for secure game connections from Amazon S3, files on disk, and other 3rd party sources.", "canonical_tags": [ diff --git a/Gems/CrashReporting/CMakeLists.txt b/Gems/CrashReporting/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/CrashReporting/CMakeLists.txt +++ b/Gems/CrashReporting/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/CrashReporting/Code/CMakeLists.txt b/Gems/CrashReporting/Code/CMakeLists.txt index 8bcb143d1c..7d7b2c76da 100644 --- a/Gems/CrashReporting/Code/CMakeLists.txt +++ b/Gems/CrashReporting/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/Gems/CrashReporting/gem.json b/Gems/CrashReporting/gem.json index b8c75548a4..1651bad7b8 100644 --- a/Gems/CrashReporting/gem.json +++ b/Gems/CrashReporting/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Crash Reporting Gem provides support for external crash reporting for Open 3D Engine projects.", "canonical_tags": [ diff --git a/Gems/CustomAssetExample/gem.json b/Gems/CustomAssetExample/gem.json index 89492ee6ea..ba1030b280 100644 --- a/Gems/CustomAssetExample/gem.json +++ b/Gems/CustomAssetExample/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Custom Asset Example Gem provides example code for creating a custom asset for Open 3D Engine's asset pipeline.", "canonical_tags": [ diff --git a/Gems/DebugDraw/gem.json b/Gems/DebugDraw/gem.json index 58eff5f87a..e140d642b8 100644 --- a/Gems/DebugDraw/gem.json +++ b/Gems/DebugDraw/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Debug Draw Gem provides Editor and runtime debug visualization features for Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/DevTextures/gem.json b/Gems/DevTextures/gem.json index 00cafbd6fb..f8c436887d 100644 --- a/Gems/DevTextures/gem.json +++ b/Gems/DevTextures/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "The Dev Textures Gem provides a collection of general purpose texture assets useful for prototypes and preproduction.", "canonical_tags": [ diff --git a/Gems/EMotionFX/CMakeLists.txt b/Gems/EMotionFX/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/EMotionFX/CMakeLists.txt +++ b/Gems/EMotionFX/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/EMotionFX/Code/CMakeLists.txt b/Gems/EMotionFX/Code/CMakeLists.txt index 67d0ba6d85..bd90e589c9 100644 --- a/Gems/EMotionFX/Code/CMakeLists.txt +++ b/Gems/EMotionFX/Code/CMakeLists.txt @@ -6,10 +6,9 @@ # # -ly_get_list_relative_pal_filename(core_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) - -ly_get_list_relative_pal_filename(editor_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Editor/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(editor_common_dir ${CMAKE_CURRENT_LIST_DIR}/Editor/Platform/Common) +o3de_pal_dir(core_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +o3de_pal_dir(editor_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Editor/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(editor_common_dir ${CMAKE_CURRENT_LIST_DIR}/Editor/Platform/Common) ly_add_target( NAME EMotionFXStaticLib STATIC diff --git a/Gems/EMotionFX/gem.json b/Gems/EMotionFX/gem.json index ed80517af1..c07c8368c2 100644 --- a/Gems/EMotionFX/gem.json +++ b/Gems/EMotionFX/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The EMotion FX Animation Gem provides Open 3D Engine's animation system for rigged actors and includes Animation Editor, a tool for creating animated behaviors, simulated objects, and colliders for rigged actors.", "canonical_tags": [ diff --git a/Gems/EditorPythonBindings/gem.json b/Gems/EditorPythonBindings/gem.json index 475483f13b..a5ee9f5631 100644 --- a/Gems/EditorPythonBindings/gem.json +++ b/Gems/EditorPythonBindings/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Editor Python Bindings Gem provides Python commands for Open 3D Engine Editor functions.", "canonical_tags": [ diff --git a/Gems/ExpressionEvaluation/gem.json b/Gems/ExpressionEvaluation/gem.json index cd712f4da9..667eebbcb5 100644 --- a/Gems/ExpressionEvaluation/gem.json +++ b/Gems/ExpressionEvaluation/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Expression Evaluation Gem provides a method for parsing and executing string expressions in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/FastNoise/gem.json b/Gems/FastNoise/gem.json index d8dfb878b4..a9c0f1f42d 100644 --- a/Gems/FastNoise/gem.json +++ b/Gems/FastNoise/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The FastNoise Gradient Gem uses the third-party, open source FastNoise library to provide a variety of high-performance noise generation algorithms.", "canonical_tags": [ diff --git a/Gems/GameState/gem.json b/Gems/GameState/gem.json index fe3a338997..d3e2d76c5a 100644 --- a/Gems/GameState/gem.json +++ b/Gems/GameState/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Game State Gem provides a generic framework to determine and manage game states and game state transitions in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/GameStateSamples/CMakeLists.txt b/Gems/GameStateSamples/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/GameStateSamples/CMakeLists.txt +++ b/Gems/GameStateSamples/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/GameStateSamples/Code/CMakeLists.txt b/Gems/GameStateSamples/Code/CMakeLists.txt index a07bef6a06..939b2ce1bd 100644 --- a/Gems/GameStateSamples/Code/CMakeLists.txt +++ b/Gems/GameStateSamples/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(include_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(include_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME GameStateSamples.Headers HEADERONLY diff --git a/Gems/GameStateSamples/gem.json b/Gems/GameStateSamples/gem.json index 80018ff1a8..94556ee677 100644 --- a/Gems/GameStateSamples/gem.json +++ b/Gems/GameStateSamples/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Game State Samples Gem provides a set of sample game states (built on top of the Game State Gem), including primary user selection, main menu, level loading, level running, and level paused.", "canonical_tags": [ diff --git a/Gems/Gestures/gem.json b/Gems/Gestures/gem.json index 8efd389d53..c0609c8d54 100644 --- a/Gems/Gestures/gem.json +++ b/Gems/Gestures/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Gestures Gem provides detection for common gesture-based input actions on iOS and Android devices.", "canonical_tags": [ diff --git a/Gems/GradientSignal/gem.json b/Gems/GradientSignal/gem.json index aac4c652c5..f0136ef104 100644 --- a/Gems/GradientSignal/gem.json +++ b/Gems/GradientSignal/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Gradient Signal Gem provides a number of components for generating, modifying, and mixing gradient signals.", "canonical_tags": [ diff --git a/Gems/GraphCanvas/gem.json b/Gems/GraphCanvas/gem.json index 4762cfef35..c2038f4645 100644 --- a/Gems/GraphCanvas/gem.json +++ b/Gems/GraphCanvas/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Graph Canvas Gem provides a C++ framework for creating custom graphical node based editors for Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/GraphModel/gem.json b/Gems/GraphModel/gem.json index ad6b592430..ece520278b 100644 --- a/Gems/GraphModel/gem.json +++ b/Gems/GraphModel/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Graph Model Gem provides a generic node graph data model framework for Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/HttpRequestor/CMakeLists.txt b/Gems/HttpRequestor/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/HttpRequestor/CMakeLists.txt +++ b/Gems/HttpRequestor/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/HttpRequestor/Code/CMakeLists.txt b/Gems/HttpRequestor/Code/CMakeLists.txt index 831eb52231..4ebca5518c 100644 --- a/Gems/HttpRequestor/Code/CMakeLists.txt +++ b/Gems/HttpRequestor/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(source_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(source_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME HttpRequestor.Static STATIC diff --git a/Gems/HttpRequestor/gem.json b/Gems/HttpRequestor/gem.json index 582bfa0071..a8e111ac63 100644 --- a/Gems/HttpRequestor/gem.json +++ b/Gems/HttpRequestor/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The HTTP Requestor Gem provides functionality to make asynchronous HTTP/HTTPS requests and return data through a user-provided call back function.", "canonical_tags": [ diff --git a/Gems/ImGui/CMakeLists.txt b/Gems/ImGui/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/ImGui/CMakeLists.txt +++ b/Gems/ImGui/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/ImGui/Code/CMakeLists.txt b/Gems/ImGui/Code/CMakeLists.txt index e345e3d546..c293065636 100644 --- a/Gems/ImGui/Code/CMakeLists.txt +++ b/Gems/ImGui/Code/CMakeLists.txt @@ -8,7 +8,7 @@ set(config_base_defines $,IMGUI_DISABLED,IMGUI_ENABLED>) -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) # This library is the 3rdParty imgui that is in the Gem's External ly_add_target( diff --git a/Gems/ImGui/gem.json b/Gems/ImGui/gem.json index dfc12f64b4..0ed889f693 100644 --- a/Gems/ImGui/gem.json +++ b/Gems/ImGui/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Immediate Mode GUI Gem provides the 3rdParty library IMGUI which can be used to create run time immediate mode overlays for debugging and profiling information in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/InAppPurchases/CMakeLists.txt b/Gems/InAppPurchases/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/InAppPurchases/CMakeLists.txt +++ b/Gems/InAppPurchases/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/InAppPurchases/Code/CMakeLists.txt b/Gems/InAppPurchases/Code/CMakeLists.txt index 99fc937919..e7b34296d1 100644 --- a/Gems/InAppPurchases/Code/CMakeLists.txt +++ b/Gems/InAppPurchases/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME InAppPurchases.Static STATIC diff --git a/Gems/InAppPurchases/gem.json b/Gems/InAppPurchases/gem.json index 21febbfeca..0b3d2e65e4 100644 --- a/Gems/InAppPurchases/gem.json +++ b/Gems/InAppPurchases/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The In-App Purchases Gem provides functionality for in app purchases for iOS and Android.", "canonical_tags": [ diff --git a/Gems/LandscapeCanvas/gem.json b/Gems/LandscapeCanvas/gem.json index 8653da40e1..f1e326efce 100644 --- a/Gems/LandscapeCanvas/gem.json +++ b/Gems/LandscapeCanvas/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Landscape Canvas Gem provides the Landscape Canvas editor, a node-based graph tool for authoring workflows to populate landscape with dynamic vegetation.", "canonical_tags": [ diff --git a/Gems/LmbrCentral/CMakeLists.txt b/Gems/LmbrCentral/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/LmbrCentral/CMakeLists.txt +++ b/Gems/LmbrCentral/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/LmbrCentral/Code/CMakeLists.txt b/Gems/LmbrCentral/Code/CMakeLists.txt index 4401d3b752..a4c94a7b40 100644 --- a/Gems/LmbrCentral/Code/CMakeLists.txt +++ b/Gems/LmbrCentral/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) ly_add_target( NAME LmbrCentral.Static STATIC diff --git a/Gems/LmbrCentral/gem.json b/Gems/LmbrCentral/gem.json index a0a6ea813f..4eea28d26e 100644 --- a/Gems/LmbrCentral/gem.json +++ b/Gems/LmbrCentral/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The O3DE Core (LmbrCentral) Gem provides required code and assets for running Open 3D Engine Editor.", "canonical_tags": [ diff --git a/Gems/LocalUser/CMakeLists.txt b/Gems/LocalUser/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/LocalUser/CMakeLists.txt +++ b/Gems/LocalUser/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/LocalUser/Code/CMakeLists.txt b/Gems/LocalUser/Code/CMakeLists.txt index 055cfe6c7c..ce937e9dc5 100644 --- a/Gems/LocalUser/Code/CMakeLists.txt +++ b/Gems/LocalUser/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME LocalUser.Static STATIC diff --git a/Gems/LocalUser/gem.json b/Gems/LocalUser/gem.json index 5199b4f777..04f2145956 100644 --- a/Gems/LocalUser/gem.json +++ b/Gems/LocalUser/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Local User Gem provides functionality for mapping local user ids to local player slots and managing local user profiles.", "canonical_tags": [ diff --git a/Gems/LyShine/CMakeLists.txt b/Gems/LyShine/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/LyShine/CMakeLists.txt +++ b/Gems/LyShine/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/LyShine/Code/CMakeLists.txt b/Gems/LyShine/Code/CMakeLists.txt index 2b550b0e36..76d7742ddf 100644 --- a/Gems/LyShine/Code/CMakeLists.txt +++ b/Gems/LyShine/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) ly_add_target( NAME LyShine.Static STATIC diff --git a/Gems/LyShine/gem.json b/Gems/LyShine/gem.json index 8dcac6404a..7ebb733b0f 100644 --- a/Gems/LyShine/gem.json +++ b/Gems/LyShine/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The LyShine Gem provides the runtime UI system and creation tools for Open 3D Engine projects.", "canonical_tags": [ diff --git a/Gems/LyShineExamples/gem.json b/Gems/LyShineExamples/gem.json index 74d2b6fe51..c91e9b819e 100644 --- a/Gems/LyShineExamples/gem.json +++ b/Gems/LyShineExamples/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "The LyShine Examples Gem provides example code and assets for LyShine, the runtime UI system and editor for Open 3D Engine projects.", "canonical_tags": [ diff --git a/Gems/Maestro/gem.json b/Gems/Maestro/gem.json index d8f884e271..95aa43c179 100644 --- a/Gems/Maestro/gem.json +++ b/Gems/Maestro/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Maestro Cinematics Gem provides Track View, Open 3D Engine's animated sequence and cinematics editor.", "canonical_tags": [ diff --git a/Gems/MessagePopup/gem.json b/Gems/MessagePopup/gem.json index fb44dd93a5..5e1b4843b0 100644 --- a/Gems/MessagePopup/gem.json +++ b/Gems/MessagePopup/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Message Popup Gem provides an example implementation of popup messages using LyShine in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/Metastream/CMakeLists.txt b/Gems/Metastream/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Metastream/CMakeLists.txt +++ b/Gems/Metastream/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Metastream/Code/CMakeLists.txt b/Gems/Metastream/Code/CMakeLists.txt index a032fc34ff..f1652058ac 100644 --- a/Gems/Metastream/Code/CMakeLists.txt +++ b/Gems/Metastream/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) ly_add_target( NAME Metastream.Static STATIC diff --git a/Gems/Metastream/gem.json b/Gems/Metastream/gem.json index 309f16b221..9a37a0a8ee 100644 --- a/Gems/Metastream/gem.json +++ b/Gems/Metastream/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Metastream Gem provides functionality for an HTTP server that allows broadcasters to customize game streams with overlays of statistics and event data from a game session.", "canonical_tags": [ diff --git a/Gems/Microphone/CMakeLists.txt b/Gems/Microphone/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Microphone/CMakeLists.txt +++ b/Gems/Microphone/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Microphone/Code/CMakeLists.txt b/Gems/Microphone/Code/CMakeLists.txt index 5b40521f6a..873d05e98d 100644 --- a/Gems/Microphone/Code/CMakeLists.txt +++ b/Gems/Microphone/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME Microphone.Static STATIC diff --git a/Gems/Microphone/gem.json b/Gems/Microphone/gem.json index 6e57bec854..6a5b415a22 100644 --- a/Gems/Microphone/gem.json +++ b/Gems/Microphone/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Microphone Gem provides support for audio input through microphones.", "canonical_tags": [ diff --git a/Gems/Multiplayer/CMakeLists.txt b/Gems/Multiplayer/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Multiplayer/CMakeLists.txt +++ b/Gems/Multiplayer/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Multiplayer/Code/CMakeLists.txt b/Gems/Multiplayer/Code/CMakeLists.txt index afe40408ab..66085476e5 100644 --- a/Gems/Multiplayer/Code/CMakeLists.txt +++ b/Gems/Multiplayer/Code/CMakeLists.txt @@ -6,6 +6,8 @@ # # +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) + ly_add_target( NAME Multiplayer.Static STATIC NAMESPACE Gem diff --git a/Gems/Multiplayer/gem.json b/Gems/Multiplayer/gem.json index f895c78c5d..2b412084af 100644 --- a/Gems/Multiplayer/gem.json +++ b/Gems/Multiplayer/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Multiplayer Gem provides a public API for multiplayer functionality such as connecting and hosting.", "canonical_tags": [ @@ -16,6 +17,7 @@ ], "icon_path": "preview.png", "requirements": "", + "documentation_url": "", "dependencies": [ "CertificateManager", "Atom_Feature_Common", diff --git a/Gems/MultiplayerCompression/gem.json b/Gems/MultiplayerCompression/gem.json index 98156cc404..a9cf3fa460 100644 --- a/Gems/MultiplayerCompression/gem.json +++ b/Gems/MultiplayerCompression/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Multiplayer Compression Gem provides an open source Compressor for use with AzNetworking's transport layer.", "canonical_tags": [ diff --git a/Gems/NvCloth/CMakeLists.txt b/Gems/NvCloth/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/NvCloth/CMakeLists.txt +++ b/Gems/NvCloth/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/NvCloth/Code/CMakeLists.txt b/Gems/NvCloth/Code/CMakeLists.txt index 5b5bba9d8b..76f5bcfeb8 100644 --- a/Gems/NvCloth/Code/CMakeLists.txt +++ b/Gems/NvCloth/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) #for PAL_TRAIT_NVCLOTH Traits diff --git a/Gems/NvCloth/gem.json b/Gems/NvCloth/gem.json index 86a70b9373..9494d65e82 100644 --- a/Gems/NvCloth/gem.json +++ b/Gems/NvCloth/gem.json @@ -2,8 +2,9 @@ "gem_name": "NvCloth", "display_name": "NVIDIA Cloth (NvCloth)", "license": "Apache-2.0 Or MIT", - "origin": "Open 3D Engine - o3de.org", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The NVIDIA Cloth Gem provides functionality to create fast, realistic cloth simulation with the NVIDIA Cloth library.", "canonical_tags": [ diff --git a/Gems/PhysX/CMakeLists.txt b/Gems/PhysX/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/PhysX/CMakeLists.txt +++ b/Gems/PhysX/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/PhysX/Code/CMakeLists.txt b/Gems/PhysX/Code/CMakeLists.txt index f045d6b00d..1cad877542 100644 --- a/Gems/PhysX/Code/CMakeLists.txt +++ b/Gems/PhysX/Code/CMakeLists.txt @@ -8,7 +8,7 @@ add_subdirectory(NumericalMethods) -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # for PAL_TRAIT_PHYSX_SUPPORTED set(LY_PHYSX_ENABLE_RUNNING_BENCHMARKS OFF CACHE BOOL "Adds a target to allow running of the physx benchmarks.") diff --git a/Gems/PhysXDebug/CMakeLists.txt b/Gems/PhysXDebug/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/PhysXDebug/CMakeLists.txt +++ b/Gems/PhysXDebug/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/PhysXDebug/Code/CMakeLists.txt b/Gems/PhysXDebug/Code/CMakeLists.txt index 3ddec9d105..0886f2bf34 100644 --- a/Gems/PhysXDebug/Code/CMakeLists.txt +++ b/Gems/PhysXDebug/Code/CMakeLists.txt @@ -6,7 +6,11 @@ # # -ly_get_list_relative_pal_filename(physx_pal_source_dir ${LY_ROOT_FOLDER}/Gems/PhysX/Code/Source/Platform/${PAL_PLATFORM_NAME}) +# This gem relies on the PhysX gem +o3de_find_gem("PhysX" physx_gem_path) +set(physx_gem_json ${physx_gem_path}/gem.json) +o3de_restricted_path(${physx_gem_json} physx_gem_restricted_path physx_gem_parent_relative_path) +o3de_pal_dir(physx_pal_source_dir ${physx_gem_path}/Code/Source/Platform/${PAL_PLATFORM_NAME} ${physx_gem_restricted_path} ${physx_gem_path} ${physx_gem_parent_relative_path}) include(${physx_pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # for PAL_TRAIT_PHYSX_SUPPORTED diff --git a/Gems/PhysXDebug/gem.json b/Gems/PhysXDebug/gem.json index 2d9f4dc24d..1087eefad4 100644 --- a/Gems/PhysXDebug/gem.json +++ b/Gems/PhysXDebug/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The PhysX Debug Gem provides debugging functionality and visualizations for NVIDIA PhysX in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/Prefab/PrefabBuilder/gem.json b/Gems/Prefab/PrefabBuilder/gem.json index 2233a7235e..1c0dcd9a72 100644 --- a/Gems/Prefab/PrefabBuilder/gem.json +++ b/Gems/Prefab/PrefabBuilder/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Prefab Builder Gem provides an Asset Processor module for prefabs, which are complex assets built by combining smaller entities.", "canonical_tags": [ diff --git a/Gems/Presence/CMakeLists.txt b/Gems/Presence/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Presence/CMakeLists.txt +++ b/Gems/Presence/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Presence/Code/CMakeLists.txt b/Gems/Presence/Code/CMakeLists.txt index c1c807d432..cc84771201 100644 --- a/Gems/Presence/Code/CMakeLists.txt +++ b/Gems/Presence/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME Presence.Headers HEADERONLY diff --git a/Gems/Presence/gem.json b/Gems/Presence/gem.json index 624af2e62d..48d9dd5ef0 100644 --- a/Gems/Presence/gem.json +++ b/Gems/Presence/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Presence Gem provides a target platform agnostic interface for Presence services.", "canonical_tags": [ diff --git a/Gems/PrimitiveAssets/gem.json b/Gems/PrimitiveAssets/gem.json index 0e4c4689dc..7669477220 100644 --- a/Gems/PrimitiveAssets/gem.json +++ b/Gems/PrimitiveAssets/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "The Primitive Assets Gem provides primitive shape mesh assets with physics enabled.", "canonical_tags": [ diff --git a/Gems/Profiler/gem.json b/Gems/Profiler/gem.json index b160bc4b3c..40478deae1 100644 --- a/Gems/Profiler/gem.json +++ b/Gems/Profiler/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "A collection of utilities for capturing performance data", "canonical_tags": [ diff --git a/Gems/PythonAssetBuilder/gem.json b/Gems/PythonAssetBuilder/gem.json index 8046104f03..54fbb949f9 100644 --- a/Gems/PythonAssetBuilder/gem.json +++ b/Gems/PythonAssetBuilder/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Python Asset Builder Gem provides functionality to implement custom asset builders in Python for Asset Processor.", "canonical_tags": [ diff --git a/Gems/QtForPython/Code/CMakeLists.txt b/Gems/QtForPython/Code/CMakeLists.txt index da763978a6..d63c71492d 100644 --- a/Gems/QtForPython/Code/CMakeLists.txt +++ b/Gems/QtForPython/Code/CMakeLists.txt @@ -9,7 +9,7 @@ if(NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() -ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) include(${CMAKE_CURRENT_SOURCE_DIR}/Source/Platform/${PAL_PLATFORM_NAME}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/Gems/QtForPython/gem.json b/Gems/QtForPython/gem.json index 17d3a26f21..63805a5bc7 100644 --- a/Gems/QtForPython/gem.json +++ b/Gems/QtForPython/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Qt for Python Gem provides the PySide2 Python libraries to manage Qt widgets.", "canonical_tags": [ diff --git a/Gems/SaveData/CMakeLists.txt b/Gems/SaveData/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/SaveData/CMakeLists.txt +++ b/Gems/SaveData/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/SaveData/Code/CMakeLists.txt b/Gems/SaveData/Code/CMakeLists.txt index 38d145f8e5..5d4eb361cc 100644 --- a/Gems/SaveData/Code/CMakeLists.txt +++ b/Gems/SaveData/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME SaveData.Static STATIC diff --git a/Gems/SaveData/gem.json b/Gems/SaveData/gem.json index 1ee5a54cec..3a686242d7 100644 --- a/Gems/SaveData/gem.json +++ b/Gems/SaveData/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Save Data Gem provides a platform independent API to save and load persistent user data in Open 3D Engine projects.", "canonical_tags": [ diff --git a/Gems/SceneLoggingExample/gem.json b/Gems/SceneLoggingExample/gem.json index ad950f3992..dc6b5179b6 100644 --- a/Gems/SceneLoggingExample/gem.json +++ b/Gems/SceneLoggingExample/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "The Scene Logging Example Gem demonstrates the basics of extending the Open 3D Engine Scene API by adding additional logging to the pipeline.", "canonical_tags": [ diff --git a/Gems/SceneProcessing/gem.json b/Gems/SceneProcessing/gem.json index 576460d0a9..3689c2500a 100644 --- a/Gems/SceneProcessing/gem.json +++ b/Gems/SceneProcessing/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Scene Processing Gem provides Scene Settings, a tool you can use to specify the default settings for processing asset files for actors, meshes, motions, and PhysX.", "canonical_tags": [ diff --git a/Gems/ScriptCanvas/gem.json b/Gems/ScriptCanvas/gem.json index fc8a504917..ace6bca50c 100644 --- a/Gems/ScriptCanvas/gem.json +++ b/Gems/ScriptCanvas/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Script Canvas Gem provides Open 3D Engine's visual scripting environment, Script Canvas.", "canonical_tags": [ diff --git a/Gems/ScriptCanvasDeveloper/gem.json b/Gems/ScriptCanvasDeveloper/gem.json index fe1fdea0fc..c7e23dab9a 100644 --- a/Gems/ScriptCanvasDeveloper/gem.json +++ b/Gems/ScriptCanvasDeveloper/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Script Canvas Developer Gem provides a suite of utility features for the development and debugging of Script Canvas systems.", "canonical_tags": [ diff --git a/Gems/ScriptCanvasPhysics/gem.json b/Gems/ScriptCanvasPhysics/gem.json index 2e35e85c46..fdf83fe479 100644 --- a/Gems/ScriptCanvasPhysics/gem.json +++ b/Gems/ScriptCanvasPhysics/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Script Canvas Physics Gem provides Script Canvas nodes for physics scene queries such as raycasts.", "canonical_tags": [ diff --git a/Gems/ScriptCanvasTesting/gem.json b/Gems/ScriptCanvasTesting/gem.json index 5cb718e674..f62ec46fd4 100644 --- a/Gems/ScriptCanvasTesting/gem.json +++ b/Gems/ScriptCanvasTesting/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Script Canvas Testing Gem provides a framework for testing for and with Script Canvas.", "canonical_tags": [ diff --git a/Gems/ScriptEvents/gem.json b/Gems/ScriptEvents/gem.json index 5640e08489..c9391da996 100644 --- a/Gems/ScriptEvents/gem.json +++ b/Gems/ScriptEvents/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Script Events Gem provides a framework for creating event assets usable from any scripting solution in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/ScriptedEntityTweener/gem.json b/Gems/ScriptedEntityTweener/gem.json index 477345093c..bf7eec470f 100644 --- a/Gems/ScriptedEntityTweener/gem.json +++ b/Gems/ScriptedEntityTweener/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Scripted Entity Tweener Gem provides a script driven animation system for Open 3D Engine projects.", "canonical_tags": [ diff --git a/Gems/SliceFavorites/gem.json b/Gems/SliceFavorites/gem.json index c4536dc042..bbb873b20b 100644 --- a/Gems/SliceFavorites/gem.json +++ b/Gems/SliceFavorites/gem.json @@ -4,13 +4,18 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "Add the ability to favorite a slice to allow easy access and instantiation", + "canonical_tags": [ + "Gem" + ], "user_tags": [ "Editor", "Slices" ], "icon_path": "preview.png", "requirements": "", + "documentation_url": "", "dependencies": [] } diff --git a/Gems/StartingPointCamera/gem.json b/Gems/StartingPointCamera/gem.json index 1033770022..1a736d6e74 100644 --- a/Gems/StartingPointCamera/gem.json +++ b/Gems/StartingPointCamera/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Starting Point Camera Gem provides the behaviors used with the Camera Framework Gem to define a camera rig.", "canonical_tags": [ diff --git a/Gems/StartingPointInput/gem.json b/Gems/StartingPointInput/gem.json index ee1655b794..77a683658d 100644 --- a/Gems/StartingPointInput/gem.json +++ b/Gems/StartingPointInput/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Starting Point Input Gem provides functionality to map low-level input events to high-level actions.", "canonical_tags": [ diff --git a/Gems/StartingPointMovement/gem.json b/Gems/StartingPointMovement/gem.json index 188d8483bc..a9941098fa 100644 --- a/Gems/StartingPointMovement/gem.json +++ b/Gems/StartingPointMovement/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Starting Point Movement Gem provides a series of Lua scripts that listen and respond to input events and trigger transform operations such as translation and rotation.", "canonical_tags": [ diff --git a/Gems/SurfaceData/gem.json b/Gems/SurfaceData/gem.json index d16254040f..10100e3b90 100644 --- a/Gems/SurfaceData/gem.json +++ b/Gems/SurfaceData/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Surface Data Gem provides functionality to emit signals or tags from surfaces such as meshes and terrain.", "canonical_tags": [ diff --git a/Gems/Terrain/gem.json b/Gems/Terrain/gem.json index 0ca470c4d3..f038eb4d90 100644 --- a/Gems/Terrain/gem.json +++ b/Gems/Terrain/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "summary": "The Terrain Gem is an experimental terrain system. The terrain system maps height, color, and surface data to regions of the world, provides gradient-based and shape-based authoring tools and workflows, includes specialized rendering for efficient display, and integrates with physics for physical simulation.", "canonical_tags": [ "Gem" diff --git a/Gems/TestAssetBuilder/gem.json b/Gems/TestAssetBuilder/gem.json index 68ed706499..96c3bb4ffb 100644 --- a/Gems/TestAssetBuilder/gem.json +++ b/Gems/TestAssetBuilder/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Test Asset Builder Gem is used to feature test Asset Processor.", "canonical_tags": [ diff --git a/Gems/TextureAtlas/gem.json b/Gems/TextureAtlas/gem.json index 142f0fb082..970982fb48 100644 --- a/Gems/TextureAtlas/gem.json +++ b/Gems/TextureAtlas/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Texture Atlas Gem provides the formatting for texture atlases from 2D textures for LyShine.", "canonical_tags": [ diff --git a/Gems/TickBusOrderViewer/gem.json b/Gems/TickBusOrderViewer/gem.json index a6a6fd23ac..78b4d96c5c 100644 --- a/Gems/TickBusOrderViewer/gem.json +++ b/Gems/TickBusOrderViewer/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Tick Bus Order Viewer Gem provides a console variable that displays the order of runtime tick events.", "canonical_tags": [ diff --git a/Gems/Twitch/CMakeLists.txt b/Gems/Twitch/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Twitch/CMakeLists.txt +++ b/Gems/Twitch/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Twitch/Code/CMakeLists.txt b/Gems/Twitch/Code/CMakeLists.txt index 80c74e5bd4..75b18627cf 100644 --- a/Gems/Twitch/Code/CMakeLists.txt +++ b/Gems/Twitch/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) ly_add_target( NAME Twitch.Static STATIC diff --git a/Gems/Twitch/gem.json b/Gems/Twitch/gem.json index 42ec1b971e..70386e057f 100644 --- a/Gems/Twitch/gem.json +++ b/Gems/Twitch/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Twitch Gem provides access to the Twitch API v5 SDK including social functions, channels, and other APIs.", "canonical_tags": [ @@ -12,7 +13,8 @@ "user_tags": [ "Network", "SDK", - "Multiplayer" + "Multiplayer", + "Twitch" ], "icon_path": "preview.png", "requirements": "", diff --git a/Gems/UiBasics/gem.json b/Gems/UiBasics/gem.json index bb2416c235..4734aef779 100644 --- a/Gems/UiBasics/gem.json +++ b/Gems/UiBasics/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "The UI Basics Gem provides a collection of basic UI prefabs such as image, text, and button, that can be used with LyShine, the Open 3D Engine runtime User Interface system and editor.", "canonical_tags": [ diff --git a/Gems/Vegetation/gem.json b/Gems/Vegetation/gem.json index 75416933f0..8dfd3b3a59 100644 --- a/Gems/Vegetation/gem.json +++ b/Gems/Vegetation/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Vegetation Gem provides tools to place natural-looking vegetation in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/VideoPlaybackFramework/gem.json b/Gems/VideoPlaybackFramework/gem.json index 381738ab4b..9115148c50 100644 --- a/Gems/VideoPlaybackFramework/gem.json +++ b/Gems/VideoPlaybackFramework/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Video Playback Framework Gem provides the interface to play back video.", "canonical_tags": [ diff --git a/Gems/VirtualGamepad/gem.json b/Gems/VirtualGamepad/gem.json index 637776ac85..a2a669bb11 100644 --- a/Gems/VirtualGamepad/gem.json +++ b/Gems/VirtualGamepad/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Virtual Gamepad Gem provides controls that emulate a gamepad on touch screen devices.", "canonical_tags": [ diff --git a/Gems/WhiteBox/CMakeLists.txt b/Gems/WhiteBox/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/WhiteBox/CMakeLists.txt +++ b/Gems/WhiteBox/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/WhiteBox/Code/CMakeLists.txt b/Gems/WhiteBox/Code/CMakeLists.txt index bfc4eb724a..91536503ac 100644 --- a/Gems/WhiteBox/Code/CMakeLists.txt +++ b/Gems/WhiteBox/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/Gems/WhiteBox/gem.json b/Gems/WhiteBox/gem.json index 2d173e9a6b..18a3022b74 100644 --- a/Gems/WhiteBox/gem.json +++ b/Gems/WhiteBox/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The White Box Gem provides White Box rapid design components for Open 3D Engine.", "canonical_tags": [ diff --git a/Templates/AssetGem/Template/gem.json b/Templates/AssetGem/Template/gem.json index 2a02362256..b04ecf9dd8 100644 --- a/Templates/AssetGem/Template/gem.json +++ b/Templates/AssetGem/Template/gem.json @@ -1,18 +1,21 @@ { "gem_name": "${Name}", "display_name": "${Name}", - "license": "What license ${Name} uses goes here: i.e. Apache-2.0 Or MIT", - "license_url": "", - "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "license": "What license ${Name} uses goes here: i.e. Apache-2.0 or MIT", + "license_url": "Link to the license web site goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT", + "origin": "The name of the originator goes here. i.e. XYZ Inc.", + "origin_url": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", "type": "Asset", - "summary": "A short description of ${Name}.", + "summary": "A short description of ${Name} goes here.", "canonical_tags": [ "Gem" ], "user_tags": [ - "Assets", "${Name}" ], "icon_path": "preview.png", - "requirements": "" + "requirements": "Notice of any requirements ${Name} has goes here. i.e. This requires X other gem", + "documentation_url": "Link to any documentation of ${Name} goes here: i.e. https://o3de.org/docs/user-guide/gems/reference/design/white-box/", + "dependencies": [ + ] } diff --git a/Templates/AssetGem/template.json b/Templates/AssetGem/template.json index e858dc526d..2f390f2077 100644 --- a/Templates/AssetGem/template.json +++ b/Templates/AssetGem/template.json @@ -1,10 +1,17 @@ { "template_name": "AssetGem", - "origin": "The primary repo for AssetGem goes here: i.e. http://www.mydomain.com", - "license": "What license AssetGem uses goes here: i.e. https://opensource.org/licenses/MIT", - "display_name": "AssetGem", - "summary": "A short description of AssetGem template.", - "canonical_tags": [], + "template_restricted_platform_relative_path": "Templates/AssetGem", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", + "license": "Apache-2.0 or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "display_name": "Asset Gem Template", + "summary": "Use this gem template to create the minimal gem needed for adding asset(s).", + "canonical_tags": [ + "Template", + "Gem", + "Asset" + ], "user_tags": [ "AssetGem" ], @@ -12,27 +19,20 @@ "copyFiles": [ { "file": "CMakeLists.txt", - "origin": "CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "gem.json", - "origin": "gem.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "preview.png", - "origin": "preview.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false } ], "createDirectories": [ { - "dir": "Assets", - "origin": "Assets" + "dir": "Assets" } ] } diff --git a/Templates/CppToolGem/Template/gem.json b/Templates/CppToolGem/Template/gem.json index 079b7152ff..05be122226 100644 --- a/Templates/CppToolGem/Template/gem.json +++ b/Templates/CppToolGem/Template/gem.json @@ -1,11 +1,12 @@ { "gem_name": "${Name}", "display_name": "${Name}", - "license": "What license ${Name} uses goes here: i.e. Apache-2.0 Or MIT", - "license_url": "", - "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "license": "What license ${Name} uses goes here: i.e. Apache-2.0 or MIT", + "license_url": "Link to the license web site goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT", + "origin": "The name of the originator goes here. i.e. XYZ Inc.", + "origin_url": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", "type": "Code", - "summary": "A short description of ${Name}.", + "summary": "A short description of ${Name} goes here.", "canonical_tags": [ "Gem" ], @@ -13,6 +14,8 @@ "${Name}" ], "icon_path": "preview.png", - "requirements": "", - "restricted_name": "gems" + "requirements": "Notice of any requirements ${Name} has goes here. i.e. This requires X other gem", + "documentation_url": "Link to any documentation of ${Name} goes here: i.e. https://o3de.org/docs/user-guide/gems/reference/design/white-box/", + "dependencies": [ + ] } diff --git a/Templates/CppToolGem/template.json b/Templates/CppToolGem/template.json index b516dbaec3..16874326ef 100644 --- a/Templates/CppToolGem/template.json +++ b/Templates/CppToolGem/template.json @@ -1,10 +1,16 @@ { "template_name": "CppToolGem", - "origin": "The primary repo for CppToolGem goes here: i.e. http://www.mydomain.com", - "license": "What license CppToolGem uses goes here: i.e. https://opensource.org/licenses/MIT", + "template_restricted_platform_relative_path": "Templates/CppToolGem", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", + "license": "Apache-2.0 or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "display_name": "CppToolGem", "summary": "A gem template for a custom tool in C++ that gets registered with the Editor.", - "canonical_tags": [], + "canonical_tags": [ + "Template", + "Gem" + ], "user_tags": [ "CppToolGem" ], @@ -12,371 +18,255 @@ "copyFiles": [ { "file": "CMakeLists.txt", - "origin": "CMakeLists.txt", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Code/${NameLower}_editor_files.cmake", - "origin": "Code/${NameLower}_editor_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_editor_shared_files.cmake", - "origin": "Code/${NameLower}_editor_shared_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_editor_tests_files.cmake", - "origin": "Code/${NameLower}_editor_tests_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_files.cmake", - "origin": "Code/${NameLower}_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_shared_files.cmake", - "origin": "Code/${NameLower}_shared_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_tests_files.cmake", - "origin": "Code/${NameLower}_tests_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/CMakeLists.txt", - "origin": "Code/CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Include/${Name}/${Name}Bus.h", - "origin": "Code/Include/${Name}/${Name}Bus.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Android/${NameLower}_android_files.cmake", - "origin": "Code/Platform/Android/${NameLower}_android_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Android/${NameLower}_shared_android_files.cmake", - "origin": "Code/Platform/Android/${NameLower}_shared_android_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Android/PAL_android.cmake", - "origin": "Code/Platform/Android/PAL_android.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/PAL_linux.cmake", - "origin": "Code/Platform/Linux/PAL_linux.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/PAL_mac.cmake", - "origin": "Code/Platform/Mac/PAL_mac.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/PAL_windows.cmake", - "origin": "Code/Platform/Windows/PAL_windows.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/iOS/${NameLower}_ios_files.cmake", - "origin": "Code/Platform/iOS/${NameLower}_ios_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/iOS/${NameLower}_shared_ios_files.cmake", - "origin": "Code/Platform/iOS/${NameLower}_shared_ios_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/iOS/PAL_ios.cmake", - "origin": "Code/Platform/iOS/PAL_ios.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}.qrc", - "origin": "Code/Source/${Name}.qrc", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorModule.cpp", - "origin": "Code/Source/${Name}EditorModule.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorSystemComponent.cpp", - "origin": "Code/Source/${Name}EditorSystemComponent.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorSystemComponent.h", - "origin": "Code/Source/${Name}EditorSystemComponent.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}Module.cpp", - "origin": "Code/Source/${Name}Module.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}ModuleInterface.h", - "origin": "Code/Source/${Name}ModuleInterface.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}SystemComponent.cpp", - "origin": "Code/Source/${Name}SystemComponent.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}SystemComponent.h", - "origin": "Code/Source/${Name}SystemComponent.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}Widget.cpp", - "origin": "Code/Source/${Name}Widget.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}Widget.h", - "origin": "Code/Source/${Name}Widget.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/toolbar_icon.svg", - "origin": "Code/Source/toolbar_icon.svg", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Code/Tests/${Name}EditorTest.cpp", - "origin": "Code/Tests/${Name}EditorTest.cpp", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Code/Tests/${Name}Test.cpp", - "origin": "Code/Tests/${Name}Test.cpp", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Android/android_gem.cmake", - "origin": "Platform/Android/android_gem.cmake", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Android/android_gem.json", - "origin": "Platform/Android/android_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Linux/linux_gem.cmake", - "origin": "Platform/Linux/linux_gem.cmake", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Linux/linux_gem.json", - "origin": "Platform/Linux/linux_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Mac/mac_gem.cmake", - "origin": "Platform/Mac/mac_gem.cmake", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Mac/mac_gem.json", - "origin": "Platform/Mac/mac_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Windows/windows_gem.cmake", - "origin": "Platform/Windows/windows_gem.cmake", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Windows/windows_gem.json", - "origin": "Platform/Windows/windows_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/iOS/ios_gem.cmake", - "origin": "Platform/iOS/ios_gem.cmake", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/iOS/ios_gem.json", - "origin": "Platform/iOS/ios_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "gem.json", - "origin": "gem.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "preview.png", - "origin": "preview.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false } ], "createDirectories": [ { - "dir": "Assets", - "origin": "Assets" + "dir": "Assets" }, { - "dir": "Code", - "origin": "Code" + "dir": "Code" }, { - "dir": "Code/Include", - "origin": "Code/Include" + "dir": "Code/Include" }, { - "dir": "Code/Include/${Name}", - "origin": "Code/Include/${Name}" + "dir": "Code/Include/${Name}" }, { - "dir": "Code/Platform", - "origin": "Code/Platform" + "dir": "Code/Platform" }, { - "dir": "Code/Platform/Android", - "origin": "Code/Platform/Android" + "dir": "Code/Platform/Android" }, { - "dir": "Code/Platform/Linux", - "origin": "Code/Platform/Linux" + "dir": "Code/Platform/Linux" }, { - "dir": "Code/Platform/Mac", - "origin": "Code/Platform/Mac" + "dir": "Code/Platform/Mac" }, { - "dir": "Code/Platform/Windows", - "origin": "Code/Platform/Windows" + "dir": "Code/Platform/Windows" }, { - "dir": "Code/Platform/iOS", - "origin": "Code/Platform/iOS" + "dir": "Code/Platform/iOS" }, { - "dir": "Code/Source", - "origin": "Code/Source" + "dir": "Code/Source" }, { - "dir": "Code/Tests", - "origin": "Code/Tests" + "dir": "Code/Tests" }, { - "dir": "Platform", - "origin": "Platform" + "dir": "Platform" }, { - "dir": "Platform/Android", - "origin": "Platform/Android" + "dir": "Platform/Android" }, { - "dir": "Platform/Linux", - "origin": "Platform/Linux" + "dir": "Platform/Linux" }, { - "dir": "Platform/Mac", - "origin": "Platform/Mac" + "dir": "Platform/Mac" }, { - "dir": "Platform/Windows", - "origin": "Platform/Windows" + "dir": "Platform/Windows" }, { - "dir": "Platform/iOS", - "origin": "Platform/iOS" + "dir": "Platform/iOS" } ] } diff --git a/Templates/DefaultGem/Template/CMakeLists.txt b/Templates/DefaultGem/Template/CMakeLists.txt index b19ea2edce..f4c55dd1a5 100644 --- a/Templates/DefaultGem/Template/CMakeLists.txt +++ b/Templates/DefaultGem/Template/CMakeLists.txt @@ -6,12 +6,11 @@ # # {END_LICENSE} -set(o3de_gem_path ${CMAKE_CURRENT_LIST_DIR}) -set(o3de_gem_json ${o3de_gem_path}/gem.json) -o3de_read_json_key(o3de_gem_name ${o3de_gem_json} "gem_name") -o3de_restricted_path(${o3de_gem_json} o3de_gem_restricted_path) +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} "${o3de_gem_restricted_path}" ${o3de_gem_path} ${o3de_gem_name}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) # Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the # project cmake for this platform. diff --git a/Templates/DefaultGem/Template/Code/CMakeLists.txt b/Templates/DefaultGem/Template/Code/CMakeLists.txt index f462e7f2d4..c5ff305b2a 100644 --- a/Templates/DefaultGem/Template/Code/CMakeLists.txt +++ b/Templates/DefaultGem/Template/Code/CMakeLists.txt @@ -8,11 +8,11 @@ # Currently we are in the Code folder: ${CMAKE_CURRENT_LIST_DIR} # Get the platform specific folder ${pal_dir} for the current folder: ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} -# Note: ly_get_list_relative_pal_filename will take care of the details for us, as this may be a restricted platform +# Note: o3de_pal_dir will take care of the details for us, as this may be a restricted platform # in which case it will see if that platform is present here or in the restricted folder. # i.e. It could here in our gem : Gems/${Name}/Code/Platform/ or # //Gems/${Name}/Code -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${o3de_gem_restricted_path} ${o3de_gem_path} ${o3de_gem_name}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${o3de_gem_restricted_path} ${o3de_gem_path} ${o3de_gem_name}) # Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the # traits for this platform. Traits for a platform are defines for things like whether or not something in this gem diff --git a/Templates/DefaultGem/Template/gem.json b/Templates/DefaultGem/Template/gem.json index d4ff637bee..05be122226 100644 --- a/Templates/DefaultGem/Template/gem.json +++ b/Templates/DefaultGem/Template/gem.json @@ -1,11 +1,12 @@ { "gem_name": "${Name}", "display_name": "${Name}", - "license": "What license ${Name} uses goes here: i.e. Apache-2.0 Or MIT", - "license_url": "", - "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "license": "What license ${Name} uses goes here: i.e. Apache-2.0 or MIT", + "license_url": "Link to the license web site goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT", + "origin": "The name of the originator goes here. i.e. XYZ Inc.", + "origin_url": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", "type": "Code", - "summary": "A short description of ${Name}.", + "summary": "A short description of ${Name} goes here.", "canonical_tags": [ "Gem" ], @@ -13,5 +14,8 @@ "${Name}" ], "icon_path": "preview.png", - "requirements": "" + "requirements": "Notice of any requirements ${Name} has goes here. i.e. This requires X other gem", + "documentation_url": "Link to any documentation of ${Name} goes here: i.e. https://o3de.org/docs/user-guide/gems/reference/design/white-box/", + "dependencies": [ + ] } diff --git a/Templates/DefaultGem/template.json b/Templates/DefaultGem/template.json index e24632d6a0..e5dc570cbe 100644 --- a/Templates/DefaultGem/template.json +++ b/Templates/DefaultGem/template.json @@ -1,12 +1,16 @@ { "template_name": "DefaultGem", + "template_restricted_platform_relative_path": "Templates/DefaultGem", "restricted_name": "o3de", - "restricted_platform_relative_path": "Templates", - "origin": "The primary repo for DefaultGem goes here: i.e. http://www.mydomain.com", - "license": "What license DefaultGem uses goes here: i.e. https://opensource.org/licenses/MIT", - "display_name": "DefaultGem", - "summary": "A short description of DefaultGem.", - "canonical_tags": [], + "restricted_platform_relative_path": "Templates/DefaultGem", + "license": "Apache-2.0 or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "display_name": "Default Gem Template", + "summary": "This is the gem template that will be used if no gem template is specified during gem creation.", + "canonical_tags": [ + "Template", + "Gem" + ], "user_tags": [ "DefaultGem" ], @@ -14,347 +18,239 @@ "copyFiles": [ { "file": "CMakeLists.txt", - "origin": "CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_editor_files.cmake", - "origin": "Code/${NameLower}_editor_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_editor_shared_files.cmake", - "origin": "Code/${NameLower}_editor_shared_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_editor_tests_files.cmake", - "origin": "Code/${NameLower}_editor_tests_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_files.cmake", - "origin": "Code/${NameLower}_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_shared_files.cmake", - "origin": "Code/${NameLower}_shared_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_tests_files.cmake", - "origin": "Code/${NameLower}_tests_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/CMakeLists.txt", - "origin": "Code/CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Include/${Name}/${Name}Bus.h", - "origin": "Code/Include/${Name}/${Name}Bus.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Android/${NameLower}_android_files.cmake", - "origin": "Code/Platform/Android/${NameLower}_android_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Android/${NameLower}_shared_android_files.cmake", - "origin": "Code/Platform/Android/${NameLower}_shared_android_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Android/PAL_android.cmake", - "origin": "Code/Platform/Android/PAL_android.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/PAL_linux.cmake", - "origin": "Code/Platform/Linux/PAL_linux.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/PAL_mac.cmake", - "origin": "Code/Platform/Mac/PAL_mac.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/PAL_windows.cmake", - "origin": "Code/Platform/Windows/PAL_windows.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/iOS/${NameLower}_ios_files.cmake", - "origin": "Code/Platform/iOS/${NameLower}_ios_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/iOS/${NameLower}_shared_ios_files.cmake", - "origin": "Code/Platform/iOS/${NameLower}_shared_ios_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/iOS/PAL_ios.cmake", - "origin": "Code/Platform/iOS/PAL_ios.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorModule.cpp", - "origin": "Code/Source/${Name}EditorModule.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorSystemComponent.cpp", - "origin": "Code/Source/${Name}EditorSystemComponent.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorSystemComponent.h", - "origin": "Code/Source/${Name}EditorSystemComponent.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}Module.cpp", - "origin": "Code/Source/${Name}Module.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}ModuleInterface.h", - "origin": "Code/Source/${Name}ModuleInterface.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}SystemComponent.cpp", - "origin": "Code/Source/${Name}SystemComponent.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}SystemComponent.h", - "origin": "Code/Source/${Name}SystemComponent.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Tests/${Name}EditorTest.cpp", - "origin": "Code/Tests/${Name}EditorTest.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Tests/${Name}Test.cpp", - "origin": "Code/Tests/${Name}Test.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Android/android_gem.cmake", - "origin": "Platform/Android/android_gem.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Android/android_gem.json", - "origin": "Platform/Android/android_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Linux/linux_gem.cmake", - "origin": "Platform/Linux/linux_gem.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Linux/linux_gem.json", - "origin": "Platform/Linux/linux_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Mac/mac_gem.cmake", - "origin": "Platform/Mac/mac_gem.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Mac/mac_gem.json", - "origin": "Platform/Mac/mac_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Windows/windows_gem.cmake", - "origin": "Platform/Windows/windows_gem.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Windows/windows_gem.json", - "origin": "Platform/Windows/windows_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/iOS/ios_gem.cmake", - "origin": "Platform/iOS/ios_gem.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/iOS/ios_gem.json", - "origin": "Platform/iOS/ios_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "gem.json", - "origin": "gem.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "preview.png", - "origin": "preview.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false } ], "createDirectories": [ { - "dir": "Assets", - "origin": "Assets" + "dir": "Assets" }, { - "dir": "Code", - "origin": "Code" + "dir": "Code" }, { - "dir": "Code/Include", - "origin": "Code/Include" + "dir": "Code/Include" }, { - "dir": "Code/Include/${Name}", - "origin": "Code/Include/${Name}" + "dir": "Code/Include/${Name}" }, { - "dir": "Code/Platform", - "origin": "Code/Platform" + "dir": "Code/Platform" }, { - "dir": "Code/Platform/Android", - "origin": "Code/Platform/Android" + "dir": "Code/Platform/Android" }, { - "dir": "Code/Platform/Linux", - "origin": "Code/Platform/Linux" + "dir": "Code/Platform/Linux" }, { - "dir": "Code/Platform/Mac", - "origin": "Code/Platform/Mac" + "dir": "Code/Platform/Mac" }, { - "dir": "Code/Platform/Windows", - "origin": "Code/Platform/Windows" + "dir": "Code/Platform/Windows" }, { - "dir": "Code/Platform/iOS", - "origin": "Code/Platform/iOS" + "dir": "Code/Platform/iOS" }, { - "dir": "Code/Source", - "origin": "Code/Source" + "dir": "Code/Source" }, { - "dir": "Code/Tests", - "origin": "Code/Tests" + "dir": "Code/Tests" }, { - "dir": "Platform", - "origin": "Platform" + "dir": "Platform" }, { - "dir": "Platform/Android", - "origin": "Platform/Android" + "dir": "Platform/Android" }, { - "dir": "Platform/Linux", - "origin": "Platform/Linux" + "dir": "Platform/Linux" }, { - "dir": "Platform/Mac", - "origin": "Platform/Mac" + "dir": "Platform/Mac" }, { - "dir": "Platform/Windows", - "origin": "Platform/Windows" + "dir": "Platform/Windows" }, { - "dir": "Platform/iOS", - "origin": "Platform/iOS" + "dir": "Platform/iOS" } ] } diff --git a/Templates/DefaultProject/Template/CMakeLists.txt b/Templates/DefaultProject/Template/CMakeLists.txt index ae4bb662a3..420a92948d 100644 --- a/Templates/DefaultProject/Template/CMakeLists.txt +++ b/Templates/DefaultProject/Template/CMakeLists.txt @@ -29,5 +29,4 @@ else() set_property(GLOBAL APPEND PROPERTY LY_PROJECTS_TARGET_NAME ${project_target_name}) - add_subdirectory(Code) endif() diff --git a/Templates/DefaultProject/Template/Code/${NameLower}_files.cmake b/Templates/DefaultProject/Template/Gem/${NameLower}_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/${NameLower}_files.cmake rename to Templates/DefaultProject/Template/Gem/${NameLower}_files.cmake diff --git a/Templates/DefaultProject/Template/Code/${NameLower}_shared_files.cmake b/Templates/DefaultProject/Template/Gem/${NameLower}_shared_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/${NameLower}_shared_files.cmake rename to Templates/DefaultProject/Template/Gem/${NameLower}_shared_files.cmake diff --git a/Templates/MinimalProject/Template/Code/CMakeLists.txt b/Templates/DefaultProject/Template/Gem/CMakeLists.txt similarity index 87% rename from Templates/MinimalProject/Template/Code/CMakeLists.txt rename to Templates/DefaultProject/Template/Gem/CMakeLists.txt index 5e646c0704..fc3eab6535 100644 --- a/Templates/MinimalProject/Template/Code/CMakeLists.txt +++ b/Templates/DefaultProject/Template/Gem/CMakeLists.txt @@ -6,13 +6,17 @@ # # {END_LICENSE} +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + # Currently we are in the ${Name}/Code folder: ${CMAKE_CURRENT_LIST_DIR} # Get the platform specific folder ${pal_dir} for the current folder: ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} -# Note: ly_get_list_relative_pal_filename will take care of the details for us, as this may be a restricted platform +# Note: o3de_pal_dir will take care of the details for us, as this may be a restricted platform # in which case it will see if that platform is present here or in the restricted folder. -# i.e. It could here : ${Name}/Code/Platform/ or +# i.e. It could here : ${Name}/Code/Platform/ or # //${Name}/Code -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${o3de_project_restricted_path} ${o3de_project_path} ${o3de_project_name}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) # Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the # traits for this platform. Traits for a platform are defines for things like whether or not something in this project @@ -71,7 +75,6 @@ ly_create_alias(NAME ${Name}.Servers NAMESPACE Gem TARGETS Gem::${Name}) # Enable the specified list of gems from GEM_FILE or GEMS list for this specific project: ly_enable_gems(PROJECT_NAME ${Name} GEM_FILE enabled_gems.cmake) - if(PAL_TRAIT_BUILD_SERVER_SUPPORTED) # this property causes it to actually make a ServerLauncher. # if you don't want a Server application, you can remove this and the diff --git a/Templates/DefaultProject/Template/Code/Include/${Name}/${Name}Bus.h b/Templates/DefaultProject/Template/Gem/Include/${Name}/${Name}Bus.h similarity index 99% rename from Templates/DefaultProject/Template/Code/Include/${Name}/${Name}Bus.h rename to Templates/DefaultProject/Template/Gem/Include/${Name}/${Name}Bus.h index d09bb2b009..d72b5785c3 100644 --- a/Templates/DefaultProject/Template/Code/Include/${Name}/${Name}Bus.h +++ b/Templates/DefaultProject/Template/Gem/Include/${Name}/${Name}Bus.h @@ -22,7 +22,7 @@ namespace ${SanitizedCppName} virtual ~${SanitizedCppName}Requests() = default; // Put your public methods here }; - + class ${SanitizedCppName}BusTraits : public AZ::EBusTraits { diff --git a/Templates/DefaultProject/Template/Code/Platform/Android/${NameLower}_android_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/Android/${NameLower}_android_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Android/${NameLower}_android_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Android/${NameLower}_android_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Android/${NameLower}_shared_android_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/Android/${NameLower}_shared_android_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Android/${NameLower}_shared_android_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Android/${NameLower}_shared_android_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Android/PAL_android.cmake b/Templates/DefaultProject/Template/Gem/Platform/Android/PAL_android.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Android/PAL_android.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Android/PAL_android.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Linux/${NameLower}_linux_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/Linux/${NameLower}_linux_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Linux/${NameLower}_linux_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Linux/${NameLower}_linux_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Linux/${NameLower}_shared_linux_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/Linux/${NameLower}_shared_linux_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Linux/${NameLower}_shared_linux_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Linux/${NameLower}_shared_linux_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Linux/PAL_linux.cmake b/Templates/DefaultProject/Template/Gem/Platform/Linux/PAL_linux.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Linux/PAL_linux.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Linux/PAL_linux.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Mac/${NameLower}_mac_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/Mac/${NameLower}_mac_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Mac/${NameLower}_mac_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Mac/${NameLower}_mac_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Mac/${NameLower}_shared_mac_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/Mac/${NameLower}_shared_mac_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Mac/${NameLower}_shared_mac_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Mac/${NameLower}_shared_mac_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Mac/PAL_mac.cmake b/Templates/DefaultProject/Template/Gem/Platform/Mac/PAL_mac.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Mac/PAL_mac.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Mac/PAL_mac.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Windows/${NameLower}_shared_windows_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/Windows/${NameLower}_shared_windows_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Windows/${NameLower}_shared_windows_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Windows/${NameLower}_shared_windows_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Windows/${NameLower}_windows_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/Windows/${NameLower}_windows_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Windows/${NameLower}_windows_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Windows/${NameLower}_windows_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Windows/PAL_windows.cmake b/Templates/DefaultProject/Template/Gem/Platform/Windows/PAL_windows.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Windows/PAL_windows.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Windows/PAL_windows.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/iOS/${NameLower}_ios_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/iOS/${NameLower}_ios_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/iOS/${NameLower}_ios_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/iOS/${NameLower}_ios_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/iOS/${NameLower}_shared_ios_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/iOS/${NameLower}_shared_ios_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/iOS/${NameLower}_shared_ios_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/iOS/${NameLower}_shared_ios_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/iOS/PAL_ios.cmake b/Templates/DefaultProject/Template/Gem/Platform/iOS/PAL_ios.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/iOS/PAL_ios.cmake rename to Templates/DefaultProject/Template/Gem/Platform/iOS/PAL_ios.cmake diff --git a/Templates/DefaultProject/Template/Code/Source/${Name}Module.cpp b/Templates/DefaultProject/Template/Gem/Source/${Name}Module.cpp similarity index 100% rename from Templates/DefaultProject/Template/Code/Source/${Name}Module.cpp rename to Templates/DefaultProject/Template/Gem/Source/${Name}Module.cpp diff --git a/Templates/DefaultProject/Template/Code/Source/${Name}SystemComponent.cpp b/Templates/DefaultProject/Template/Gem/Source/${Name}SystemComponent.cpp similarity index 99% rename from Templates/DefaultProject/Template/Code/Source/${Name}SystemComponent.cpp rename to Templates/DefaultProject/Template/Gem/Source/${Name}SystemComponent.cpp index cfb6ae3c42..487391c716 100644 --- a/Templates/DefaultProject/Template/Code/Source/${Name}SystemComponent.cpp +++ b/Templates/DefaultProject/Template/Gem/Source/${Name}SystemComponent.cpp @@ -52,7 +52,7 @@ namespace ${SanitizedCppName} void ${SanitizedCppName}SystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent) { } - + ${SanitizedCppName}SystemComponent::${SanitizedCppName}SystemComponent() { if (${SanitizedCppName}Interface::Get() == nullptr) diff --git a/Templates/DefaultProject/Template/Code/Source/${Name}SystemComponent.h b/Templates/DefaultProject/Template/Gem/Source/${Name}SystemComponent.h similarity index 100% rename from Templates/DefaultProject/Template/Code/Source/${Name}SystemComponent.h rename to Templates/DefaultProject/Template/Gem/Source/${Name}SystemComponent.h diff --git a/Templates/DefaultProject/Template/Code/enabled_gems.cmake b/Templates/DefaultProject/Template/Gem/enabled_gems.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/enabled_gems.cmake rename to Templates/DefaultProject/Template/Gem/enabled_gems.cmake diff --git a/Templates/DefaultProject/Template/Gem/gem.json b/Templates/DefaultProject/Template/Gem/gem.json new file mode 100644 index 0000000000..b60f512006 --- /dev/null +++ b/Templates/DefaultProject/Template/Gem/gem.json @@ -0,0 +1,21 @@ +{ + "gem_name": "${Name}", + "display_name": "${Name}", + "license": "What license ${Name} uses goes here: i.e. Apache-2.0 or MIT", + "license_url": "Link to the license web site goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT", + "origin": "The name of the originator goes here. i.e. XYZ Inc.", + "origin_url": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "type": "", + "summary": "A short description of ${Name}.", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + "${Name}" + ], + "icon_path": "preview.png", + "requirements": "", + "documentation_url": "", + "dependencies": [ + ] +} diff --git a/Templates/DefaultProject/Template/project.json b/Templates/DefaultProject/Template/project.json index f8d4643ce9..6d1875fcaa 100644 --- a/Templates/DefaultProject/Template/project.json +++ b/Templates/DefaultProject/Template/project.json @@ -2,7 +2,7 @@ "project_name": "${Name}", "project_id": "${ProjectId}", "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", - "license": "What license ${Name} uses goes here: i.e. https://opensource.org/licenses/MIT", + "license": "What license ${Name} uses goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT etc.", "display_name": "${Name}", "summary": "A short description of ${Name}.", "canonical_tags": [ @@ -13,5 +13,8 @@ ], "icon_path": "preview.png", "engine": "o3de", - "external_subdirectories": [] + "external_subdirectories": [ + "Gem" + ], + "restricted": "${Name}" } diff --git a/Templates/DefaultProject/template.json b/Templates/DefaultProject/template.json index fcffafcb34..203e1ec4ef 100644 --- a/Templates/DefaultProject/template.json +++ b/Templates/DefaultProject/template.json @@ -1,12 +1,18 @@ { "template_name": "DefaultProject", + "template_restricted_platform_relative_path": "Templates/DefaultProject", "restricted_name": "o3de", - "restricted_platform_relative_path": "Templates", - "origin": "The primary repo for DefaultProject goes here: i.e. http://www.mydomain.com", - "license": "What license DefaultProject uses goes here: i.e. https://opensource.org/licenses/MIT", - "display_name": "Standard", - "summary": "This template has everything you need to build a full online 3D game or application.", - "canonical_tags": [], + "restricted_platform_relative_path": "Templates/DefaultProject", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", + "license": "Apache-2.0 or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "display_name": "Default Project Template", + "summary": "This is the project template that will be used if no project template is specified during project creation.", + "canonical_tags": [ + "Template", + "Project" + ], "user_tags": [ "DefaultProject" ], @@ -14,657 +20,459 @@ "copyFiles": [ { "file": ".gitignore", - "origin": ".gitignore", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "CMakeLists.txt", - "origin": "CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { - "file": "Code/${NameLower}_files.cmake", - "origin": "Code/${NameLower}_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "cmake/EngineFinder.cmake", + "isTemplated": true }, { - "file": "Code/${NameLower}_shared_files.cmake", - "origin": "Code/${NameLower}_shared_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "cmake/CompilerSettings.cmake", + "isTemplated": false }, { - "file": "Code/CMakeLists.txt", - "origin": "Code/CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "file": "cmake/Platform/Linux/CompilerSettings_linux.cmake", + "isTemplated": false }, { - "file": "Code/Include/${Name}/${Name}Bus.h", - "origin": "Code/Include/${Name}/${Name}Bus.h", - "isTemplated": true, - "isOptional": false + "file": "Config/default_aws_resource_mappings.json", + "isTemplated": false }, { - "file": "Code/Platform/Android/${NameLower}_android_files.cmake", - "origin": "Code/Platform/Android/${NameLower}_android_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Config/shader_global_build_options.json", + "isTemplated": false }, { - "file": "Code/Platform/Android/${NameLower}_shared_android_files.cmake", - "origin": "Code/Platform/Android/${NameLower}_shared_android_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/${NameLower}_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Android/PAL_android.cmake", - "origin": "Code/Platform/Android/PAL_android.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/${NameLower}_shared_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/CMakeLists.txt", + "isTemplated": true }, { - "file": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Include/${Name}/${Name}Bus.h", + "isTemplated": true }, { - "file": "Code/Platform/Linux/PAL_linux.cmake", - "origin": "Code/Platform/Linux/PAL_linux.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Android/${NameLower}_android_files.cmake", + "isTemplated": false }, { - "file": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Android/${NameLower}_shared_android_files.cmake", + "isTemplated": false }, { - "file": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Android/PAL_android.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Mac/PAL_mac.cmake", - "origin": "Code/Platform/Mac/PAL_mac.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Linux/${NameLower}_linux_files.cmake", + "isTemplated": false }, { - "file": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Linux/${NameLower}_shared_linux_files.cmake", + "isTemplated": false }, { - "file": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Linux/PAL_linux.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Windows/PAL_windows.cmake", - "origin": "Code/Platform/Windows/PAL_windows.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Mac/${NameLower}_mac_files.cmake", + "isTemplated": false }, { - "file": "Code/Platform/iOS/${NameLower}_ios_files.cmake", - "origin": "Code/Platform/iOS/${NameLower}_ios_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Mac/${NameLower}_shared_mac_files.cmake", + "isTemplated": false }, { - "file": "Code/Platform/iOS/${NameLower}_shared_ios_files.cmake", - "origin": "Code/Platform/iOS/${NameLower}_shared_ios_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Mac/PAL_mac.cmake", + "isTemplated": true }, { - "file": "Code/Platform/iOS/PAL_ios.cmake", - "origin": "Code/Platform/iOS/PAL_ios.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Windows/${NameLower}_shared_windows_files.cmake", + "isTemplated": false }, { - "file": "Code/Source/${Name}Module.cpp", - "origin": "Code/Source/${Name}Module.cpp", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Windows/${NameLower}_windows_files.cmake", + "isTemplated": false }, { - "file": "Code/Source/${Name}SystemComponent.cpp", - "origin": "Code/Source/${Name}SystemComponent.cpp", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Windows/PAL_windows.cmake", + "isTemplated": true }, { - "file": "Code/Source/${Name}SystemComponent.h", - "origin": "Code/Source/${Name}SystemComponent.h", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/iOS/${NameLower}_ios_files.cmake", + "isTemplated": false }, { - "file": "Code/enabled_gems.cmake", - "origin": "Code/enabled_gems.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/iOS/${NameLower}_shared_ios_files.cmake", + "isTemplated": false }, { - "file": "Code/gem.json", - "origin": "Code/gem.json", - "isTemplated": true, - "isOptional": true + "file": "Gem/Platform/iOS/PAL_ios.cmake", + "isTemplated": true }, { - "file": "Config/shader_global_build_options.json", - "origin": "Config/shader_global_build_options.json", - "isTemplated": false, - "isOptional": false + "file": "Gem/Source/${Name}Module.cpp", + "isTemplated": true }, { - "file": "Config/default_aws_resource_mappings.json", - "origin": "Config/default_aws_resource_mappings.json", - "isTemplated": false, - "isOptional": false + "file": "Gem/Source/${Name}SystemComponent.cpp", + "isTemplated": true }, { - "file": "cmake/EngineFinder.cmake", - "origin": "cmake/EngineFinder.cmake", - "isTemplated": false, - "isOptional": false + "file": "Gem/Source/${Name}SystemComponent.h", + "isTemplated": true }, { - "file": "cmake/CompilerSettings.cmake", - "origin": "cmake/CompilerSettings.cmake", - "isTemplated": false, - "isOptional": false + "file": "Gem/enabled_gems.cmake", + "isTemplated": true }, { - "file": "cmake/Platform/Linux/CompilerSettings_linux.cmake", - "origin": "cmake/Platform/Linux/CompilerSettings_linux.cmake", - "isTemplated": false, - "isOptional": false + "file": "Gem/gem.json", + "isTemplated": true }, { "file": "Platform/Android/android_project.cmake", - "origin": "Platform/Android/android_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Android/android_project.json", - "origin": "Platform/Android/android_project.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Linux/linux_project.cmake", - "origin": "Platform/Linux/linux_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Linux/linux_project.json", - "origin": "Platform/Linux/linux_project.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Mac/mac_project.cmake", - "origin": "Platform/Mac/mac_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Mac/mac_project.json", - "origin": "Platform/Mac/mac_project.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Windows/windows_project.cmake", - "origin": "Platform/Windows/windows_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Windows/windows_project.json", - "origin": "Platform/Windows/windows_project.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/iOS/ios_project.cmake", - "origin": "Platform/iOS/ios_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": false }, { "file": "Platform/iOS/ios_project.json", - "origin": "Platform/iOS/ios_project.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Registry/assets_scan_folders.setreg", - "origin": "Registry/assets_scan_folders.setreg", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Registry/awscoreconfiguration.setreg", - "origin": "Registry/awscoreconfiguration.setreg", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { - "file": "Resources/LegacyLogoLauncher.bmp", - "origin": "Resources/LegacyLogoLauncher.bmp", - "isTemplated": false, - "isOptional": false + "file": "Resources/GameSDK.ico", + "isTemplated": false }, { - "file": "Resources/GameSDK.ico", - "origin": "Resources/GameSDK.ico", - "isTemplated": false, - "isOptional": false + "file": "Resources/LegacyLogoLauncher.bmp", + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/Contents.json", - "origin": "Resources/Platform/Mac/Images.xcassets/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/Contents.json", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { - "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png", - "isTemplated": false, - "isOptional": false + "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128.png", + "isTemplated": false }, { - "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128.png", - "isTemplated": false, - "isOptional": false + "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png", + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16_2x.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { - "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png", - "isTemplated": false, - "isOptional": false + "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png", + "isTemplated": false }, { - "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png", - "isTemplated": false, - "isOptional": false + "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png", + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32_2x.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512_2x.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Info.plist", - "origin": "Resources/Platform/Mac/Info.plist", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Resources/Platform/iOS/Images.xcassets/Contents.json", - "origin": "Resources/Platform/iOS/Images.xcassets/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/Contents.json", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/Contents.json", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon152x152.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon152x152.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon76x76.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon76x76.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadProAppIcon167x167.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadProAppIcon167x167.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon29x29.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon29x29.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon58x58.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon58x58.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon40x40.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon40x40.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon80x80.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon80x80.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon120x120.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon120x120.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon180x180.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon180x180.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon58x58.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon58x58.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon87x87.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon87x87.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon120x120.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon120x120.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon80x80.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon80x80.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Info.plist", - "origin": "Resources/Platform/iOS/Info.plist", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "ShaderLib/README.md", - "origin": "ShaderLib/README.md", - "isTemplated": false, - "isOptional": true + "isTemplated": false }, { "file": "ShaderLib/scenesrg.srgi", - "origin": "ShaderLib/scenesrg.srgi", - "isTemplated": true, - "isOptional": false + "isTemplated": false }, { "file": "ShaderLib/viewsrg.srgi", - "origin": "ShaderLib/viewsrg.srgi", - "isTemplated": true, - "isOptional": false + "isTemplated": false }, { "file": "autoexec.cfg", - "origin": "autoexec.cfg", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "game.cfg", - "origin": "game.cfg", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "preview.png", - "origin": "preview.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "project.json", - "origin": "project.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true } ], "createDirectories": [ { - "dir": "Assets", - "origin": "Assets" + "dir": "Assets" + }, + { + "dir": "cmake" + }, + { + "dir": "cmake/Platform" + }, + { + "dir": "cmake/Platform/Linux" }, { - "dir": "Code", - "origin": "Code" + "dir": "Config" }, { - "dir": "Code/Include", - "origin": "Code/Include" + "dir": "Gem" }, { - "dir": "Code/Include/${Name}", - "origin": "Code/Include/${Name}" + "dir": "Gem/Include" }, { - "dir": "Code/Platform", - "origin": "Code/Platform" + "dir": "Gem/Include/${Name}" }, { - "dir": "Code/Platform/Android", - "origin": "Code/Platform/Android" + "dir": "Gem/Platform" }, { - "dir": "Code/Platform/Linux", - "origin": "Code/Platform/Linux" + "dir": "Gem/Platform/Android" }, { - "dir": "Code/Platform/Mac", - "origin": "Code/Platform/Mac" + "dir": "Gem/Platform/Linux" }, { - "dir": "Code/Platform/Windows", - "origin": "Code/Platform/Windows" + "dir": "Gem/Platform/Mac" }, { - "dir": "Code/Platform/iOS", - "origin": "Code/Platform/iOS" + "dir": "Gem/Platform/Windows" }, { - "dir": "Code/Source", - "origin": "Code/Source" + "dir": "Gem/Platform/iOS" }, { - "dir": "Config", - "origin": "Config" + "dir": "Gem/Source" }, { - "dir": "Platform", - "origin": "Platform" + "dir": "Platform" }, { - "dir": "Platform/Android", - "origin": "Platform/Android" + "dir": "Platform/Android" }, { - "dir": "Platform/Linux", - "origin": "Platform/Linux" + "dir": "Platform/Linux" }, { - "dir": "Platform/Mac", - "origin": "Platform/Mac" + "dir": "Platform/Mac" }, { - "dir": "Platform/Windows", - "origin": "Platform/Windows" + "dir": "Platform/Windows" }, { - "dir": "Platform/iOS", - "origin": "Platform/iOS" + "dir": "Platform/iOS" }, { - "dir": "Registry", - "origin": "Registry" + "dir": "Registry" }, { - "dir": "Resources", - "origin": "Resources" + "dir": "Resources" }, { - "dir": "Resources/Platform", - "origin": "Resources/Platform" + "dir": "Resources/Platform" }, { - "dir": "Resources/Platform/Mac", - "origin": "Resources/Platform/Mac" + "dir": "Resources/Platform/Mac" }, { - "dir": "Resources/Platform/Mac/Images.xcassets", - "origin": "Resources/Platform/Mac/Images.xcassets" + "dir": "Resources/Platform/Mac/Images.xcassets" }, { - "dir": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset" + "dir": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset" }, { - "dir": "Resources/Platform/iOS", - "origin": "Resources/Platform/iOS" + "dir": "Resources/Platform/iOS" }, { - "dir": "Resources/Platform/iOS/Images.xcassets", - "origin": "Resources/Platform/iOS/Images.xcassets" + "dir": "Resources/Platform/iOS/Images.xcassets" }, { - "dir": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage" + "dir": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage" }, { - "dir": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset" + "dir": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset" }, { - "dir": "ShaderLib", - "origin": "ShaderLib" + "dir": "ShaderLib" }, { - "dir": "Shaders", - "origin": "Shaders" + "dir": "Shaders" }, { - "dir": "Shaders/ShaderResourceGroups", - "origin": "Shaders/ShaderResourceGroups" + "dir": "Shaders/ShaderResourceGroups" } ] } diff --git a/Templates/GemRepo/Template/gem.json b/Templates/GemRepo/Template/gem.json index 292681b2b5..7ba555a127 100644 --- a/Templates/GemRepo/Template/gem.json +++ b/Templates/GemRepo/Template/gem.json @@ -1,19 +1,23 @@ { - "gem_name": "${Name}Gem", - "display_name": "${Name}Gem", - "license": "What license ${Name}Gem uses goes here: i.e. Apache-2.0 Or MIT", - "license_url": "", - "origin": "The primary repo for ${Name}Gem goes here: i.e. http://www.mydomain.com", - "summary": "A short description of ${Name}Gem which is zipped up in an archive named gem.zip in the root of the Gem Repo. Though not required, it is recommended that the sha256 of the gem.zip file should be placed in the sha256 field of this gem.json so the download can be verified.", + "gem_name": "${Name}", + "display_name": "${Name}", + "license": "What license ${Name} uses goes here: i.e. Apache-2.0 or MIT", + "license_url": "Link to the license web site goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT", + "origin": "The name of the originator goes here. i.e. XYZ Inc.", + "origin_url": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "type": "Code", + "summary": "A short description of ${Name} which is zipped up in an archive named gem.zip in the root of the Gem Repo. Though not required, it is recommended that the sha256 of the gem.zip file be placed in the sha256 field of this gem.json so the download can be verified.", "origin_uri": "${RepoURI}/gem.zip", "sha256": "", - "type": "Code", "canonical_tags": [ "Gem" ], "user_tags": [ - "${Name}Gem" + "${Name}" ], "icon_path": "preview.png", - "requirements": "" + "requirements": "", + "documentation_url": "", + "dependencies": [ + ] } diff --git a/Templates/GemRepo/template.json b/Templates/GemRepo/template.json index 88123a9dae..ca042329be 100644 --- a/Templates/GemRepo/template.json +++ b/Templates/GemRepo/template.json @@ -1,10 +1,14 @@ { "template_name": "GemRepo", - "origin": "The primary repo for GemRepo goes here: i.e. http://www.mydomain.com", - "license": "What license GemRepo uses goes here: i.e. https://opensource.org/licenses/MIT", + "origin_url": "https://github.com/o3de/o3de", + "license": "Apache-2.0 or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "display_name": "GemRepo", "summary": "A Gem Repository that contains a single Gem.", - "canonical_tags": [], + "canonical_tags": [ + "Gem", + "Repo" + ], "user_tags": [ "GemRepo" ], @@ -12,15 +16,11 @@ "copyFiles": [ { "file": "gem.json", - "origin": "gem.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "repo.json", - "origin": "repo.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true } ], "createDirectories": [] diff --git a/Templates/MinimalProject/Template/CMakeLists.txt b/Templates/MinimalProject/Template/CMakeLists.txt index ae4bb662a3..420a92948d 100644 --- a/Templates/MinimalProject/Template/CMakeLists.txt +++ b/Templates/MinimalProject/Template/CMakeLists.txt @@ -29,5 +29,4 @@ else() set_property(GLOBAL APPEND PROPERTY LY_PROJECTS_TARGET_NAME ${project_target_name}) - add_subdirectory(Code) endif() diff --git a/Templates/MinimalProject/Template/Code/${NameLower}_files.cmake b/Templates/MinimalProject/Template/Gem/${NameLower}_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/${NameLower}_files.cmake rename to Templates/MinimalProject/Template/Gem/${NameLower}_files.cmake diff --git a/Templates/MinimalProject/Template/Code/${NameLower}_shared_files.cmake b/Templates/MinimalProject/Template/Gem/${NameLower}_shared_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/${NameLower}_shared_files.cmake rename to Templates/MinimalProject/Template/Gem/${NameLower}_shared_files.cmake diff --git a/Templates/DefaultProject/Template/Code/CMakeLists.txt b/Templates/MinimalProject/Template/Gem/CMakeLists.txt similarity index 87% rename from Templates/DefaultProject/Template/Code/CMakeLists.txt rename to Templates/MinimalProject/Template/Gem/CMakeLists.txt index 7bbb9a0852..6b1dcf9172 100644 --- a/Templates/DefaultProject/Template/Code/CMakeLists.txt +++ b/Templates/MinimalProject/Template/Gem/CMakeLists.txt @@ -6,13 +6,17 @@ # # {END_LICENSE} +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + # Currently we are in the ${Name}/Code folder: ${CMAKE_CURRENT_LIST_DIR} # Get the platform specific folder ${pal_dir} for the current folder: ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} -# Note: ly_get_list_relative_pal_filename will take care of the details for us, as this may be a restricted platform +# Note: o3de_pal_dir will take care of the details for us, as this may be a restricted platform # in which case it will see if that platform is present here or in the restricted folder. -# i.e. It could here : ${Name}/Code/Platform/ or +# i.e. It could here : ${Name}/Code/Platform/ or # //${Name}/Code -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${o3de_project_restricted_path} ${o3de_project_path} ${o3de_project_name}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) # Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the # traits for this platform. Traits for a platform are defines for things like whether or not something in this project @@ -71,6 +75,7 @@ ly_create_alias(NAME ${Name}.Servers NAMESPACE Gem TARGETS Gem::${Name}) # Enable the specified list of gems from GEM_FILE or GEMS list for this specific project: ly_enable_gems(PROJECT_NAME ${Name} GEM_FILE enabled_gems.cmake) + if(PAL_TRAIT_BUILD_SERVER_SUPPORTED) # this property causes it to actually make a ServerLauncher. # if you don't want a Server application, you can remove this and the diff --git a/Templates/MinimalProject/Template/Code/Include/${Name}/${Name}Bus.h b/Templates/MinimalProject/Template/Gem/Include/${Name}/${Name}Bus.h similarity index 100% rename from Templates/MinimalProject/Template/Code/Include/${Name}/${Name}Bus.h rename to Templates/MinimalProject/Template/Gem/Include/${Name}/${Name}Bus.h diff --git a/Templates/MinimalProject/Template/Code/Platform/Android/${NameLower}_android_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/Android/${NameLower}_android_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Android/${NameLower}_android_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Android/${NameLower}_android_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Android/${NameLower}_shared_android_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/Android/${NameLower}_shared_android_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Android/${NameLower}_shared_android_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Android/${NameLower}_shared_android_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Android/PAL_android.cmake b/Templates/MinimalProject/Template/Gem/Platform/Android/PAL_android.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Android/PAL_android.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Android/PAL_android.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Linux/${NameLower}_linux_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/Linux/${NameLower}_linux_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Linux/${NameLower}_linux_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Linux/${NameLower}_linux_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Linux/${NameLower}_shared_linux_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/Linux/${NameLower}_shared_linux_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Linux/${NameLower}_shared_linux_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Linux/${NameLower}_shared_linux_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Linux/PAL_linux.cmake b/Templates/MinimalProject/Template/Gem/Platform/Linux/PAL_linux.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Linux/PAL_linux.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Linux/PAL_linux.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Mac/${NameLower}_mac_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/Mac/${NameLower}_mac_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Mac/${NameLower}_mac_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Mac/${NameLower}_mac_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Mac/${NameLower}_shared_mac_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/Mac/${NameLower}_shared_mac_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Mac/${NameLower}_shared_mac_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Mac/${NameLower}_shared_mac_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Mac/PAL_mac.cmake b/Templates/MinimalProject/Template/Gem/Platform/Mac/PAL_mac.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Mac/PAL_mac.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Mac/PAL_mac.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Windows/${NameLower}_shared_windows_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/Windows/${NameLower}_shared_windows_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Windows/${NameLower}_shared_windows_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Windows/${NameLower}_shared_windows_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Windows/${NameLower}_windows_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/Windows/${NameLower}_windows_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Windows/${NameLower}_windows_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Windows/${NameLower}_windows_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Windows/PAL_windows.cmake b/Templates/MinimalProject/Template/Gem/Platform/Windows/PAL_windows.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Windows/PAL_windows.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Windows/PAL_windows.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/iOS/${NameLower}_ios_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/iOS/${NameLower}_ios_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/iOS/${NameLower}_ios_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/iOS/${NameLower}_ios_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/iOS/${NameLower}_shared_ios_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/iOS/${NameLower}_shared_ios_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/iOS/${NameLower}_shared_ios_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/iOS/${NameLower}_shared_ios_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/iOS/PAL_ios.cmake b/Templates/MinimalProject/Template/Gem/Platform/iOS/PAL_ios.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/iOS/PAL_ios.cmake rename to Templates/MinimalProject/Template/Gem/Platform/iOS/PAL_ios.cmake diff --git a/Templates/MinimalProject/Template/Code/Source/${Name}Module.cpp b/Templates/MinimalProject/Template/Gem/Source/${Name}Module.cpp similarity index 100% rename from Templates/MinimalProject/Template/Code/Source/${Name}Module.cpp rename to Templates/MinimalProject/Template/Gem/Source/${Name}Module.cpp diff --git a/Templates/MinimalProject/Template/Code/Source/${Name}SystemComponent.cpp b/Templates/MinimalProject/Template/Gem/Source/${Name}SystemComponent.cpp similarity index 100% rename from Templates/MinimalProject/Template/Code/Source/${Name}SystemComponent.cpp rename to Templates/MinimalProject/Template/Gem/Source/${Name}SystemComponent.cpp diff --git a/Templates/MinimalProject/Template/Code/Source/${Name}SystemComponent.h b/Templates/MinimalProject/Template/Gem/Source/${Name}SystemComponent.h similarity index 100% rename from Templates/MinimalProject/Template/Code/Source/${Name}SystemComponent.h rename to Templates/MinimalProject/Template/Gem/Source/${Name}SystemComponent.h diff --git a/Templates/MinimalProject/Template/Code/enabled_gems.cmake b/Templates/MinimalProject/Template/Gem/enabled_gems.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/enabled_gems.cmake rename to Templates/MinimalProject/Template/Gem/enabled_gems.cmake diff --git a/Templates/MinimalProject/Template/Gem/gem.json b/Templates/MinimalProject/Template/Gem/gem.json new file mode 100644 index 0000000000..b60f512006 --- /dev/null +++ b/Templates/MinimalProject/Template/Gem/gem.json @@ -0,0 +1,21 @@ +{ + "gem_name": "${Name}", + "display_name": "${Name}", + "license": "What license ${Name} uses goes here: i.e. Apache-2.0 or MIT", + "license_url": "Link to the license web site goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT", + "origin": "The name of the originator goes here. i.e. XYZ Inc.", + "origin_url": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "type": "", + "summary": "A short description of ${Name}.", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + "${Name}" + ], + "icon_path": "preview.png", + "requirements": "", + "documentation_url": "", + "dependencies": [ + ] +} diff --git a/Templates/MinimalProject/Template/cmake/CompilerSettings.cmake b/Templates/MinimalProject/Template/cmake/CompilerSettings.cmake index 60bda1d45b..4efaecd60f 100644 --- a/Templates/MinimalProject/Template/cmake/CompilerSettings.cmake +++ b/Templates/MinimalProject/Template/cmake/CompilerSettings.cmake @@ -1,10 +1,10 @@ -# +# {BEGIN_LICENSE} # Copyright (c) Contributors to the Open 3D Engine Project. # For complete copyright and license terms please see the LICENSE at the root of this distribution. # # SPDX-License-Identifier: Apache-2.0 OR MIT # -# +# {END_LICENSE} # File to tweak compiler settings before compiler detection happens (before project() is called) # We dont have PAL enabled at this point, so we can only use pure-CMake variables diff --git a/Templates/MinimalProject/Template/cmake/Platform/Linux/CompilerSettings_linux.cmake b/Templates/MinimalProject/Template/cmake/Platform/Linux/CompilerSettings_linux.cmake index 9bb629c53b..386117873f 100644 --- a/Templates/MinimalProject/Template/cmake/Platform/Linux/CompilerSettings_linux.cmake +++ b/Templates/MinimalProject/Template/cmake/Platform/Linux/CompilerSettings_linux.cmake @@ -1,10 +1,10 @@ -# +# {BEGIN_LICENSE} # Copyright (c) Contributors to the Open 3D Engine Project. # For complete copyright and license terms please see the LICENSE at the root of this distribution. # # SPDX-License-Identifier: Apache-2.0 OR MIT # -# +# {END_LICENSE} if(NOT CMAKE_C_COMPILER AND NOT CMAKE_CXX_COMPILER AND NOT "$ENV{CC}" AND NOT "$ENV{CXX}") set(path_search diff --git a/Templates/MinimalProject/Template/project.json b/Templates/MinimalProject/Template/project.json index f8d4643ce9..a303186a64 100644 --- a/Templates/MinimalProject/Template/project.json +++ b/Templates/MinimalProject/Template/project.json @@ -2,7 +2,7 @@ "project_name": "${Name}", "project_id": "${ProjectId}", "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", - "license": "What license ${Name} uses goes here: i.e. https://opensource.org/licenses/MIT", + "license": "What license ${Name} uses goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT etc.", "display_name": "${Name}", "summary": "A short description of ${Name}.", "canonical_tags": [ @@ -13,5 +13,7 @@ ], "icon_path": "preview.png", "engine": "o3de", - "external_subdirectories": [] + "external_subdirectories": [ + "Gem" + ] } diff --git a/Templates/MinimalProject/template.json b/Templates/MinimalProject/template.json index 7d6a4f9b94..4cc3031ff5 100644 --- a/Templates/MinimalProject/template.json +++ b/Templates/MinimalProject/template.json @@ -1,10 +1,18 @@ { "template_name": "MinimalProject", - "origin": "The primary repo for MinimalProject goes here: i.e. http://www.mydomain.com", - "license": "What license MinimalProject uses goes here: i.e. https://opensource.org/licenses/MIT", - "display_name": "Minimal", - "summary": "This will be a good starting point for developers who are looking for building the game with the bare minimum of gems in O3DE, and adding more when needed. ", - "canonical_tags": [], + "template_restricted_platform_relative_path": "Templates/MinimalProject", + "restricted_name": "o3de", + "restricted_platform_relative_path": "Templates/MinimalProject", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", + "license": "Apache-2.0 or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "display_name": "Minimal Project Template", + "summary": "Use this project template to create project that is the absolute minimum needed to get started in O3DE.", + "canonical_tags": [ + "Template", + "Project" + ], "user_tags": [ "MinimalProject" ], @@ -12,645 +20,454 @@ "copyFiles": [ { "file": ".gitignore", - "origin": ".gitignore", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "CMakeLists.txt", - "origin": "CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { - "file": "Code/${NameLower}_files.cmake", - "origin": "Code/${NameLower}_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "cmake/EngineFinder.cmake", + "isTemplated": false }, { - "file": "Code/${NameLower}_shared_files.cmake", - "origin": "Code/${NameLower}_shared_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "cmake/CompilerSettings.cmake", + "isTemplated": false }, { - "file": "Code/CMakeLists.txt", - "origin": "Code/CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "file": "cmake/Platform/Linux/CompilerSettings_linux.cmake", + "isTemplated": false }, { - "file": "Code/Include/${Name}/${Name}Bus.h", - "origin": "Code/Include/${Name}/${Name}Bus.h", - "isTemplated": true, - "isOptional": false + "file": "Config/shader_global_build_options.json", + "isTemplated": false }, { - "file": "Code/Platform/Android/${NameLower}_android_files.cmake", - "origin": "Code/Platform/Android/${NameLower}_android_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/${NameLower}_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Android/${NameLower}_shared_android_files.cmake", - "origin": "Code/Platform/Android/${NameLower}_shared_android_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/${NameLower}_shared_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Android/PAL_android.cmake", - "origin": "Code/Platform/Android/PAL_android.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/CMakeLists.txt", + "isTemplated": true }, { - "file": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Include/${Name}/${Name}Bus.h", + "isTemplated": true }, { - "file": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Android/${NameLower}_android_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Linux/PAL_linux.cmake", - "origin": "Code/Platform/Linux/PAL_linux.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Android/${NameLower}_shared_android_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Android/PAL_android.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Linux/${NameLower}_linux_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Mac/PAL_mac.cmake", - "origin": "Code/Platform/Mac/PAL_mac.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Linux/${NameLower}_shared_linux_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Linux/PAL_linux.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Mac/${NameLower}_mac_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Windows/PAL_windows.cmake", - "origin": "Code/Platform/Windows/PAL_windows.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Mac/${NameLower}_shared_mac_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/iOS/${NameLower}_ios_files.cmake", - "origin": "Code/Platform/iOS/${NameLower}_ios_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Mac/PAL_mac.cmake", + "isTemplated": true }, { - "file": "Code/Platform/iOS/${NameLower}_shared_ios_files.cmake", - "origin": "Code/Platform/iOS/${NameLower}_shared_ios_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Windows/${NameLower}_shared_windows_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/iOS/PAL_ios.cmake", - "origin": "Code/Platform/iOS/PAL_ios.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Windows/${NameLower}_windows_files.cmake", + "isTemplated": true }, { - "file": "Code/Source/${Name}Module.cpp", - "origin": "Code/Source/${Name}Module.cpp", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Windows/PAL_windows.cmake", + "isTemplated": true }, { - "file": "Code/Source/${Name}SystemComponent.cpp", - "origin": "Code/Source/${Name}SystemComponent.cpp", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/iOS/${NameLower}_ios_files.cmake", + "isTemplated": true }, { - "file": "Code/Source/${Name}SystemComponent.h", - "origin": "Code/Source/${Name}SystemComponent.h", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/iOS/${NameLower}_shared_ios_files.cmake", + "isTemplated": true }, { - "file": "Code/enabled_gems.cmake", - "origin": "Code/enabled_gems.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/iOS/PAL_ios.cmake", + "isTemplated": true }, { - "file": "Code/gem.json", - "origin": "Code/gem.json", - "isTemplated": true, - "isOptional": true + "file": "Gem/Source/${Name}Module.cpp", + "isTemplated": true }, { - "file": "Config/shader_global_build_options.json", - "origin": "Config/shader_global_build_options.json", - "isTemplated": false, - "isOptional": false + "file": "Gem/Source/${Name}SystemComponent.cpp", + "isTemplated": true }, { - "file": "cmake/EngineFinder.cmake", - "origin": "cmake/EngineFinder.cmake", - "isTemplated": false, - "isOptional": false + "file": "Gem/Source/${Name}SystemComponent.h", + "isTemplated": true }, { - "file": "cmake/CompilerSettings.cmake", - "origin": "cmake/CompilerSettings.cmake", - "isTemplated": false, - "isOptional": false + "file": "Gem/enabled_gems.cmake", + "isTemplated": true }, { - "file": "cmake/Platform/Linux/CompilerSettings_linux.cmake", - "origin": "cmake/Platform/Linux/CompilerSettings_linux.cmake", - "isTemplated": false, - "isOptional": false + "file": "Gem/gem.json", + "isTemplated": true }, { "file": "Platform/Android/android_project.cmake", - "origin": "Platform/Android/android_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Android/android_project.json", - "origin": "Platform/Android/android_project.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Linux/linux_project.cmake", - "origin": "Platform/Linux/linux_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Linux/linux_project.json", - "origin": "Platform/Linux/linux_project.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Mac/mac_project.cmake", - "origin": "Platform/Mac/mac_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Mac/mac_project.json", - "origin": "Platform/Mac/mac_project.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Windows/windows_project.cmake", - "origin": "Platform/Windows/windows_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Windows/windows_project.json", - "origin": "Platform/Windows/windows_project.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/iOS/ios_project.cmake", - "origin": "Platform/iOS/ios_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/iOS/ios_project.json", - "origin": "Platform/iOS/ios_project.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Registry/assets_scan_folders.setreg", - "origin": "Registry/assets_scan_folders.setreg", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Resources/LegacyLogoLauncher.bmp", - "origin": "Resources/LegacyLogoLauncher.bmp", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/GameSDK.ico", - "origin": "Resources/GameSDK.ico", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/Contents.json", - "origin": "Resources/Platform/Mac/Images.xcassets/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/Contents.json", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16_2x.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32_2x.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512_2x.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Info.plist", - "origin": "Resources/Platform/Mac/Info.plist", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Resources/Platform/iOS/Images.xcassets/Contents.json", - "origin": "Resources/Platform/iOS/Images.xcassets/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/Contents.json", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/Contents.json", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon152x152.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon152x152.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon76x76.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon76x76.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadProAppIcon167x167.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadProAppIcon167x167.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon29x29.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon29x29.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon58x58.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon58x58.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon40x40.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon40x40.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon80x80.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon80x80.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon120x120.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon120x120.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon180x180.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon180x180.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon58x58.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon58x58.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon87x87.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon87x87.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon120x120.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon120x120.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon80x80.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon80x80.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Info.plist", - "origin": "Resources/Platform/iOS/Info.plist", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "ShaderLib/README.md", - "origin": "ShaderLib/README.md", - "isTemplated": false, - "isOptional": true + "isTemplated": false }, { "file": "ShaderLib/scenesrg.srgi", - "origin": "ShaderLib/scenesrg.srgi", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "ShaderLib/viewsrg.srgi", - "origin": "ShaderLib/viewsrg.srgi", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "autoexec.cfg", - "origin": "autoexec.cfg", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "game.cfg", - "origin": "game.cfg", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "preview.png", - "origin": "preview.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "project.json", - "origin": "project.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true } ], "createDirectories": [ { - "dir": "Assets", - "origin": "Assets" + "dir": "Assets" + }, + { + "dir": "cmake" + }, + { + "dir": "cmake/Platform" + }, + { + "dir": "cmake/Platform/Linux" + }, + { + "dir": "Config" }, { - "dir": "Code", - "origin": "Code" + "dir": "Gem" }, { - "dir": "Code/Include", - "origin": "Code/Include" + "dir": "Gem/Include" }, { - "dir": "Code/Include/${Name}", - "origin": "Code/Include/${Name}" + "dir": "Gem/Include/${Name}" }, { - "dir": "Code/Platform", - "origin": "Code/Platform" + "dir": "Gem/Platform" }, { - "dir": "Code/Platform/Android", - "origin": "Code/Platform/Android" + "dir": "Gem/Platform/Android" }, { - "dir": "Code/Platform/Linux", - "origin": "Code/Platform/Linux" + "dir": "Gem/Platform/Linux" }, { - "dir": "Code/Platform/Mac", - "origin": "Code/Platform/Mac" + "dir": "Gem/Platform/Mac" }, { - "dir": "Code/Platform/Windows", - "origin": "Code/Platform/Windows" + "dir": "Gem/Platform/Windows" }, { - "dir": "Code/Platform/iOS", - "origin": "Code/Platform/iOS" + "dir": "Gem/Platform/iOS" }, { - "dir": "Code/Source", - "origin": "Code/Source" + "dir": "Gem/Source" }, { - "dir": "Config", - "origin": "Config" + "dir": "Config" }, { - "dir": "Platform", - "origin": "Platform" + "dir": "Platform" }, { - "dir": "Platform/Android", - "origin": "Platform/Android" + "dir": "Platform/Android" }, { - "dir": "Platform/Linux", - "origin": "Platform/Linux" + "dir": "Platform/Linux" }, { - "dir": "Platform/Mac", - "origin": "Platform/Mac" + "dir": "Platform/Mac" }, { - "dir": "Platform/Windows", - "origin": "Platform/Windows" + "dir": "Platform/Windows" }, { - "dir": "Platform/iOS", - "origin": "Platform/iOS" + "dir": "Platform/iOS" }, { - "dir": "Registry", - "origin": "Registry" + "dir": "Registry" }, { - "dir": "Resources", - "origin": "Resources" + "dir": "Resources" }, { - "dir": "Resources/Platform", - "origin": "Resources/Platform" + "dir": "Resources/Platform" }, { - "dir": "Resources/Platform/Mac", - "origin": "Resources/Platform/Mac" + "dir": "Resources/Platform/Mac" }, { - "dir": "Resources/Platform/Mac/Images.xcassets", - "origin": "Resources/Platform/Mac/Images.xcassets" + "dir": "Resources/Platform/Mac/Images.xcassets" }, { - "dir": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset" + "dir": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset" }, { - "dir": "Resources/Platform/iOS", - "origin": "Resources/Platform/iOS" + "dir": "Resources/Platform/iOS" }, { - "dir": "Resources/Platform/iOS/Images.xcassets", - "origin": "Resources/Platform/iOS/Images.xcassets" + "dir": "Resources/Platform/iOS/Images.xcassets" }, { - "dir": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage" + "dir": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage" }, { - "dir": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset" + "dir": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset" }, { - "dir": "ShaderLib", - "origin": "ShaderLib" + "dir": "ShaderLib" }, { - "dir": "Shaders", - "origin": "Shaders" + "dir": "Shaders" }, { - "dir": "Shaders/ShaderResourceGroups", - "origin": "Shaders/ShaderResourceGroups" + "dir": "Shaders/ShaderResourceGroups" } ] } diff --git a/Templates/PythonToolGem/Template/gem.json b/Templates/PythonToolGem/Template/gem.json index 84f5b65a3e..3164c7b5b8 100644 --- a/Templates/PythonToolGem/Template/gem.json +++ b/Templates/PythonToolGem/Template/gem.json @@ -2,8 +2,9 @@ "gem_name": "${Name}", "display_name": "${Name}", "license": "What license ${Name} uses goes here: i.e. Apache-2.0 Or MIT", - "license_url": "", - "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "origin": "The name of the originator goes here. i.e. XYZ Inc.", + "origin_url": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", "type": "Code", "summary": "A short description of ${Name}.", "canonical_tags": [ @@ -14,6 +15,7 @@ ], "icon_path": "preview.png", "requirements": "", + "documentation_url": "", "dependencies": [ "QtForPython" ] diff --git a/Templates/PythonToolGem/template.json b/Templates/PythonToolGem/template.json index 6dc68de3fc..3af74eb49f 100644 --- a/Templates/PythonToolGem/template.json +++ b/Templates/PythonToolGem/template.json @@ -1,12 +1,18 @@ { "template_name": "PythonToolGem", + "template_restricted_platform_relative_path": "Templates/PythonToolGem", "restricted_name": "o3de", - "restricted_platform_relative_path": "Templates", - "origin": "The primary repo for PythonToolGem goes here: i.e. http://www.mydomain.com", - "license": "What license PythonToolGem uses goes here: i.e. https://opensource.org/licenses/MIT", + "restricted_platform_relative_path": "Templates/PythonToolGem", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", + "license": "Apache-2.0 or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "display_name": "PythonToolGem", "summary": "A gem template for a custom tool in Python that gets registered with the Editor.", - "canonical_tags": [], + "canonical_tags": [ + "Python", + "Gem" + ], "user_tags": [ "PythonToolGem" ], @@ -14,221 +20,153 @@ "copyFiles": [ { "file": ".gitignore", - "origin": ".gitignore", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "CMakeLists.txt", - "origin": "CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_editor_files.cmake", - "origin": "Code/${NameLower}_editor_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_editor_shared_files.cmake", - "origin": "Code/${NameLower}_editor_shared_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_editor_tests_files.cmake", - "origin": "Code/${NameLower}_editor_tests_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/CMakeLists.txt", - "origin": "Code/CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Include/${Name}/${Name}Bus.h", - "origin": "Code/Include/${Name}/${Name}Bus.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/PAL_linux.cmake", - "origin": "Code/Platform/Linux/PAL_linux.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/PAL_mac.cmake", - "origin": "Code/Platform/Mac/PAL_mac.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/PAL_windows.cmake", - "origin": "Code/Platform/Windows/PAL_windows.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}.qrc", - "origin": "Code/Source/${Name}.qrc", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorModule.cpp", - "origin": "Code/Source/${Name}EditorModule.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorSystemComponent.cpp", - "origin": "Code/Source/${Name}EditorSystemComponent.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorSystemComponent.h", - "origin": "Code/Source/${Name}EditorSystemComponent.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}ModuleInterface.h", - "origin": "Code/Source/${Name}ModuleInterface.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/toolbar_icon.svg", - "origin": "Code/Source/toolbar_icon.svg", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Code/Tests/${Name}EditorTest.cpp", - "origin": "Code/Tests/${Name}EditorTest.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Editor/Scripts/__init__.py", - "origin": "Editor/Scripts/__init__.py", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Editor/Scripts/bootstrap.py", - "origin": "Editor/Scripts/bootstrap.py", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Editor/Scripts/${NameLower}_dialog.py", - "origin": "Editor/Scripts/${NameLower}_dialog.py", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "gem.json", - "origin": "gem.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "preview.png", - "origin": "preview.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false } ], "createDirectories": [ { - "dir": "Assets", - "origin": "Assets" + "dir": "Assets" }, { - "dir": "Code", - "origin": "Code" + "dir": "Code" }, { - "dir": "Editor", - "origin": "Editor" + "dir": "Editor" }, { - "dir": "Editor/Scripts", - "origin": "Editor/Scripts" + "dir": "Editor/Scripts" }, { - "dir": "Code/Include", - "origin": "Code/Include" + "dir": "Code/Include" }, { - "dir": "Code/Include/${Name}", - "origin": "Code/Include/${Name}" + "dir": "Code/Include/${Name}" }, { - "dir": "Code/Platform", - "origin": "Code/Platform" + "dir": "Code/Platform" }, { - "dir": "Code/Platform/Linux", - "origin": "Code/Platform/Linux" + "dir": "Code/Platform/Linux" }, { - "dir": "Code/Platform/Mac", - "origin": "Code/Platform/Mac" + "dir": "Code/Platform/Mac" }, { - "dir": "Code/Platform/Windows", - "origin": "Code/Platform/Windows" + "dir": "Code/Platform/Windows" }, { - "dir": "Code/Source", - "origin": "Code/Source" + "dir": "Code/Source" }, { - "dir": "Code/Tests", - "origin": "Code/Tests" + "dir": "Code/Tests" } ] } diff --git a/cmake/3rdParty.cmake b/cmake/3rdParty.cmake index 7d98c3ea3e..1bea5f4f67 100644 --- a/cmake/3rdParty.cmake +++ b/cmake/3rdParty.cmake @@ -186,7 +186,7 @@ function(ly_add_external_target) endif() # Check if there is a pal file - ly_get_absolute_pal_filename(pal_file ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}/${ly_add_external_target_PACKAGE}_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) + o3de_pal_dir(pal_file ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}/${ly_add_external_target_PACKAGE}_${PAL_PLATFORM_NAME_LOWERCASE}.cmake ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) if(NOT EXISTS ${pal_file}) set(pal_file ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}/${ly_add_external_target_PACKAGE}_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) endif() @@ -357,12 +357,12 @@ endfunction() # Add the 3rdParty folder to find the modules list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/3rdParty) -ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/3rdParty/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/3rdParty/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) list(APPEND CMAKE_MODULE_PATH ${pal_dir}) if(NOT INSTALLED_ENGINE) # Add the 3rdParty cmake files to the IDE ly_include_cmake_file_list(cmake/3rdParty/cmake_files.cmake) - ly_get_absolute_pal_filename(pal_3rdparty_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}) + o3de_pal_dir(pal_3rdparty_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdParty/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_include_cmake_file_list(${pal_3rdparty_dir}/cmake_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake) endif() diff --git a/cmake/3rdParty/BuiltInPackages.cmake b/cmake/3rdParty/BuiltInPackages.cmake index 743e2e983e..e81cfffe01 100644 --- a/cmake/3rdParty/BuiltInPackages.cmake +++ b/cmake/3rdParty/BuiltInPackages.cmake @@ -12,9 +12,9 @@ # cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake #include the platform-specific 3rd party packages. -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) -set(LY_PAL_PACKAGE_FILE_NAME ${CMAKE_CURRENT_LIST_DIR}/${pal_dir}/BuiltInPackages_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) +set(LY_PAL_PACKAGE_FILE_NAME ${pal_dir}/BuiltInPackages_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) include(${LY_PAL_PACKAGE_FILE_NAME}) # add the above file to the ALLFILES list, so that they show up in IDEs diff --git a/cmake/3rdPartyPackages.cmake b/cmake/3rdPartyPackages.cmake index a3f15bdb22..f9a72672c0 100644 --- a/cmake/3rdPartyPackages.cmake +++ b/cmake/3rdPartyPackages.cmake @@ -614,7 +614,7 @@ endfunction() # and ensure the path to the package root is added to the find_package search paths. # For example # ly_associate_package(TARGETS zlib PACKAGE_NAME zlib-1.2.8-multiplatform PACKAGE_HASH e6f34b8ac16acf881e3d666ef9fd0c1aee94c3f69283fb6524d35d6f858eebbb) -# - this waill cause it to automatically download and activate this package if it finds a target that +# - this will cause it to automatically download and activate this package if it finds a target that # depends on '3rdParty::zlib' in its runtime or its build time dependency list. # - note that '3rdParty' is implied, do not specify it in the TARGETS list. function(ly_associate_package) @@ -684,6 +684,7 @@ endmacro() # is associated with a package, as above. If it is, it makes sure that the package # is brought into scope (and if necessary, downloaded.) macro(ly_download_associated_package find_library_name) + unset(package_name) ly_get_package_association(${find_library_name} package_name) if (package_name) # it is an associated package. diff --git a/cmake/Configurations.cmake b/cmake/Configurations.cmake index 51dee2f07b..709c81e3d2 100644 --- a/cmake/Configurations.cmake +++ b/cmake/Configurations.cmake @@ -189,5 +189,5 @@ foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES) endforeach() # flags are defined per platform, follow platform files under Platform//Configurations_.cmake -ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/Configurations_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/cmake/FileUtil.cmake b/cmake/FileUtil.cmake index 4607e14452..5721cf452c 100644 --- a/cmake/FileUtil.cmake +++ b/cmake/FileUtil.cmake @@ -26,8 +26,16 @@ function(ly_include_cmake_file_list file) include(${file}) get_filename_component(file_path "${file}" PATH) if(file_path) - list(TRANSFORM FILES PREPEND ${file_path}/) + foreach(f ${FILES}) + cmake_path(IS_RELATIVE f is_relative) + if(is_relative) + string(PREPEND f ${file_path}/) + endif() + list(APPEND TRANSFORMED_FILES ${f}) + endforeach() + set(FILES ${TRANSFORMED_FILES}) endif() + foreach(f ${FILES}) get_filename_component(absolute_path ${f} ABSOLUTE) if(NOT EXISTS ${absolute_path}) @@ -41,12 +49,19 @@ function(ly_include_cmake_file_list file) list(APPEND UNITY_AUTO_EXCLUSIONS ${f}) endif() endif() - endforeach() + list(APPEND FILES ${file}) # Add the _files.cmake to the list so it shows in the IDE if(file_path) - list(TRANSFORM SKIP_UNITY_BUILD_INCLUSION_FILES PREPEND ${file_path}/) + foreach(f ${SKIP_UNITY_BUILD_INCLUSION_FILES}) + cmake_path(IS_RELATIVE f is_relative) + if(is_relative) + string(PREPEND f ${file_path}/) + endif() + list(APPEND SKIP_UNITY_BUILD_INCLUSION_TRANSFORMED_FILES ${f}) + endforeach() + set(SKIP_UNITY_BUILD_INCLUSION_FILES ${SKIP_UNITY_BUILD_INCLUSION_TRANSFORMED_FILES}) endif() # Check if there are any files to exclude from unity groupings diff --git a/cmake/Install.cmake b/cmake/Install.cmake index b558590b9e..55f56b05e8 100644 --- a/cmake/Install.cmake +++ b/cmake/Install.cmake @@ -30,7 +30,7 @@ function(ly_install) install(CODE "endif()\n" ALL_COMPONENTS) else() install(${ARGN}) - endif() + endif() endfunction() @@ -195,6 +195,6 @@ function(ly_install_run_script SCRIPT) endfunction() if(LY_INSTALL_ENABLED) - ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}) + o3de_pal_dir(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/Install_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) endif() diff --git a/cmake/LYTestWrappers.cmake b/cmake/LYTestWrappers.cmake index 03146b6045..9f4cd41a47 100644 --- a/cmake/LYTestWrappers.cmake +++ b/cmake/LYTestWrappers.cmake @@ -141,7 +141,7 @@ function(ly_add_test) set(wrapper_file ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}/LYTestWrappers_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) if(NOT EXISTS ${wrapper_file}) - ly_get_absolute_pal_filename(wrapper_file ${wrapper_file}) + o3de_pal_dir(wrapper_file ${wrapper_file} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) endif() include(${wrapper_file}) diff --git a/cmake/LYWrappers.cmake b/cmake/LYWrappers.cmake index d4bf1d7423..a2f4359fd5 100644 --- a/cmake/LYWrappers.cmake +++ b/cmake/LYWrappers.cmake @@ -11,7 +11,7 @@ set(LY_UNITY_BUILD ON CACHE BOOL "UNITY builds") include(CMakeFindDependencyMacro) include(cmake/LyAutoGen.cmake) -ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/LYWrappers_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # Not all platforms support unity builds diff --git a/cmake/PAL.cmake b/cmake/PAL.cmake index 67ed17b6d4..d0d1ad5396 100644 --- a/cmake/PAL.cmake +++ b/cmake/PAL.cmake @@ -15,67 +15,205 @@ # PAL_PLATFORM_NAME_LOWERCASE: name of the platform in lower case (part of filenames) # -file(GLOB detection_files "cmake/Platform/*/PALDetection_*.cmake") -foreach(detection_file ${detection_files}) - include(${detection_file}) -endforeach() +#! o3de_get_home_path: returns the home path +# +# \arg:o3de_manifest_path returns the path of the manifest +function(o3de_get_home_path o3de_home_path) + # The o3de_manifest.json is in the home directory / .o3de folder + file(TO_CMAKE_PATH "$ENV{USERPROFILE}" home_path) # Windows + if(NOT EXISTS ${home_path}) + file(TO_CMAKE_PATH "$ENV{HOME}" home_path) # Unix + if (NOT EXISTS ${home_path}) + message(FATAL_ERROR "o3de Home path not found") + endif() + endif() + set(${o3de_home_path} ${home_path} PARENT_SCOPE) +endfunction() +#! o3de_get_manifest_path: returns the path to the manifest +# +# \arg:o3de_manifest_path returns the path of the manifest +function(o3de_get_manifest_path o3de_manifest_path) + # The o3de_manifest.json is in the home directory / .o3de folder + o3de_get_home_path(o3de_home_path) + set(${o3de_manifest_path} ${o3de_home_path}/.o3de/o3de_manifest.json PARENT_SCOPE) +endfunction() -#! o3de_restricted_id: Reads the "restricted" key from the o3de manifest +#! o3de_read_manifest: returns the contents of the manifest # -# \arg:o3de_json_file name of the o3de json file to read the "restricted_name" key from -# \arg:restricted returns the restricted association element from an o3de json, otherwise engine 'o3de' is assumed -# \arg:o3de_json_file name of the o3de json file -function(o3de_restricted_id o3de_json_file restricted) - ly_file_read(${o3de_json_file} json_data) - string(JSON restricted_entry ERROR_VARIABLE json_error GET ${json_data} "restricted_name") +# \arg:restricted_subdirs returns the restricted elements from the manifest +function(o3de_read_manifest o3de_manifest_json_data) + #get the manifest path + o3de_get_manifest_path(o3de_manifest_path) + if(EXISTS ${o3de_manifest_path}) + ly_file_read(${o3de_manifest_path} json_data) + set(${o3de_manifest_json_data} ${json_data} PARENT_SCOPE) + endif() +endfunction() + +#! o3de_recurse_gems: returns the gem paths +# +# \arg:object json path +# \arg:gems returns the gems from the external subdirectory elements from the manifest +function(o3de_recurse_gems object_json_path gems) + get_filename_component(object_json_parent_path ${object_json_path} DIRECTORY) + ly_file_read(${object_json_path} json_data) + string(JSON external_subdirectories_count ERROR_VARIABLE json_error LENGTH ${json_data} "external_subdirectories") + if(NOT json_error) + if(external_subdirectories_count GREATER 0) + math(EXPR external_subdirectories_range "${external_subdirectories_count}-1") + foreach(external_subdirectories_index RANGE ${external_subdirectories_range}) + string(JSON external_subdirectories_entry ERROR_VARIABLE json_error GET ${json_data} "external_subdirectories" "${external_subdirectories_index}") + cmake_path(IS_RELATIVE external_subdirectories_entry is_relative) + if(${is_relative}) + cmake_path(ABSOLUTE_PATH external_subdirectories_entry BASE_DIRECTORY ${object_json_parent_path} NORMALIZE OUTPUT_VARIABLE external_subdirectories_entry) + endif() + if(EXISTS ${external_subdirectories_entry}/gem.json) + list(APPEND gem_entries ${external_subdirectories_entry}) + o3de_recurse_gems(${external_subdirectories_entry}/gem.json gem_entries) + endif() + endforeach() + endif() + endif() + set(${gems} ${gem_entries} PARENT_SCOPE) +endfunction() + +#! o3de_find_gem: returns the gem path +# +# \arg:gem_name the gem name to find +# \arg:the path of the gem +function(o3de_find_gem gem_name gem_path) + o3de_get_manifest_path(manifest_path) + if(EXISTS ${manifest_path}) + o3de_recurse_gems(${manifest_path} gems) + endif() + o3de_recurse_gems(${LY_ROOT_FOLDER}/engine.json gems) + foreach(gem ${gems}) + ly_file_read(${gem}/gem.json json_data) + string(JSON gem_json_name ERROR_VARIABLE json_error GET ${json_data} "gem_name") + if(gem_json_name STREQUAL gem_name) + set(${gem_path} ${gem} PARENT_SCOPE) + return() + endif() + endforeach() +endfunction() + +#! o3de_manifest_restricted: returns the manifests restricted paths +# +# \arg:restricted returns the restricted elements from the manifest +function(o3de_manifest_restricted restricted) + #read the manifest + o3de_read_manifest(o3de_manifest_json_data) + string(JSON restricted_count ERROR_VARIABLE json_error LENGTH ${o3de_manifest_json_data} "restricted") if(json_error) # Restricted fields can never be a requirement so no warning is issued return() endif() - if(restricted_entry) - set(${restricted} ${restricted_entry} PARENT_SCOPE) + if(restricted_count GREATER 0) + math(EXPR restricted_range "${restricted_count}-1") + foreach(restricted_index RANGE ${restricted_range}) + string(JSON restricted_entry ERROR_VARIABLE json_error GET ${o3de_manifest_json_data} "restricted" "${restricted_index}") + list(APPEND restricted_entries ${restricted_entry}) + endforeach() endif() + set(${restricted} ${restricted_entries} PARENT_SCOPE) endfunction() -#! o3de_find_restricted_folder: +#! o3de_json_restricted: returns the restricted element from a json # -# \arg:restricted_path returns the path of the o3de restricted folder with name restricted_name -# \arg:restricted_name name of the restricted -function(o3de_find_restricted_folder restricted_name restricted_path) - # Read the restricted path from engine.json if one EXISTS - ly_file_read(${LY_ROOT_FOLDER}/engine.json engine_json_data) - string(JSON restricted_subdirs_count ERROR_VARIABLE engine_json_error LENGTH ${engine_json_data} "restricted") - if(restricted_subdirs_count GREATER 0) - string(JSON restricted_subdir ERROR_VARIABLE engine_json_error GET ${engine_json_data} "restricted" "0") - set(${restricted_path} ${restricted_subdir} PARENT_SCOPE) +# \arg:restricted returns the restricted element of the json +function(o3de_json_restricted json_path restricted) + if(EXISTS ${json_path}) + ly_file_read(${json_path} json_data) + string(JSON restricted_entry ERROR_VARIABLE json_error GET ${json_data} "restricted") + if(json_error) + # Restricted fields can never be a requirement so no warning is issued + return() + endif() + set(${restricted} ${restricted_entry} PARENT_SCOPE) + endif() +endfunction() + +#! o3de_restricted_id: determines the restricted object for this json +# +# Find this objects restricted name. If the object has a "restricted" element +# If it does not have one it inherits its parents "restricted" element if it has one +# If the parent does not have one it inherits its parents parent "restricted" element is it has one and so on... +# We stop looking if the object or parent is in the manifest, as the manifest only has top level objects +# which means they have no children. +# +# \arg:o3de_json_file name of the o3de json file to read the "restricted" key from +# \arg:restricted returns the restricted association element from an o3de json, otherwise its doesnt change anything +# \arg:o3de_json_file name of the o3de json file +function(o3de_restricted_id o3de_json_file restricted parent_relative_path) + # read the passed in o3de json and see if "restricted" is set + o3de_json_restricted(${o3de_json_file} restricted_name) + if(restricted_name) + set(${parent_relative_path} "" PARENT_SCOPE) + set(${restricted} ${restricted_name} PARENT_SCOPE) return() endif() + # This object did not have a "restricted" set, now we must look at the parent + # Stop if this is a top level object + o3de_manifest_restricted(manifest_restricted_paths) + get_filename_component(o3de_json_file_parent ${o3de_json_file} DIRECTORY) + get_filename_component(relative_path ${o3de_json_file_parent} NAME) + get_filename_component(o3de_json_file_parent ${o3de_json_file_parent} DIRECTORY) + if(${o3de_json_file_parent} IN_LIST manifest_restricted_paths) + set(${parent_relative_path} "" PARENT_SCOPE) + set(${restricted} "" PARENT_SCOPE) + return() + endif() - file(TO_CMAKE_PATH "$ENV{USERPROFILE}" home_directory) # Windows - if(NOT EXISTS ${home_directory}) - file(TO_CMAKE_PATH "$ENV{HOME}" home_directory) # Unix - if (NOT EXISTS ${home_directory}) - return() + string(LENGTH ${o3de_json_file_parent} parent_len) + while(parent_len) + if(EXISTS ${o3de_json_file_parent}/engine.json) + o3de_json_restricted(${o3de_json_file_parent}/engine.json restricted_name) + if(restricted_name) + set(${parent_relative_path} ${relative_path} PARENT_SCOPE) + set(${restricted} ${restricted_name} PARENT_SCOPE) + return() + endif() + endif() + if(EXISTS ${o3de_json_file_parent}/project.json) + o3de_json_restricted(${o3de_json_file_parent}/project.json restricted_name) + if(restricted_name) + set(${parent_relative_path} ${relative_path} PARENT_SCOPE) + set(${restricted} ${restricted_name} PARENT_SCOPE) + return() + endif() + endif() + if(EXISTS ${o3de_json_file_parent}/gem.json) + o3de_json_restricted(${o3de_json_file_parent}/gem.json restricted_name) + if(restricted_name) + set(${parent_relative_path} ${relative_path} PARENT_SCOPE) + set(${restricted} ${restricted_name} PARENT_SCOPE) + return() + endif() endif() - endif() - # Examine the o3de manifest file for the list of restricted directories - set(o3de_manifest_path ${home_directory}/.o3de/o3de_manifest.json) - if(EXISTS ${o3de_manifest_path}) - ly_file_read(${o3de_manifest_path} o3de_manifest_json_data) - string(JSON restricted_subdirs_count ERROR_VARIABLE engine_json_error LENGTH ${o3de_manifest_json_data} "restricted") - if(restricted_subdirs_count GREATER 0) - math(EXPR restricted_subdirs_range "${restricted_subdirs_count}-1") - foreach(restricted_subdir_index RANGE ${restricted_subdirs_range}) - string(JSON restricted_subdir ERROR_VARIABLE engine_json_error GET ${o3de_manifest_json_data} "restricted" "${restricted_subdir_index}") - list(APPEND restricted_subdirs ${restricted_subdir}) - endforeach() + if(${o3de_json_file_parent} IN_LIST manifest_restricted_paths) + set(${parent_relative_path} "" PARENT_SCOPE) + set(${restricted} "" PARENT_SCOPE) + return() endif() - endif() + + get_filename_component(parent ${o3de_json_file_parent} NAME) + string(PREPEND relative_path ${parent}/) + get_filename_component(o3de_json_file_parent ${o3de_json_file_parent} DIRECTORY) + string(LENGTH ${o3de_json_file_parent} parent_len) + endwhile() +endfunction() + +#! o3de_find_restricted_folder: +# +# \arg:restricted_path returns the path of the o3de restricted folder using the restricted_name +# \arg:restricted_name name of the restricted +function(o3de_find_restricted_folder restricted_name restricted_path) + o3de_manifest_restricted(restricted_entries) # Iterate over the restricted directories from the manifest file - foreach(restricted_entry ${restricted_subdirs}) + foreach(restricted_entry ${restricted_entries}) set(restricted_json_file ${restricted_entry}/restricted.json) ly_file_read(${restricted_json_file} restricted_json) string(JSON this_restricted_name ERROR_VARIABLE json_error GET ${restricted_json} "restricted_name") @@ -95,30 +233,30 @@ endfunction() # # \arg:o3de_json_file json file to read restricted id from # \arg:restricted_name name of the restricted object -function(o3de_restricted_path o3de_json_file restricted_path) - o3de_restricted_id(${o3de_json_file} restricted_name) +function(o3de_restricted_path o3de_json_file restricted_path parent_relative_path) + o3de_restricted_id(${o3de_json_file} restricted_name parent_relative) + set(${parent_relative_path} ${parent_relative} PARENT_SCOPE) if(restricted_name) o3de_find_restricted_folder(${restricted_name} restricted_folder) if(restricted_folder) set(${restricted_path} ${restricted_folder} PARENT_SCOPE) + else() + get_filename_component(o3de_json_file_parent ${o3de_json_file} DIRECTORY) + set(${restricted_path} ${o3de_json_file_parent}/restricted PARENT_SCOPE) endif() endif() endfunction() -#! read_engine_restricted_path: Locates the restricted path within the engine from a json file -# -# \arg:output_restricted_path returns the path of the o3de restricted folder with name restricted_name -function(read_engine_restricted_path output_restricted_path) - # Set manifest path to path in the user home directory - set(manifest_path ${LY_ROOT_FOLDER}/engine.json) - if(EXISTS ${manifest_path}) - o3de_restricted_path(${manifest_path} read_restricted_path) - set(${output_restricted_path} ${read_restricted_path} PARENT_SCOPE) - endif() -endfunction() +# detect open platforms +file(GLOB detection_files "cmake/Platform/*/PALDetection_*.cmake") +foreach(detection_file ${detection_files}) + include(${detection_file}) +endforeach() -read_engine_restricted_path(O3DE_ENGINE_RESTRICTED_PATH) +# set the O3DE_ENGINE_RESTRICTED_PATH +o3de_restricted_path(${LY_ROOT_FOLDER}/engine.json O3DE_ENGINE_RESTRICTED_PATH engine_has_no_parent) +# detect platforms in the restricted path file(GLOB detection_files ${O3DE_ENGINE_RESTRICTED_PATH}/*/cmake/PALDetection_*.cmake) foreach(detection_file ${detection_files}) include(${detection_file}) @@ -146,21 +284,16 @@ foreach(pal_restricted_file ${pal_restricted_files}) string(TOLOWER ${platform} platform_lower) list(APPEND PAL_RESTRICTED_PLATFORMS ${platform_lower}) endforeach() +list(REMOVE_DUPLICATES PAL_RESTRICTED_PLATFORMS) + ly_set(PAL_RESTRICTED_PLATFORMS ${PAL_RESTRICTED_PLATFORMS}) function(ly_get_absolute_pal_filename out_name in_name) - set(full_name ${in_name}) + message(DEPRECATION "ly_get_list_relative_pal_filename is being deprecated, change your code to use o3de_pal_dir instead.") + # parent relative path is optional if(${ARGC} GREATER 4) - # The object name is used to resolve ambiguities when a PAL directory is requested from - # two different external subdirectory root paths - # Such as if a PAL directory for two root object paths with same relative structure was requested to be Palified - # i.e /Platform//IO and /Platform//IO - # Normally the restricted PAL path for both gems would be "//IO". - # The object name can be used to make this path unique - # "///IO" for gem 1 and - # "///IO" for gem 2 - set(object_name ${ARGV4}) + set(parent_relative_path ${ARGV4}) endif() # The Default object path for path is the LY_ROOT_FOLDER @@ -170,14 +303,30 @@ function(ly_get_absolute_pal_filename out_name in_name) cmake_path(SET object_path NORMALIZE ${ARGV3}) endif() - # The Default restricted object path is the result of the read_engine_restricted_path function + # The default restricted object path is O3DE_ENGINE_RESTRICTED_PATH cmake_path(SET object_restricted_path NORMALIZE "${O3DE_ENGINE_RESTRICTED_PATH}") if(${ARGC} GREATER 2) # The user has supplied an object restricted path cmake_path(SET object_restricted_path NORMALIZE ${ARGV2}) endif() - # The input path must exist in order to form a PAL path + if(${ARGC} GREATER 4) + o3de_pal_dir(abs_name ${in_name} ${object_restricted_path} ${object_path} ${parent_relative_path}) + else() + o3de_pal_dir(abs_name ${in_name} ${object_restricted_path} ${object_path}) + endif() + set(${out_name} ${abs_name} PARENT_SCOPE) +endfunction() + +function(o3de_pal_dir out_name in_name object_restricted_path object_path) #parent_relative_path) + set(full_name ${in_name}) + + # parent relative path is optional + if(${ARGC} GREATER 4) + set(parent_relative_path ${ARGV4}) + endif() + + # The input path must not exist in order to form a restricted PAL path if (NOT EXISTS ${full_name}) # if the file is not in the object path then we cannot determine a PAL file for it cmake_path(IS_PREFIX object_path ${full_name} is_input_path_in_root) @@ -222,7 +371,7 @@ function(ly_get_absolute_pal_filename out_name in_name) if(NOT EXISTS ${candidate_PAL_path}) string(TOLOWER ${candidate_platform_name} candidate_platform_name_lower) if("${candidate_platform_name_lower}" IN_LIST PAL_RESTRICTED_PLATFORMS) - cmake_path(APPEND object_restricted_path ${candidate_platform_name} ${object_name} + cmake_path(APPEND object_restricted_path ${candidate_platform_name} ${parent_relative_path} ${pre_platform_paths} OUTPUT_VARIABLE candidate_PAL_path) endif() endif() @@ -236,17 +385,43 @@ function(ly_get_absolute_pal_filename out_name in_name) endfunction() function(ly_get_list_relative_pal_filename out_name in_name) - ly_get_absolute_pal_filename(abs_name ${in_name} ${ARGN}) + message(DEPRECATION "ly_get_list_relative_pal_filename is being deprecated, change your code to use o3de_pal_dir instead.") + + # parent relative path is optional + if(${ARGC} GREATER 4) + set(parent_relative_path ${ARGV4}) + endif() + + # The Default object path for path is the LY_ROOT_FOLDER + cmake_path(SET object_path NORMALIZE "${LY_ROOT_FOLDER}") + if(${ARGC} GREATER 3) + # The user has supplied an object restricted path, the object path for consideration + cmake_path(SET object_path NORMALIZE ${ARGV3}) + endif() + + # The default restricted object path is O3DE_ENGINE_RESTRICTED_PATH + cmake_path(SET object_restricted_path NORMALIZE "${O3DE_ENGINE_RESTRICTED_PATH}") + if(${ARGC} GREATER 2) + # The user has supplied an object restricted path + cmake_path(SET object_restricted_path NORMALIZE ${ARGV2}) + endif() + + if(${ARGC} GREATER 4) + o3de_pal_dir(abs_name ${in_name} ${object_restricted_path} ${object_path} ${parent_relative_path}) + else() + o3de_pal_dir(abs_name ${in_name} ${object_restricted_path} ${object_path}) + endif() + cmake_path(RELATIVE_PATH abs_name BASE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} OUTPUT_VARIABLE relative_name) set(${out_name} ${relative_name} PARENT_SCOPE) endfunction() -ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_cmake_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) -ly_include_cmake_file_list(${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake) +ly_include_cmake_file_list(${pal_cmake_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake) -include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) -include(${pal_dir}/Toolchain_${PAL_PLATFORM_NAME_LOWERCASE}.cmake OPTIONAL) +include(${pal_cmake_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) +include(${pal_cmake_dir}/Toolchain_${PAL_PLATFORM_NAME_LOWERCASE}.cmake OPTIONAL) set(LY_DISABLE_TEST_MODULES FALSE CACHE BOOL "Option to forcibly disable the inclusion of test targets in the build") diff --git a/cmake/PALTools.cmake b/cmake/PALTools.cmake index 2204abf5ae..88e827f9c2 100644 --- a/cmake/PALTools.cmake +++ b/cmake/PALTools.cmake @@ -35,14 +35,14 @@ ly_set(LY_PAL_TOOLS_DEFINES ${LY_PAL_TOOLS_DEFINES}) # Include files to the CMakeFiles project foreach(enabled_platform ${LY_PAL_TOOLS_ENABLED}) string(TOLOWER ${enabled_platform} enabled_platform_lowercase) - ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${enabled_platform}) + o3de_pal_dir(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${enabled_platform}) ly_include_cmake_file_list(${pal_dir}/pal_tools_${enabled_platform_lowercase}_files.cmake) endforeach() function(ly_get_pal_tool_dirs out_list pal_path) set(pal_paths "") foreach(platform ${LY_PAL_TOOLS_ENABLED}) - ly_get_absolute_pal_filename(path ${pal_path}/${platform}) + o3d_pal_dir(path ${pal_path}/${platform} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) list(APPEND pal_paths ${path}) endforeach() set(${out_list} ${pal_paths} PARENT_SCOPE) diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake index ecef5261b1..81409369dc 100644 --- a/cmake/Packaging.cmake +++ b/cmake/Packaging.cmake @@ -73,7 +73,7 @@ set(CPACK_PROJECT_CONFIG_FILE ${CPACK_SOURCE_DIR}/PackagingConfig.cmake) set(CPACK_AUTO_GEN_TAG ${LY_INSTALLER_AUTO_GEN_TAG}) # attempt to apply platform specific settings -ly_get_absolute_pal_filename(pal_dir ${CPACK_SOURCE_DIR}/Platform/${PAL_HOST_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CPACK_SOURCE_DIR}/Platform/${PAL_HOST_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/Packaging_${PAL_HOST_PLATFORM_NAME_LOWERCASE}.cmake) # if we get here and the generator hasn't been set, then a non fatal error occurred disabling packaging support diff --git a/cmake/Projects.cmake b/cmake/Projects.cmake index 13161c9e0f..c6aa6c382a 100644 --- a/cmake/Projects.cmake +++ b/cmake/Projects.cmake @@ -118,17 +118,27 @@ function(ly_generate_project_build_path_setreg project_real_path) file(GENERATE OUTPUT ${project_user_build_path_setreg_file} CONTENT ${project_build_path_setreg_content}) endfunction() +function(add_gem_json_external_subdirectories gem_path) + set(gem_json_path ${gem_path}/gem.json) + if(EXISTS ${gem_json_path}) + read_json_external_subdirs(gem_external_subdirs ${gem_path}/gem.json) + foreach(gem_external_subdir ${gem_external_subdirs}) + file(REAL_PATH ${gem_external_subdir} real_external_subdir BASE_DIRECTORY ${gem_path}) + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${real_external_subdir}) + add_gem_json_external_subdirectories(${real_external_subdir}) + endforeach() + endif() +endfunction() function(add_project_json_external_subdirectories project_path) set(project_json_path ${project_path}/project.json) if(EXISTS ${project_json_path}) - read_json_external_subdirs(external_subdirs ${project_path}/project.json) - foreach(external_subdir ${external_subdirs}) - file(REAL_PATH ${external_subdir} real_external_subdir BASE_DIRECTORY ${project_path}) - list(APPEND project_external_subdirs ${real_external_subdir}) + read_json_external_subdirs(project_external_subdirs ${project_path}/project.json) + foreach(project_external_subdir ${project_external_subdirs}) + file(REAL_PATH ${project_external_subdir} real_external_subdir BASE_DIRECTORY ${project_path}) + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${real_external_subdir}) + add_gem_json_external_subdirectories(${real_external_subdir}) endforeach() - - set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${project_external_subdirs}) endif() endfunction() diff --git a/cmake/RuntimeDependencies.cmake b/cmake/RuntimeDependencies.cmake index 9cc7315b08..d36789791f 100644 --- a/cmake/RuntimeDependencies.cmake +++ b/cmake/RuntimeDependencies.cmake @@ -6,6 +6,6 @@ # # -ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/RuntimeDependencies_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/engine.json b/engine.json index 737ac24fea..51b6738001 100644 --- a/engine.json +++ b/engine.json @@ -1,6 +1,6 @@ { "engine_name": "o3de", - "restricted_name": "o3de", + "restricted": "o3de", "FileVersion": 1, "O3DEVersion": "0.0.0.0", "O3DECopyrightYear": 2021, diff --git a/scripts/o3de/CMakeLists.txt b/scripts/o3de/CMakeLists.txt index 79836305c0..fced0f7727 100644 --- a/scripts/o3de/CMakeLists.txt +++ b/scripts/o3de/CMakeLists.txt @@ -8,7 +8,7 @@ add_subdirectory(tests) -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/o3de_install_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) ly_install_files(FILES ../o3de.py diff --git a/scripts/o3de/o3de/disable_gem.py b/scripts/o3de/o3de/disable_gem.py index 0b0e465d12..eecc765d32 100644 --- a/scripts/o3de/o3de/disable_gem.py +++ b/scripts/o3de/o3de/disable_gem.py @@ -98,9 +98,6 @@ def disable_gem_in_project(gem_name: str = None, def _run_disable_gem_in_project(args: argparse) -> int: - if args.override_home_folder: - manifest.override_home_folder = args.override_home_folder - return disable_gem_in_project(args.gem_name, args.gem_path, args.project_name, @@ -133,9 +130,6 @@ def add_parser_args(parser): help='The cmake enabled gem file in which gem names are to be removed from.' 'If not specified it will assume ') - parser.add_argument('-ohf', '--override-home-folder', type=pathlib.Path, required=False, - help='By default the home folder is the user folder, override it to this folder.') - parser.set_defaults(func=_run_disable_gem_in_project) diff --git a/scripts/o3de/o3de/download.py b/scripts/o3de/o3de/download.py index 8e28561e50..a7d5b56440 100644 --- a/scripts/o3de/o3de/download.py +++ b/scripts/o3de/o3de/download.py @@ -277,9 +277,6 @@ def is_o3de_restricted_update_available(restricted_name: str, local_last_updated return is_o3de_object_update_available(restricted_name, 'restricted_name', local_last_updated) def _run_download(args: argparse) -> int: - if args.override_home_folder: - manifest.override_home_folder = args.override_home_folder - if args.engine_name: return download_engine(args.engine_name, args.dest_path, @@ -331,8 +328,6 @@ def add_parser_args(parser): parser.add_argument('-f', '--force', action='store_true', required=False, default=False, help = 'Force overwrite the current object') - parser.add_argument('-ohf', '--override-home-folder', type=str, required=False, - help='By default the home folder is the user folder, override it to this folder.') parser.set_defaults(func=_run_download) diff --git a/scripts/o3de/o3de/enable_gem.py b/scripts/o3de/o3de/enable_gem.py index fc4dc6e9cf..ea79f6c73f 100644 --- a/scripts/o3de/o3de/enable_gem.py +++ b/scripts/o3de/o3de/enable_gem.py @@ -115,9 +115,6 @@ def enable_gem_in_project(gem_name: str = None, def _run_enable_gem_in_project(args: argparse) -> int: - if args.override_home_folder: - manifest.override_home_folder = args.override_home_folder - return enable_gem_in_project(args.gem_name, args.gem_path, args.project_name, @@ -150,9 +147,6 @@ def add_parser_args(parser): help='The cmake enabled_gem file in which the gem names are specified.' 'If not specified it will assume enabled_gems.cmake') - parser.add_argument('-ohf', '--override-home-folder', type=pathlib.Path, required=False, - help='By default the home folder is the user folder, override it to this folder.') - parser.set_defaults(func=_run_enable_gem_in_project) diff --git a/scripts/o3de/o3de/engine_template.py b/scripts/o3de/o3de/engine_template.py index 6b2e098cf0..d9993fb5d0 100755 --- a/scripts/o3de/o3de/engine_template.py +++ b/scripts/o3de/o3de/engine_template.py @@ -80,10 +80,20 @@ restricted_platforms = { 'Provo', 'Salem', 'Jasper', - 'Paris' + 'Paris', + 'Xenia', + 'Lancaster' } -template_file_name = 'template.json' +O3DE_LICENSE_TEXT = \ + """'# {BEGIN_LICENSE} +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# {END_LICENSE} +""" + this_script_parent = pathlib.Path(os.path.dirname(os.path.realpath(__file__))) @@ -165,7 +175,8 @@ def _execute_template_json(json_data: dict, destination_path: pathlib.Path, template_path: pathlib.Path, replacements: list, - keep_license_text: bool = False) -> None: + keep_license_text: bool = False, + keep_restricted_in_instance: bool = False) -> None: # create dirs first # for each createDirectory entry, transform the folder name for create_directory in json_data['createDirectories']: @@ -174,6 +185,18 @@ def _execute_template_json(json_data: dict, # transform the folder name new_dir = _transform(new_dir.as_posix(), replacements, keep_license_text) + new_dir = pathlib.Path(new_dir) + + if not keep_restricted_in_instance and 'Platform' in new_dir.parts: + try: + # the name of the Platform should follow the '/Platform/' + pattern = r'/Platform/(?P[^/:*?\"<>|\r\n]+/?)' + found_platform = re.search(pattern, new_dir.as_posix()).group('Platform') + found_platform = found_platform.replace('/', '') + if found_platform in restricted_platforms: + continue + except Exception as e: + pass # create the folder os.makedirs(new_dir, exist_ok=True) @@ -184,16 +207,23 @@ def _execute_template_json(json_data: dict, # construct the input file name in_file = template_path / 'Template' / copy_file['file'] - # the file can be marked as optional, if it is and it does not exist skip - if copy_file['isOptional'] and copy_file['isOptional'] == 'true': - if not os.path.isfile(in_file): - continue - # construct the output file name out_file = destination_path / copy_file['file'] # transform the output file name out_file = _transform(out_file.as_posix(), replacements, keep_license_text) + out_file = pathlib.Path(out_file) + + if not keep_restricted_in_instance and 'Platform' in out_file.parts: + try: + # the name of the Platform should follow the '/Platform/' + pattern = r'/Platform/(?P[^/:*?\"<>|\r\n]+/?)' + found_platform = re.search(pattern, out_file.as_posix()).group('Platform') + found_platform = found_platform.replace('/', '') + if found_platform in restricted_platforms: + continue + except Exception as e: + pass # if for some reason the output folder for this file was not created above do it now os.makedirs(os.path.dirname(out_file), exist_ok=True) @@ -205,18 +235,20 @@ def _execute_template_json(json_data: dict, shutil.copy(in_file, out_file) -def _execute_restricted_template_json(json_data: dict, +def _execute_restricted_template_json(template_json_data: dict, + json_data: dict, restricted_platform: str, destination_name, - template_name, destination_path: pathlib.Path, destination_restricted_path: pathlib.Path, + template_path: pathlib.Path, template_restricted_path: pathlib.Path, destination_restricted_platform_relative_path: pathlib.Path, template_restricted_platform_relative_path: pathlib.Path, replacements: list, keep_restricted_in_instance: bool = False, keep_license_text: bool = False) -> None: + # if we are not keeping restricted in instance make restricted.json if not present if not keep_restricted_in_instance: restricted_json = destination_restricted_path / 'restricted.json' @@ -227,50 +259,96 @@ def _execute_restricted_template_json(json_data: dict, restricted_json_data.update({"restricted_name": destination_name}) s.write(json.dumps(restricted_json_data, indent=4) + '\n') + ################################################################################### + # for each createDirectories in the template copy any entries in the json_data that are for this platform + for create_directory in template_json_data['createDirectories']: + new_dir = pathlib.Path(create_directory['dir']) + if not keep_restricted_in_instance and 'Platform' in new_dir.parts: + try: + # the name of the Platform should follow the '/Platform/' + pattern = r'/Platform/(?P[^/:*?\"<>|\r\n]+/?)' + found_platform = re.search(pattern, new_dir.as_posix()).group('Platform') + except Exception as e: + pass + else: + found_platform = found_platform.replace('/', '') + if found_platform == restricted_platform: + create_dirs = [] + if 'createDirectories' in json_data.keys(): + create_dirs = json_data['createDirectories'] + create_dirs.append(create_directory) + json_data.update({'createDirectories': create_dirs}) + + # for each copyFiles in the template copy any entries in the json_data that are for this platform + for copy_file in template_json_data['copyFiles']: + new_file = pathlib.Path(copy_file['file']) + if not keep_restricted_in_instance and 'Platform' in new_file.parts: + try: + # the name of the Platform should follow the '/Platform/' + pattern = r'/Platform/(?P[^/:*?\"<>|\r\n]+/?)' + found_platform = re.search(pattern, new_file.as_posix()).group('Platform') + except Exception as e: + pass + else: + found_platform = found_platform.replace('/', '') + if found_platform == restricted_platform: + copy_files = [] + if 'copyFiles' in json_data.keys(): + copy_files = json_data['copyFiles'] + copy_files.append(copy_file) + json_data.update({'copyFiles': copy_files}) + + ################################################################################### + + # every entry is saved in its combined location, so if not keep_restricted_in_instance + # then we need to palify into the restricted folder + # create dirs first # for each createDirectory entry, transform the folder name - for create_directory in json_data['createDirectories']: - # construct the new folder name - new_dir = destination_restricted_path / restricted_platform / destination_restricted_platform_relative_path\ - / destination_name / create_directory['dir'] - if keep_restricted_in_instance: - new_dir = destination_path / create_directory['origin'] + if 'createDirectories' in json_data: + for create_directory in json_data['createDirectories']: + # construct the new folder name + if keep_restricted_in_instance: + new_dir = destination_path / create_directory['dir'] + else: + pal_dir = create_directory['dir'].replace(f'Platform/{restricted_platform}','') + new_dir = destination_restricted_path / restricted_platform / destination_restricted_platform_relative_path / pal_dir - # transform the folder name - new_dir = _transform(new_dir.as_posix(), replacements, keep_license_text) + # transform the folder name + new_dir = _transform(new_dir.as_posix(), replacements, keep_license_text) - # create the folder - os.makedirs(new_dir, exist_ok=True) + # create the folder + os.makedirs(new_dir, exist_ok=True) # for each copyFiles entry, _transformCopy the templated source file into a concrete instance file or # regular copy if not templated - for copy_file in json_data['copyFiles']: - # construct the input file name - in_file = template_restricted_path / restricted_platform / template_restricted_platform_relative_path\ - / template_name / 'Template' / copy_file['file'] + if 'copyFiles' in json_data: + for copy_file in json_data['copyFiles']: + # construct the input file name + if template_restricted_path: + pal_file = copy_file['file'].replace(f'Platform/{restricted_platform}/', '') + in_file = template_restricted_path / restricted_platform / template_restricted_platform_relative_path / 'Template' / pal_file + else: + in_file = template_path / 'Template' / copy_file['file'] - # the file can be marked as optional, if it is and it does not exist skip - if copy_file['isOptional'] and copy_file['isOptional'] == 'true': - if not os.path.isfile(in_file): - continue + # construct the output file name + if keep_restricted_in_instance: + out_file = destination_path / copy_file['file'] + else: + pal_file = copy_file['file'].replace(f'Platform/{restricted_platform}/', '') + out_file = destination_restricted_path / restricted_platform / destination_restricted_platform_relative_path / pal_file - # construct the output file name - out_file = destination_restricted_path / restricted_platform / destination_restricted_platform_relative_path\ - / destination_name / copy_file['file'] - if keep_restricted_in_instance: - out_file = destination_path / copy_file['origin'] + # transform the output file name + out_file = _transform(out_file.as_posix(), replacements, keep_license_text) - # transform the output file name - out_file = _transform(out_file.as_posix(), replacements, keep_license_text) - - # if for some reason the output folder for this file was not created above do it now - os.makedirs(os.path.dirname(out_file), exist_ok=True) + # if for some reason the output folder for this file was not created above do it now + os.makedirs(os.path.dirname(out_file), exist_ok=True) - # if templated _transformCopy the file, if not just copy it - if copy_file['isTemplated']: - _transform_copy(in_file, out_file, replacements, keep_license_text) - else: - shutil.copy(in_file, out_file) + # if templated _transformCopy the file, if not just copy it + if copy_file['isTemplated']: + _transform_copy(in_file, out_file, replacements, keep_license_text) + else: + shutil.copy(in_file, out_file) def _instantiate_template(template_json_data: dict, @@ -309,46 +387,51 @@ def _instantiate_template(template_json_data: dict, :return: 0 for success or non 0 failure code """ # execute the template json + # this will filter out any restricted platforms in the template _execute_template_json(template_json_data, destination_path, template_path, replacements, - keep_license_text) + keep_license_text, + keep_restricted_in_instance) - # execute restricted platform jsons if any - if template_restricted_path: - for restricted_platform in os.listdir(template_restricted_path): - if os.path.isfile(restricted_platform): - continue + # we execute the jason data again if there are any restricted platforms in the main template and + # execute any restricted platform jsons if separate + + for restricted_platform in restricted_platforms: + restricted_json_data = {} + if template_restricted_path: template_restricted_platform = template_restricted_path / restricted_platform - template_restricted_platform_path_rel = template_restricted_platform / template_restricted_platform_relative_path / template_name - platform_json = template_restricted_platform_path_rel / template_file_name + template_restricted_platform_path_rel = template_restricted_platform / template_restricted_platform_relative_path + platform_json = template_restricted_platform_path_rel / 'template.json' if os.path.isfile(platform_json): if not validation.valid_o3de_template_json(platform_json): logger.error(f'Template json {platform_json} is invalid.') return 1 - # load the template json and execute it + # load the template json with open(platform_json, 'r') as s: try: - json_data = json.load(s) + restricted_json_data = json.load(s) except json.JSONDecodeError as e: logger.error(f'Failed to load {platform_json}: ' + str(e)) return 1 - else: - _execute_restricted_template_json(json_data, - restricted_platform, - destination_name, - template_name, - destination_path, - destination_restricted_path, - template_restricted_path, - destination_restricted_platform_relative_path, - template_restricted_platform_relative_path, - replacements, - keep_restricted_in_instance, - keep_license_text) + + # execute for this restricted platform + _execute_restricted_template_json(template_json_data, + restricted_json_data, + restricted_platform, + destination_name, + destination_path, + destination_restricted_path, + template_path, + template_restricted_path, + destination_restricted_platform_relative_path, + template_restricted_platform_relative_path, + replacements, + keep_restricted_in_instance, + keep_license_text) return 0 @@ -365,7 +448,8 @@ def create_template(source_path: pathlib.Path, keep_restricted_in_template: bool = False, keep_license_text: bool = False, replace: list = None, - force: bool = False) -> int: + force: bool = False, + no_register: bool = False) -> int: """ Create a template from a source directory using replacement @@ -391,6 +475,7 @@ def create_template(source_path: pathlib.Path, this controls if you want to keep the license text from the template in the new instance. It is false by default because most people will not want license text in their instances. :param force Overrides existing files even if they exist + :param no_register: whether or not after completion that the new object is registered :return: 0 for success or non 0 failure code """ @@ -401,15 +486,19 @@ def create_template(source_path: pathlib.Path, if not source_path.is_dir(): logger.error(f'Src path {source_path} is not a folder.') return 1 - source_path = source_path.resolve() - # source_name is now the last component of the source_path + + # if not specified, source_name defaults to the last component of the source_path if not source_name: source_name = os.path.basename(source_path) sanitized_source_name = utils.sanitize_identifier_for_cpp(source_name) # if no template path, use default_templates_folder path if not template_path: + logger.info(f'Template path empty. Using source name {source_name}') + template_path = source_name + # if the template_path is not an absolute path, then it default to relative from the default template folder + if not template_path.is_absolute(): default_templates_folder = manifest.get_registered(default_folder='templates') template_path = default_templates_folder / source_name logger.info(f'Template path empty. Using default templates folder {template_path}') @@ -423,7 +512,8 @@ def create_template(source_path: pathlib.Path, except ValueError: pass else: - logger.error(f'Template output path {template_path} cannot be a subdirectory of the source_path {source_path}\n') + logger.error( + f'Template output path {template_path} cannot be a subdirectory of the source_path {source_path}\n') return 1 # template name is now the last component of the template_path @@ -434,69 +524,61 @@ def create_template(source_path: pathlib.Path, logger.error(f'Template path cannot be a restricted name. {template_name}') return 1 + # if the source restricted name was given and no source restricted path, look up the restricted name to fill + # in the path if source_restricted_name and not source_restricted_path: source_restricted_path = manifest.get_registered(restricted_name=source_restricted_name) - # source_restricted_path + # if we have a source restricted path, make sure its a real restricted object if source_restricted_path: - if not os.path.isabs(source_restricted_path): - engine_json = manifest.get_this_engine_path() / 'engine.json' - if not validation.valid_o3de_engine_json(engine_json): - logger.error(f"Engine json {engine_json} is not valid.") - return 1 - with open(engine_json) as s: - try: - engine_json_data = json.load(s) - except json.JSONDecodeError as e: - logger.error(f"Failed to read engine json {engine_json}: {str(e)}") - return 1 - try: - engine_restricted = engine_json_data['restricted_name'] - except KeyError as e: - logger.error(f"Engine json {engine_json} restricted not found.") - return 1 - engine_restricted_folder = manifest.get_registered(restricted_name=engine_restricted) - new_source_restricted_path = engine_restricted_folder / source_restricted_path - logger.info(f'Source restricted path {source_restricted_path} not a full path. We must assume this engines' - f' restricted folder {new_source_restricted_path}') - if not os.path.isdir(source_restricted_path): + if not source_restricted_path.is_dir(): logger.error(f'Source restricted path {source_restricted_path} is not a folder.') return 1 + restricted_json = source_restricted_path / 'restricted.json' + if not validation.valid_o3de_restricted_json(restricted_json): + logger.error(f"Restricted json {restricted_json} is not valid.") + return 1 + with open(restricted_json, 'r') as s: + try: + restricted_json_data = json.load(s) + except json.JSONDecodeError as e: + logger.error(f'Failed to load {restricted_json}: ' + str(e)) + return 1 + try: + source_restricted_name = restricted_json_data['restricted_name'] + except KeyError as e: + logger.error(f'Failed to read restricted_name from {restricted_json}') + return 1 + # if the template restricted name was given and no template restricted path, look up the restricted name to fill + # in the path if template_restricted_name and not template_restricted_path: template_restricted_path = manifest.get_registered(restricted_name=template_restricted_name) + # if we dont have a template restricted name then set it to the templates name if not template_restricted_name: template_restricted_name = template_name - # template_restricted_path + # if we have a template restricted path, it must either not exist yet or must be a restricted object already if template_restricted_path: - if not os.path.isabs(template_restricted_path): - default_templates_restricted_folder = manifest.get_registered(restricted_name='templates') - new_template_restricted_path = default_templates_restricted_folder / template_restricted_path - logger.info(f'Template restricted path {template_restricted_path} not a full path. We must assume the' - f' default templates restricted folder {new_template_restricted_path}') - template_restricted_path = new_template_restricted_path - - if os.path.isdir(template_restricted_path): + if template_restricted_path.is_dir(): # see if this is already a restricted path, if it is get the "restricted_name" from the restricted json # so we can set "restricted_name" to it for this template restricted_json = template_restricted_path / 'restricted.json' - if os.path.isfile(restricted_json): - if not validation.valid_o3de_restricted_json(restricted_json): - logger.error(f'{restricted_json} is not valid.') + if not validation.valid_o3de_restricted_json(restricted_json): + logger.error(f'{restricted_json} is not valid.') + return 1 + with open(restricted_json, 'r') as s: + try: + restricted_json_data = json.load(s) + except json.JSONDecodeError as e: + logger.error(f'Failed to load {restricted_json}: ' + str(e)) + return 1 + try: + template_restricted_name = restricted_json_data['restricted_name'] + except KeyError as e: + logger.error(f'Failed to read restricted_name from {restricted_json}') return 1 - with open(restricted_json, 'r') as s: - try: - restricted_json_data = json.load(s) - except json.JSONDecodeError as e: - logger.error(f'Failed to load {restricted_json}: ' + str(e)) - return 1 - try: - template_restricted_name = restricted_json_data['restricted_name'] - except KeyError as e: - logger.error(f'Failed to read restricted_name from {restricted_json}') - return 1 else: os.makedirs(template_restricted_path, exist_ok=True) @@ -610,36 +692,7 @@ def create_template(source_path: pathlib.Path, else: return False, t_data - def _transform_into_template_restricted_filename(s_data: object, - platform: str) -> (bool, object): - """ - Internal function to transform a restricted platform file name into restricted template file name - :param s_data: the input data, this could be file data or file name data - :return: bool: whether or not the returned data MAY need to be transformed to instantiate it - t_data: potentially transformed data 0 for success or non 0 failure code - """ - # copy the src data to the transformed data, then operate only on transformed data - t_data = s_data - - # run all the replacements - for replacement in replacements: - t_data = t_data.replace(replacement[0], replacement[1]) - - # the name of the Platform should follow the '/Platform/{platform}' - t_data = t_data.replace(f"Platform/{platform}", '') - - # we want to send back the transformed data and whether or not this file - # may require transformation when instantiated. So if the input data is not the - # same as the output, then we transformed it which means there may be a transformation - # needed to instance it. - if s_data != t_data: - return True, t_data - else: - return False, t_data - - def _transform_restricted_into_copyfiles_and_createdirs(source_path: pathlib.Path, - restricted_platform: str, - root_abs: pathlib.Path, + def _transform_restricted_into_copyfiles_and_createdirs(root_abs: pathlib.Path, path_abs: pathlib.Path = None) -> None: """ Internal function recursively called to transform any paths files into copyfiles and create dirs relative to @@ -657,70 +710,49 @@ def create_template(source_path: pathlib.Path, # create the absolute entry by joining the path_abs and the entry entry_abs = path_abs / entry + # report what file we are processing so we have a good idea if it breaks on what file it broke on + logger.info(f'Processing file: {entry_abs}') + # create the relative entry by removing the root_abs try: entry_rel = entry_abs.relative_to(root_abs) except ValueError as err: - logger.warning(f'Unable to create relative path: {str(err)}') + logger.fatal(f'Unable to create relative path: {str(err)}') - # report what file we are processing so we have a good idea if it breaks on what file it broke on - logger.info(f'Processing file: {entry_abs}') - - # this is a restricted file, so we need to transform it, unpalify it - # restricted///some/folders/ -> - # /some/folders/Platform// - # - # C:/repo/Lumberyard/restricted/Jasper/TestDP/CMakeLists.txt -> - # C:/repo/Lumberyard/TestDP/Platform/Jasper/CMakeLists.txt - # - _, origin_entry_rel = _transform_into_template(entry_rel.as_posix()) - components = list(origin_entry_rel.parts) - num_components = len(components) - - # see how far along the source path the restricted folder matches - # then hopefully there is a Platform folder, warn if there isn't - before = [] - after = [] - relative = '' - - if os.path.isdir(entry_abs): - for x in range(0, num_components): - relative += f'{components[x]}/' - if os.path.isdir(f'{source_path}/{relative}'): - before.append(components[x]) - else: - after.append(components[x]) - else: - for x in range(0, num_components - 1): - relative += f'{components[x]}/' - if os.path.isdir(f'{source_path}/{relative}'): - before.append(components[x]) - else: - after.append(components[x]) - - after.append(components[num_components - 1]) - - before.append("Platform") - warn_if_not_platform = source_path / pathlib.Path(*before) - before.append(restricted_platform) - before.extend(after) - - origin_entry_rel = pathlib.Path(*before) - - if not os.path.isdir(warn_if_not_platform): - logger.warning( - f'{entry_abs} -> {origin_entry_rel}: Other Platforms not found in {warn_if_not_platform}') - - destination_entry_rel = origin_entry_rel - destination_entry_abs = template_path / 'Template' / origin_entry_rel + # templatize the entry relative into the destination entry relative + _, destination_entry_rel = _transform_into_template(entry_rel.as_posix()) + destination_entry_rel = pathlib.Path(destination_entry_rel) # clean up any relative leading slashes - if origin_entry_rel.as_posix().startswith('/'): - origin_entry_rel = pathlib.Path(origin_entry_rel.as_posix().lstrip('/')) if destination_entry_rel.as_posix().startswith('/'): destination_entry_rel = pathlib.Path(destination_entry_rel.as_posix().lstrip('/')) + if isinstance(destination_entry_rel, pathlib.Path): + destination_entry_rel = destination_entry_rel.as_posix() - # make sure the dst folder may or may not exist yet, make sure it does exist before we transform + if template_restricted_path: + destination_entry_abs = template_restricted_path / restricted_platform / template_restricted_platform_relative_path / 'Template' / destination_entry_rel + destination_entry_rel = pathlib.Path(destination_entry_rel) + first = True + for component in destination_entry_rel.parts: + if first: + first = False + result = pathlib.Path(component) / 'Platform' / restricted_platform + else: + result = result / component + destination_entry_rel = result.as_posix() + else: + destination_entry_rel = pathlib.Path(destination_entry_rel) + first = True + for component in destination_entry_rel.parts: + if first: + first = False + result = pathlib.Path(component) / 'Platform' / restricted_platform + else: + result = result / component + destination_entry_rel = result.as_posix() + destination_entry_abs = template_path / 'Template' / destination_entry_rel + + # the destination folder may or may not exist yet, make sure it does exist before we transform # data into it os.makedirs(os.path.dirname(destination_entry_abs), exist_ok=True) @@ -730,8 +762,8 @@ def create_template(source_path: pathlib.Path, if os.path.isfile(entry_abs): # if this file is a known binary file, there is no transformation needed and just copy it - # if not a known binary file open it and try to transform the data. if it is an unknown binary - # type it will throw and we catch copy + # if not a known binary file open it and try to transform the data. + # if it is an unknown binary type it will throw and we catch copy # if we had no known binary type it would still work, but much slower name, ext = os.path.splitext(entry) if ext in binary_file_ext: @@ -743,7 +775,7 @@ def create_template(source_path: pathlib.Path, source_data = s.read() templated, source_data = _transform_into_template(source_data, _is_cpp_file(entry_abs)) - # if the file type is a file that we expect to fins license header and we don't find any + # if the file type is a file that we expect to find a license header and we don't find any # warn that the we didn't find the license info, this makes it easy to make sure we didn't # miss any files we want to have license info in. if keep_license_text and ext in expect_license_info_ext: @@ -761,19 +793,26 @@ def create_template(source_path: pathlib.Path, shutil.copy(entry_abs, destination_entry_abs) pass - copy_files.append({ - "file": destination_entry_rel, - "origin": origin_entry_rel, - "isTemplated": templated, - "isOptional": False - }) + if keep_restricted_in_template: + copy_files.append({ + "file": destination_entry_rel, + "isTemplated": templated + }) + else: + restricted_platform_entries[restricted_platform]['copyFiles'].append({ + "file": destination_entry_rel, + "isTemplated": templated + }) else: - create_dirs.append({ - "dir": destination_entry_rel, - "origin": origin_entry_rel - }) - _transform_restricted_into_copyfiles_and_createdirs(source_path, restricted_platform, root_abs, - entry_abs) + if keep_restricted_in_template: + create_dirs.append({ + "dir": destination_entry_rel + }) + else: + restricted_platform_entries[restricted_platform]['createDirs'].append({ + "dir": destination_entry_rel + }) + _transform_restricted_into_copyfiles_and_createdirs(root_abs, entry_abs) def _transform_dir_into_copyfiles_and_createdirs(root_abs: pathlib.Path, path_abs: pathlib.Path = None) -> None: @@ -793,18 +832,21 @@ def create_template(source_path: pathlib.Path, # create the absolute entry by joining the path_abs and the entry entry_abs = path_abs / entry + # report what file we are processing so we have a good idea if it breaks on what file it broke on + logger.info(f'Processing file: {entry_abs}') + # create the relative entry by removing the root_abs - entry_rel = entry_abs try: - entry_rel = entry_abs.relative_to(root_abs) + entry_rel = entry_abs.relative_to(root_abs).as_posix() except ValueError as err: - logger.warning(f'Unable to create relative path: {str(err)}') + logger.fatal(f'Unable to create relative path: {str(err)}') - # report what file we are processing so we have a good idea if it breaks on what file it broke on - logger.info(f'Processing file: {entry_abs}') + # templatize the entry relative into the origin entry relative + _, destination_entry_rel = _transform_into_template(entry_rel) + destination_entry_rel = pathlib.Path(destination_entry_rel) - # see if the entry is a platform file, if it is then we save its copyfile data in a platform specific list - # then at the end we can save the restricted ones separately + # see if the entry is a restricted platform file, if it is then we save its copyfile data in a + # platform specific list then at the end we can save the restricted ones separately found_platform = '' platform = False if not keep_restricted_in_template and 'Platform' in entry_abs.parts: @@ -812,7 +854,7 @@ def create_template(source_path: pathlib.Path, try: # the name of the Platform should follow the '/Platform/' pattern = r'/Platform/(?P[^/:*?\"<>|\r\n]+/?)' - found_platform = re.search(pattern, entry_abs).group('Platform') + found_platform = re.search(pattern, entry_abs.as_posix()).group('Platform') found_platform = found_platform.replace('/', '') except Exception as e: pass @@ -831,30 +873,35 @@ def create_template(source_path: pathlib.Path, # Now if we found a platform and still have a found_platform which is a restricted platform # then transform the entry relative name into a dst relative entry name and dst abs entry. # if not then create a normal relative and abs dst entry name - _, origin_entry_rel = _transform_into_template(entry_rel.as_posix()) if platform and found_platform in restricted_platforms: # if we don't have a template restricted path and we found restricted files... warn and skip # the file/dir if not template_restricted_path: - logger.warning("Restricted platform files found!!! {entry_rel}, {found_platform}") + logger.warning("Restricted platform file found!!! {destination_entry_rel}, {found_platform}") continue - _, destination_entry_rel = _transform_into_template_restricted_filename(entry_rel, found_platform) - destination_entry_abs = template_restricted_path / found_platform\ - / template_restricted_platform_relative_path / template_name / 'Template'\ - / destination_entry_rel + + # run all the replacements + for replacement in replacements: + destination_entry_rel = destination_entry_rel.replace(replacement[0], replacement[1]) + + # the name of the Platform should follow the '/Platform/{found_platform}' + destination_entry_rel = destination_entry_rel.replace(f"Platform/{found_platform}", '') + destination_entry_rel = destination_entry_rel.lstrip('/') + + # construct the absolute entry from the relative + if template_restricted_platform_relative_path: + destination_entry_abs = template_restricted_path / found_platform / template_restricted_platform_relative_path / template_name / 'Template' / destination_entry_rel + else: + destination_entry_abs = template_restricted_path / found_platform / 'Template' / destination_entry_rel else: - destination_entry_rel = origin_entry_rel + # construct the absolute entry from the relative destination_entry_abs = template_path / 'Template' / destination_entry_rel # clean up any relative leading slashes - if isinstance(origin_entry_rel, pathlib.Path): - origin_entry_rel = origin_entry_rel.as_posix() - if origin_entry_rel.startswith('/'): - origin_entry_rel = pathlib.Path(origin_entry_rel.lstrip('/')) if isinstance(destination_entry_rel, pathlib.Path): destination_entry_rel = destination_entry_rel.as_posix() if destination_entry_rel.startswith('/'): - destination_entry_rel = pathlib.Path(destination_entry_rel.lstrip('/')) + destination_entry_rel = destination_entry_rel.lstrip('/') # make sure the dst folder may or may not exist yet, make sure it does exist before we transform # data into it @@ -902,29 +949,23 @@ def create_template(source_path: pathlib.Path, if platform and found_platform in restricted_platforms: restricted_platform_entries[found_platform]['copyFiles'].append({ "file": destination_entry_rel, - "origin": origin_entry_rel, - "isTemplated": templated, - "isOptional": False + "isTemplated": templated }) else: copy_files.append({ "file": destination_entry_rel, - "origin": origin_entry_rel, - "isTemplated": templated, - "isOptional": False + "isTemplated": templated }) else: # if the folder was for a restricted platform add the entry to the restricted platform, otherwise add it # to the non restricted if platform and found_platform in restricted_platforms: restricted_platform_entries[found_platform]['createDirs'].append({ - "dir": destination_entry_rel, - "origin": origin_entry_rel + "dir": destination_entry_rel }) else: create_dirs.append({ - "dir": destination_entry_rel, - "origin": origin_entry_rel + "dir": destination_entry_rel }) # recurse using the same root and this folder @@ -937,11 +978,11 @@ def create_template(source_path: pathlib.Path, # when we run the transformation any restricted platforms entries we find will go in here restricted_platform_entries = {} - # Every project will have a unrestricted folder which is src_path_abs which MAY have restricted files in it, and - # each project MAY have a restricted folder which will only have restricted files in them. The process is the + # Every template will have a unrestricted folder which is src_path_abs which MAY have restricted files in it, and + # each template MAY have a restricted folder which will only have restricted files in them. The process is the # same for all of them and the result will be a separation of all restricted files from unrestricted files. We do - # this by running the transformation first over the src path abs and then on each restricted folder for this project - # we find. This will effectively combine all sources then separates all the restricted. + # this by running the transformation first over the src path abs and then on each restricted folder for this + # template we find. This will effectively combine all sources then separates all the restricted. # run the transformation on the src, which may or may not have restricted files _transform_dir_into_copyfiles_and_createdirs(source_path) @@ -950,11 +991,12 @@ def create_template(source_path: pathlib.Path, # run the transformation on each src restricted folder if source_restricted_path: for restricted_platform in os.listdir(source_restricted_path): - restricted_platform_src_path_abs = source_restricted_path / restricted_platform\ - / source_restricted_platform_relative_path / source_name + restricted_platform_src_path_abs = source_restricted_path / restricted_platform \ + / source_restricted_platform_relative_path if os.path.isdir(restricted_platform_src_path_abs): - _transform_restricted_into_copyfiles_and_createdirs(source_path, restricted_platform, - restricted_platform_src_path_abs) + if restricted_platform not in restricted_platform_entries: + restricted_platform_entries.update({restricted_platform: {'copyFiles': [], 'createDirs': []}}) + _transform_restricted_into_copyfiles_and_createdirs(restricted_platform_src_path_abs) # sort copy_files.sort(key=lambda x: x['file']) @@ -972,39 +1014,47 @@ def create_template(source_path: pathlib.Path, json_data.update({'canonical_tags': []}) json_data.update({'user_tags': [f"{template_name}"]}) json_data.update({'icon_path': "preview.png"}) - if template_restricted_path: + if not keep_restricted_in_template and template_restricted_path: json_data.update({'restricted_name': template_restricted_name}) if template_restricted_platform_relative_path != '': - json_data.update({'template_restricted_platform_relative_path': template_restricted_platform_relative_path}) + json_data.update({'template_restricted_platform_relative_path': template_restricted_platform_relative_path.as_posix()}) json_data.update({'copyFiles': copy_files}) json_data.update({'createDirectories': create_dirs}) - json_name = template_path / template_file_name + json_name = template_path / source_restricted_platform_relative_path / 'template.json' with json_name.open('w') as s: s.write(json.dumps(json_data, indent=4) + '\n') # copy the default preview.png preview_png_src = this_script_parent / 'resources' / 'preview.png' - preview_png_dst = template_path / 'Template' / 'preview.png' + preview_png_dst = template_path / 'preview.png' if not os.path.isfile(preview_png_dst): shutil.copy(preview_png_src, preview_png_dst) # if no restricted template path was given and restricted platform files were found - if not template_restricted_path and len(restricted_platform_entries): + if not keep_restricted_in_template and not template_restricted_path and len(restricted_platform_entries): logger.info(f'Restricted platform files found!!! and no template restricted path was found...') - if template_restricted_path: + if not keep_restricted_in_template and template_restricted_path: + json_name = template_restricted_path / 'restricted.json' + if not json_name.is_file(): + json_data = {} + json_data.update({'restricted_name': template_restricted_name}) + os.makedirs(os.path.dirname(json_name), exist_ok=True) + + with json_name.open('w') as s: + s.write(json.dumps(json_data, indent=4) + '\n') + # now write out each restricted platform template json separately for restricted_platform in restricted_platform_entries: - restricted_template_path = template_restricted_path / restricted_platform\ - / template_restricted_platform_relative_path / template_name - + restricted_template_path = template_restricted_path / restricted_platform / template_restricted_platform_relative_path # sort restricted_platform_entries[restricted_platform]['copyFiles'].sort(key=lambda x: x['file']) restricted_platform_entries[restricted_platform]['createDirs'].sort(key=lambda x: x['dir']) json_data = {} + json_data.update({'restricted_name': template_name}) json_data.update({'template_name': template_name}) json_data.update( {'origin': f'The primary repo for {template_name} goes here: i.e. http://www.mydomain.com'}) @@ -1012,23 +1062,25 @@ def create_template(source_path: pathlib.Path, {'license': f'What license {template_name} uses goes here: i.e. https://opensource.org/licenses/MIT'}) json_data.update({'display_name': template_name}) json_data.update({'summary': f"A short description of {template_name}."}) - json_data.update({'canonical_tags': []}) + json_data.update({'canonical_tags': [f'{restricted_platform}']}) json_data.update({'user_tags': [f'{template_name}']}) - json_data.update({'icon_path': "preview.png"}) json_data.update({'copyFiles': restricted_platform_entries[restricted_platform]['copyFiles']}) json_data.update({'createDirectories': restricted_platform_entries[restricted_platform]['createDirs']}) - json_name = restricted_template_path / template_file_name + json_name = restricted_template_path / 'template.json' os.makedirs(os.path.dirname(json_name), exist_ok=True) with json_name.open('w') as s: s.write(json.dumps(json_data, indent=4) + '\n') - preview_png_dst = restricted_template_path / 'Template' /' preview.png' - if not os.path.isfile(preview_png_dst): - shutil.copy(preview_png_src, preview_png_dst) + # Register the restricted + if not no_register: + if register.register(restricted_path=template_restricted_path): + logger.error(f'Failed to register the restricted {template_restricted_path}.') + return 1 - return 0 + # Register the template + return register.register(template_path=template_path) if not no_register else 0 def create_from_template(destination_path: pathlib.Path, @@ -1044,7 +1096,8 @@ def create_from_template(destination_path: pathlib.Path, keep_restricted_in_instance: bool = False, keep_license_text: bool = False, replace: list = None, - force: bool = False) -> int: + force: bool = False, + no_register: bool = False) -> int: """ Generic template instantiation for non o3de object templates. This function makes NO assumptions! Assumptions are made only for specializations like create_project or create_gem etc... So this function @@ -1251,17 +1304,18 @@ def create_from_template(destination_path: pathlib.Path, # destination restricted path elif destination_restricted_path: - if os.path.isabs(destination_restricted_path): + if not os.path.isabs(destination_restricted_path): restricted_default_path = manifest.get_registered(default_folder='restricted') - new_destination_restricted_path = restricted_default_path / destination_restricted_path + new_destination_restricted_path = restricted_default_path / "Templates" / destination_restricted_path logger.info(f'{destination_restricted_path} is not a full path, making it relative' f' to default restricted path = {new_destination_restricted_path}') destination_restricted_path = new_destination_restricted_path - elif template_restricted_path: - restricted_default_path = manifest.get_registered(restricted_name='restricted') - logger.info(f'--destination-restricted-path is not specified, using default restricted path / destination name' - f' = {restricted_default_path}') - destination_restricted_path = restricted_default_path + else: + restricted_default_path = manifest.get_registered(default_folder='restricted') + new_destination_restricted_path = restricted_default_path / "Templates" / destination_name + logger.info(f'--destination-restricted-path is not specified, using default restricted path' + f' / Templates / destination name = {new_destination_restricted_path}') + destination_restricted_path = new_destination_restricted_path # destination restricted relative if not destination_restricted_platform_relative_path: @@ -1306,7 +1360,7 @@ def create_from_template(destination_path: pathlib.Path, if destination_restricted_path: os.makedirs(destination_restricted_path, exist_ok=True) - # read the restricted_name from the destination restricted.json + # write the restricted_name to the destination restricted.json restricted_json = destination_restricted_path / 'restricted.json' if not os.path.isfile(restricted_json): with open(restricted_json, 'w') as s: @@ -1314,6 +1368,12 @@ def create_from_template(destination_path: pathlib.Path, restricted_json_data.update({'restricted_name': destination_name}) s.write(json.dumps(restricted_json_data, indent=4) + '\n') + # Register the restricted + if not no_register: + if register.register(restricted_path=destination_restricted_path): + logger.error(f'Failed to register the restricted {destination_restricted_path}.') + return 1 + logger.warning(f'Instantiation successful. NOTE: This is a generic instantiation of the template. If this' f' was a template of an o3de object like a project, gem, template, etc. then the create-project' f' or create-gem command can be used to register the object type via its project.json or gem.json, etc.' @@ -1364,6 +1424,7 @@ def create_project(project_path: pathlib.Path, Ex. ${Name},TestGem,${Player},TestGemPlayer This will cause all references to ${Name} be replaced by TestGem, and all ${Player} replaced by 'TestGemPlayer' :param force Overrides existing files even if they exist + :param no_register: whether or not after completion that the new object is registered :param system_component_class_id: optionally specify a uuid for the system component class, default is random uuid :param editor_system_component_class_id: optionally specify a uuid for the editor system component class, default is random uuid @@ -1422,12 +1483,10 @@ def create_project(project_path: pathlib.Path, # see if the template itself specifies a restricted name if not template_restricted_name and not template_restricted_path: try: - template_json_restricted_name = template_json_data['restricted_name'] + template_restricted_name = template_json_data['restricted_name'] except KeyError as e: # the template json doesn't have a 'restricted_name' element warn and use it logger.info(f'The template does not specify a "restricted_name".') - else: - template_restricted_name = template_json_restricted_name # if no restricted name or path we continue on as if there is no template restricted files. if template_restricted_name or template_restricted_path: @@ -1523,8 +1582,13 @@ def create_project(project_path: pathlib.Path, if not project_path: logger.error('Project path cannot be empty.') return 1 - project_path = project_path.resolve() + if not os.path.isabs(project_path): + default_projects_folder = manifest.get_registered(default_folder='projects') + new_project_path = default_projects_folder / project_path + logger.info(f'Project Path {project_path} is not a full path, we must assume its relative' + f' to default projects path = {new_project_path}') + project_path = new_project_path if not force and project_path.is_dir() and len(list(project_path.iterdir())): logger.error(f'Project path {project_path} already exists and is not empty.') return 1 @@ -1536,7 +1600,8 @@ def create_project(project_path: pathlib.Path, project_name = os.path.basename(project_path) if not utils.validate_identifier(project_name): - logger.error(f'Project name must be fewer than 64 characters, contain only alphanumeric, "_" or "-" characters, and start with a letter. {project_name}') + logger.error( + f'Project name must be fewer than 64 characters, contain only alphanumeric, "_" or "-" characters, and start with a letter. {project_name}') return 1 # project name cannot be the same as a restricted platform name @@ -1546,21 +1611,19 @@ def create_project(project_path: pathlib.Path, # project restricted name if project_restricted_name and not project_restricted_path: - project_restricted_path = manifest.get_registered(restricted_name=project_restricted_name) + gem_restricted_path = manifest.get_registered(restricted_name=project_restricted_name) + if not gem_restricted_path: + logger.error(f'Project Restricted Name {project_restricted_name} cannot be found.') + return 1 # project restricted path - elif project_restricted_path: + if project_restricted_path: if not os.path.isabs(project_restricted_path): - default_projects_restricted_folder = manifest.get_registered(restricted_name='projects') - new_project_restricted_path = default_projects_restricted_folder/ project_restricted_path - logger.info(f'Project restricted path {project_restricted_path} is not a full path, we must assume its' - f' relative to default projects restricted path = {new_project_restricted_path}') - project_restricted_path = new_project_restricted_path - elif template_restricted_path: - project_restricted_default_path = manifest.get_registered(restricted_name='projects') - logger.info(f'--project-restricted-path is not specified, using default project restricted path / project name' - f' = {project_restricted_default_path}') - project_restricted_path = project_restricted_default_path + logger.error(f'Project Restricted Path {project_restricted_path} is not an absolute path.') + return 1 + # neither put it in the default restricted projects + else: + project_restricted_path = manifest.get_o3de_restricted_folder() / 'Projects' / project_name # project restricted relative path if not project_restricted_platform_relative_path: @@ -1639,7 +1702,7 @@ def create_project(project_path: pathlib.Path, os.makedirs(project_restricted_path, exist_ok=True) # read the restricted_name from the projects restricted.json - restricted_json = project_restricted_path / 'restricted.json' + restricted_json = project_restricted_path / 'restricted.json' if os.path.isfile(restricted_json): if not validation.valid_o3de_restricted_json(restricted_json): logger.error(f'Restricted json {restricted_json} is not valid.') @@ -1663,7 +1726,8 @@ def create_project(project_path: pathlib.Path, logger.error(f'Failed to read "restricted_name" from restricted json {restricted_json}.') return 1 - # set the "restricted_name": "restricted_name" element of the project.json + # set the "restricted": element of the project.json + project_json = project_path / 'project.json' if not validation.valid_o3de_project_json(project_json): logger.error(f'Project json {project_json} is not valid.') return 1 @@ -1675,7 +1739,7 @@ def create_project(project_path: pathlib.Path, logger.error(f'Failed to load project json {project_json}.') return 1 - project_json_data.update({"restricted_name": restricted_name}) + project_json_data.update({"restricted": restricted_name}) os.unlink(project_json) with open(project_json, 'w') as s: try: @@ -1684,20 +1748,11 @@ def create_project(project_path: pathlib.Path, logger.error(f'Failed to write project json {project_json}.') return 1 - for restricted_platform in restricted_platforms: - restricted_project = project_restricted_path / restricted_platform / project_name - os.makedirs(restricted_project, exist_ok=True) - cmakelists_file_name = restricted_project/ 'CMakeLists.txt' - if not os.path.isfile(cmakelists_file_name): - with open(cmakelists_file_name, 'w') as d: - if keep_license_text: - d.write('# {BEGIN_LICENSE}\n') - d.write('# Copyright (c) Contributors to the Open 3D Engine Project.\n') - d.write('# For complete copyright and license terms please see the LICENSE at the root of this distribution.\n') - d.write('#\n') - d.write('# SPDX-License-Identifier: Apache-2.0 OR MIT\n') - d.write('# {END_LICENSE}\n') - + # Register the restricted + if not no_register: + if register.register(restricted_path=project_restricted_path): + logger.error(f'Failed to register the restricted {project_restricted_path}.') + return 1 # Register the project with the either o3de_manifest.json or engine.json # and set the project.json "engine" field to match the @@ -1906,10 +1961,15 @@ def create_gem(gem_path: pathlib.Path, if not gem_path: logger.error('Gem path cannot be empty.') return 1 - gem_path = gem_path.resolve() + if not os.path.isabs(gem_path): + default_gems_folder = manifest.get_registered(default_folder='gems') + new_gem_path = default_gems_folder / gem_path + logger.info(f'Gem Path {gem_path} is not a full path, we must assume its relative' + f' to default gems path = {new_gem_path}') + gem_path = new_gem_path if not force and gem_path.is_dir() and len(list(gem_path.iterdir())): - logger.error(f'Gem path {gem_path} already exists and is not empty.') + logger.error(f'Gem path {gem_path} already exists.') return 1 else: os.makedirs(gem_path, exist_ok=force) @@ -1930,22 +1990,18 @@ def create_gem(gem_path: pathlib.Path, # gem restricted name if gem_restricted_name and not gem_restricted_path: gem_restricted_path = manifest.get_registered(restricted_name=gem_restricted_name) + if not gem_restricted_path: + logger.error(f'Gem Restricted Name {gem_restricted_name} cannot be found.') + return 1 # gem restricted path - elif gem_restricted_path: + if gem_restricted_path: if not os.path.isabs(gem_restricted_path): - gem_restricted_default_path = manifest.get_registered(restricted_name='gems') - if gem_restricted_default_path: - new_gem_restricted_path = gem_restricted_default_path / gem_restricted_path - logger.info(f'Gem restricted path {gem_restricted_path} is not a full path, we must assume its' - f' relative to default gems restricted path = {new_gem_restricted_path}') - gem_restricted_path = new_gem_restricted_path + logger.error(f'Gem Restricted Path {gem_restricted_path} is not an absolute path.') + return 1 + # neither put it in the default restricted gems else: - gem_restricted_default_path = manifest.get_registered(restricted_name='gems') - if gem_restricted_default_path: - logger.info(f'--gem-restricted-path is not specified, using default / ' - f' = {gem_restricted_default_path}') - gem_restricted_path = gem_restricted_default_path / gem_name + gem_restricted_path = manifest.get_o3de_restricted_folder() / "Gems" / gem_name # gem restricted relative if not gem_restricted_platform_relative_path: @@ -2035,47 +2091,49 @@ def create_gem(gem_path: pathlib.Path, logger.error(f'Failed to load restricted json {restricted_json}.') return 1 + try: + restricted_name = restricted_json_data["restricted_name"] + except KeyError as e: + logger.error(f'Failed to read "restricted_name" from restricted json {restricted_json}.') + return 1 + + # set the "restricted_name": element of the gem.json + gem_json = gem_path / 'gem.json' + if not validation.valid_o3de_gem_json(gem_json): + logger.error(f'Gem json {gem_json} is not valid.') + return 1 + + with open(gem_json, 'r') as s: try: - restricted_name = restricted_json_data["restricted_name"] - except KeyError as e: - logger.error(f'Failed to read "restricted_name" from restricted json {restricted_json}.') + gem_json_data = json.load(s) + except json.JSONDecodeError as e: + logger.error(f'Failed to load gem json {gem_json}.') return 1 - # set the "restricted_name": "restricted_name" element of the gem.json - gem_json = gem_path / 'gem.json' - if not validation.valid_o3de_gem_json(gem_json): - logger.error(f'Gem json {gem_json} is not valid.') + gem_json_data.update({"restricted": restricted_name}) + os.unlink(gem_json) + with open(gem_json, 'w') as s: + try: + s.write(json.dumps(gem_json_data, indent=4) + '\n') + except OSError as e: + logger.error(f'Failed to write project json {gem_json}.') + return 1 + ''' + for restricted_platform in restricted_platforms: + restricted_gem = gem_restricted_path / restricted_platform / gem_name + os.makedirs(restricted_gem, exist_ok=True) + cmakelists_file_name = restricted_gem / 'CMakeLists.txt' + if not os.path.isfile(cmakelists_file_name): + with open(cmakelists_file_name, 'w') as d: + if keep_license_text: + d.write(O3DE_LICENSE_TEXT) + ''' + # Register the restricted + if not no_register: + if register.register(restricted_path=gem_restricted_path): + logger.error(f'Failed to register the restricted {gem_restricted_path}.') return 1 - with open(gem_json, 'r') as s: - try: - gem_json_data = json.load(s) - except json.JSONDecodeError as e: - logger.error(f'Failed to load gem json {gem_json}.') - return 1 - - gem_json_data.update({"restricted_name": restricted_name}) - os.unlink(gem_json) - with open(gem_json, 'w') as s: - try: - s.write(json.dumps(gem_json_data, indent=4) + '\n') - except OSError as e: - logger.error(f'Failed to write project json {gem_json}.') - return 1 - - for restricted_platform in restricted_platforms: - restricted_gem = gem_restricted_path / restricted_platform/ gem_name - os.makedirs(restricted_gem, exist_ok=True) - cmakelists_file_name = restricted_gem / 'CMakeLists.txt' - if not os.path.isfile(cmakelists_file_name): - with open(cmakelists_file_name, 'w') as d: - if keep_license_text: - d.write('# {BEGIN_LICENSE}\n') - d.write('# Copyright (c) Contributors to the Open 3D Engine Project.\n') - d.write('# For complete copyright and license terms please see the LICENSE at the root of this distribution.\n') - d.write('#\n') - d.write('# SPDX-License-Identifier: Apache-2.0 OR MIT\n') - d.write('# {END_LICENSE}\n') # Register the gem with the either o3de_manifest.json, engine.json or project.json based on the gem path return register.register(gem_path=gem_path) if not no_register else 0 @@ -2093,7 +2151,8 @@ def _run_create_template(args: argparse) -> int: args.keep_restricted_in_template, args.keep_license_text, args.replace, - args.force) + args.force, + args.no_register) def _run_create_from_template(args: argparse) -> int: @@ -2110,7 +2169,8 @@ def _run_create_from_template(args: argparse) -> int: args.keep_restricted_in_instance, args.keep_license_text, args.replace, - args.force) + args.force, + args.no_register) def _run_create_project(args: argparse) -> int: @@ -2166,7 +2226,6 @@ def add_args(subparsers) -> None: call add_args and execute: python o3de.py create-gem --gem-path TestGem :param subparsers: the caller instantiates subparsers and passes it in here """ - # turn a directory into a template create_template_subparser = subparsers.add_parser('create-template') @@ -2242,7 +2301,10 @@ def add_args(subparsers) -> None: ' Note: is automatically ${NameLower}' ' Note: is automatically ${NameUpper}') create_template_subparser.add_argument('-f', '--force', action='store_true', default=False, - help='Copies to new template directory even if it exist.') + help='Copies to new template directory even if it exist.') + create_template_subparser.add_argument('--no-register', action='store_true', default=False, + help='If the template is created successfully, it will not register the' + ' template with the global or engine manifest file.') create_template_subparser.set_defaults(func=_run_create_template) # create from template @@ -2268,11 +2330,11 @@ def add_args(subparsers) -> None: ' resolve the --template-path.') create_from_template_subparser.add_argument('-dn', '--destination-name', type=str, - help='The name to use when substituting the ${Name} placeholder in instantiated template,' - ' must be alphanumeric, ' - ' and can contain _ and - characters.' - ' If no name is provided, will use last component of destination path.' - ' Ex. New_Gem') + help='The name to use when substituting the ${Name} placeholder in instantiated template,' + ' must be alphanumeric, ' + ' and can contain _ and - characters.' + ' If no name is provided, will use last component of destination path.' + ' Ex. New_Gem') group = create_from_template_subparser.add_mutually_exclusive_group(required=False) group.add_argument('-drp', '--destination-restricted-path', type=pathlib.Path, required=False, @@ -2293,7 +2355,8 @@ def add_args(subparsers) -> None: help='The name of the registered restricted path to read from if any. If supplied this will' ' resolve the --template-restricted-path.') - create_from_template_subparser.add_argument('-drprp', '--destination-restricted-platform-relative-path', type=pathlib.Path, + create_from_template_subparser.add_argument('-drprp', '--destination-restricted-platform-relative-path', + type=pathlib.Path, required=False, default=None, help='Any path to append to the --destination-restricted-path/' @@ -2301,7 +2364,8 @@ def add_args(subparsers) -> None: ' --destination-restricted-path C:/instance' ' --destination-restricted-platform-relative-path some/folder' ' => C:/instance//some/folder/') - create_from_template_subparser.add_argument('-trprp', '--template-restricted-platform-relative-path', type=pathlib.Path, + create_from_template_subparser.add_argument('-trprp', '--template-restricted-platform-relative-path', + type=pathlib.Path, required=False, default=None, help='Any path to append to the --template-restricted-path/' @@ -2329,7 +2393,10 @@ def add_args(subparsers) -> None: ' Note: ${NameLower} is automatically ' ' Note: ${NameUpper} is automatically ') create_from_template_subparser.add_argument('-f', '--force', action='store_true', default=False, - help='Copies over instantiated template directory even if it exist.') + help='Copies over instantiated template directory even if it exist.') + create_from_template_subparser.add_argument('--no-register', action='store_true', default=False, + help='If the project template is instantiated successfully, it will not register the' + ' project with the global or engine manifest file.') create_from_template_subparser.set_defaults(func=_run_create_from_template) # creation of a project from a template (like create from template but makes project assumptions) @@ -2430,10 +2497,10 @@ def add_args(subparsers) -> None: help='The str id you want to associate with the project, default is a random uuid' ' Ex. {b60c92eb-3139-454b-a917-a9d3c5819594}') create_project_subparser.add_argument('-f', '--force', action='store_true', default=False, - help='Copies over instantiated template directory even if it exist.') + help='Copies over instantiated template directory even if it exist.') create_project_subparser.add_argument('--no-register', action='store_true', default=False, - help='If the project template is instantiated successfully, it will not register the' - ' project with the global or engine manifest file.') + help='If the project template is instantiated successfully, it will not register the' + ' project with the global or engine manifest file.') create_project_subparser.set_defaults(func=_run_create_project) # creation of a gem from a template (like create from template but makes gem assumptions) @@ -2445,11 +2512,11 @@ def add_args(subparsers) -> None: create_gem_subparser.add_argument('-gp', '--gem-path', type=pathlib.Path, required=True, help='The gem path, can be absolute or relative to the current working directory') create_gem_subparser.add_argument('-gn', '--gem-name', type=str, - help='The name to use when substituting the ${Name} placeholder for the gem,' - ' must be alphanumeric, ' - ' and can contain _ and - characters.' - ' If no name is provided, will use last component of gem path.' - ' Ex. New_Gem') + help='The name to use when substituting the ${Name} placeholder for the gem,' + ' must be alphanumeric, ' + ' and can contain _ and - characters.' + ' If no name is provided, will use last component of gem path.' + ' Ex. New_Gem') group = create_gem_subparser.add_mutually_exclusive_group(required=False) group.add_argument('-tp', '--template-path', type=pathlib.Path, required=False, @@ -2529,7 +2596,7 @@ def add_args(subparsers) -> None: help='The uuid you want to associate with the gem module,' ' default is a random uuid Ex. {b60c92eb-3139-454b-a917-a9d3c5819594}') create_gem_subparser.add_argument('-f', '--force', action='store_true', default=False, - help='Copies over instantiated template directory even if it exist.') + help='Copies over instantiated template directory even if it exist.') create_gem_subparser.add_argument('--no-register', action='store_true', default=False, help='If the gem template is instantiated successfully, it will not register the' ' gem with the global, project or engine manifest file.') diff --git a/scripts/o3de/o3de/get_registration.py b/scripts/o3de/o3de/get_registration.py index d64056e8b2..1271d56804 100644 --- a/scripts/o3de/o3de/get_registration.py +++ b/scripts/o3de/o3de/get_registration.py @@ -14,9 +14,6 @@ from o3de import manifest def _run_get_registered(args: argparse) -> int: - if args.override_home_folder: - manifest.override_home_folder = args.override_home_folder - registered_path = manifest.get_registered(args.engine_name, args.project_name, args.gem_name, @@ -55,9 +52,6 @@ def add_parser_args(parser): group.add_argument('-rsn', '--restricted-name', type=str, required=False, help='Restricted name.') - parser.add_argument('-ohf', '--override-home-folder', type=str, required=False, - help='By default the home folder is the user folder, override it to this folder.') - parser.set_defaults(func=_run_get_registered) diff --git a/scripts/o3de/o3de/manifest.py b/scripts/o3de/o3de/manifest.py index a334109e6a..88e6ae8229 100644 --- a/scripts/o3de/o3de/manifest.py +++ b/scripts/o3de/o3de/manifest.py @@ -22,18 +22,13 @@ logger = logging.getLogger('o3de.manifest') logging.basicConfig(format=utils.LOG_FORMAT) # Directory methods -override_home_folder = None - def get_this_engine_path() -> pathlib.Path: return pathlib.Path(os.path.realpath(__file__)).parents[3].resolve() def get_home_folder() -> pathlib.Path: - if override_home_folder: - return pathlib.Path(override_home_folder).resolve() - else: - return pathlib.Path(os.path.expanduser("~")).resolve() + return pathlib.Path(os.path.expanduser("~")).resolve() def get_o3de_folder() -> pathlib.Path: @@ -42,12 +37,6 @@ def get_o3de_folder() -> pathlib.Path: return o3de_folder -def get_o3de_user_folder() -> pathlib.Path: - o3de_user_folder = get_home_folder() / 'O3DE' - o3de_user_folder.mkdir(parents=True, exist_ok=True) - return o3de_user_folder - - def get_o3de_registry_folder() -> pathlib.Path: registry_folder = get_o3de_folder() / 'Registry' registry_folder.mkdir(parents=True, exist_ok=True) @@ -73,19 +62,19 @@ def get_o3de_engines_folder() -> pathlib.Path: def get_o3de_projects_folder() -> pathlib.Path: - projects_folder = get_o3de_user_folder() / 'Projects' + projects_folder = get_o3de_folder() / 'Projects' projects_folder.mkdir(parents=True, exist_ok=True) return projects_folder def get_o3de_gems_folder() -> pathlib.Path: - gems_folder = get_o3de_user_folder() / 'Gems' + gems_folder = get_o3de_folder() / 'Gems' gems_folder.mkdir(parents=True, exist_ok=True) return gems_folder def get_o3de_templates_folder() -> pathlib.Path: - templates_folder = get_o3de_user_folder() / 'Templates' + templates_folder = get_o3de_folder() / 'Templates' templates_folder.mkdir(parents=True, exist_ok=True) return templates_folder @@ -117,6 +106,10 @@ def get_default_o3de_manifest_json_data() -> dict: username = os.path.split(get_home_folder())[-1] o3de_folder = get_o3de_folder() + default_registry_folder = get_o3de_registry_folder() + default_cache_folder = get_o3de_cache_folder() + default_downloads_folder = get_o3de_download_folder() + default_logs_folder = get_o3de_logs_folder() default_engines_folder = get_o3de_engines_folder() default_projects_folder = get_o3de_projects_folder() default_gems_folder = get_o3de_gems_folder() @@ -124,12 +117,20 @@ def get_default_o3de_manifest_json_data() -> dict: default_restricted_folder = get_o3de_restricted_folder() default_third_party_folder = get_o3de_third_party_folder() - default_projects_restricted_folder = default_projects_folder / 'Restricted' - default_projects_restricted_folder.mkdir(parents=True, exist_ok=True) - default_gems_restricted_folder = default_gems_folder / 'Restricted' - default_gems_restricted_folder.mkdir(parents=True, exist_ok=True) - default_templates_restricted_folder = default_templates_folder / 'Restricted' - default_templates_restricted_folder.mkdir(parents=True, exist_ok=True) + default_restricted_projects_folder = default_restricted_folder / 'Projects' + default_restricted_projects_folder.mkdir(parents=True, exist_ok=True) + default_restricted_gems_folder = default_restricted_folder / 'Gems' + default_restricted_gems_folder.mkdir(parents=True, exist_ok=True) + default_restricted_engine_folder = default_restricted_folder / 'Engines' / 'o3de' + default_restricted_engine_folder.mkdir(parents=True, exist_ok=True) + default_restricted_templates_folder = default_restricted_folder / 'Templates' + default_restricted_templates_folder.mkdir(parents=True, exist_ok=True) + default_restricted_engine_folder_json = default_restricted_engine_folder / 'restricted.json' + if not default_restricted_engine_folder_json.is_file(): + with default_restricted_engine_folder_json.open('w') as s: + restricted_json_data = {} + restricted_json_data.update({'restricted_name': 'o3de'}) + s.write(json.dumps(restricted_json_data, indent=4) + '\n') json_data = {} json_data.update({'o3de_manifest_name': f'{username}'}) @@ -140,45 +141,14 @@ def get_default_o3de_manifest_json_data() -> dict: json_data.update({'default_templates_folder': default_templates_folder.as_posix()}) json_data.update({'default_restricted_folder': default_restricted_folder.as_posix()}) json_data.update({'default_third_party_folder': default_third_party_folder.as_posix()}) - - json_data.update({'engines': []}) json_data.update({'projects': []}) json_data.update({'external_subdirectories': []}) json_data.update({'templates': []}) - json_data.update({'restricted': []}) + json_data.update({'restricted': [default_restricted_engine_folder.as_posix()]}) json_data.update({'repos': []}) - - default_restricted_folder_json = default_restricted_folder / 'restricted.json' - if not default_restricted_folder_json.is_file(): - with default_restricted_folder_json.open('w') as s: - restricted_json_data = {} - restricted_json_data.update({'restricted_name': 'o3de'}) - s.write(json.dumps(restricted_json_data, indent=4) + '\n') - - default_projects_restricted_folder_json = default_projects_restricted_folder / 'restricted.json' - if not default_projects_restricted_folder_json.is_file(): - with default_projects_restricted_folder_json.open('w') as s: - restricted_json_data = {} - restricted_json_data.update({'restricted_name': 'projects'}) - s.write(json.dumps(restricted_json_data, indent=4) + '\n') - - default_gems_restricted_folder_json = default_gems_restricted_folder / 'restricted.json' - if not default_gems_restricted_folder_json.is_file(): - with default_gems_restricted_folder_json.open('w') as s: - restricted_json_data = {} - restricted_json_data.update({'restricted_name': 'gems'}) - s.write(json.dumps(restricted_json_data, indent=4) + '\n') - - default_templates_restricted_folder_json = default_templates_restricted_folder / 'restricted.json' - if not default_templates_restricted_folder_json.is_file(): - with default_templates_restricted_folder_json.open('w') as s: - restricted_json_data = {} - restricted_json_data.update({'restricted_name': 'templates'}) - s.write(json.dumps(restricted_json_data, indent=4) + '\n') - + json_data.update({'engines': []}) return json_data - def get_o3de_manifest() -> pathlib.Path: manifest_path = get_o3de_folder() / 'o3de_manifest.json' if not manifest_path.is_file(): @@ -229,12 +199,12 @@ def save_o3de_manifest(json_data: dict, manifest_path: pathlib.Path = None) -> b return False -def get_gems_from_subdirectories(external_subdirs: list) -> list: - """ +def get_gems_from_external_subdirectories(external_subdirs: list) -> list: + ''' Helper Method for scanning a set of external subdirectories for gem.json files - """ + ''' def is_gem_subdirectory(subdir_files): - for name in subdir_files: + for name in files: if name == 'gem.json': return True return False @@ -250,7 +220,8 @@ def get_gems_from_subdirectories(external_subdirs: list) -> list: return gem_directories -def get_engines() -> list: +# Data query methods +def get_manifest_engines() -> list: json_data = load_o3de_manifest() engine_list = json_data['engines'] if 'engines' in json_data else [] # Convert each engine dict entry into a string entry @@ -259,31 +230,31 @@ def get_engines() -> list: engine_list)) -def get_projects() -> list: +def get_manifest_projects() -> list: json_data = load_o3de_manifest() return json_data['projects'] if 'projects' in json_data else [] -def get_gems() -> list: - return get_gems_from_subdirectories(get_external_subdirectories()) +def get_manifest_gems() -> list: + return get_gems_from_external_subdirectories(get_manifest_external_subdirectories()) -def get_external_subdirectories() -> list: +def get_manifest_external_subdirectories() -> list: json_data = load_o3de_manifest() return json_data['external_subdirectories'] if 'external_subdirectories' in json_data else [] -def get_templates() -> list: +def get_manifest_templates() -> list: json_data = load_o3de_manifest() return json_data['templates'] if 'templates' in json_data else [] -def get_restricted() -> list: +def get_manifest_restricted() -> list: json_data = load_o3de_manifest() return json_data['restricted'] if 'restricted' in json_data else [] -def get_repos() -> list: +def get_manifest_repos() -> list: json_data = load_o3de_manifest() return json_data['repos'] if 'repos' in json_data else [] @@ -299,7 +270,7 @@ def get_engine_projects() -> list: def get_engine_gems() -> list: - return get_gems_from_subdirectories(get_engine_external_subdirectories()) + return get_gems_from_external_subdirectories(get_engine_external_subdirectories()) def get_engine_external_subdirectories() -> list: @@ -320,23 +291,9 @@ def get_engine_templates() -> list: return [] -def get_engine_restricted() -> list: - engine_path = get_this_engine_path() - engine_object = get_engine_json_data(engine_path=engine_path) - if engine_object: - return list(map(lambda rel_path: (pathlib.Path(engine_path) / rel_path).as_posix(), - engine_object['restricted'])) if 'restricted' in engine_object else [] - return [] - - # project.json queries -def get_project_engine_name(project_path: pathlib.Path) -> str or None: - project_object = get_project_json_data(project_path=project_path) - return project_object.get('engine', None) if project_object else None - - def get_project_gems(project_path: pathlib.Path) -> list: - return get_gems_from_subdirectories(get_project_external_subdirectories(project_path)) + return get_gems_from_external_subdirectories(get_project_external_subdirectories(project_path)) def get_project_external_subdirectories(project_path: pathlib.Path) -> list: @@ -355,74 +312,95 @@ def get_project_templates(project_path: pathlib.Path) -> list: return [] -def get_project_restricted(project_path: pathlib.Path) -> list: - project_object = get_project_json_data(project_path=project_path) - if project_object: - return list(map(lambda rel_path: (pathlib.Path(project_path) / rel_path).as_posix(), - project_object['restricted'])) if 'restricted' in project_object else [] +# gem.json queries +def get_gem_gems(gem_path: pathlib.Path) -> list: + return get_gems_from_external_subdirectories(get_gem_external_subdirectories(gem_path)) + + +def get_gem_external_subdirectories(gem_path: pathlib.Path) -> list: + gem_object = get_gem_json_data(gem_path=gem_path) + if gem_object: + return list(map(lambda rel_path: (pathlib.Path(gem_path) / rel_path).as_posix(), + gem_object[ + 'external_subdirectories'])) if 'external_subdirectories' in gem_object else [] + return [] + + +def get_gem_templates(gem_path: pathlib.Path) -> list: + gem_object = get_gem_json_data(gem_path=gem_path) + if gem_object: + return list(map(lambda rel_path: (pathlib.Path(gem_path) / rel_path).as_posix(), + gem_object['templates'])) if 'templates' in gem_object else [] return [] # Combined manifest queries def get_all_projects() -> list: - projects_data = get_projects() + projects_data = get_manifest_projects() projects_data.extend(get_engine_projects()) # Remove duplicates from the list return list(dict.fromkeys(projects_data)) def get_all_gems(project_path: pathlib.Path = None) -> list: - gems_data = get_gems() - gems_data.extend(get_engine_gems()) - if project_path: - gems_data.extend(get_project_gems(project_path)) - return list(dict.fromkeys(gems_data)) + return get_gems_from_external_subdirectories(get_all_external_subdirectories(project_path)) def get_all_external_subdirectories(project_path: pathlib.Path = None) -> list: - external_subdirectories_data = get_external_subdirectories() + external_subdirectories_data = get_manifest_external_subdirectories() external_subdirectories_data.extend(get_engine_external_subdirectories()) if project_path: external_subdirectories_data.extend(get_project_external_subdirectories(project_path)) + + def descend_gems(gem_path: pathlib.Path): + new_external_subdirectories_data = get_gem_external_subdirectories(gem_path) + external_subdirectories_data.extend(new_external_subdirectories_data) + new_gems_data = get_gems_from_external_subdirectories(new_external_subdirectories_data) + for new_gem in new_gems_data: + descend_gems(new_gem) + + gems_data = get_gems_from_external_subdirectories(external_subdirectories_data) + for gem in gems_data: + descend_gems(gem) + + # Remove duplicates from the list return list(dict.fromkeys(external_subdirectories_data)) def get_all_templates(project_path: pathlib.Path = None) -> list: - templates_data = get_templates() + templates_data = get_manifest_templates() templates_data.extend(get_engine_templates()) if project_path: templates_data.extend(get_project_templates(project_path)) - return list(dict.fromkeys(templates_data)) + gems_data = get_all_gems(project_path) + for gem_path in gems_data: + templates_data.extend(get_gem_templates(gem_path)) -def get_all_restricted(project_path: pathlib.Path = None) -> list: - restricted_data = get_restricted() - restricted_data.extend(get_engine_restricted()) - if project_path: - restricted_data.extend(get_project_restricted(project_path)) - return list(dict.fromkeys(restricted_data)) + # Remove duplicates from the list + return list(dict.fromkeys(templates_data)) # Template functions -def get_templates_for_project_creation(): +def get_templates_for_project_creation(project_path: pathlib.Path = None) -> list: project_templates = [] - for template_path in get_all_templates(): + for template_path in get_all_templates(project_path): template_path = pathlib.Path(template_path) - template_json_path = pathlib.Path(template_path) / 'template.json' + template_json_path = template_path / 'template.json' if not validation.valid_o3de_template_json(template_json_path): continue - project_json_path = template_path / 'Template' / 'project.json' if validation.valid_o3de_project_json(project_json_path): project_templates.append(template_path) + return project_templates -def get_templates_for_gem_creation(): +def get_templates_for_gem_creation(project_path: pathlib.Path = None) -> list: gem_templates = [] - for template_path in get_all_templates(): + for template_path in get_all_templates(project_path): template_path = pathlib.Path(template_path) - template_json_path = pathlib.Path(template_path) / 'template.json' + template_json_path = template_path / 'template.json' if not validation.valid_o3de_template_json(template_json_path): continue @@ -432,72 +410,55 @@ def get_templates_for_gem_creation(): return gem_templates -def get_templates_for_generic_creation(): # temporary until we have a better way to do this... maybe template_type element - def filter_project_and_gem_templates_out(template_path, - templates_for_project_creation = get_templates_for_project_creation(), - templates_for_gem_creation = get_templates_for_gem_creation()): +def get_templates_for_generic_creation(project_path: pathlib.Path = None) -> list: + generic_templates = [] + for template_path in get_all_templates(project_path): template_path = pathlib.Path(template_path) - return template_path not in templates_for_project_creation and template_path not in templates_for_gem_creation + template_json_path = template_path / 'template.json' + if not validation.valid_o3de_template_json(template_json_path): + continue + gem_json_path = template_path / 'Template' / 'gem.json' + project_json_path = template_path / 'Template' / 'project.json' + if not validation.valid_o3de_gem_json(gem_json_path) and\ + not validation.valid_o3de_project_json(project_json_path): + generic_templates.append(template_path) - return list(filter(filter_project_and_gem_templates_out, get_all_templates())) + return generic_templates -def get_json_file_path(object_typename: str, - object_path: str or pathlib.Path) -> pathlib.Path: - if not object_typename or not object_path: - logger.error('Must specify an object typename and object path.') +def get_engine_json_data(engine_name: str = None, + engine_path: str or pathlib.Path = None) -> dict or None: + if not engine_name and not engine_path: + logger.error('Must specify either a Engine name or Engine Path.') return None - object_path = pathlib.Path(object_path).resolve() - return object_path / f'{object_typename}.json' - + if engine_name and not engine_path: + engine_path = get_registered(engine_name=engine_name) -def get_json_data_file(object_json: pathlib.Path, - object_typename: str, - object_validator: callable) -> dict or None: - if not object_typename: - logger.error('Missing object typename.') + if not engine_path: + logger.error(f'Engine Path {engine_path} has not been registered.') return None - if not object_json or not object_json.is_file(): - logger.error(f'Invalid {object_typename} json {object_json} supplied or file missing.') + engine_path = pathlib.Path(engine_path).resolve() + engine_json = engine_path / 'engine.json' + if not engine_json.is_file(): + logger.error(f'Engine json {engine_json} is not present.') return None - - if not object_validator or not object_validator(object_json): - logger.error(f'{object_typename} json {object_json} is not valid or could not be validated.') + if not validation.valid_o3de_engine_json(engine_json): + logger.error(f'Engine json {engine_json} is not valid.') return None - with object_json.open('r') as f: + with engine_json.open('r') as f: try: - object_json_data = json.load(f) + engine_json_data = json.load(f) except json.JSONDecodeError as e: - logger.warning(f'{object_json} failed to load: {e}') + logger.warning(f'{engine_json} failed to load: {str(e)}') else: - return object_json_data + return engine_json_data return None -def get_json_data(object_typename: str, - object_path: str or pathlib.Path, - object_validator: callable) -> dict or None: - object_json = get_json_file_path(object_typename, object_path) - - return get_json_data_file(object_json, object_typename, object_validator) - - -def get_engine_json_data(engine_name: str = None, - engine_path: str or pathlib.Path = None) -> dict or None: - if not engine_name and not engine_path: - logger.error('Must specify either a Engine name or Engine Path.') - return None - - if engine_name and not engine_path: - engine_path = get_registered(engine_name=engine_name) - - return get_json_data('engine', engine_path, validation.valid_o3de_engine_json) - - def get_project_json_data(project_name: str = None, project_path: str or pathlib.Path = None) -> dict or None: if not project_name and not project_path: @@ -507,7 +468,28 @@ def get_project_json_data(project_name: str = None, if project_name and not project_path: project_path = get_registered(project_name=project_name) - return get_json_data('project', project_path, validation.valid_o3de_project_json) + if not project_path: + logger.error(f'Project Path {project_path} has not been registered.') + return None + + project_path = pathlib.Path(project_path).resolve() + project_json = project_path / 'project.json' + if not project_json.is_file(): + logger.error(f'Project json {project_json} is not present.') + return None + if not validation.valid_o3de_project_json(project_json): + logger.error(f'Project json {project_json} is not valid.') + return None + + with project_json.open('r') as f: + try: + project_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{project_json} failed to load: {str(e)}') + else: + return project_json_data + + return None def get_gem_json_data(gem_name: str = None, gem_path: str or pathlib.Path = None, @@ -519,10 +501,28 @@ def get_gem_json_data(gem_name: str = None, gem_path: str or pathlib.Path = None if gem_name and not gem_path: gem_path = get_registered(gem_name=gem_name, project_path=project_path) - if pathlib.Path(gem_path).is_file(): - return get_json_data_file(gem_path, 'gem', validation.valid_o3de_gem_json) - else: - return get_json_data('gem', gem_path, validation.valid_o3de_gem_json) + if not gem_path: + logger.error(f'Gem Path {gem_path} has not been registered.') + return None + + gem_path = pathlib.Path(gem_path).resolve() + gem_json = gem_path / 'gem.json' + if not gem_json.is_file(): + logger.error(f'Gem json {gem_json} is not present.') + return None + if not validation.valid_o3de_gem_json(gem_json): + logger.error(f'Gem json {gem_json} is not valid.') + return None + + with gem_json.open('r') as f: + try: + gem_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{gem_json} failed to load: {str(e)}') + else: + return gem_json_data + + return None def get_template_json_data(template_name: str = None, template_path: str or pathlib.Path = None, @@ -534,7 +534,28 @@ def get_template_json_data(template_name: str = None, template_path: str or path if template_name and not template_path: template_path = get_registered(template_name=template_name, project_path=project_path) - return get_json_data('template', template_path, validation.valid_o3de_template_json) + if not template_path: + logger.error(f'Template Path {template_path} has not been registered.') + return None + + template_path = pathlib.Path(template_path).resolve() + template_json = template_path / 'template.json' + if not template_json.is_file(): + logger.error(f'Template json {template_json} is not present.') + return None + if not validation.valid_o3de_template_json(template_json): + logger.error(f'Template json {template_json} is not valid.') + return None + + with template_json.open('r') as f: + try: + template_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{template_json} failed to load: {str(e)}') + else: + return template_json_data + + return None def get_restricted_json_data(restricted_name: str = None, restricted_path: str or pathlib.Path = None, @@ -546,26 +567,28 @@ def get_restricted_json_data(restricted_name: str = None, restricted_path: str o if restricted_name and not restricted_path: restricted_path = get_registered(restricted_name=restricted_name, project_path=project_path) - return get_json_data('restricted', restricted_path, validation.valid_o3de_restricted_json) - - -def get_repo_json_data(repo_uri: str) -> dict or None: - if not repo_uri: - logger.error('Must specify a Repo Uri.') + if not restricted_path: + logger.error(f'Restricted Path {restricted_path} has not been registered.') return None - repo_json = get_repo_path(repo_uri=repo_uri) - - return get_json_data_file(repo_json, "Repo", validation.valid_o3de_repo_json) - + restricted_path = pathlib.Path(restricted_path).resolve() + restricted_json = restricted_path / 'restricted.json' + if not restricted_json.is_file(): + logger.error(f'Restricted json {restricted_json} is not present.') + return None + if not validation.valid_o3de_restricted_json(restricted_json): + logger.error(f'Restricted json {restricted_json} is not valid.') + return None -def get_repo_path(repo_uri: str, cache_folder: str or pathlib.Path = None) -> pathlib.Path: - if not cache_folder: - cache_folder = get_o3de_cache_folder() + with restricted_json.open('r') as f: + try: + restricted_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{restricted_json} failed to load: {str(e)}') + else: + return restricted_json_data - repo_manifest = f'{repo_uri}/repo.json' - repo_sha256 = hashlib.sha256(repo_manifest.encode()) - return cache_folder / str(repo_sha256.hexdigest() + '.json') + return None def get_registered(engine_name: str = None, @@ -604,7 +627,7 @@ def get_registered(engine_name: str = None, # check global first then this engine if isinstance(engine_name, str): - engines = get_engines() + engines = get_manifest_engines() for engine in engines: if isinstance(engine, dict): engine_path = pathlib.Path(engine['path']).resolve() @@ -633,72 +656,60 @@ def get_registered(engine_name: str = None, for project_path in projects: project_path = pathlib.Path(project_path).resolve() project_json = project_path / 'project.json' - if not pathlib.Path(project_json).is_file(): - logger.warning(f'{project_json} does not exist') - else: - with project_json.open('r') as f: - try: - project_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{project_json} failed to load: {str(e)}') - else: - this_projects_name = project_json_data['project_name'] - if this_projects_name == project_name: - return project_path + with project_json.open('r') as f: + try: + project_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{project_json} failed to load: {str(e)}') + else: + this_projects_name = project_json_data['project_name'] + if this_projects_name == project_name: + return project_path elif isinstance(gem_name, str): gems = get_all_gems(project_path) for gem_path in gems: gem_path = pathlib.Path(gem_path).resolve() gem_json = gem_path / 'gem.json' - if not pathlib.Path(gem_json).is_file(): - logger.warning(f'{gem_json} does not exist') - else: - with gem_json.open('r') as f: - try: - gem_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{gem_json} failed to load: {str(e)}') - else: - this_gems_name = gem_json_data['gem_name'] - if this_gems_name == gem_name: - return gem_path + with gem_json.open('r') as f: + try: + gem_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{gem_json} failed to load: {str(e)}') + else: + this_gems_name = gem_json_data['gem_name'] + if this_gems_name == gem_name: + return gem_path elif isinstance(template_name, str): templates = get_all_templates(project_path) for template_path in templates: template_path = pathlib.Path(template_path).resolve() template_json = template_path / 'template.json' - if not pathlib.Path(template_json).is_file(): - logger.warning(f'{template_json} does not exist') - else: - with template_json.open('r') as f: - try: - template_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{template_path} failed to load: {str(e)}') - else: - this_templates_name = template_json_data['template_name'] - if this_templates_name == template_name: - return template_path + with template_json.open('r') as f: + try: + template_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{template_path} failed to load: {str(e)}') + else: + this_templates_name = template_json_data['template_name'] + if this_templates_name == template_name: + return template_path elif isinstance(restricted_name, str): - restricted = get_all_restricted(project_path) + restricted = get_manifest_restricted() for restricted_path in restricted: restricted_path = pathlib.Path(restricted_path).resolve() restricted_json = restricted_path / 'restricted.json' - if not pathlib.Path(restricted_json).is_file(): - logger.warning(f'{restricted_json} does not exist') - else: - with restricted_json.open('r') as f: - try: - restricted_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{restricted_json} failed to load: {str(e)}') - else: - this_restricted_name = restricted_json_data['restricted_name'] - if this_restricted_name == restricted_name: - return restricted_path + with restricted_json.open('r') as f: + try: + restricted_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{restricted_json} failed to load: {str(e)}') + else: + this_restricted_name = restricted_json_data['restricted_name'] + if this_restricted_name == restricted_name: + return restricted_path elif isinstance(default_folder, str): if default_folder == 'engines': @@ -720,7 +731,9 @@ def get_registered(engine_name: str = None, elif isinstance(repo_name, str): cache_folder = get_o3de_cache_folder() for repo_uri in json_data['repos']: - cache_file = get_repo_path(repo_uri=repo_uri, cache_folder=cache_folder) + repo_uri = pathlib.Path(repo_uri).resolve() + repo_sha256 = hashlib.sha256(repo_uri.encode()) + cache_file = cache_folder / str(repo_sha256.hexdigest() + '.json') if cache_file.is_file(): repo = pathlib.Path(cache_file).resolve() with repo.open('r') as f: diff --git a/scripts/o3de/o3de/print_registration.py b/scripts/o3de/o3de/print_registration.py index 77e098d0ba..2bd3202ca0 100644 --- a/scripts/o3de/o3de/print_registration.py +++ b/scripts/o3de/o3de/print_registration.py @@ -39,69 +39,68 @@ def get_project_path(project_path: pathlib.Path, project_name: str) -> pathlib.P return project_path -def print_this_engine(verbose: int) -> int: +def print_this_engine(verbose: int = 0) -> int: this_engine_path = manifest.get_this_engine_path() print(f'This Engine:\n{json.dumps(str(this_engine_path), indent=4)}') if verbose > 0: return print_manifest_json_data([this_engine_path], 'This Engine', - manifest.get_engine_json_data, 'engine_path') + manifest.get_engine_json_data, 'engine_path') return 0 -def print_engines(verbose: int) -> None: - engines_data = manifest.get_engines() +def print_engines(verbose: int = 0) -> int: + engines_data = manifest.get_manifest_engines() print(f'Engine Paths:\n{json.dumps(engines_data, indent=4)}') if verbose > 0: return print_manifest_json_data(engines_data, 'Engine Jsons', - manifest.get_engine_json_data, 'engine_path') + manifest.get_engine_json_data, 'engine_path') return 0 -def print_projects(verbose: int) -> int: - projects_data = manifest.get_projects() +def print_projects(verbose: int = 0) -> int: + projects_data = manifest.get_all_projects() print(f'Project Paths:\n{json.dumps(projects_data, indent=4)}') if verbose > 0: return print_manifest_json_data(projects_data, 'Project Jsons', - manifest.get_project_json_data, 'project_path') + manifest.get_project_json_data, 'project_path') return 0 -def print_gems(verbose: int) -> int: - gems_data = manifest.get_gems() +def print_gems(verbose: int = 0) -> int: + gems_data = manifest.get_all_gems() print(f'Gem Paths:\n{json.dumps(gems_data, indent=4)}') if verbose > 0: return print_manifest_json_data(gems_data, 'Gem Jsons', - manifest.get_gem_json_data, 'gem_path') + manifest.get_gem_json_data, 'gem_path') return 0 -def print_external_subdirectories(verbose: int) -> int: - external_subdirs_data = manifest.get_external_subdirectories() +def print_external_subdirectories(verbose: int = 0) -> int: + external_subdirs_data = manifest.get_all_external_subdirectories() print(f'External Subdirectories:\n{json.dumps(external_subdirs_data, indent=4)}') return 0 - def print_templates(verbose: int) -> int: - templates_data = manifest.get_templates() + templates_data = manifest.get_all_templates() print(f'Template Paths:\n{json.dumps(templates_data, indent=4)}') if verbose > 0: return print_manifest_json_data(templates_data, 'Template Jsons', - manifest.get_template_json_data, 'template_path') + manifest.get_template_json_data, 'template_path') return 0 def print_restricted(verbose: int) -> int: - restricted_data = manifest.get_restricted() + restricted_data = manifest.get_manifest_restricted() print(f'Restricted Paths:\n{json.dumps(restricted_data, indent=4)}') if verbose > 0: return print_manifest_json_data(restricted_data, 'Restricted Jsons', - manifest.get_restricted_json_data, 'restricted_path') + manifest.get_restricted_json_data, 'restricted_path') return 0 @@ -112,7 +111,7 @@ def print_engine_projects(verbose: int) -> int: if verbose > 0: return print_manifest_json_data(engine_projects_data, 'Project Jsons', - manifest.get_project_json_data, 'project_path') + manifest.get_project_json_data, 'project_path') return 0 @@ -122,7 +121,7 @@ def print_engine_gems(verbose: int) -> int: if verbose > 0: return print_manifest_json_data(engine_gems_data, 'Gem Jsons', - manifest.get_gem_json_data, 'gem_path') + manifest.get_gem_json_data, 'gem_path') return 0 @@ -132,17 +131,7 @@ def print_engine_templates(verbose: int) -> int: if verbose > 0: return print_manifest_json_data(engine_templates_data, 'Template Jsons', - manifest.get_template_json_data, 'template_path') - return 0 - - -def print_engine_restricted(verbose: int) -> int: - engine_restricted_data = manifest.get_engine_restricted() - print(f'Restricted Paths:\n{json.dumps(engine_restricted_data, indent=4)}') - - if verbose > 0: - return print_manifest_json_data(engine_restricted_data, 'Restricted Jsons', - manifest.get_restricted_json_data, 'restricted_path') + manifest.get_template_json_data, 'template_path') return 0 @@ -153,21 +142,6 @@ def print_engine_external_subdirectories(verbose: int) -> int: # Project output methods -def print_project_engine_name(verbose: int, project_path: pathlib.Path, project_name: str) -> int: - project_path = get_project_path(project_path, project_name) - if not project_path: - return 1 - - engine_name = manifest.get_project_engine_name(project_path) - if engine_name: - print(f'Project\'s engine name:\n{engine_name}') - return 0 - - if verbose > 0: - logger.info(f'project.json at path "{project_path}" contains no registered "engine" field') - return 1 - - def print_project_gems(verbose: int, project_path: pathlib.Path, project_name: str) -> int: project_path = get_project_path(project_path, project_name) if not project_path: @@ -178,7 +152,7 @@ def print_project_gems(verbose: int, project_path: pathlib.Path, project_name: s if verbose > 0: return print_manifest_json_data(project_gems_data, 'Gems Jsons', - manifest.get_gem_json_data, 'gem_path') + manifest.get_gem_json_data, 'gem_path') return 0 @@ -201,20 +175,7 @@ def print_project_templates(verbose: int, project_path: pathlib.Path, project_na print(f'Template Paths:\n{json.dumps(project_templates_data, indent=4)}') if verbose > 0: return print_manifest_json_data(project_templates_data, 'Template Jsons', - manifest.get_template_json_data, 'template_path') - return 0 - - -def print_project_restricted(verbose: int, project_path: pathlib.Path, project_name: str) -> int: - project_path = get_project_path(project_path, project_name) - if not project_path: - return 1 - - project_restricted_data = manifest.get_project_restricted(project_path) - print(f'Restricted Paths:\n{json.dumps(project_restricted_data, indent=4)}') - if verbose > 0: - return print_manifest_json_data(project_restricted_data, 'Restricted Jsons', - manifest.get_restricted_json_data, 'restricted_path') + manifest.get_template_json_data, 'template_path') return 0 @@ -224,12 +185,12 @@ def print_all_projects(verbose: int) -> int: if verbose > 0: return print_manifest_json_data(all_projects_data, 'Project Jsons', - manifest.get_project_json_data, 'project_path') + manifest.get_project_json_data, 'project_path') return 0 def print_all_gems(verbose: int, project_path: pathlib.Path = None, project_name: str = None) -> int: - all_gems = manifest.get_gems() + all_gems = manifest.get_manifest_gems() all_gems.extend(manifest.get_engine_gems()) # If a project path or project name is supplied query the gems from that project, otherwise query the gems from @@ -245,12 +206,12 @@ def print_all_gems(verbose: int, project_path: pathlib.Path = None, project_name if verbose > 0: return print_manifest_json_data(all_gems, 'Gem Jsons', - manifest.get_gem_json_data, 'gem_path') + manifest.get_gem_json_data, 'gem_path') return 0 def print_all_external_subdirectories(verbose: int, project_path: pathlib.Path = None, project_name: str = None) -> int: - all_external_subdirectories = manifest.get_external_subdirectories() + all_external_subdirectories = manifest.get_manifest_external_subdirectories() all_external_subdirectories.extend(manifest.get_engine_external_subdirectories()) # If a project path or project name is supplied query the external subdirectories from that project, @@ -267,7 +228,7 @@ def print_all_external_subdirectories(verbose: int, project_path: pathlib.Path = def print_all_templates(verbose: int, project_path: pathlib.Path = None, project_name: str = None) -> int: - all_templates = manifest.get_templates() + all_templates = manifest.get_manifest_templates() all_templates.extend(manifest.get_engine_templates()) # If a project path or project name is supplied query the templates from that project, @@ -283,31 +244,9 @@ def print_all_templates(verbose: int, project_path: pathlib.Path = None, project if verbose > 0: return print_manifest_json_data(all_templates, 'Template Jsons', - manifest.get_template_json_data, 'template_path') - return 0 - - -def print_all_restricted(verbose: int, project_path: pathlib.Path = None, project_name: str = None) -> int: - all_restricted = manifest.get_restricted() - all_restricted.extend(manifest.get_engine_restricted()) - - # If a project path or project name is supplied query the restricted from that project, - # otherwise query the restricted from all projects - project_path = get_project_path(project_path, project_name) if project_path or project_name else None - projects = [project_path] if project_path else manifest.get_all_projects() - for project in projects: - all_restricted.extend(manifest.get_project_restricted(project)) - - # Filter out duplicates - all_restricted = list(dict.fromkeys(all_restricted)) - print(f'Restricted Paths:\n{json.dumps(all_restricted, indent=4)}') - - if verbose > 0: - return print_manifest_json_data(all_restricted, 'Restricted Jsons', - manifest.get_restricted_json_data, 'restricted_path') + manifest.get_template_json_data, 'template_path') return 0 - def print_manifest_json_data(uri_json_data: list, print_prefix: str, get_json_func: callable, get_json_data_kw: str) -> int: print('\n') @@ -351,7 +290,7 @@ def print_repos_data(repos_data: dict) -> int: def print_repos(verbose: int) -> int: - repos_data = manifest.get_repos() + repos_data = manifest.get_manifest_repos() print(json.dumps(repos_data, indent=4)) if verbose > 0: @@ -370,16 +309,13 @@ def register_show(verbose: int, project_path: pathlib.Path = None, project_name: result = print_all_projects(verbose) or result result = print_all_gems(verbose, project_path, project_name) or result result = print_all_templates(verbose, project_path, project_name) or result - result = print_all_restricted(verbose, project_path, project_name) or result + result = print_restricted(verbose) or result result = print_repos(verbose) or result return result def _run_register_show(args: argparse) -> int: - if args.override_home_folder: - manifest.override_home_folder = args.override_home_folder - if args.this_engine: return print_this_engine(args.verbose) elif args.engines: @@ -393,7 +329,7 @@ def _run_register_show(args: argparse) -> int: elif args.templates: return print_templates(args.verbose) elif args.repos: - return register_show_repos(args.verbose) + return print_repos(args.verbose) elif args.restricted: return print_restricted(args.verbose) @@ -405,8 +341,6 @@ def _run_register_show(args: argparse) -> int: return print_engine_external_subdirectories(args.verbose) elif args.engine_templates: return print_engine_templates(args.verbose) - elif args.engine_restricted: - return print_engine_restricted(args.verbose) elif args.project_gems: return print_project_gems(args.verbose, args.project_path, args.project_name) @@ -414,8 +348,6 @@ def _run_register_show(args: argparse) -> int: return print_project_external_subdirectories(args.verbose, args.project_path, args.project_name) elif args.project_templates: return print_project_templates(args.verbose, args.project_path, args.project_name) - elif args.project_restricted: - return print_project_restricted(args.verbose, args.project_path, args.project_name) elif args.project_engine_name: return print_project_engine_name(args.verbose, args.project_path, args.project_name) @@ -427,8 +359,6 @@ def _run_register_show(args: argparse) -> int: return print_all_external_subdirectories(args.verbose, args.project_path, args.project_name) elif args.all_templates: return print_all_templates(args.verbose, args.project_path, args.project_name) - elif args.all_restricted: - return print_all_restricted(args.verbose, args.project_path, args.project_name) else: return register_show(args.verbose, args.project_path, args.project_name) @@ -538,9 +468,6 @@ def add_parser_args(parser): project_group.add_argument('-pn', '--project-name', type=str, help='The name of a project.') - parser.add_argument('-ohf', '--override-home-folder', type=str, required=False, - help='By default the home folder is the user folder, override it to this folder.') - parser.set_defaults(func=_run_register_show) diff --git a/scripts/o3de/o3de/register.py b/scripts/o3de/o3de/register.py index a175104997..926c413521 100644 --- a/scripts/o3de/o3de/register.py +++ b/scripts/o3de/o3de/register.py @@ -490,7 +490,7 @@ def register_repo(json_data: dict, repo_sha256 = hashlib.sha256(url.encode()) cache_file = manifest.get_o3de_cache_folder() / str(repo_sha256.hexdigest() + '.json') - result = utils.download_file(parsed_uri, cache_file, True) + result = utils.download_file(url, cache_file, True) if result == 0: json_data.setdefault('repos', []).insert(0, repo_uri) @@ -793,9 +793,6 @@ def register(engine_path: pathlib.Path = None, def _run_register(args: argparse) -> int: - if args.override_home_folder: - manifest.override_home_folder = args.override_home_folder - if args.update: remove_invalid_o3de_objects() return repo.refresh_repos() @@ -891,8 +888,6 @@ def add_parser_args(parser): default=False, help='Refresh the repo cache.') - parser.add_argument('-ohf', '--override-home-folder', type=pathlib.Path, required=False, - help='By default the home folder is the user folder, override it to this folder.') parser.add_argument('-r', '--remove', action='store_true', required=False, default=False, help='Remove entry.') diff --git a/scripts/o3de/tests/unit_test_enable_gem.py b/scripts/o3de/tests/unit_test_enable_gem.py index c765f74731..8067fc329d 100644 --- a/scripts/o3de/tests/unit_test_enable_gem.py +++ b/scripts/o3de/tests/unit_test_enable_gem.py @@ -42,8 +42,10 @@ TEST_GEM_JSON_PAYLOAD = ''' { "gem_name": "TestGem", "display_name": "TestGem", - "license": "What license TestGem uses goes here: i.e. https://opensource.org/licenses/MIT", - "origin": "The primary repo for TestGem goes here: i.e. http://www.mydomain.com", + "license": "Apache-2.0 Or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "A short description of TestGem.", "canonical_tags": [ @@ -53,7 +55,10 @@ TEST_GEM_JSON_PAYLOAD = ''' "TestGem" ], "icon_path": "preview.png", - "requirements": "" + "requirements": "Any requirement goes here.", + "documentation_url": "The link to the documentation goes here.", + "dependencies": [ + ] } ''' diff --git a/scripts/o3de/tests/unit_test_engine_template.py b/scripts/o3de/tests/unit_test_engine_template.py index ed1c8258d3..da23ee11f1 100755 --- a/scripts/o3de/tests/unit_test_engine_template.py +++ b/scripts/o3de/tests/unit_test_engine_template.py @@ -93,37 +93,28 @@ TEST_TEMPLATE_JSON_CONTENTS = """\ "copyFiles": [ { "file": "Code/Include/${Name}/${Name}Bus.h", - "origin": "Code/Include/${Name}/${Name}Bus.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { - "file": "Code/Include/Platform/Salem/${Name}Bus.h", - "origin": "Code/Include/Platform/Salem/${Name}Bus.h", - "isTemplated": true, - "isOptional": false + "file": "Code/Include/Platform/Windows/${Name}Bus.h", + "isTemplated": true } ], "createDirectories": [ { - "dir": "Code", - "origin": "Code" + "dir": "Code" }, { - "dir": "Code/Include", - "origin": "Code/Include" + "dir": "Code/Include" }, { - "dir": "Code/Include/${Name}", - "origin": "Code/Include/${Name}" + "dir": "Code/Include/${Name}" }, { - "dir": "Code/Include/Platform", - "origin": "Code/Include/Platform" + "dir": "Code/Include/Platform" }, { - "dir": "Code/Include/Platform/Salem", - "origin": "Code/Include/Platform/Salem" + "dir": "Code/Include/Platform/Windows" } ] } @@ -174,10 +165,10 @@ def test_create_template(tmpdir, with gem_bus_file.open('w') as s: s.write(concrete_contents) - engine_gem_code_include_platform_salem = template_source_path / 'Code/Include/Platform/Salem' - engine_gem_code_include_platform_salem.mkdir(parents=True, exist_ok=True) + engine_gem_code_include_platform_windows = template_source_path / 'Code/Include/Platform/Windows' + engine_gem_code_include_platform_windows.mkdir(parents=True, exist_ok=True) - restricted_gem_bus_file = engine_gem_code_include_platform_salem / 'TestTemplateBus.h' + restricted_gem_bus_file = engine_gem_code_include_platform_windows / 'TestTemplateBus.h' with restricted_gem_bus_file.open('w') as s: s.write(concrete_contents) @@ -209,9 +200,9 @@ def test_create_template(tmpdir, else: assert s_data == templated_contents_without_license - platform_template_folder = engine_root / 'Salem/Templates' + platform_template_folder = engine_root / 'Windows/Templates' - new_platform_default_name_bus_file = template_content_folder / 'Code/Include/Platform/Salem/${Name}Bus.h' + new_platform_default_name_bus_file = template_content_folder / 'Code/Include/Platform/Windows/${Name}Bus.h' assert new_platform_default_name_bus_file.is_file() with new_platform_default_name_bus_file.open('r') as s: s_data = s.read() @@ -255,7 +246,7 @@ class TestCreateTemplate: s.write(templated_contents) template_content_folder = template_default_folder / 'Template' - platform_default_name_bus_dir = template_content_folder / 'Code/Include/Platform/Salem' + platform_default_name_bus_dir = template_content_folder / 'Code/Include/Platform/Windows' platform_default_name_bus_dir.mkdir(parents=True, exist_ok=True) platform_default_name_bus_file = platform_default_name_bus_dir / '${Name}Bus.h' @@ -263,10 +254,13 @@ class TestCreateTemplate: s.write(templated_contents) template_dest_path = engine_root / instantiated_name - # Skip registeration in test + # Skip registration in test with patch('uuid.uuid4', return_value=uuid.uuid5(uuid.NAMESPACE_DNS, instantiated_name)) as uuid4_mock: - result = create_from_template_func(template_dest_path, template_path=template_default_folder, force=True, - keep_license_text=keep_license_text, **create_from_template_kwargs) + result = create_from_template_func(template_dest_path, + template_path=template_default_folder, + keep_license_text=keep_license_text, + force=True, + **create_from_template_kwargs) if expect_failure: assert result != 0 else: @@ -281,7 +275,7 @@ class TestCreateTemplate: s_data = s.read() assert s_data == concrete_contents - platform_test_bus_folder = test_folder / 'Code/Include/Platform/Salem' + platform_test_bus_folder = test_folder / 'Code/Include/Platform/Windows' assert platform_test_bus_folder.is_dir() platform_default_name_bus_file = platform_test_bus_folder / f'{instantiated_name}Bus.h' @@ -338,9 +332,7 @@ class TestCreateTemplate: template_json_dict.setdefault('copyFiles', []).append( { "file": "project.json", - "origin": "project.json", - "isTemplated": True, - "isOptional": False + "isTemplated": True }) # Convert the python dictionary back into a json string template_json_contents = json.dumps(template_json_dict, indent=4) @@ -376,9 +368,7 @@ class TestCreateTemplate: template_json_dict.setdefault('copyFiles', []).append( { "file": "gem.json", - "origin": "gem.json", - "isTemplated": True, - "isOptional": False + "isTemplated": True }) #Convert dict back to string template_json_contents = json.dumps(template_json_dict, indent=4) diff --git a/scripts/o3de/tests/unit_test_gem_properties.py b/scripts/o3de/tests/unit_test_gem_properties.py index dee5811b65..6358917852 100644 --- a/scripts/o3de/tests/unit_test_gem_properties.py +++ b/scripts/o3de/tests/unit_test_gem_properties.py @@ -18,10 +18,9 @@ TEST_GEM_JSON_PAYLOAD = ''' { "gem_name": "TestGem", "display_name": "TestGem", - "license": "MIT", - "license_url": "https://opensource.org/licenses/MIT", + "license": "Apache-2.0 or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "The primary repo for TestGem goes here: i.e. http://www.mydomain.com", - "type": "Code", "summary": "A short description of TestGem.", "canonical_tags": [ "Gem" @@ -31,7 +30,9 @@ TEST_GEM_JSON_PAYLOAD = ''' ], "icon_path": "preview.png", "requirements": "", - "documentation_url": "https://o3de.org/docs/" + "documentation_url": "https://o3de.org/docs/", + "dependencies": [ + ] } ''' diff --git a/scripts/o3de/tests/unit_test_manifest.py b/scripts/o3de/tests/unit_test_manifest.py index ad4809dc1d..c7d7a7573b 100644 --- a/scripts/o3de/tests/unit_test_manifest.py +++ b/scripts/o3de/tests/unit_test_manifest.py @@ -22,7 +22,7 @@ from o3de import manifest ]) class TestGetTemplatesForCreation: @staticmethod - def get_templates() -> list: + def get_manifest_templates() -> list: return [] @staticmethod @@ -40,20 +40,24 @@ class TestGetTemplatesForCreation: ) def test_get_templates_for_generic_creation(self, valid_project_json_paths, valid_gem_json_paths, expected_template_paths): - def validate_project_json(template_path) -> bool: - return pathlib.Path(template_path) in valid_project_json_paths + def validate_project_json(project_json_path) -> bool: + return pathlib.Path(project_json_path) in valid_project_json_paths - def validate_gem_json(template_path) -> bool: - return pathlib.Path(template_path) in valid_gem_json_paths + def validate_gem_json(gem_json_path) -> bool: + return pathlib.Path(gem_json_path) in valid_gem_json_paths - with patch('o3de.manifest.get_templates', side_effect=self.get_templates) as get_templates_patch, \ + with patch('o3de.manifest.get_manifest_templates', side_effect=self.get_manifest_templates)\ + as get_manifest_templates_patch, \ patch('o3de.manifest.get_project_templates', side_effect=self.get_project_templates)\ as get_project_templates_patch, \ patch('o3de.manifest.get_engine_templates', side_effect=self.get_engine_templates)\ as get_engine_templates_patch, \ - patch('o3de.validation.valid_o3de_template_json', return_value=True) as validate_template_json,\ - patch('o3de.validation.valid_o3de_project_json', side_effect=validate_project_json) as validate_project_json,\ - patch('o3de.validation.valid_o3de_gem_json', side_effect=validate_gem_json) as validate_gem_json: + patch('o3de.validation.valid_o3de_template_json', return_value=True) \ + as validate_template_json,\ + patch('o3de.validation.valid_o3de_project_json', side_effect=validate_project_json) \ + as validate_project_json,\ + patch('o3de.validation.valid_o3de_gem_json', side_effect=validate_gem_json) \ + as validate_gem_json: templates = manifest.get_templates_for_generic_creation() assert templates == expected_template_paths @@ -64,21 +68,24 @@ class TestGetTemplatesForCreation: ) def test_get_templates_for_gem_creation(self, valid_project_json_paths, valid_gem_json_paths, expected_template_paths): - def validate_project_json(template_path) -> bool: - return pathlib.Path(template_path) in valid_project_json_paths + def validate_project_json(project_json_path) -> bool: + return pathlib.Path(project_json_path) in valid_project_json_paths - def validate_gem_json(template_path) -> bool: - return pathlib.Path(template_path) in valid_gem_json_paths + def validate_gem_json(gem_json_path) -> bool: + return pathlib.Path(gem_json_path) in valid_gem_json_paths - with patch('o3de.manifest.get_templates', side_effect=self.get_templates) as get_templates_patch, \ + with patch('o3de.manifest.get_manifest_templates', side_effect=self.get_manifest_templates)\ + as get_manifest_templates_patch, \ patch('o3de.manifest.get_project_templates', side_effect=self.get_project_templates) \ as get_project_templates_patch, \ patch('o3de.manifest.get_engine_templates', side_effect=self.get_engine_templates) \ as get_engine_templates_patch, \ - patch('o3de.validation.valid_o3de_template_json', return_value=True) as validate_template_json, \ - patch('o3de.validation.valid_o3de_project_json', - side_effect=validate_project_json) as validate_project_json, \ - patch('o3de.validation.valid_o3de_gem_json', side_effect=validate_gem_json) as validate_gem_json: + patch('o3de.validation.valid_o3de_template_json', return_value=True) \ + as validate_template_json, \ + patch('o3de.validation.valid_o3de_project_json', side_effect=validate_project_json) \ + as validate_project_json, \ + patch('o3de.validation.valid_o3de_gem_json', side_effect=validate_gem_json) \ + as validate_gem_json: templates = manifest.get_templates_for_project_creation() assert templates == expected_template_paths @@ -89,20 +96,23 @@ class TestGetTemplatesForCreation: ) def test_get_templates_for_project_creation(self, valid_project_json_paths, valid_gem_json_paths, expected_template_paths): - def validate_project_json(template_path) -> bool: - return pathlib.Path(template_path) in valid_project_json_paths + def validate_project_json(project_json_path) -> bool: + return pathlib.Path(project_json_path) in valid_project_json_paths - def validate_gem_json(template_path) -> bool: - return pathlib.Path(template_path) in valid_gem_json_paths + def validate_gem_json(gem_json_path) -> bool: + return pathlib.Path(gem_json_path) in valid_gem_json_paths - with patch('o3de.manifest.get_templates', side_effect=self.get_templates) as get_templates_patch, \ + with patch('o3de.manifest.get_manifest_templates', side_effect=self.get_manifest_templates) \ + as get_manifest_templates_patch, \ patch('o3de.manifest.get_project_templates', side_effect=self.get_project_templates) \ as get_project_templates_patch, \ patch('o3de.manifest.get_engine_templates', side_effect=self.get_engine_templates) \ as get_engine_templates_patch, \ - patch('o3de.validation.valid_o3de_template_json', return_value=True) as validate_template_json, \ - patch('o3de.validation.valid_o3de_project_json', - side_effect=validate_project_json) as validate_project_json, \ - patch('o3de.validation.valid_o3de_gem_json', side_effect=validate_gem_json) as validate_gem_json: + patch('o3de.validation.valid_o3de_template_json', return_value=True) \ + as validate_template_json, \ + patch('o3de.validation.valid_o3de_project_json', side_effect=validate_project_json) \ + as validate_project_json, \ + patch('o3de.validation.valid_o3de_gem_json', side_effect=validate_gem_json) \ + as validate_gem_json: templates = manifest.get_templates_for_gem_creation() assert templates == expected_template_paths \ No newline at end of file diff --git a/scripts/o3de/tests/unit_test_print_registration.py b/scripts/o3de/tests/unit_test_print_registration.py index 7e3e75edcd..d01434c99f 100644 --- a/scripts/o3de/tests/unit_test_print_registration.py +++ b/scripts/o3de/tests/unit_test_print_registration.py @@ -90,27 +90,20 @@ TEST_TEMPLATE_JSON_PAYLOAD = ''' "copyFiles": [ { "file": "CMakeLists.txt", - "origin": "CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "gem.json", - "origin": "gem.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "preview.png", - "origin": "preview.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false } ], "createDirectories": [ { - "dir": "Assets", - "origin": "Assets" + "dir": "Assets" } ] } @@ -277,13 +270,9 @@ class TestPrintRegistration: # Patch the manifest.py function to locate gem.json files in external subdirectories # to just return a fake path to a single test gem - def get_gems_from_subdirectories(external_subdirs: list) -> list: - return ["D:/TestGem"] - with patch('o3de.manifest.load_o3de_manifest', side_effect=self.load_manifest_json) as load_manifest_patch, \ patch('o3de.manifest.get_gem_json_data', side_effect=self.get_gem_json_data) as get_json_patch, \ patch('o3de.manifest.get_project_json_data', side_effect=self.get_project_json_data) as get_project_json_patch, \ - patch('o3de.manifest.get_gems_from_subdirectories', side_effect=get_gems_from_subdirectories) as get_gems_from_subdirs_patch, \ patch('o3de.print_registration.get_project_path', return_value=project_path) as get_project_path_patch: result = print_registration._run_register_show(test_args) assert result == 0 From 284ae60139eef1c69cd8981048dc77c4bd26631a Mon Sep 17 00:00:00 2001 From: moudgils <47460854+moudgils@users.noreply.github.com> Date: Fri, 14 Jan 2022 10:34:57 -0800 Subject: [PATCH 386/399] Add missing 'precise' keyword for Vertex shaders (#6902) Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com> --- .../Assets/Materials/Types/EnhancedPBR_DepthPass_WithPS.azsl | 4 ++-- .../Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl | 2 +- Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl | 2 +- .../Types/StandardMultilayerPBR_DepthPass_WithPS.azsl | 4 ++-- .../Materials/Types/StandardMultilayerPBR_ForwardPass.azsl | 2 +- .../TestData/Materials/Types/AutoBrick_ForwardPass.azsl | 2 +- .../TestData/Materials/Types/MinimalPBR_ForwardPass.azsl | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_DepthPass_WithPS.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_DepthPass_WithPS.azsl index f2564cf10c..08642decc0 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_DepthPass_WithPS.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_DepthPass_WithPS.azsl @@ -28,7 +28,7 @@ struct VSInput struct VSDepthOutput { - float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float2 m_uv[UvSetCount] : UV1; // only used for parallax depth calculation @@ -62,7 +62,7 @@ VSDepthOutput MainVS(VSInput IN) struct PSDepthOutput { - float m_depth : SV_Depth; + precise float m_depth : SV_Depth; }; PSDepthOutput MainPS(VSDepthOutput IN, bool isFrontFace : SV_IsFrontFace) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl index 0f9771e480..4b37f67930 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl @@ -67,7 +67,7 @@ struct VSInput struct VSOutput { // Base fields (required by the template azsli file)... - float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float3 m_normal: NORMAL; float3 m_tangent : TANGENT; float3 m_bitangent : BITANGENT; diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl index 523353f8fa..00dee50c93 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl @@ -86,7 +86,7 @@ struct VSInput struct VSOutput { // Base fields (required by the template azsli file)... - float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float3 m_normal: NORMAL; float3 m_tangent : TANGENT; float3 m_bitangent : BITANGENT; diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_DepthPass_WithPS.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_DepthPass_WithPS.azsl index 39597e2bdd..7875457489 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_DepthPass_WithPS.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_DepthPass_WithPS.azsl @@ -41,7 +41,7 @@ struct VSInput struct VSDepthOutput { - float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float2 m_uv[UvSetCount] : UV1; // only used for parallax depth calculation @@ -88,7 +88,7 @@ VSDepthOutput MainVS(VSInput IN) struct PSDepthOutput { - float m_depth : SV_Depth; + precise float m_depth : SV_Depth; }; PSDepthOutput MainPS(VSDepthOutput IN, bool isFrontFace : SV_IsFrontFace) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl index 8f58c6dd33..5b05e48d3b 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl @@ -80,7 +80,7 @@ struct VSInput struct VSOutput { // Base fields (required by the template azsli file)... - float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float3 m_normal: NORMAL; float3 m_tangent : TANGENT; float3 m_bitangent : BITANGENT; diff --git a/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick_ForwardPass.azsl b/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick_ForwardPass.azsl index 2dbba46d8b..05ce5f4774 100644 --- a/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick_ForwardPass.azsl +++ b/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick_ForwardPass.azsl @@ -28,7 +28,7 @@ struct VSInput struct VSOutput { - float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float3 m_normal: NORMAL; float3 m_tangent : TANGENT; float3 m_bitangent : BITANGENT; diff --git a/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR_ForwardPass.azsl b/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR_ForwardPass.azsl index 2f6f038e4b..fe9e4099d0 100644 --- a/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR_ForwardPass.azsl +++ b/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR_ForwardPass.azsl @@ -33,7 +33,7 @@ struct VSInput struct VSOutput { - float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float3 m_normal: NORMAL; float3 m_tangent : TANGENT; float3 m_bitangent : BITANGENT; From bbfe740cc9c9eb1772aa35f76a1ba0a98606f9c7 Mon Sep 17 00:00:00 2001 From: allisaurus <34254888+allisaurus@users.noreply.github.com> Date: Fri, 14 Jan 2022 10:52:32 -0800 Subject: [PATCH 387/399] Disable flaky HttpRequestor test (#6866) Signed-off-by: allisaurus <34254888+allisaurus@users.noreply.github.com> --- Gems/HttpRequestor/Code/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Gems/HttpRequestor/Code/CMakeLists.txt b/Gems/HttpRequestor/Code/CMakeLists.txt index 4ebca5518c..56d3527e24 100644 --- a/Gems/HttpRequestor/Code/CMakeLists.txt +++ b/Gems/HttpRequestor/Code/CMakeLists.txt @@ -71,5 +71,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) ) ly_add_googletest( NAME Gem::HttpRequestor.Tests + TEST_SUITE sandbox ) endif() From 7680d1f9d0ea0b2ac2a5f073ba5329f8b7080033 Mon Sep 17 00:00:00 2001 From: Scott Romero <24445312+AMZN-ScottR@users.noreply.github.com> Date: Fri, 14 Jan 2022 11:28:21 -0800 Subject: [PATCH 388/399] [development] fixed issue with dangling budget pointers if the budget tracker is torn down and rebuilt (#6801) Signed-off-by: AMZN-ScottR 24445312+AMZN-ScottR@users.noreply.github.com --- .../AzCore/Component/ComponentApplication.cpp | 10 +++++---- Code/Framework/AzCore/AzCore/Debug/Budget.h | 16 +++++++++----- .../AzCore/AzCore/Debug/BudgetTracker.cpp | 22 +++++++++++++------ .../AzCore/AzCore/Debug/BudgetTracker.h | 4 ++-- 4 files changed, 33 insertions(+), 19 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp index 693b2f1648..72b6e807d2 100644 --- a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp +++ b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp @@ -565,10 +565,6 @@ namespace AZ m_entityActivatedEvent.DisconnectAllHandlers(); m_entityDeactivatedEvent.DisconnectAllHandlers(); -#if !defined(_RELEASE) - m_budgetTracker.Reset(); -#endif - DestroyAllocator(); } @@ -758,6 +754,12 @@ namespace AZ static_cast(m_settingsRegistry.get())->ClearNotifiers(); static_cast(m_settingsRegistry.get())->ClearMergeEvents(); +#if !defined(_RELEASE) + // the budget tracker must be cleaned up prior to module unloading to ensure + // budgets initialized cross boundary are freed properly + m_budgetTracker.Reset(); +#endif + // Uninit and unload any dynamic modules. m_moduleManager->UnloadModules(); ComponentApplicationLifecycle::SignalEvent(*m_settingsRegistry, "GemsUnloaded", R"({})"); diff --git a/Code/Framework/AzCore/AzCore/Debug/Budget.h b/Code/Framework/AzCore/AzCore/Debug/Budget.h index 4646ef8b2c..c909302886 100644 --- a/Code/Framework/AzCore/AzCore/Debug/Budget.h +++ b/Code/Framework/AzCore/AzCore/Debug/Budget.h @@ -62,12 +62,16 @@ namespace AZ::Debug // // Anywhere the budget is used, the budget must be declared (either in a header or in the source file itself) // AZ_DECLARE_BUDGET(AzCore); -#define AZ_DEFINE_BUDGET(name) \ - ::AZ::Debug::Budget* AZ_BUDGET_GETTER(name)() \ - { \ - constexpr static uint32_t crc = AZ_CRC_CE(#name); \ - static ::AZ::Debug::Budget* budget = ::AZ::Debug::BudgetTracker::GetBudgetFromEnvironment(#name, crc); \ - return budget; \ +#define AZ_DEFINE_BUDGET(name) \ + ::AZ::Debug::Budget* AZ_BUDGET_GETTER(name)() \ + { \ + static ::AZ::Debug::Budget* budget = nullptr; \ + if (budget == nullptr) \ + { \ + constexpr static uint32_t crc = AZ_CRC_CE(#name); \ + ::AZ::Debug::BudgetTracker::GetBudgetFromEnvironment(budget, #name, crc); \ + } \ + return budget; \ } #endif diff --git a/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.cpp b/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.cpp index 2dac9a566e..faadbfc31a 100644 --- a/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.cpp +++ b/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.cpp @@ -13,23 +13,24 @@ #include #include #include +#include #include namespace AZ::Debug { struct BudgetTracker::BudgetTrackerImpl { - AZStd::unordered_map m_budgets; + AZStd::unordered_map m_budgets; + AZStd::unordered_set m_externalBudgetRefs; }; - Budget* BudgetTracker::GetBudgetFromEnvironment(const char* budgetName, uint32_t crc) + void BudgetTracker::GetBudgetFromEnvironment(Budget*& extBudgetRef, const char* budgetName, uint32_t crc) { BudgetTracker* tracker = Interface::Get(); if (tracker) { - return &tracker->GetBudget(budgetName, crc); + tracker->GetBudget(extBudgetRef, budgetName, crc); } - return nullptr; } BudgetTracker::~BudgetTracker() @@ -54,17 +55,24 @@ namespace AZ::Debug if (m_impl) { Interface::Unregister(this); + + for (auto budgetRef : m_impl->m_externalBudgetRefs) + { + *budgetRef = nullptr; + } + delete m_impl; m_impl = nullptr; } } - Budget& BudgetTracker::GetBudget(const char* budgetName, uint32_t crc) + void BudgetTracker::GetBudget(Budget*& extBudgetRef, const char* budgetName, uint32_t crc) { AZStd::scoped_lock lock{ m_mutex }; - auto it = m_impl->m_budgets.try_emplace(budgetName, budgetName, crc).first; + m_impl->m_externalBudgetRefs.insert(&extBudgetRef); - return it->second; + auto iter = m_impl->m_budgets.try_emplace(budgetName, budgetName, crc).first; + extBudgetRef = &iter->second; } } // namespace AZ::Debug diff --git a/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.h b/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.h index 34d8510349..69e8185746 100644 --- a/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.h +++ b/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.h @@ -20,7 +20,7 @@ namespace AZ::Debug { public: AZ_TYPE_INFO(BudgetTracker, "{E14A746D-BFFE-4C02-90FB-4699B79864A5}"); - static Budget* GetBudgetFromEnvironment(const char* budgetName, uint32_t crc); + static void GetBudgetFromEnvironment(Budget*& extBudgetRef, const char* budgetName, uint32_t crc); ~BudgetTracker(); @@ -28,7 +28,7 @@ namespace AZ::Debug bool Init(); void Reset(); - Budget& GetBudget(const char* budgetName, uint32_t crc); + void GetBudget(Budget*& extBudgetRef, const char* budgetName, uint32_t crc); private: struct BudgetTrackerImpl; From c403fa3db6d3dc8653c8f5908b6cbb908636c2c7 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Fri, 14 Jan 2022 13:30:45 -0600 Subject: [PATCH 389/399] More GetValues() overrides (#6896) * Benchmarks and tests for Image and Constant GetValues Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Verify GetValues for Perlin and Random Gradients Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Standardized the assert format for GetValues(). Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * More GetValues unit tests and test cleanup Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed typos Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * GetValues() unit tests for surface gradients. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Benchmarks for ShapeAreaFalloff Gradient Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added benchmarks for all remaining gradients and cleaned up the helper methods. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Renamed class for better report formatting. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added missing Mocks dependencies for the Editor tests. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * First batch of specific GetValues() overrides. Each one is measurably faster than the generic version. Also, in ShapeAreaFalloffGradient, I optimized and simplified the logic a bit, so GetValue() is marginally faster too. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Change GetValues() to use span and add more overrides. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Convert GetValues() to use AZStd::span and added more overrides. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Add missing include. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * PR feedback - switch to fill Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed the logic and added unit tests and comments. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../AzCore/AzCore/std/containers/span.h | 2 +- .../AzCore/AzCore/std/containers/span.inl | 2 +- Gems/GradientSignal/Code/CMakeLists.txt | 5 - .../Components/ConstantGradientComponent.h | 2 +- .../Components/DitherGradientComponent.h | 8 + .../Components/ImageGradientComponent.h | 2 +- .../Components/InvertGradientComponent.h | 1 + .../Components/LevelsGradientComponent.h | 1 + .../Components/PerlinGradientComponent.h | 2 +- .../Components/RandomGradientComponent.h | 2 +- .../ShapeAreaFalloffGradientComponent.h | 2 +- .../Ebuses/GradientRequestBus.h | 11 +- .../Include/GradientSignal/GradientSampler.h | 20 +-- .../Code/Include/GradientSignal/Util.h | 60 ++++++-- .../Components/ConstantGradientComponent.cpp | 8 +- .../Components/DitherGradientComponent.cpp | 144 +++++++++++------- .../Components/ImageGradientComponent.cpp | 10 +- .../Components/InvertGradientComponent.cpp | 15 ++ .../Components/LevelsGradientComponent.cpp | 17 ++- .../Components/PerlinGradientComponent.cpp | 10 +- .../Components/RandomGradientComponent.cpp | 10 +- .../ShapeAreaFalloffGradientComponent.cpp | 13 +- .../Tests/GradientSignalGetValuesTests.cpp | 6 +- .../Tests/GradientSignalServicesTests.cpp | 126 +++++++++++++++ 24 files changed, 333 insertions(+), 146 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/std/containers/span.h b/Code/Framework/AzCore/AzCore/std/containers/span.h index 8f68e921d8..5bb51bf481 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/span.h +++ b/Code/Framework/AzCore/AzCore/std/containers/span.h @@ -59,7 +59,7 @@ namespace AZStd constexpr span(pointer s, size_type length); - constexpr span(pointer first, const_pointer last); + constexpr span(pointer first, pointer last); // We explicitly delete this constructor because it's too easy to accidentally // create a span to just the first element instead of an entire array. diff --git a/Code/Framework/AzCore/AzCore/std/containers/span.inl b/Code/Framework/AzCore/AzCore/std/containers/span.inl index c33e4a7227..01bab9a5a4 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/span.inl +++ b/Code/Framework/AzCore/AzCore/std/containers/span.inl @@ -24,7 +24,7 @@ namespace AZStd } template - inline constexpr span::span(pointer first, const_pointer last) + inline constexpr span::span(pointer first, pointer last) : m_begin(first) , m_end(last) { } diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index d4cf666630..d2d8f8c696 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -19,7 +19,6 @@ ly_add_target( BUILD_DEPENDENCIES PUBLIC AZ::AzCore - AZ::AtomCore AZ::AzFramework Gem::SurfaceData Gem::ImageProcessingAtom.Headers @@ -41,7 +40,6 @@ ly_add_target( Gem::LmbrCentral PUBLIC AZ::AzCore - AZ::AtomCore Gem::GradientSignal.Static Gem::ImageProcessingAtom.Headers # Atom/ImageProcessing/PixelFormats.h is part of a header in Includes RUNTIME_DEPENDENCIES @@ -73,7 +71,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) PUBLIC 3rdParty::Qt::Widgets AZ::AzCore - AZ::AtomCore AZ::AzFramework AZ::AzToolsFramework AZ::AssetBuilderSDK @@ -97,8 +94,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) PRIVATE Gem::GradientSignal.Editor.Static Gem::LmbrCentral.Editor - PUBLIC - AZ::AtomCore RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor ) diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h index af896f0933..1ed06a976a 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h @@ -62,7 +62,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/DitherGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/DitherGradientComponent.h index ed12ec2ff7..add6de06cf 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/DitherGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/DitherGradientComponent.h @@ -77,6 +77,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; ////////////////////////////////////////////////////////////////////////// @@ -102,6 +103,13 @@ namespace GradientSignal GradientSampler& GetGradientSampler() override; private: + static int ScaledPositionToPatternIndex(const AZ::Vector3& scaledPosition, int patternSize); + static float GetDitherValue4x4(const AZ::Vector3& scaledPosition); + static float GetDitherValue8x8(const AZ::Vector3& scaledPosition); + + float GetCalculatedPointsPerUnit() const; + float GetDitherValue(const AZ::Vector3& scaledPosition, float value) const; + DitherGradientConfig m_configuration; LmbrCentral::DependencyMonitor m_dependencyMonitor; }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h index 9fc98124cb..79d42ec478 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h @@ -69,7 +69,7 @@ namespace GradientSignal // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; // AZ::Data::AssetBus overrides... void OnAssetReady(AZ::Data::Asset asset) override; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/InvertGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/InvertGradientComponent.h index 79dbea975b..a370286b0b 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/InvertGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/InvertGradientComponent.h @@ -64,6 +64,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/LevelsGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/LevelsGradientComponent.h index 5e70adfe32..093f84ef3a 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/LevelsGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/LevelsGradientComponent.h @@ -69,6 +69,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h index 1b39f7f17b..19f3fe7294 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h @@ -70,7 +70,7 @@ namespace GradientSignal // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; private: PerlinGradientConfig m_configuration; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h index 274442a2c0..328fed5118 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h @@ -61,7 +61,7 @@ namespace GradientSignal // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; private: RandomGradientConfig m_configuration; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h index df86c38069..27b2da58a3 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h @@ -69,7 +69,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h index 3a215c5b5d..45b5a173a3 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h @@ -10,8 +10,7 @@ #include #include #include - -#include +#include namespace GradientSignal { @@ -57,7 +56,7 @@ namespace GradientSignal * \param positions The input list of positions to query. * \param outValues The output list of values. This list is expected to be the same size as the positions list. */ - virtual void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + virtual void GetValues(AZStd::span positions, AZStd::span outValues) const { // Reference implementation of GetValues for any gradients that don't have their own optimized implementations. // This is 10%-60% faster than calling GetValue via EBus many times due to the per-call EBus overhead. @@ -72,11 +71,7 @@ namespace GradientSignal for (size_t index = 0; index < positions.size(); index++) { sampleParams.m_position = positions[index]; - - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); - outValue = GetValue(sampleParams); + outValues[index] = GetValue(sampleParams); } } diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h index a2e1849590..c9aa7f680c 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h @@ -33,7 +33,7 @@ namespace GradientSignal static void Reflect(AZ::ReflectContext* context); inline float GetValue(const GradientSampleParams& sampleParams) const; - inline void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const; + inline void GetValues(AZStd::span positions, AZStd::span outValues) const; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const; @@ -147,18 +147,12 @@ namespace GradientSignal return output * m_opacity; } - inline void GradientSampler::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + inline void GradientSampler::GetValues(AZStd::span positions, AZStd::span outValues) const { - auto ClearOutputValues = [](AZStd::array_view outValues) + auto ClearOutputValues = [](AZStd::span outValues) { // If we don't have a valid gradient (or it is fully transparent), clear out all the output values. - for (size_t index = 0; index < outValues.size(); index++) - { - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); - outValue = 0.0f; - } + memset(outValues.data(), 0, outValues.size() * sizeof(float)); }; if (m_opacity <= 0.0f || !m_gradientId.IsValid()) @@ -214,12 +208,8 @@ namespace GradientSignal } // Perform any post-fetch transformations on the gradient values (invert, levels, opacity). - for (size_t index = 0; index < outValues.size(); index++) + for (auto& outValue : outValues) { - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); - if (m_invertInput) { outValue = 1.0f - outValue; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Util.h b/Gems/GradientSignal/Code/Include/GradientSignal/Util.h index fa1791c053..f91c5d54f1 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Util.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Util.h @@ -7,11 +7,12 @@ */ #pragma once +#include #include #include -#include #include #include +#include #include #include @@ -53,28 +54,61 @@ namespace GradientSignal inline float GetLevels(float input, float inputMid, float inputMin, float inputMax, float outputMin, float outputMax) { - input = AZ::GetClamp(input, 0.0f, 1.0f); - inputMid = AZ::GetClamp(inputMid, 0.01f, 10.0f); // Clamp the midpoint to a non-zero value so that it's always safe to divide by it. + inputMid = AZ::GetClamp(inputMid, 0.01f, 10.0f); // Clamp the midpoint to a non-zero value so that it's always safe to divide by it. inputMin = AZ::GetClamp(inputMin, 0.0f, 1.0f); inputMax = AZ::GetClamp(inputMax, 0.0f, 1.0f); outputMin = AZ::GetClamp(outputMin, 0.0f, 1.0f); outputMax = AZ::GetClamp(outputMax, 0.0f, 1.0f); - float inputCorrected = 0.0f; if (inputMin == inputMax) { - inputCorrected = (input <= inputMin) ? 0.0f : 1.0f; - } - else - { - const float inputRemapped = AZ::GetMin(AZ::GetMax(input - inputMin, 0.0f) / (inputMax - inputMin), 1.0f); - // Note: Some paint programs map the midpoint using 1/mid where low values are dark and high values are light, - // others do the reverse and use mid directly, so low values are light and high values are dark. We've chosen to - // align with 1/mid since it appears to be the more prevalent of the two approaches. - inputCorrected = powf(inputRemapped, 1.0f / inputMid); + return (AZ::GetClamp(input, 0.0f, 1.0f) <= inputMin) ? outputMin : outputMax; } + const float inputMidReciprocal = 1.0f / inputMid; + const float inputExtentsReciprocal = 1.0f / (inputMax - inputMin); + + const float inputRemapped = + AZ::GetMin(AZ::GetMax(AZ::GetClamp(input, 0.0f, 1.0f) - inputMin, 0.0f) * inputExtentsReciprocal, 1.0f); + + // Note: Some paint programs map the midpoint using 1/mid where low values are dark and high values are light, + // others do the reverse and use mid directly, so low values are light and high values are dark. We've chosen to + // align with 1/mid since it appears to be the more prevalent of the two approaches. + const float inputCorrected = powf(inputRemapped, inputMidReciprocal); + return AZ::Lerp(outputMin, outputMax, inputCorrected); } + inline void GetLevels(AZStd::span inOutValues, float inputMid, float inputMin, float inputMax, float outputMin, float outputMax) + { + inputMid = AZ::GetClamp(inputMid, 0.01f, 10.0f); // Clamp the midpoint to a non-zero value so that it's always safe to divide by it. + inputMin = AZ::GetClamp(inputMin, 0.0f, 1.0f); + inputMax = AZ::GetClamp(inputMax, 0.0f, 1.0f); + outputMin = AZ::GetClamp(outputMin, 0.0f, 1.0f); + outputMax = AZ::GetClamp(outputMax, 0.0f, 1.0f); + + if (inputMin == inputMax) + { + for (auto& inOutValue : inOutValues) + { + inOutValue = (AZ::GetClamp(inOutValue, 0.0f, 1.0f) <= inputMin) ? outputMin : outputMax; + } + } + + const float inputMidReciprocal = 1.0f / inputMid; + const float inputExtentsReciprocal = 1.0f / (inputMax - inputMin); + + for (auto& inOutValue : inOutValues) + { + const float inputRemapped = + AZ::GetMin(AZ::GetMax(AZ::GetClamp(inOutValue, 0.0f, 1.0f) - inputMin, 0.0f) * inputExtentsReciprocal, 1.0f); + + // Note: Some paint programs map the midpoint using 1/mid where low values are dark and high values are light, + // others do the reverse and use mid directly, so low values are light and high values are dark. We've chosen to + // align with 1/mid since it appears to be the more prevalent of the two approaches. + const float inputCorrected = powf(inputRemapped, inputMidReciprocal); + + inOutValue = AZ::Lerp(outputMin, outputMax, inputCorrected); + } + } } // namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp index 2b1487f75e..ac81f616c6 100644 --- a/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp @@ -135,7 +135,7 @@ namespace GradientSignal } void ConstantGradientComponent::GetValues( - [[maybe_unused]] AZStd::array_view positions, AZStd::array_view outValues) const + [[maybe_unused]] AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { @@ -143,11 +143,7 @@ namespace GradientSignal return; } - for (auto& outValue : outValues) - { - float& writableOutValue = const_cast(outValue); - writableOutValue = m_configuration.m_value; - } + AZStd::fill(outValues.begin(), outValues.end(), m_configuration.m_value); } float ConstantGradientComponent::GetConstantValue() const diff --git a/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp index c7845a41a6..1b320afeb9 100644 --- a/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp @@ -174,90 +174,122 @@ namespace GradientSignal return false; } - int PositionToMatrixIndex(float position, int patternSize) + int DitherGradientComponent::ScaledPositionToPatternIndex(const AZ::Vector3& scaledPosition, int patternSize) { - int result = static_cast(std::floor(fmod(position, static_cast(patternSize)))); + // The input position is expected to be scaled up so that each integer value is a unique point in our dither pattern, and + // the fractional value is just the amount within the point. The output is the specific index into an NxN pattern to use + // for the dither comparison value. - if (result < 0) - { - result += patternSize; - } + // Get the floor before casting to int because we want fractional negative values to go "down" to the next negative value. + AZ::Vector3 flooredScaledPosition = scaledPosition.GetFloor(); + + // For a pattern of 4, we want our indices to go 0, 1, 2, 3, 0, 1, 2, 3, etc. However, we want it continuous across + // negative and positive positions so we can't just use mod with abs(). Instead, we use a double-mod which gives us + // a result that's continuous across all coordinate space. + const int x = ((static_cast(flooredScaledPosition.GetX()) % patternSize) + patternSize) % patternSize; + const int y = ((static_cast(flooredScaledPosition.GetY()) % patternSize) + patternSize) % patternSize; - return result; + return (patternSize * y + x); } - float GetDitherValue4x4(const AZ::Vector3& position) + float DitherGradientComponent::GetDitherValue4x4(const AZ::Vector3& scaledPosition) { - const int patternSize = 4; - const int patternSizeSq = patternSize * patternSize; - const int indexMatrix[patternSizeSq] = { - 0, 8, 2, 10, - 12, 4, 14, 6, - 3, 11, 1, 9, - 15, 7, 13, 5 }; - - const int x = PositionToMatrixIndex(position.GetX(), patternSize); - const int y = PositionToMatrixIndex(position.GetY(), patternSize); - - return indexMatrix[patternSize * y + x] / static_cast(patternSizeSq); + constexpr int patternSize = 4; + constexpr float indexMatrix[] = { + 0.0f / 16.0f, 8.0f / 16.0f, 2.0f / 16.0f, 10.0f / 16.0f, + 12.0f / 16.0f, 4.0f / 16.0f, 14.0f / 16.0f, 6.0f / 16.0f, + 3.0f / 16.0f, 11.0f / 16.0f, 1.0f / 16.0f, 9.0f / 16.0f, + 15.0f / 16.0f, 7.0f / 16.0f, 13.0f / 16.0f, 5.0f / 16.0f }; + + return indexMatrix[ScaledPositionToPatternIndex(scaledPosition, patternSize)]; } - float GetDitherValue8x8(const AZ::Vector3& position) + float DitherGradientComponent::GetDitherValue8x8(const AZ::Vector3& scaledPosition) { - const int patternSize = 8; - const int patternSizeSq = patternSize * patternSize; - const int indexMatrix[patternSizeSq] = { - 0, 32, 8, 40, 2, 34, 10, 42, - 48, 16, 56, 24, 50, 18, 58, 26, - 12, 44, 4, 36, 14, 46, 6, 38, - 60, 28, 52, 20, 62, 30, 54, 22, - 3, 35, 11, 43, 1, 33, 9, 41, - 51, 19, 59, 27, 49, 17, 57, 25, - 15, 47, 7, 39, 13, 45, 5, 37, - 63, 31, 55, 23, 61, 29, 53, 21 }; - - const int x = PositionToMatrixIndex(position.GetX(), patternSize); - const int y = PositionToMatrixIndex(position.GetY(), patternSize); - - return indexMatrix[patternSize * y + x] / static_cast(patternSizeSq); + constexpr int patternSize = 8; + constexpr float indexMatrix[] = { + 0.0f / 64.0f, 32.0f / 64.0f, 8.0f / 64.0f, 40.0f / 64.0f, 2.0f / 64.0f, 34.0f / 64.0f, 10.0f / 64.0f, 42.0f / 64.0f, + 48.0f / 64.0f, 16.0f / 64.0f, 56.0f / 64.0f, 24.0f / 64.0f, 50.0f / 64.0f, 18.0f / 64.0f, 58.0f / 64.0f, 26.0f / 64.0f, + 12.0f / 64.0f, 44.0f / 64.0f, 4.0f / 64.0f, 36.0f / 64.0f, 14.0f / 64.0f, 46.0f / 64.0f, 6.0f / 64.0f, 38.0f / 64.0f, + 60.0f / 64.0f, 28.0f / 64.0f, 52.0f / 64.0f, 20.0f / 64.0f, 62.0f / 64.0f, 30.0f / 64.0f, 54.0f / 64.0f, 22.0f / 64.0f, + 3.0f / 64.0f, 35.0f / 64.0f, 11.0f / 64.0f, 43.0f / 64.0f, 1.0f / 64.0f, 33.0f / 64.0f, 9.0f / 64.0f, 41.0f / 64.0f, + 51.0f / 64.0f, 19.0f / 64.0f, 59.0f / 64.0f, 27.0f / 64.0f, 49.0f / 64.0f, 17.0f / 64.0f, 57.0f / 64.0f, 25.0f / 64.0f, + 15.0f / 64.0f, 47.0f / 64.0f, 7.0f / 64.0f, 39.0f / 64.0f, 13.0f / 64.0f, 45.0f / 64.0f, 5.0f / 64.0f, 37.0f / 64.0f, + 63.0f / 64.0f, 31.0f / 64.0f, 55.0f / 64.0f, 23.0f / 64.0f, 61.0f / 64.0f, 29.0f / 64.0f, 53.0f / 64.0f, 21.0f / 64.0f + }; + + return indexMatrix[ScaledPositionToPatternIndex(scaledPosition, patternSize)]; } - float DitherGradientComponent::GetValue(const GradientSampleParams& sampleParams) const + float DitherGradientComponent::GetCalculatedPointsPerUnit() const { - AZ_PROFILE_FUNCTION(Entity); - - const AZ::Vector3& coordinate = sampleParams.m_position; - float pointsPerUnit = m_configuration.m_pointsPerUnit; if (m_configuration.m_useSystemPointsPerUnit) { SectorDataRequestBus::Broadcast(&SectorDataRequestBus::Events::GetPointsPerMeter, pointsPerUnit); } - pointsPerUnit = AZ::GetMax(pointsPerUnit, 0.0001f); - - auto scaledCoordinate = coordinate * pointsPerUnit; - auto x = std::floor(scaledCoordinate.GetX()) / pointsPerUnit; - auto y = std::floor(scaledCoordinate.GetY()) / pointsPerUnit; - auto z = std::floor(scaledCoordinate.GetZ()) / pointsPerUnit; - AZ::Vector3 flooredCoordinate(x, y, z); - - GradientSampleParams adjustedSampleParams = sampleParams; - adjustedSampleParams.m_position = flooredCoordinate; - float value = m_configuration.m_gradientSampler.GetValue(adjustedSampleParams); + return AZ::GetMax(pointsPerUnit, 0.0001f); + } + float DitherGradientComponent::GetDitherValue(const AZ::Vector3& scaledPosition, float value) const + { float d = 0.0f; switch (m_configuration.m_patternType) { default: case DitherGradientConfig::BayerPatternType::PATTERN_SIZE_4x4: - d = GetDitherValue4x4((scaledCoordinate) + m_configuration.m_patternOffset); + d = GetDitherValue4x4(scaledPosition + m_configuration.m_patternOffset); break; case DitherGradientConfig::BayerPatternType::PATTERN_SIZE_8x8: - d = GetDitherValue8x8((scaledCoordinate) + m_configuration.m_patternOffset); + d = GetDitherValue8x8(scaledPosition + m_configuration.m_patternOffset); break; } - return value > d ? 1.0f : 0.0f; + return (value > d) ? 1.0f : 0.0f; + } + + float DitherGradientComponent::GetValue(const GradientSampleParams& sampleParams) const + { + const AZ::Vector3& coordinate = sampleParams.m_position; + + const float pointsPerUnit = GetCalculatedPointsPerUnit(); + + AZ::Vector3 scaledCoordinate = coordinate * pointsPerUnit; + AZ::Vector3 flooredCoordinate = scaledCoordinate.GetFloor() / pointsPerUnit; + + GradientSampleParams adjustedSampleParams = sampleParams; + adjustedSampleParams.m_position = flooredCoordinate; + float value = m_configuration.m_gradientSampler.GetValue(adjustedSampleParams); + + return GetDitherValue(scaledCoordinate, value); + } + + void DitherGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + const float pointsPerUnit = GetCalculatedPointsPerUnit(); + + // Create the entire set of floored coordinates to use in the gradient value lookups. + AZStd::vector flooredCoordinates(positions.size()); + for (size_t index = 0; index < positions.size(); index++) + { + AZ::Vector3 scaledCoordinate = positions[index] * pointsPerUnit; + flooredCoordinates[index] = scaledCoordinate.GetFloor() / pointsPerUnit; + } + + m_configuration.m_gradientSampler.GetValues(flooredCoordinates, outValues); + + // For each gradient value, turn it into a 0 or 1 based on the location and the dither pattern. + for (size_t index = 0; index < positions.size(); index++) + { + AZ::Vector3 scaledCoordinate = positions[index] * pointsPerUnit; + outValues[index] = GetDitherValue(scaledCoordinate, outValues[index]); + } } bool DitherGradientComponent::IsEntityInHierarchy(const AZ::EntityId& entityId) const diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp index 06a3674188..d948f6269e 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp @@ -219,7 +219,7 @@ namespace GradientSignal return 0.0f; } - void ImageGradientComponent::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + void ImageGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { @@ -234,20 +234,16 @@ namespace GradientSignal for (size_t index = 0; index < positions.size(); index++) { - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); - m_gradientTransform.TransformPositionToUVWNormalized(positions[index], uvw, wasPointRejected); if (!wasPointRejected) { - outValue = GetValueFromImageAsset( + outValues[index] = GetValueFromImageAsset( m_configuration.m_imageAsset, uvw, m_configuration.m_tilingX, m_configuration.m_tilingY, 0.0f); } else { - outValue = 0.0f; + outValues[index] = 0.0f; } } } diff --git a/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp index 678f3b363c..aef5cc7a52 100644 --- a/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp @@ -137,6 +137,21 @@ namespace GradientSignal return output; } + void InvertGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + m_configuration.m_gradientSampler.GetValues(positions, outValues); + for (auto& outValue : outValues) + { + outValue = 1.0f - AZ::GetClamp(outValue, 0.0f, 1.0f); + } + } + bool InvertGradientComponent::IsEntityInHierarchy(const AZ::EntityId& entityId) const { return m_configuration.m_gradientSampler.IsEntityInHierarchy(entityId); diff --git a/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp index b2958c590c..25f6a34614 100644 --- a/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp @@ -172,8 +172,6 @@ namespace GradientSignal float LevelsGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(Entity); - float output = 0.0f; output = GetLevels( @@ -187,6 +185,21 @@ namespace GradientSignal return output; } + void LevelsGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + m_configuration.m_gradientSampler.GetValues(positions, outValues); + + GetLevels(outValues, + m_configuration.m_inputMid, m_configuration.m_inputMin, m_configuration.m_inputMax, + m_configuration.m_outputMin, m_configuration.m_outputMax); + } + bool LevelsGradientComponent::IsEntityInHierarchy(const AZ::EntityId& entityId) const { return m_configuration.m_gradientSampler.IsEntityInHierarchy(entityId); diff --git a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp index 667d8c30a7..e3dfaf2161 100644 --- a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp @@ -203,7 +203,7 @@ namespace GradientSignal return 0.0f; } - void PerlinGradientComponent::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + void PerlinGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { @@ -218,21 +218,17 @@ namespace GradientSignal for (size_t index = 0; index < positions.size(); index++) { - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); - m_gradientTransform.TransformPositionToUVW(positions[index], uvw, wasPointRejected); if (!wasPointRejected) { - outValue = m_perlinImprovedNoise->GenerateOctaveNoise( + outValues[index] = m_perlinImprovedNoise->GenerateOctaveNoise( uvw.GetX(), uvw.GetY(), uvw.GetZ(), m_configuration.m_octave, m_configuration.m_amplitude, m_configuration.m_frequency); } else { - outValue = 0.0f; + outValues[index] = 0.0f; } } } diff --git a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp index ae51bdd4ac..0f4ece38a1 100644 --- a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp @@ -183,7 +183,7 @@ namespace GradientSignal return 0.0f; } - void RandomGradientComponent::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + void RandomGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { @@ -200,19 +200,15 @@ namespace GradientSignal for (size_t index = 0; index < positions.size(); index++) { - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); - m_gradientTransform.TransformPositionToUVW(positions[index], uvw, wasPointRejected); if (!wasPointRejected) { - outValue = GetRandomValue(uvw, seed); + outValues[index] = GetRandomValue(uvw, seed); } else { - outValue = 0.0f; + outValues[index] = 0.0f; } } } diff --git a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp index f2416f4fb6..77b7f1a428 100644 --- a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp @@ -168,7 +168,7 @@ namespace GradientSignal return (distance <= 0.0f) ? 1.0f : AZ::GetMax(1.0f - (distance / m_configuration.m_falloffWidth), 0.0f); } - void ShapeAreaFalloffGradientComponent::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + void ShapeAreaFalloffGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { @@ -187,10 +187,6 @@ namespace GradientSignal for (size_t index = 0; index < positions.size(); index++) { - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); - float distance = shapeRequests->DistanceFromPoint(positions[index]); // Since this is outer falloff, distance should give us values from 1.0 at the minimum distance to 0.0 at the maximum @@ -198,18 +194,15 @@ namespace GradientSignal // inside the shape (0 distance) return 1.0, and all points outside the shape return 0. This works because division by 0 // gives infinity, which gets clamped by the GetMax() to 0. However, if distance == 0, it would give us NaN, so we have // the separate conditional check to handle that case and clamp to 1.0. - outValue = (distance <= 0.0f) ? 1.0f : AZ::GetMax(1.0f - (distance / falloffWidth), 0.0f); + outValues[index] = (distance <= 0.0f) ? 1.0f : AZ::GetMax(1.0f - (distance / falloffWidth), 0.0f); } }); // If there's no shape, there's no falloff. if (!shapeConnected) { - for (size_t index = 0; index < positions.size(); index++) + for (auto& outValue : outValues) { - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); outValue = 1.0f; } } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp index 5504fa5b45..6c4ebcc4c0 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp @@ -56,9 +56,9 @@ namespace UnitTest params.m_position = positions[positionIndex]; float value = gradientSampler.GetValue(params); - // We use ASSERT_EQ instead of EXPECT_EQ because if one value doesn't match, they probably all won't, so there's no reason - // to keep running and printing failures for every value. - ASSERT_EQ(value, results[positionIndex]); + // We use ASSERT_NEAR instead of EXPECT_NEAR because if one value doesn't match, they probably all won't, so there's no + // reason to keep running and printing failures for every value. + ASSERT_NEAR(value, results[positionIndex], 0.000001f); } } }; diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp index 449719af67..830c578b9b 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp @@ -10,6 +10,8 @@ #include +#include + #include #include #include @@ -81,6 +83,130 @@ namespace UnitTest TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); } + TEST_F(GradientSignalServicesTestsFixture, DitherGradientComponent_4x4At50Pct_CrossingZero) + { + // With a 4x4 gradient filled with 8/16 (0.5), verify that the resulting dithered output + // is an expected checkerboard pattern with 8 of 16 pixels filled. The pattern offset is + // shifted -2 in the X direction so that the lookups go from [-2, 2) to verify that the + // pattern remains consistent across negative and positive coordinates. + + constexpr int dataSize = 4; + + AZStd::vector inputData(dataSize * dataSize, 8.0f / 16.0f); + AZStd::vector expectedOutput = { + 1.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 1.0f, + 1.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 1.0f, + }; + + auto entityMock = CreateEntity(); + const AZ::EntityId id = entityMock->GetId(); + UnitTest::MockGradientArrayRequestsBus mockGradientRequestsBus(id, inputData, dataSize); + + GradientSignal::DitherGradientConfig config; + config.m_useSystemPointsPerUnit = false; + config.m_pointsPerUnit = 1.0f; + config.m_patternOffset = AZ::Vector3(-2.0f, 0.0f, 0.0f); + config.m_patternType = GradientSignal::DitherGradientConfig::BayerPatternType::PATTERN_SIZE_4x4; + config.m_gradientSampler.m_gradientId = entityMock->GetId(); + + auto entity = CreateEntity(); + entity->CreateComponent(config); + ActivateEntity(entity.get()); + + TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); + } + + TEST_F(GradientSignalServicesTestsFixture, DitherGradientComponent_4x4At50Pct_MorePointsPerUnit) + { + // With a 4x4 gradient filled with 8/16 (0.5), and 1/2 point per unit, if we query a 4x4 region, + // we should get a checkerboard in 2x2 blocks of the same value because it takes 2 units before the value changes. + + constexpr int dataSize = 4; + + AZStd::vector inputData(dataSize * dataSize, 8.0f / 16.0f); + AZStd::vector expectedOutput = { + 1.0f, 1.0f, 0.0f, 0.0f, + 1.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 1.0f, + 0.0f, 0.0f, 1.0f, 1.0f, + }; + + auto entityMock = CreateEntity(); + const AZ::EntityId id = entityMock->GetId(); + UnitTest::MockGradientArrayRequestsBus mockGradientRequestsBus(id, inputData, dataSize); + + GradientSignal::DitherGradientConfig config; + config.m_useSystemPointsPerUnit = false; + config.m_pointsPerUnit = 0.5f; + config.m_patternOffset = AZ::Vector3::CreateZero(); + config.m_patternType = GradientSignal::DitherGradientConfig::BayerPatternType::PATTERN_SIZE_4x4; + config.m_gradientSampler.m_gradientId = entityMock->GetId(); + + auto entity = CreateEntity(); + entity->CreateComponent(config); + ActivateEntity(entity.get()); + + TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); + } + + TEST_F(GradientSignalServicesTestsFixture, DitherGradientComponent_4x4At50Pct_MorePointsAndCrossingZero) + { + // With a 4x4 gradient filled with 8/16 (0.5), and 2 points per unit, verify that querying + // from -1 to 1 produces a constant checkerboard pattern of results as it crosses the 0 boundary. + // Our expected results are a consistent checkerboard pattern, but with 2x2 blocks of the same value because we're + // querying at 2x the point density (i.e. querying 4 points per unit) to ensure that fractional position lookups work too. + + float expectedValues[] = { + 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, + 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, + 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, + 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, + 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, + }; + + // Create a 50% constant gradient. + GradientSignal::ConstantGradientConfig constantConfig; + constantConfig.m_value = 8.0f / 16.0f; + auto constantGradientEntity = CreateEntity(); + constantGradientEntity->CreateComponent(constantConfig); + ActivateEntity(constantGradientEntity.get()); + + GradientSignal::DitherGradientConfig config; + config.m_useSystemPointsPerUnit = false; + config.m_pointsPerUnit = 2.0f; + config.m_patternOffset = AZ::Vector3::CreateZero(); + config.m_patternType = GradientSignal::DitherGradientConfig::BayerPatternType::PATTERN_SIZE_4x4; + config.m_gradientSampler.m_gradientId = constantGradientEntity->GetId(); + + auto entity = CreateEntity(); + entity->CreateComponent(config); + ActivateEntity(entity.get()); + + // Run through [-1, 1) at 1/4 intervals and make sure we get our expected checkerboard. This is testing both that + // we have a consistent pattern across the 0 boundary and that fractional position lookups work correctly + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = entity->GetId(); + int expectedValueIndex = 0; + for (float y = -1.0f; y < 1.0f; y += 0.25f) + { + for (float x = -1.0f; x < 1.0f; x += 0.25f) + { + GradientSignal::GradientSampleParams params; + params.m_position = AZ::Vector3(x, y, 0.0f); + + float actualValue = gradientSampler.GetValue(params); + float expectedValue = expectedValues[expectedValueIndex++]; + + EXPECT_NEAR(actualValue, expectedValue, 0.01f); + } + } + } + TEST_F(GradientSignalServicesTestsFixture, DitherGradientComponent_4x4At31Pct) { // With a 4x4 gradient filled with 5/16 (0.3125), verify that the resulting dithered output From d95e157f480c92086ac38a79f6ae764ae0f1f3d8 Mon Sep 17 00:00:00 2001 From: moudgils <47460854+moudgils@users.noreply.github.com> Date: Fri, 14 Jan 2022 12:24:58 -0800 Subject: [PATCH 390/399] Different Pso cache per vendor/driver (#6893) * Support to add a different PSO cache per vendor/driver version. Also added support to have a differnt cache for Warp Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com> * Added a way to reset PSO cache for everyone Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com> * Fix tabbing for one line which is failing validation Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com> --- .../Atom/RHI.Reflect/PhysicalDeviceDescriptor.h | 3 ++- Gems/Atom/RHI/Code/Include/Atom/RHI/FrameScheduler.h | 12 ++++++++---- Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h | 3 +++ .../RHI/Code/Include/Atom/RHI/RHISystemInterface.h | 3 +++ Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp | 6 ++++++ .../Source/Platform/Windows/RHI/Device_Windows.cpp | 5 ++++- .../RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp | 10 ++++------ .../RPI/Code/Source/RPI.Public/Shader/Shader.cpp | 12 ++++++++++-- 8 files changed, 40 insertions(+), 14 deletions(-) diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PhysicalDeviceDescriptor.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PhysicalDeviceDescriptor.h index ac79ff0521..4d78d24ca8 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PhysicalDeviceDescriptor.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PhysicalDeviceDescriptor.h @@ -28,7 +28,8 @@ namespace AZ (AMD, 0x1002), (Qualcomm, 0x5143), (Samsung, 0x1099), - (ARM, 0x13B5) + (ARM, 0x13B5), + (Warp, 0x1414) ); void ReflectVendorIdEnums(ReflectContext* context); diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameScheduler.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameScheduler.h index eb2b0b5b0c..47cf7709db 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameScheduler.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameScheduler.h @@ -164,23 +164,27 @@ namespace AZ //! it will defer to the platform for parallel dispatch support. void Execute(JobPolicy jobPolicy); - /// Returns the timing statistics for the previous frame. + //! Returns the timing statistics for the previous frame. const TransientAttachmentStatistics* GetTransientAttachmentStatistics() const; - /// Returns current CPU frame to frame time in milliseconds. + //! Returns current CPU frame to frame time in milliseconds. double GetCpuFrameTime() const; - /// Returns memory statistics for the previous frame. + //! Returns memory statistics for the previous frame. const MemoryStatistics* GetMemoryStatistics() const; - /// Returns the implicit root scope id. + //! Returns the implicit root scope id. ScopeId GetRootScopeId() const; + //! Returns the descriptor which has information on the properties of a TransientAttachmentPool. const TransientAttachmentPoolDescriptor* GetTransientAttachmentPoolDescriptor() const; //! Adds a RayTracingShaderTable to be built this frame void QueueRayTracingShaderTableForBuild(RayTracingShaderTable* rayTracingShaderTable); + //! Returns PhysicalDeviceDescriptor which can be used to extract vendor/driver information + const PhysicalDeviceDescriptor& GetPhysicalDeviceDescriptor(); + private: const ScopeId m_rootScopeId{"Root"}; diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h index 6d416b77fc..c2a3162025 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h @@ -53,6 +53,7 @@ namespace AZ const RHI::TransientAttachmentPoolDescriptor* GetTransientAttachmentPoolDescriptor() const override; ConstPtr GetPlatformLimitsDescriptor() const override; void QueueRayTracingShaderTableForBuild(RayTracingShaderTable* rayTracingShaderTable) override; + const PhysicalDeviceDescriptor& GetPhysicalDeviceDescriptor() override; ////////////////////////////////////////////////////////////////////////// private: @@ -65,6 +66,8 @@ namespace AZ RHI::Ptr m_pipelineStateCache; RHI::FrameScheduler m_frameScheduler; RHI::FrameSchedulerCompileRequest m_compileRequest; + PhysicalDeviceDescriptor m_physicalDeviceDescriptor; + }; } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystemInterface.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystemInterface.h index 19ba1cb762..66f6b2bcde 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystemInterface.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystemInterface.h @@ -26,6 +26,7 @@ namespace AZ class PipelineState; class PipelineStateCache; class PlatformLimitsDescriptor; + class PhysicalDeviceDescriptor; class RayTracingShaderTable; struct FrameSchedulerCompileRequest; struct TransientAttachmentStatistics; @@ -65,6 +66,8 @@ namespace AZ virtual ConstPtr GetPlatformLimitsDescriptor() const = 0; virtual void QueueRayTracingShaderTableForBuild(RayTracingShaderTable* rayTracingShaderTable) = 0; + + virtual const PhysicalDeviceDescriptor& GetPhysicalDeviceDescriptor() = 0; }; //! This bus exists to give RHI samples the ability to slot in scopes manually diff --git a/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp b/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp index e7515bbf6e..3ec0cfeb93 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp @@ -165,6 +165,7 @@ namespace AZ RHI::Ptr device = RHI::Factory::Get().CreateDevice(); if (device->Init(*physicalDeviceFound) == RHI::ResultCode::Success) { + m_physicalDeviceDescriptor = physicalDeviceFound->GetDescriptor(); PlatformLimitsDescriptor::Create(); return device; } @@ -279,5 +280,10 @@ namespace AZ { m_frameScheduler.QueueRayTracingShaderTableForBuild(rayTracingShaderTable); } + + const PhysicalDeviceDescriptor& RHISystem::GetPhysicalDeviceDescriptor() + { + return m_physicalDeviceDescriptor; + } } //namespace RPI } //namespace AZ diff --git a/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/RHI/Device_Windows.cpp b/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/RHI/Device_Windows.cpp index f6ed3be692..a2ed31ff84 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/RHI/Device_Windows.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/RHI/Device_Windows.cpp @@ -157,7 +157,10 @@ namespace AZ disabledMessages.push_back(D3D12_MESSAGE_ID_COPY_DESCRIPTORS_INVALID_RANGES); } - // [GFX TODO][ATOM-4712] - Fix PipelineLibrary Loading. These warnings were silenced for a release and need to be fixed properly. + // We disable these warnings as the our current implementation of Pipeline Library will trigger these warnings unknowingly. For example + // it will always first try to load a pso from pipelinelibrary triggering D3D12_MESSAGE_ID_LOADPIPELINE_NAMENOTFOUND (for the first time) before storing the PSO in a library. + // Similarly when we merge multiple pipeline libraries (in multiple threads) we may trigger D3D12_MESSAGE_ID_STOREPIPELINE_DUPLICATENAME as it is possible to save + // a PSO already saved in the main library. #if defined (AZ_DX12_USE_PIPELINE_LIBRARY) disabledMessages.push_back(D3D12_MESSAGE_ID_LOADPIPELINE_NAMENOTFOUND); disabledMessages.push_back(D3D12_MESSAGE_ID_STOREPIPELINE_DUPLICATENAME); diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp index 63625fde72..ae3053f446 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp @@ -50,10 +50,9 @@ namespace AZ bool shouldCreateLibFromSerializedData = true; if (RHI::Factory::Get().IsRenderDocModuleLoaded() || - RHI::Factory::Get().IsPixModuleLoaded() || - RHI::Factory::Get().UsingWarpDevice()) + RHI::Factory::Get().IsPixModuleLoaded()) { - // CreatePipelineLibrary api does not function properly if Renderdoc, Pix or Warp is enabled + // CreatePipelineLibrary api does not function properly if Renderdoc or Pix is enabled shouldCreateLibFromSerializedData = false; } @@ -218,10 +217,9 @@ namespace AZ RHI::ResultCode PipelineLibrary::MergeIntoInternal([[maybe_unused]] AZStd::array_view pipelineLibraries) { if (RHI::Factory::Get().IsRenderDocModuleLoaded() || - RHI::Factory::Get().IsPixModuleLoaded() || - RHI::Factory::Get().UsingWarpDevice()) + RHI::Factory::Get().IsPixModuleLoaded()) { - // StorePipeline api does not function properly if RenderDoc, Pix or Warp is enabled + // StorePipeline api does not function properly if RenderDoc or Pix is enabled return RHI::ResultCode::Fail; } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp index b1ae460af6..92c2e30594 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp @@ -17,6 +17,7 @@ #include +#define PSOCacheVersion 0 // Bump this if you want to reset PSO cache for everyone namespace AZ { @@ -85,10 +86,17 @@ namespace AZ AZStd::string uuidString; assetId.m_guid.ToString(uuidString, false, false); + RHI::RHISystemInterface* rhiSystem = RHI::RHISystemInterface::Get(); + RHI::PhysicalDeviceDescriptor physicalDeviceDesc = rhiSystem->GetPhysicalDeviceDescriptor(); + char pipelineLibraryPathTemp[AZ_MAX_PATH_LEN]; azsnprintf( - pipelineLibraryPathTemp, AZ_MAX_PATH_LEN, "@user@/Atom/PipelineStateCache/%s/%s_%s_%d.bin", platformName.GetCStr(), - shaderName.GetCStr(), uuidString.data(), assetId.m_subId); + pipelineLibraryPathTemp, AZ_MAX_PATH_LEN, "@user@/Atom/PipelineStateCache_%s_%i_%i _Ver_%i/%s/%s_%s_%d.bin", + ToString(physicalDeviceDesc.m_vendorId).data(), physicalDeviceDesc.m_deviceId, physicalDeviceDesc.m_driverVersion, PSOCacheVersion, + platformName.GetCStr(), + shaderName.GetCStr(), + uuidString.data(), + assetId.m_subId); fileIOBase->ResolvePath(pipelineLibraryPathTemp, pipelineLibraryPath, pipelineLibraryPathLength); return true; From aa18deef5d70f2468a67df535de4e64fcd799ff3 Mon Sep 17 00:00:00 2001 From: Adi Bar-Lev <82479970+Adi-Amazon@users.noreply.github.com> Date: Fri, 14 Jan 2022 15:26:41 -0500 Subject: [PATCH 391/399] AtomTressFX - fixing crash bug for prefab (#6892) - The crash happens due to attempt to get an instance of the hair dynamic data before it was initialized. Signed-off-by: Adi Bar-Lev <82479970+Adi-Amazon@users.noreply.github.com> --- .../Code/Rendering/HairRenderObject.cpp | 16 +++++++++++++--- .../Code/Rendering/HairRenderObject.h | 10 ++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Gems/AtomTressFX/Code/Rendering/HairRenderObject.cpp b/Gems/AtomTressFX/Code/Rendering/HairRenderObject.cpp index fe167cae8b..472a610016 100644 --- a/Gems/AtomTressFX/Code/Rendering/HairRenderObject.cpp +++ b/Gems/AtomTressFX/Code/Rendering/HairRenderObject.cpp @@ -213,6 +213,8 @@ namespace AZ Data::Instance rasterShader, uint32_t vertexCount, uint32_t strandsCount ) { + m_initialized = false; + AZ_Assert(vertexCount <= std::numeric_limits().max(), "Hair vertex count exceeds uint32_t size."); // Create the dynamic shared buffers Srg. @@ -608,8 +610,16 @@ namespace AZ // First, Directly loading from the asset stored in the render settings. if (pRenderSettings) { - m_baseAlbedo = RPI::StreamingImage::FindOrCreate(pRenderSettings->m_baseAlbedoAsset); - m_strandAlbedo = RPI::StreamingImage::FindOrCreate(pRenderSettings->m_strandAlbedoAsset); + if (pRenderSettings->m_baseAlbedoAsset) + { + pRenderSettings->m_baseAlbedoAsset.BlockUntilLoadComplete(); + m_baseAlbedo = RPI::StreamingImage::FindOrCreate(pRenderSettings->m_baseAlbedoAsset); + } + if (pRenderSettings->m_strandAlbedoAsset) + { + pRenderSettings->m_strandAlbedoAsset.BlockUntilLoadComplete(); + m_strandAlbedo = RPI::StreamingImage::FindOrCreate(pRenderSettings->m_strandAlbedoAsset); + } } // Fallback using the texture name stored in the render settings. @@ -1142,7 +1152,7 @@ namespace AZ if (!renderMaterialSrg || !simSrg) { - AZ_Error("Hair Gem", false, "Failed to get thre hair material Srg for the raster pass."); + AZ_Error("Hair Gem", false, "Failed to get the hair material Srg for the raster pass."); return false; } // No need to compile the simSrg since it was compiled already by the Compute pass this frame diff --git a/Gems/AtomTressFX/Code/Rendering/HairRenderObject.h b/Gems/AtomTressFX/Code/Rendering/HairRenderObject.h index 817ebd89fa..564272e6f0 100644 --- a/Gems/AtomTressFX/Code/Rendering/HairRenderObject.h +++ b/Gems/AtomTressFX/Code/Rendering/HairRenderObject.h @@ -110,8 +110,14 @@ namespace AZ PrepareSrgDescriptors(m_dynamicBuffersDescriptors, vertexCount, strandsCount); } - Data::Instance GetSimSrgForCompute() { return m_simSrgForCompute; } - Data::Instance GetSimSrgForRaster() { return m_simSrgForRaster; } + Data::Instance GetSimSrgForCompute() + { + return m_initialized ? m_simSrgForCompute : nullptr; + } + + Data::Instance GetSimSrgForRaster() + { + return m_initialized ? m_simSrgForRaster : nullptr; } bool IsInitialized() { return m_initialized; } From c9ee1f7871b5875de19b943df05d7a705f0ce7ef Mon Sep 17 00:00:00 2001 From: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> Date: Fri, 14 Jan 2022 13:31:13 -0800 Subject: [PATCH 392/399] ATOM-17132 Image builder failed to build some images after preset was fixed (#6900) The issue was because the preset reload was only happened in CreateJobs but not ProcessJobs. But these two functions might be called from different AssetBuilder. The fix is to add preset reload for Processjobs too. There was another change to add debug device name for streaming image. Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> --- .../BuilderSettings/TextureSettings.cpp | 8 +++++ .../Code/Source/ImageBuilderComponent.cpp | 34 +++++++++++++++++-- .../RPI.Public/Image/StreamingImage.cpp | 12 ++++--- 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/TextureSettings.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/TextureSettings.cpp index 29d9b21775..4772a94ffa 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/TextureSettings.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/TextureSettings.cpp @@ -226,6 +226,14 @@ namespace ImageProcessingAtom MultiplatformTextureSettings settings; PlatformNameList platformsList = BuilderSettingManager::Instance()->GetPlatformList(); PresetName suggestedPreset = BuilderSettingManager::Instance()->GetSuggestedPreset(imageFilepath); + + // If the suggested preset doesn't exist (or was failed to be loaded), return empty texture settings + if (BuilderSettingManager::Instance()->GetPreset(suggestedPreset) == nullptr) + { + AZ_Error("Image Processing", false, "Failed to find suggested preset [%s]", suggestedPreset.GetCStr()); + return settings; + } + for (PlatformName& platform : platformsList) { TextureSettings textureSettings; diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp index 5e021a3fdd..55a6c1ea8f 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp @@ -241,8 +241,7 @@ namespace ImageProcessingAtom // Reload preset if it was changed ImageProcessingAtom::BuilderSettingManager::Instance()->ReloadPreset(presetName); - AZStd::string_view filePath; - auto presetSettings = BuilderSettingManager::Instance()->GetPreset(presetName, /*default platform*/"", &filePath); + auto presetSettings = BuilderSettingManager::Instance()->GetPreset(presetName, /*default platform*/""); AssetBuilderSDK::SourceFileDependency sourceFileDependency; sourceFileDependency.m_sourceDependencyType = AssetBuilderSDK::SourceFileDependency::SourceFileDependencyType::Absolute; @@ -274,6 +273,32 @@ namespace ImageProcessingAtom } } + void ReloadPresetIfNeeded(PresetName presetName) + { + // Reload preset if it was changed + ImageProcessingAtom::BuilderSettingManager::Instance()->ReloadPreset(presetName); + + auto presetSettings = BuilderSettingManager::Instance()->GetPreset(presetName, /*default platform*/""); + + if (presetSettings) + { + // handle special case here + // Cubemap setting may reference some other presets + if (presetSettings->m_cubemapSetting) + { + if (presetSettings->m_cubemapSetting->m_generateIBLDiffuse && !presetSettings->m_cubemapSetting->m_iblDiffusePreset.IsEmpty()) + { + ImageProcessingAtom::BuilderSettingManager::Instance()->ReloadPreset(presetSettings->m_cubemapSetting->m_iblDiffusePreset); + } + + if (presetSettings->m_cubemapSetting->m_generateIBLSpecular && !presetSettings->m_cubemapSetting->m_iblSpecularPreset.IsEmpty()) + { + ImageProcessingAtom::BuilderSettingManager::Instance()->ReloadPreset(presetSettings->m_cubemapSetting->m_iblSpecularPreset); + } + } + } + } + // this happens early on in the file scanning pass // this function should consistently always create the same jobs, and should do no checking whether the job is up to date or not - just be consistent. void ImageBuilderWorker::CreateJobs(const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response) @@ -336,6 +361,11 @@ namespace ImageProcessingAtom // Do conversion and get exported file's path if (needConversion) { + + // Handles preset changes + auto presetName = GetImagePreset(request.m_fullPath); + ReloadPresetIfNeeded(presetName); + AZ_TracePrintf(AssetBuilderSDK::InfoWindow, "Performing image conversion: %s\n", request.m_fullPath.c_str()); ImageConvertProcess* process = CreateImageConvertProcess(request.m_fullPath, request.m_tempDirPath, request.m_jobDescription.GetPlatformIdentifier(), response.m_outputProducts); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Image/StreamingImage.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Image/StreamingImage.cpp index fb03d109a2..49cd52f212 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Image/StreamingImage.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Image/StreamingImage.cpp @@ -143,11 +143,6 @@ namespace AZ RHI::ResultCode resultCode = RHI::ResultCode::Success; const ImageMipChainAsset& mipChainTailAsset = imageAsset.GetTailMipChain(); - -#ifdef AZ_RPI_STREAMING_IMAGE_DEBUG_LOG - m_image->SetName(Name(imageAsset.GetHint().c_str())); - AZ_TracePrintf("StreamingImage", "Init image [%s]\n", m_image->GetName().data()); -#endif { RHI::StreamingImageInitRequest initRequest; @@ -193,6 +188,13 @@ namespace AZ m_rhiPool = rhiPool; m_pool = pool; m_pool->AttachImage(this); + + // Set rhi image name + m_image->SetName(Name(m_imageAsset.GetHint())); + +#ifdef AZ_RPI_STREAMING_IMAGE_DEBUG_LOG + AZ_TracePrintf("StreamingImage", "Init image [%s]\n", m_image->GetName().data()); +#endif #if defined (AZ_RPI_STREAMING_IMAGE_HOT_RELOADING) BusConnect(imageAsset.GetId()); From 588527064019a15f81c8626a80db7ada0b472e49 Mon Sep 17 00:00:00 2001 From: Vincent Liu <5900509+onecent1101@users.noreply.github.com> Date: Fri, 14 Jan 2022 14:36:15 -0800 Subject: [PATCH 393/399] [iOS] Update to use AWSNativeSDK 1.9.50 (#6890) Signed-off-by: onecent1101 --- Gems/AWSCore/Code/Platform/iOS/AWSCore_Traits_iOS.h | 2 +- cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/AWSCore/Code/Platform/iOS/AWSCore_Traits_iOS.h b/Gems/AWSCore/Code/Platform/iOS/AWSCore_Traits_iOS.h index d7b1f32461..2cacfb0d34 100644 --- a/Gems/AWSCore/Code/Platform/iOS/AWSCore_Traits_iOS.h +++ b/Gems/AWSCore/Code/Platform/iOS/AWSCore_Traits_iOS.h @@ -7,4 +7,4 @@ */ #pragma once -#define AWSCORE_BACKWARD_INCOMPATIBLE_CHANGE 0 +#define AWSCORE_BACKWARD_INCOMPATIBLE_CHANGE 1 diff --git a/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake b/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake index d8dd7e8134..4b99efc9d0 100644 --- a/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake +++ b/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake @@ -18,7 +18,7 @@ ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS gla # platform-specific: ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-rev3-ios TARGETS TIFF PACKAGE_HASH e9067e88649fb6e93a926d9ed38621a9fae360a2e6f6eb24ebca63c1bc7761ea) ly_associate_package(PACKAGE_NAME freetype-2.10.4.16-ios TARGETS freetype PACKAGE_HASH 3ac3c35e056ae4baec2e40caa023d76a7a3320895ef172b6655e9261b0dc2e29) -ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev4-ios TARGETS AWSNativeSDK PACKAGE_HASH d10e7496ca705577032821011beaf9f2507689f23817bfa0ed4d2a2758afcd02) +ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.9.50-rev1-ios TARGETS AWSNativeSDK PACKAGE_HASH c3c9478c259ecb569fb2ce6fcfa733647adc3b6bd2854e8eff9de64bcd18c745) ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev5-ios TARGETS Lua PACKAGE_HASH c2d3c4e67046c293049292317a7d60fdb8f23effeea7136aefaef667163e5ffe) ly_associate_package(PACKAGE_NAME PhysX-4.1.2.29882248-rev5-ios TARGETS PhysX PACKAGE_HASH 4a5e38b385837248590018eb133444b4e440190414e6756191200a10c8fa5615) ly_associate_package(PACKAGE_NAME mikkelsen-1.0.0.4-ios TARGETS mikkelsen PACKAGE_HASH 976aaa3ccd8582346132a10af253822ccc5d5bcc9ea5ba44d27848f65ee88a8a) From 1ef868437a67ec87057df8b87cedb16907df84ee Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Fri, 14 Jan 2022 17:28:14 -0700 Subject: [PATCH 394/399] Added supervariantIndex check in Shader::OnShaderVariantAssetReady Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- .../Include/Atom/RPI.Reflect/Shader/ShaderVariantAsset.h | 1 + Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp | 6 ++++++ .../Code/Source/RPI.Reflect/Shader/ShaderVariantAsset.cpp | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderVariantAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderVariantAsset.h index 5146ae370a..b65d9837f7 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderVariantAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderVariantAsset.h @@ -50,6 +50,7 @@ namespace AZ RPI::ShaderVariantStableId GetStableId() const { return m_stableId; } const ShaderVariantId& GetShaderVariantId() const { return m_shaderVariantId; } + uint32_t GetSupervariantIndex() const; //! Returns the shader stage function associated with the provided stage enum value. const RHI::ShaderStageFunction* GetShaderStageFunction(RHI::ShaderStage shaderStage) const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp index 3830d8ee42..ed9d3430d9 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp @@ -253,6 +253,12 @@ namespace AZ AZ_Assert(shaderVariantAsset, "Reloaded ShaderVariantAsset is null"); const ShaderVariantStableId stableId = shaderVariantAsset->GetStableId(); + // check the supervariantIndex of the ShaderVariantAsset to make sure it matches the supervariantIndex of this shader instance + if (shaderVariantAsset->GetSupervariantIndex() != m_supervariantIndex.GetIndex()) + { + return; + } + // We make a copy of the updated variant because OnShaderVariantReinitialized must not be called inside // m_variantCacheMutex or deadlocks may occur. // Or if there is an error, we leave this object in its default state to indicate there was an error. diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderVariantAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderVariantAsset.cpp index ec1a65a6d5..f9f046ac8a 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderVariantAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderVariantAsset.cpp @@ -65,6 +65,11 @@ namespace AZ return m_buildTimestamp; } + uint32_t ShaderVariantAsset::GetSupervariantIndex() const + { + return (m_assetId.m_subId >> SupervariantIndexBitPosition) & SupervariantIndexMaxValue; + } + const RHI::ShaderStageFunction* ShaderVariantAsset::GetShaderStageFunction(RHI::ShaderStage shaderStage) const { return m_functionsByStage[static_cast(shaderStage)].get(); From b87e6896e6784e35220365f9441313c3c4304a8b Mon Sep 17 00:00:00 2001 From: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> Date: Fri, 14 Jan 2022 16:43:01 -0800 Subject: [PATCH 395/399] ScreenToWorld and WorldToScreen Camera functionality (#6903) Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> --- .../AzFramework/Components/CameraBus.h | 26 ++++ .../Component/DebugCamera/CameraComponent.h | 4 + .../Code/Source/CameraComponent.cpp | 26 +++- Gems/Camera/Code/Source/CameraComponent.cpp | 4 + .../Code/Source/CameraComponentController.cpp | 63 ++++++++ .../Code/Source/CameraComponentController.h | 7 + .../EBus/Senders/CameraRequestBus.names | 134 +++++++++++++++++- ...hysXWorld_RayCastFromScreenWithGroup.names | 88 ++++++++++++ .../Code/Source/WorldNodes.h | 39 +++++ 9 files changed, 389 insertions(+), 2 deletions(-) create mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/Nodes/PhysXWorld_RayCastFromScreenWithGroup.names diff --git a/Code/Framework/AzFramework/AzFramework/Components/CameraBus.h b/Code/Framework/AzFramework/AzFramework/Components/CameraBus.h index e20578e939..964bf664a0 100644 --- a/Code/Framework/AzFramework/AzFramework/Components/CameraBus.h +++ b/Code/Framework/AzFramework/AzFramework/Components/CameraBus.h @@ -129,6 +129,32 @@ namespace Camera GetFrustumHeight() }; } + + //! Unprojects a position in screen space pixel coordinates to world space. + //! With a depth of zero, the position returned will be on the near clip plane of the camera + //! in world space. + //! @param screenPosition The absolute screen position + //! @param depth The depth offset into the world relative to the near clip plane of the camera + //! @return the position in world space + virtual AZ::Vector3 ScreenToWorld(const AZ::Vector2& screenPosition, float depth) = 0; + + //! Unprojects a position in screen space normalized device coordinates to world space. + //! With a depth of zero, the position returned will be on the near clip plane of the camera + //! in world space. + //! @param screenNdcPosition The normalized device coordinates in the range [0,1] + //! @param depth The depth offset into the world relative to the near clip plane of the camera + //! @return the position in world space + virtual AZ::Vector3 ScreenNdcToWorld(const AZ::Vector2& screenNdcPosition, float depth) = 0; + + //! Projects a position in world space to screen space for the given camera. + //! @param worldPosition The world position + //! @return The absolute screen position + virtual AZ::Vector2 WorldToScreen(const AZ::Vector3& worldPosition) = 0; + + //! Projects a position in world space to screen space normalized device coordinates. + //! @param worldPosition The world position + //! @return The normalized device coordinates in the range [0,1] + virtual AZ::Vector2 WorldToScreenNdc(const AZ::Vector3& worldPosition) = 0; }; using CameraRequestBus = AZ::EBus; diff --git a/Gems/Atom/Component/DebugCamera/Code/Include/Atom/Component/DebugCamera/CameraComponent.h b/Gems/Atom/Component/DebugCamera/Code/Include/Atom/Component/DebugCamera/CameraComponent.h index fb9c543bca..47254bcdc5 100644 --- a/Gems/Atom/Component/DebugCamera/Code/Include/Atom/Component/DebugCamera/CameraComponent.h +++ b/Gems/Atom/Component/DebugCamera/Code/Include/Atom/Component/DebugCamera/CameraComponent.h @@ -104,6 +104,10 @@ namespace AZ void SetOrthographicHalfWidth(float halfWidth) override; void MakeActiveView() override; bool IsActiveView() override; + AZ::Vector3 ScreenToWorld(const AZ::Vector2& screenPosition, float depth) override; + AZ::Vector3 ScreenNdcToWorld(const AZ::Vector2& screenPosition, float depth) override; + AZ::Vector2 WorldToScreen(const AZ::Vector3& worldPosition) override; + AZ::Vector2 WorldToScreenNdc(const AZ::Vector3& worldPosition) override; // RPI::WindowContextNotificationBus overrides... void OnViewportResized(uint32_t width, uint32_t height) override; diff --git a/Gems/Atom/Component/DebugCamera/Code/Source/CameraComponent.cpp b/Gems/Atom/Component/DebugCamera/Code/Source/CameraComponent.cpp index f3123e2b38..c4420dc417 100644 --- a/Gems/Atom/Component/DebugCamera/Code/Source/CameraComponent.cpp +++ b/Gems/Atom/Component/DebugCamera/Code/Source/CameraComponent.cpp @@ -245,7 +245,7 @@ namespace AZ AZ_Assert(false, "DebugCamera does not support orthographic projection"); } - void CameraComponent::MakeActiveView() + void CameraComponent::MakeActiveView() { // do nothing } @@ -255,6 +255,30 @@ namespace AZ return false; } + AZ::Vector3 CameraComponent::ScreenToWorld([[maybe_unused]] const AZ::Vector2& screenPosition, [[maybe_unused]] float depth) + { + // not implemented + return AZ::Vector3::CreateZero(); + } + + AZ::Vector3 CameraComponent::ScreenNdcToWorld([[maybe_unused]] const AZ::Vector2& screenPosition, [[maybe_unused]] float depth) + { + // not implemented + return AZ::Vector3::CreateZero(); + } + + AZ::Vector2 CameraComponent::WorldToScreen([[maybe_unused]] const AZ::Vector3& worldPosition) + { + // not implemented + return AZ::Vector2::CreateZero(); + } + + AZ::Vector2 CameraComponent::WorldToScreenNdc([[maybe_unused]] const AZ::Vector3& worldPosition) + { + // not implemented + return AZ::Vector2::CreateZero(); + } + void CameraComponent::OnViewportResized(uint32_t width, uint32_t height) { AZ_UNUSED(width); diff --git a/Gems/Camera/Code/Source/CameraComponent.cpp b/Gems/Camera/Code/Source/CameraComponent.cpp index 960f13a082..290691bbbe 100644 --- a/Gems/Camera/Code/Source/CameraComponent.cpp +++ b/Gems/Camera/Code/Source/CameraComponent.cpp @@ -106,6 +106,10 @@ namespace Camera ->Event("SetOrthographic", &CameraRequestBus::Events::SetOrthographic) ->Event("GetOrthographicHalfWidth", &CameraRequestBus::Events::GetOrthographicHalfWidth) ->Event("SetOrthographicHalfWidth", &CameraRequestBus::Events::SetOrthographicHalfWidth) + ->Event("ScreenToWorld", &CameraRequestBus::Events::ScreenToWorld) + ->Event("ScreenNdcToWorld", &CameraRequestBus::Events::ScreenNdcToWorld) + ->Event("WorldToScreen", &CameraRequestBus::Events::WorldToScreen) + ->Event("WorldToScreenNdc", &CameraRequestBus::Events::WorldToScreenNdc) ->VirtualProperty("FieldOfView","GetFovDegrees","SetFovDegrees") ->VirtualProperty("NearClipDistance", "GetNearClipDistance", "SetNearClipDistance") ->VirtualProperty("FarClipDistance", "GetFarClipDistance", "SetFarClipDistance") diff --git a/Gems/Camera/Code/Source/CameraComponentController.cpp b/Gems/Camera/Code/Source/CameraComponentController.cpp index 5b2e26b897..dfb2810fe2 100644 --- a/Gems/Camera/Code/Source/CameraComponentController.cpp +++ b/Gems/Camera/Code/Source/CameraComponentController.cpp @@ -10,12 +10,15 @@ #include "CameraViewRegistrationBus.h" #include +#include #include #include #include #include +#include + namespace Camera { void CameraComponentConfig::Reflect(AZ::ReflectContext* context) @@ -412,6 +415,66 @@ namespace Camera return m_isActiveView; } + namespace Util + { + AZ::Vector3 GetWorldPosition(const AZ::Vector3& origin, float depth, const AzFramework::CameraState& cameraState) + { + if (depth == 0.f) + { + return origin; + } + else + { + const AZ::Vector3 rayDirection = cameraState.m_orthographic ? cameraState.m_forward : (origin - cameraState.m_position); + return origin + (rayDirection.GetNormalized() * depth); + } + } + } + + AZ::Vector3 CameraComponentController::ScreenToWorld(const AZ::Vector2& screenPosition, float depth) + { + const AzFramework::ScreenPoint point{ static_cast(screenPosition.GetX()), static_cast(screenPosition.GetY()) }; + const AzFramework::CameraState& cameraState = GetCameraState(); + const AZ::Vector3 origin = AzFramework::ScreenToWorld(point, cameraState); + return Util::GetWorldPosition(origin, depth, cameraState); + } + + AZ::Vector3 CameraComponentController::ScreenNdcToWorld(const AZ::Vector2& screenNdcPosition, float depth) + { + const AzFramework::CameraState& cameraState = GetCameraState(); + const AZ::Vector3 origin = AzFramework::ScreenNdcToWorld(screenNdcPosition, AzFramework::InverseCameraView(cameraState), AzFramework::InverseCameraProjection(cameraState)); + return Util::GetWorldPosition(origin, depth, cameraState); + } + + AZ::Vector2 CameraComponentController::WorldToScreenNdc(const AZ::Vector3& worldPosition) + { + const AzFramework::CameraState& cameraState = GetCameraState(); + const AZ::Vector3 screenPosition = AzFramework::WorldToScreenNdc(worldPosition, AzFramework::CameraView(cameraState), AzFramework::CameraProjection(cameraState)); + return AZ::Vector3ToVector2(screenPosition); + } + + AZ::Vector2 CameraComponentController::WorldToScreen(const AZ::Vector3& worldPosition) + { + const AzFramework::ScreenPoint& point = AzFramework::WorldToScreen(worldPosition, GetCameraState()); + return AZ::Vector2(static_cast(point.m_x), static_cast(point.m_y)); + } + + AzFramework::CameraState CameraComponentController::GetCameraState() + { + auto viewportContext = GetViewportContext(); + if (!m_atomCamera || ! viewportContext) + { + return AzFramework::CameraState(); + } + + auto windowSize = viewportContext->GetViewportSize(); + auto viewportSize = AzFramework::Vector2FromScreenSize(AzFramework::ScreenSize(windowSize.m_width, windowSize.m_height)); + + AzFramework::CameraState cameraState = AzFramework::CreateDefaultCamera(m_atomCamera->GetCameraTransform(), viewportSize); + AzFramework::SetCameraClippingVolumeFromPerspectiveFovMatrixRH(cameraState, m_atomCamera->GetViewToClipMatrix()); + return cameraState; + } + void CameraComponentController::OnTransformChanged([[maybe_unused]] const AZ::Transform& local, const AZ::Transform& world) { if (m_updatingTransformFromEntity) diff --git a/Gems/Camera/Code/Source/CameraComponentController.h b/Gems/Camera/Code/Source/CameraComponentController.h index 09af7529dc..265ffaa0e9 100644 --- a/Gems/Camera/Code/Source/CameraComponentController.h +++ b/Gems/Camera/Code/Source/CameraComponentController.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -110,6 +111,11 @@ namespace Camera void MakeActiveView() override; bool IsActiveView() override; + AZ::Vector3 ScreenToWorld(const AZ::Vector2& screenPosition, float depth) override; + AZ::Vector3 ScreenNdcToWorld(const AZ::Vector2& screenNdcPosition, float depth) override; + AZ::Vector2 WorldToScreen(const AZ::Vector3& worldPosition) override; + AZ::Vector2 WorldToScreenNdc(const AZ::Vector3& worldPosition) override; + // AZ::TransformNotificationBus::Handler interface void OnTransformChanged(const AZ::Transform& local, const AZ::Transform& world) override; @@ -127,6 +133,7 @@ namespace Camera void DeactivateAtomView(); void UpdateCamera(); void SetupAtomAuxGeom(AZ::RPI::ViewportContextPtr viewportContext); + AzFramework::CameraState GetCameraState(); CameraComponentConfig m_config; AZ::EntityId m_entityId; diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/CameraRequestBus.names b/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/CameraRequestBus.names index 6c0112bfc2..ad2127c2a1 100644 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/CameraRequestBus.names +++ b/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/CameraRequestBus.names @@ -31,6 +31,66 @@ } ] }, + { + "base": "WorldToScreen", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke World To Screen" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after World To Screen is invoked" + }, + "details": { + "name": "World To Screen" + }, + "params": [ + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "World Position" + } + } + ], + "results": [ + { + "typeid": "{3D80F623-C85C-4741-90D0-E4E66164E6BF}", + "details": { + "name": "Screen Position" + } + } + ] + }, + { + "base": "WorldToScreenNdc", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke World To Screen Ndc" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after World To Screen Ndc is invoked" + }, + "details": { + "name": "World To Screen NDC" + }, + "params": [ + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "World Position" + } + } + ], + "results": [ + { + "typeid": "{3D80F623-C85C-4741-90D0-E4E66164E6BF}", + "details": { + "name": "Screen NDC Position" + } + } + ] + }, { "base": "GetFov", "entry": { @@ -53,6 +113,78 @@ } ] }, + { + "base": "ScreenToWorld", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke Screen To World" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after Screen To World is invoked" + }, + "details": { + "name": "Screen To World" + }, + "params": [ + { + "typeid": "{3D80F623-C85C-4741-90D0-E4E66164E6BF}", + "details": { + "name": "Screen Position" + } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "Depth" + } + } + ], + "results": [ + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "World Position" + } + } + ] + }, + { + "base": "ScreenNdcToWorld", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke Screen Ndc To World" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after Screen Ndc To World is invoked" + }, + "details": { + "name": "Screen NDC To World" + }, + "params": [ + { + "typeid": "{3D80F623-C85C-4741-90D0-E4E66164E6BF}", + "details": { + "name": "Screen NDC Position" + } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "Depth" + } + } + ], + "results": [ + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "World Position" + } + } + ] + }, { "base": "SetFovRadians", "entry": { @@ -356,4 +488,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/Nodes/PhysXWorld_RayCastFromScreenWithGroup.names b/Gems/ScriptCanvas/Assets/TranslationAssets/Nodes/PhysXWorld_RayCastFromScreenWithGroup.names new file mode 100644 index 0000000000..447866ae44 --- /dev/null +++ b/Gems/ScriptCanvas/Assets/TranslationAssets/Nodes/PhysXWorld_RayCastFromScreenWithGroup.names @@ -0,0 +1,88 @@ +{ + "entries": [ + { + "base": "{B164D87F-6620-5A1D-A2BC-CC09BA18C9B1}", + "context": "ScriptCanvas::Node", + "variant": "", + "details": { + "name": "Ray Cast From Screen With Group", + "category": "PhysX/World", + "tooltip": "Returns the first entity hit by a ray cast from the provided absolute 2D screen position." + }, + "slots": [ + { + "base": "Input_In_0", + "details": { + "name": "In" + } + }, + { + "base": "Output_Out_0", + "details": { + "name": "Out" + } + }, + { + "base": "DataInput_Screen Position_0", + "details": { + "name": "Screen Position" + } + }, + { + "base": "DataInput_Distance_1", + "details": { + "name": "Distance" + } + }, + { + "base": "DataInput_Collision group_2", + "details": { + "name": "Collision group" + } + }, + { + "base": "DataInput_Ignore_3", + "details": { + "name": "Ignore" + } + }, + { + "base": "DataOutput_Object hit_0", + "details": { + "name": "Object hit" + } + }, + { + "base": "DataOutput_Position_1", + "details": { + "name": "Position" + } + }, + { + "base": "DataOutput_Normal_2", + "details": { + "name": "Normal" + } + }, + { + "base": "DataOutput_Distance_3", + "details": { + "name": "Distance" + } + }, + { + "base": "DataOutput_EntityId_4", + "details": { + "name": "EntityId" + } + }, + { + "base": "DataOutput_Surface_5", + "details": { + "name": "Surface" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/Gems/ScriptCanvasPhysics/Code/Source/WorldNodes.h b/Gems/ScriptCanvasPhysics/Code/Source/WorldNodes.h index 96a15a9d29..1b03bd1851 100644 --- a/Gems/ScriptCanvasPhysics/Code/Source/WorldNodes.h +++ b/Gems/ScriptCanvasPhysics/Code/Source/WorldNodes.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -120,6 +121,43 @@ namespace ScriptCanvasPhysics "EntityId", "Surface"); + AZ_INLINE Result RayCastFromScreenWithGroup( + const AZ::Vector2& screenPosition, + float distance, + const AZStd::string& collisionGroup, + AZ::EntityId ignore) + { + AZ::EntityId camera; + Camera::CameraSystemRequestBus::BroadcastResult(camera, &Camera::CameraSystemRequestBus::Events::GetActiveCamera); + if (camera.IsValid()) + { + AZ::Vector3 origin = AZ::Vector3::CreateZero(); + Camera::CameraRequestBus::EventResult(origin, camera, &Camera::CameraRequestBus::Events::ScreenToWorld, screenPosition, 0.f); + AZ::Vector3 offset = AZ::Vector3::CreateZero(); + Camera::CameraRequestBus::EventResult(offset, camera, &Camera::CameraRequestBus::Events::ScreenToWorld, screenPosition, 1.f); + const AZ::Vector3 direction = (offset - origin).GetNormalized(); + return RayCastWorldSpaceWithGroup(origin, direction, distance, collisionGroup, ignore); + } + + // fallback in the rare case there is no active camera + return AZStd::make_tuple(false, AZ::Vector3::CreateZero(), AZ::Vector3::CreateZero(), 0.0f, AZ::EntityId(), AZ::Crc32()); + } + + SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(RayCastFromScreenWithGroup, + k_categoryName, + "{8F98A766-A93F-4DA7-B281-482C3DB20649}", + "Returns the first entity hit by a ray cast from the provided absolute 2D screen position.", + "Screen Position", + "Distance", + "Collision group", + "Ignore", + "Object hit", + "Position", + "Normal", + "Distance", + "EntityId", + "Surface"); + AZ_INLINE Result RayCastLocalSpaceWithGroup(const AZ::EntityId& fromEntityId, const AZ::Vector3& direction, float distance, @@ -389,6 +427,7 @@ namespace ScriptCanvasPhysics Date: Fri, 14 Jan 2022 17:41:18 -0800 Subject: [PATCH 396/399] Fix type (#6919) Signed-off-by: amzn-sj --- cmake/Platform/Mac/runtime_dependencies_mac.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in index c27bf1fde4..fff816cb3e 100644 --- a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in +++ b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in @@ -216,7 +216,7 @@ if(@target_file_dir@ MATCHES ".app/Contents/MacOS") # fixup bundle ends up removing the rpath of dxc (despite we exclude it) if(EXISTS "${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7") - execute_process(COMMAND $"{LY_INSTALL_NAME_TOOL}" -add_rpath @executable_path/../lib ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7) + execute_process(COMMAND "${LY_INSTALL_NAME_TOOL}" -add_rpath @executable_path/../lib ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7) endif() # misplaced .DS_Store files can cause signing to fail From 0b9dc78d67d1ddea29b4fae29bd75c0335dee9ae Mon Sep 17 00:00:00 2001 From: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> Date: Mon, 17 Jan 2022 17:58:19 +0000 Subject: [PATCH 397/399] Fixed problem with inputting numbers in sliders (#6859) * Fixed problem with inputting numbers in sliders Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> * Changes from PR Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> * Missed removing pragma optimize Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> --- .../AzQtComponents/Components/Widgets/Slider.cpp | 3 +-- .../AzQtComponents/Components/Widgets/SliderCombo.cpp | 10 +++++----- .../AzQtComponents/Components/Widgets/SliderCombo.h | 1 - 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Slider.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Slider.cpp index 14ac2010bc..f50b9c36ec 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Slider.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Slider.cpp @@ -870,8 +870,7 @@ void SliderDouble::setCurveMidpoint(double midpoint) QString SliderDouble::hoverValueText(int sliderValue) const { - // maybe format this, max number of digits? - QString valueText = locale().toString(calculateRealSliderValue(sliderValue), 'f', m_decimals); + QString valueText = toString(calculateRealSliderValue(sliderValue), m_decimals, locale(), false, true); return QStringLiteral("%1").arg(valueText); } diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.cpp index 6333d28365..9d289e5d44 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.cpp @@ -14,6 +14,7 @@ #include #include +#include namespace AzQtComponents { @@ -254,11 +255,12 @@ SliderDoubleCombo::~SliderDoubleCombo() { } +bool m_fromSlider{ false }; + void SliderDoubleCombo::setValueSlider(double value) { const bool doEmit = m_value != value; m_value = value; - updateSpinBox(); updateSlider(); @@ -267,6 +269,8 @@ void SliderDoubleCombo::setValueSlider(double value) // We don't want to update the slider from setValue as this // causes rounding errors in the tooltip hint. m_fromSlider = true; + QTimer::singleShot( 10, []() { m_fromSlider = false; }); + Q_EMIT valueChanged(); } } @@ -286,10 +290,6 @@ void SliderDoubleCombo::setValue(double value) Q_EMIT valueChanged(); } } - else - { - m_fromSlider = false; - } } SliderDouble* SliderDoubleCombo::slider() const diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.h b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.h index 05d0f7b51b..be6c86b520 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.h +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.h @@ -237,6 +237,5 @@ namespace AzQtComponents double m_softMinimum = 0.0; double m_softMaximum = 100.0; double m_value = 0.0; - bool m_fromSlider{ false }; }; } // namespace AzQtComponents From c1bbe3806db1cb4dea1eea710a1c9fbd8ef2bb67 Mon Sep 17 00:00:00 2001 From: Ignacio Martinez <82394219+AMZN-Igarri@users.noreply.github.com> Date: Tue, 18 Jan 2022 13:29:06 +0100 Subject: [PATCH 398/399] Asset Browser Search Entries Highlight (#6133) * Adding hilight to search entries Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Delegate Cleanup Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * delegate cleanup Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * General cleanup Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * reformatting file Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Updated Comments Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Abstracted richText functions Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Extracting highlighting behavior Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Added highlighter to the entity outliner Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Addressed Code Review Comments Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Switched to static functions Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * changed variable name Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Removed unused variable Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Apply changes to the Entity Outliner Model Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Removed duplicated line Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> --- .../AzAssetBrowser/AzAssetBrowserWindow.cpp | 4 ++ .../UI/Outliner/OutlinerListModel.cpp | 22 ++------ .../AssetBrowser/AssetBrowserFilterModel.cpp | 5 ++ .../AssetBrowser/AssetBrowserFilterModel.h | 4 +- .../AssetBrowser/AssetBrowserModel.cpp | 16 ++++++ .../AssetBrowser/AssetBrowserModel.h | 9 ++- .../AssetBrowser/Search/Filter.cpp | 5 ++ .../AssetBrowser/Search/Filter.h | 1 + .../Views/AssetBrowserTableView.cpp | 1 + .../AssetBrowser/Views/EntryDelegate.cpp | 27 +++++++-- .../AssetBrowser/Views/EntryDelegate.h | 3 +- .../Editor/RichTextHighlighter.cpp | 55 +++++++++++++++++++ .../Editor/RichTextHighlighter.h | 36 ++++++++++++ .../UI/Outliner/EntityOutlinerListModel.cpp | 30 +--------- .../aztoolsframework_files.cmake | 2 + 15 files changed, 167 insertions(+), 53 deletions(-) create mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.cpp create mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.h diff --git a/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp b/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp index bcaaa02b67..a7faea36f6 100644 --- a/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp +++ b/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp @@ -17,6 +17,7 @@ #include #include #include +#include // AzQtComponents #include @@ -83,6 +84,9 @@ AzAssetBrowserWindow::AzAssetBrowserWindow(QWidget* parent) m_ui->m_assetBrowserTableViewWidget->setVisible(false); m_ui->m_toggleDisplayViewBtn->setVisible(false); m_ui->m_searchWidget->SetFilterInputInterval(AZStd::chrono::milliseconds(250)); + + m_assetBrowserModel->SetFilterModel(m_filterModel.data()); + if (ed_useNewAssetBrowserTableView) { m_ui->m_toggleDisplayViewBtn->setVisible(true); diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp index 08d79adcf5..1c361b050d 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp @@ -53,6 +53,7 @@ #include #include #include +#include #include "OutlinerDisplayOptionsMenu.h" #include "OutlinerSortFilterProxyModel.hxx" @@ -252,17 +253,7 @@ QVariant OutlinerListModel::dataForName(const QModelIndex& index, int role) cons if (s_paintingName && !m_filterString.empty()) { // highlight characters in filter - int highlightTextIndex = 0; - do - { - highlightTextIndex = label.lastIndexOf(QString(m_filterString.c_str()), highlightTextIndex - 1, Qt::CaseInsensitive); - if (highlightTextIndex >= 0) - { - const QString BACKGROUND_COLOR{ "#707070" }; - label.insert(static_cast(highlightTextIndex + m_filterString.length()), ""); - label.insert(highlightTextIndex, ""); - } - } while(highlightTextIndex > 0); + label = AzToolsFramework::RichTextHighlighter::HighlightText(label, m_filterString.c_str()); } return label; } @@ -2609,16 +2600,11 @@ void OutlinerItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& optionV4.widget->style()->drawControl(QStyle::CE_ItemViewItem, &optionV4, painter); // Now we setup a Text Document so it can draw the rich text - QTextDocument textDoc; - textDoc.setDefaultFont(optionV4.font); - textDoc.setDefaultStyleSheet("body {color: white}"); - textDoc.setHtml("" + entityNameRichText + ""); int verticalOffset = GetEntityNameVerticalOffset(entityId); painter->translate(textRect.topLeft() + QPoint(0, verticalOffset)); - textDoc.setTextWidth(textRect.width()); - textDoc.drawContents(painter, QRectF(0, 0, textRect.width(), textRect.height())); - painter->restore(); + AzToolsFramework::RichTextHighlighter::PaintHighlightedRichText(entityNameRichText, painter, optionV4, textRect); + OutlinerListModel::s_paintingName = false; } else diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.cpp index c6772ea2d7..21229e5570 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.cpp @@ -68,6 +68,11 @@ namespace AzToolsFramework } } + QSharedPointer AssetBrowserFilterModel::GetStringFilter() const + { + return m_stringFilter; + } + bool AssetBrowserFilterModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const { //get the source idx, if invalid early out diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.h index 5d3ad0e1b0..cafe694ad6 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.h @@ -48,7 +48,7 @@ namespace AzToolsFramework // AssetBrowserComponentNotificationBus ////////////////////////////////////////////////////////////////////////// void OnAssetBrowserComponentReady() override; - + QSharedPointer GetStringFilter() const; Q_SIGNALS: void filterChanged(); ////////////////////////////////////////////////////////////////////////// @@ -70,7 +70,7 @@ namespace AzToolsFramework //Asset source name match filter FilterConstType m_filter; AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: class '...' needs to have dll-interface to be used by clients of class '...' - QWeakPointer m_stringFilter; + QSharedPointer m_stringFilter; QWeakPointer m_assetTypeFilter; QCollator m_collator; // cache the collator as its somewhat expensive to constantly create and destroy one. AZ_POP_DISABLE_WARNING diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserModel.cpp index f0e1520aab..fd05543097 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserModel.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 'QRegularExpression::d': class 'QExplicitlySharedDataPointer' needs to have dll-interface to be used by clients of class 'QRegularExpression' @@ -268,6 +269,21 @@ namespace AzToolsFramework m_rootEntry = rootEntry; } + AssetBrowserFilterModel* AssetBrowserModel::GetFilterModel() + { + return m_filterModel; + } + + const AssetBrowserFilterModel* AssetBrowserModel::GetFilterModel() const + { + return m_filterModel; + } + + void AssetBrowser::AssetBrowserModel::SetFilterModel(AssetBrowserFilterModel* filterModel) + { + m_filterModel = filterModel; + } + QModelIndex AssetBrowserModel::parent(const QModelIndex& child) const { if (!child.isValid()) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserModel.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserModel.h index c46b73417c..2905844a23 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserModel.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserModel.h @@ -35,6 +35,7 @@ namespace AzToolsFramework class AssetBrowserEntry; class RootAssetBrowserEntry; class AssetEntryChangeset; + class AssetBrowserFilterModel; class AssetBrowserModel : public QAbstractItemModel @@ -75,7 +76,7 @@ namespace AzToolsFramework void EndAddEntry(AssetBrowserEntry* parent) override; void BeginRemoveEntry(AssetBrowserEntry* entry) override; void EndRemoveEntry() override; - + ////////////////////////////////////////////////////////////////////////// // TickBus ////////////////////////////////////////////////////////////////////////// @@ -84,10 +85,16 @@ namespace AzToolsFramework AZStd::shared_ptr GetRootEntry() const; void SetRootEntry(AZStd::shared_ptr rootEntry); + AssetBrowserFilterModel* GetFilterModel(); + const AssetBrowserFilterModel* GetFilterModel() const; + void SetFilterModel(AssetBrowserFilterModel* filterModel); + static void SourceIndexesToAssetIds(const QModelIndexList& indexes, AZStd::vector& assetIds); static void SourceIndexesToAssetDatabaseEntries(const QModelIndexList& indexes, AZStd::vector& entries); private: + //Non owning pointer + AssetBrowserFilterModel* m_filterModel = nullptr; AZStd::shared_ptr m_rootEntry; bool m_loaded; bool m_addingEntry; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.cpp index d617638632..4ec26d4c3d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.cpp @@ -229,6 +229,11 @@ namespace AzToolsFramework Q_EMIT updatedSignal(); } + QString StringFilter::GetFilterString() const + { + return m_filterString; + } + QString StringFilter::GetNameInternal() const { return m_filterString; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.h index 94f47e0599..1d93d4d0cf 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.h @@ -106,6 +106,7 @@ namespace AzToolsFramework ~StringFilter() override = default; void SetFilterString(const QString& filterString); + QString GetFilterString() const; protected: QString GetNameInternal() const override; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.cpp index cfcac579ff..a913009da0 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.cpp @@ -66,6 +66,7 @@ namespace AzToolsFramework m_tableModel = qobject_cast(model); AZ_Assert(m_tableModel, "Expecting AssetBrowserTableModel"); m_sourceFilterModel = qobject_cast(m_tableModel->sourceModel()); + m_delegate->Init(); AzQtComponents::TableView::setModel(model); connect(m_tableModel, &AssetBrowserTableModel::layoutChanged, this, &AssetBrowserTableView::layoutChangedSlot); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp index 8b58791e68..8e69d5f788 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp @@ -9,12 +9,16 @@ #include #include #include +#include #include #include #include #include +#include #include +#include + AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // 4251: class 'QScopedPointer' needs to have dll-interface to be used by clients of class 'QBrush' // 4800: 'uint': forcing value to bool 'true' or 'false' (performance warning) #include @@ -160,13 +164,20 @@ namespace AzToolsFramework LoadBranchPixMaps(); } + void SearchEntryDelegate::Init() + { + AssetBrowserModel* assetBrowserModel; + AssetBrowserComponentRequestBus::BroadcastResult(assetBrowserModel, &AssetBrowserComponentRequests::GetAssetBrowserModel); + AZ_Assert(assetBrowserModel, "Failed to get filebrowser model"); + m_assetBrowserFilerModel = assetBrowserModel->GetFilterModel(); + } + void SearchEntryDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const { auto data = index.data(AssetBrowserModel::Roles::EntryRole); if (data.canConvert()) { bool isEnabled = (option.state & QStyle::State_Enabled) != 0; - bool isSelected = (option.state & QStyle::State_Selected) != 0; QStyle* style = option.widget ? option.widget->style() : QApplication::style(); @@ -265,13 +276,21 @@ namespace AzToolsFramework remainingRect.adjust(thumbX, 0, 0, 0); // bump it to the right by the size of the thumbnail remainingRect.adjust(EntrySpacingLeftPixels, 0, 0, 0); // bump it to the right by the spacing. } + QString displayString = index.column() == aznumeric_cast(AssetBrowserEntry::Column::Name) ? qvariant_cast(entry->data(aznumeric_cast(AssetBrowserEntry::Column::Name))) : qvariant_cast(entry->data(aznumeric_cast(AssetBrowserEntry::Column::Path))); - style->drawItemText( - painter, remainingRect, option.displayAlignment, actualPalette, isEnabled, displayString, - isSelected ? QPalette::HighlightedText : QPalette::Text); + QStyleOptionViewItem optionV4{ option }; + initStyleOption(&optionV4, index); + optionV4.state &= ~(QStyle::State_HasFocus | QStyle::State_Selected); + + if (m_assetBrowserFilerModel && m_assetBrowserFilerModel->GetStringFilter() + && !m_assetBrowserFilerModel->GetStringFilter()->GetFilterString().isEmpty()) + { + displayString = RichTextHighlighter::HighlightText(displayString, m_assetBrowserFilerModel->GetStringFilter()->GetFilterString()); + } + RichTextHighlighter::PaintHighlightedRichText(displayString, painter, optionV4, remainingRect); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.h index ac68c19248..7c7d919f2d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.h @@ -70,7 +70,7 @@ namespace AzToolsFramework Q_OBJECT public: explicit SearchEntryDelegate(QWidget* parent = nullptr); - + void Init(); void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; private: @@ -78,6 +78,7 @@ namespace AzToolsFramework void DrawBranchPixMap(EntryBranchType branchType, QPainter* painter, const QPoint& point, const QSize& size) const; private: + AssetBrowserFilterModel* m_assetBrowserFilerModel; QMap m_branchIcons; }; } // namespace AssetBrowser diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.cpp new file mode 100644 index 0000000000..8b28298c3d --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.cpp @@ -0,0 +1,55 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include "RichTextHighlighter.h" + +namespace AzToolsFramework +{ + + QString RichTextHighlighter::HighlightText(const QString& displayString, const QString& matchingSubstring) + { + QString highlightedString = displayString; + int highlightTextIndex = 0; + do + { + highlightTextIndex = highlightedString.lastIndexOf(matchingSubstring, highlightTextIndex - 1, Qt::CaseInsensitive); + if (highlightTextIndex >= 0) + { + const QString backgroundColor{ "#707070" }; + highlightedString.insert(static_cast(highlightTextIndex + matchingSubstring.length()), ""); + highlightedString.insert(highlightTextIndex, ""); + } + } while (highlightTextIndex > 0); + + return highlightedString; + } + + void RichTextHighlighter::PaintHighlightedRichText(const QString& highlightedString,QPainter* painter, QStyleOptionViewItem option, QRect availableRect) + { + painter->save(); + painter->setRenderHint(QPainter::Antialiasing); + + // Now we setup a Text Document so it can draw the rich text + QTextDocument textDoc; + textDoc.setDefaultFont(option.font); + if (option.state & QStyle::State_Enabled) + { + textDoc.setDefaultStyleSheet("body {color: white}"); + } + else + { + textDoc.setDefaultStyleSheet("body {color: #7C7C7C}"); + } + textDoc.setHtml("" + highlightedString + ""); + painter->translate(availableRect.topLeft()); + textDoc.setTextWidth(availableRect.width()); + textDoc.drawContents(painter, QRectF(0, 0, availableRect.width(), availableRect.height())); + + painter->restore(); + } +} // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.h new file mode 100644 index 0000000000..b5c1859497 --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include +#include + +AZ_PUSH_DISABLE_WARNING(4251 4800,"-Wunknown-warning-option") // 4251: class 'QScopedPointer' needs to have dll-interface to be used + // by clients of class 'QBrush' 4800: 'uint': forcing value to bool 'true' or 'false' (performance warning) +#include +AZ_POP_DISABLE_WARNING + +namespace AzToolsFramework +{ + //! @class RichTextHighlighter + //! @brief Highlights a given string given a matching substring. + class RichTextHighlighter + { + public: + AZ_CLASS_ALLOCATOR(RichTextHighlighter, AZ::SystemAllocator, 0); + RichTextHighlighter() = delete; + + static QString HighlightText(const QString& displayString, const QString& matchingSubstring); + static void PaintHighlightedRichText(const QString& highlightedString,QPainter* painter, QStyleOptionViewItem option, QRect availableRect); + + }; +} // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp index 056f16c52f..e0060e2b42 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp @@ -66,6 +66,7 @@ #include #include #include +#include //////////////////////////////////////////////////////////////////////////// // EntityOutlinerListModel @@ -259,17 +260,7 @@ namespace AzToolsFramework if (s_paintingName && !m_filterString.empty()) { // highlight characters in filter - int highlightTextIndex = 0; - do - { - highlightTextIndex = label.lastIndexOf(QString(m_filterString.c_str()), highlightTextIndex - 1, Qt::CaseInsensitive); - if (highlightTextIndex >= 0) - { - const QString BACKGROUND_COLOR{ "#707070" }; - label.insert(highlightTextIndex + static_cast(m_filterString.length()), ""); - label.insert(highlightTextIndex, ""); - } - } while(highlightTextIndex > 0); + label = AzToolsFramework::RichTextHighlighter::HighlightText(label, m_filterString.c_str()); } return label; } @@ -2375,23 +2366,8 @@ namespace AzToolsFramework optionV4.text.clear(); optionV4.widget->style()->drawControl(QStyle::CE_ItemViewItem, &optionV4, painter); - // Now we setup a Text Document so it can draw the rich text - QTextDocument textDoc; - textDoc.setDefaultFont(optionV4.font); - if (option.state & QStyle::State_Enabled) - { - textDoc.setDefaultStyleSheet("body {color: white}"); - } - else - { - textDoc.setDefaultStyleSheet("body {color: #7C7C7C}"); - } - textDoc.setHtml("" + entityNameRichText + ""); - painter->translate(textRect.topLeft()); - textDoc.setTextWidth(textRect.width()); - textDoc.drawContents(painter, QRectF(0, 0, textRect.width(), textRect.height())); + AzToolsFramework::RichTextHighlighter::PaintHighlightedRichText(entityNameRichText, painter, optionV4, textRect); - painter->restore(); EntityOutlinerListModel::s_paintingName = false; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index 05c07afecd..0d7bf05211 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -123,6 +123,8 @@ set(FILES ContainerEntity/ContainerEntitySystemComponent.h Editor/EditorContextMenuBus.h Editor/EditorSettingsAPIBus.h + Editor/RichTextHighlighter.h + Editor/RichTextHighlighter.cpp Entity/EditorEntityStartStatus.h Entity/EditorEntityAPIBus.h Entity/EditorEntityContextComponent.cpp From e166479bb7c77e0d0ebc391ff9bc9d2835ebb5eb Mon Sep 17 00:00:00 2001 From: Ignacio Martinez <82394219+AMZN-Igarri@users.noreply.github.com> Date: Tue, 18 Jan 2022 16:47:27 +0100 Subject: [PATCH 399/399] Fixed Camera angle on switch levels (#6954) Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> --- Code/Editor/EditorViewportWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Editor/EditorViewportWidget.cpp b/Code/Editor/EditorViewportWidget.cpp index e9a57dba4f..a8180bcace 100644 --- a/Code/Editor/EditorViewportWidget.cpp +++ b/Code/Editor/EditorViewportWidget.cpp @@ -582,11 +582,11 @@ void EditorViewportWidget::OnEditorNotifyEvent(EEditorNotifyEvent event) case eNotify_OnCloseScene: m_renderViewport->SetScene(nullptr); - SetDefaultCamera(); break; case eNotify_OnEndSceneOpen: UpdateScene(); + SetDefaultCamera(); break; case eNotify_OnBeginNewScene: